एक वृत्त का एक केंद्र और एक त्रिज्या होती है। OpenCV का उपयोग करके वृत्त बनाने के लिए, हमें केंद्र और त्रिज्या को परिभाषित करना होगा। OpenCV में हमें <imgproc.hpp> हेडर शामिल करना होगा क्योंकि 'circle()' फ़ंक्शन इसी हेडर में परिभाषित है।
इस मेथड का मूल सिंटैक्स इस प्रकार है -
सिंटैक्स
circle(whiteMatrix, center, radius, line_Color, thickness);
निम्नलिखित प्रोग्राम OpenCV में वृत्त बनाने का प्रतिनिधित्व करता है।
उदाहरण
#include <iostream>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
using namespace cv;
using namespace std;
int main() {
Mat whiteMatrix(200, 200, CV_8UC3, Scalar(255, 255, 255));
Point center(100, 100);
int radius = 50;
Scalar line_Color(0, 0, 0);
int thickness = 2;
namedWindow("whiteMatrix");
circle(whiteMatrix, center, radius, line_Color, thickness);
imshow("WhiteMatrix", whiteMatrix);
waitKey(0);
return 0;
}
आउटपुट
