亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

使用OpenCV circle函數(shù)圖像上畫圓的示例代碼

 更新時(shí)間:2019年12月27日 09:38:00   作者:csdn_1HAO  
這篇文章主要介紹了使用OpenCV circle函數(shù)圖像上畫圓的示例代碼,本文內(nèi)容簡(jiǎn)短,給大家突出重點(diǎn)內(nèi)容,需要的朋友可以參考下

OpenCV中circle與rectangle函數(shù)顯示,只不過rectangle在圖像中畫矩形,circle在圖像中畫圓。

void circle(Mat img, Point center, int radius, Scalar color, int thickness=1, int lineType=8, int shift=0)

img為源圖像

center為畫圓的圓心坐標(biāo)

radius為圓的半徑

color為設(shè)定圓的顏色,規(guī)則根據(jù)B(藍(lán))G(綠)R(紅)

thickness 如果是正數(shù),表示組成圓的線條的粗細(xì)程度。否則,表示圓是否被填充

line_type 線條的類型。默認(rèn)是8

shift 圓心坐標(biāo)點(diǎn)和半徑值的小數(shù)點(diǎn)位數(shù)

示例程序:

#include <iostream> 
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/opencv.hpp>
using namespace std;
using namespace cv;
int main()
{
  Mat src = imread("C:\\tupian\\test1.jpg", 3);
  circle(src, Point(src.cols/ 2, src.rows / 2), 30, Scalar(0, 0, 255));
  imshow("src", src);
  waitKey(0);
  return 0;
}

總結(jié)

以上所述是小編給大家介紹的使用OpenCV circle函數(shù)圖像上畫圓的示例代碼,希望對(duì)大家有所幫助,如果大家有任何疑問請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!
如果你覺得本文對(duì)你有幫助,歡迎轉(zhuǎn)載,煩請(qǐng)注明出處,謝謝!

相關(guān)文章

最新評(píng)論