当前位置:网站首页>First knowledge of opencv4.x --- drawing shapes on images
First knowledge of opencv4.x --- drawing shapes on images
2022-07-25 09:47:00 【F l e】
// Drawing shapes on images
#include <stdio.h>
#include <iostream>
#include <string>
#include <opencv2\opencv.hpp>
using namespace std;
using namespace cv;
int main()
{
Mat img = Mat::zeros(Size(500, 500), CV_8UC1);// Create a black background , Note that Size(x,y), namely ( Column , That's ok )
// A circle
circle(img, Point(250,50 ), 30, Scalar(255));// Note that Point(x,y), namely ( Column , That's ok )
// Draw a straight line
line(img, Point(250, 80), Point(250, 100), Scalar(255));
line(img, Point(220, 100), Point(200, 150), Scalar(255));
line(img, Point(280, 100), Point(300, 150), Scalar(255));
line(img, Point(250, 150), Point(250, 180), Scalar(255));
line(img, Point(250, 180), Point(220, 200), Scalar(255));
line(img, Point(250, 180), Point(280, 200), Scalar(255));
// Draw a rectangular
rectangle(img, Point(220, 100), Point(280, 150), Scalar(255));// Draw with two points at the opposite corners of the rectangle
// Generate text
putText(img, "people", Point(220, 220), 6, 1, Scalar(255));// Currently, only Chinese is supported
imshow("img", img);
waitKey(0);
return 0;
}

边栏推荐
猜你喜欢

无向连通图邻接矩阵的创建输出广度深度遍历

解决QTCreator使用VS编译中文乱码错误

Swift简单实现待办事项

Kotlin basic knowledge points
![Customize the view to realize the background of redeeming lottery tickets [elementary]](/img/97/53e28673dcd52b31ac7eb7b00d42b3.png)
Customize the view to realize the background of redeeming lottery tickets [elementary]

鱼眼图像自监督深度估计原理分析和Omnidet核心代码解读

卷积神经网络发展历程(部分)

Redis installation (Ubuntu)

OC -- object replication

Preliminary understanding and implementation of wechat applet bottom navigation bar
随机推荐
CoreData存储待办事项
初识Opencv4.X----均值滤波
服务器cuda toolkit多版本切换
OC -- Foundation -- string + date and time
Singleton mode
Kotlin basic knowledge points
@4-1 CCF 2020-06-1 linear classifier
Minkowskiengine installation
Customize dialog to realize the pop-up box of privacy clause statement imitating Netease cloud music
cf #785(div2) C. Palindrome Basis
初识Opencv4.X----图像直方图均衡
Customize the view to realize the background of redeeming lottery tickets [elementary]
类(2) 和 协议
matlab如何导入大量数据
UI - infinite rotation chart and column controller
Matlab drawing | some common settings of axis
Esp8266的Flash读写操作以及Flash上传文件
初识Opencv4.X----为图像添加椒盐噪声
*6-2 CCF 2015-03-3 Festival
Some usages of Matlab's find() function (quickly find qualified values)