当前位置:网站首页>初识Opencv4.X----在图像上绘制形状
初识Opencv4.X----在图像上绘制形状
2022-07-25 09:22:00 【F l e】
//在图像上绘制形状
#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);//创建一个黑色背景,注意是Size(x,y),即(列,行)
//画圆
circle(img, Point(250,50 ), 30, Scalar(255));//注意是Point(x,y),即(列,行)
//画直线
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));
//画矩形
rectangle(img, Point(220, 100), Point(280, 150), Scalar(255));//用矩形的对角两个点绘制
//生成文字
putText(img, "people", Point(220, 220), 6, 1, Scalar(255));//目前只支持中文
imshow("img", img);
waitKey(0);
return 0;
}

边栏推荐
猜你喜欢

@2-1 safety index predicted by CCF at the end of December 1, 2020

The jar package has been launched on Alibaba cloud server and the security group has been opened, but postman still can't run. What should we do

*6-2 CCF 2015-03-3 节日

OC -- Foundation -- Collection
![[De1CTF 2019]SSRF Me](/img/12/44c37cc713b49172a10579c9628c94.png)
[De1CTF 2019]SSRF Me

Swagger2显示get接口有问题,加注解就能解决

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

cf #785(div2) C. Palindrome Basis

Jar包在阿里云服务器起起来了,安全组也开通了,但postman仍跑不通怎么办
![[GKCTF 2021]easynode](/img/f0/1daf6f83fea66fdefd55608cbddac6.png)
[GKCTF 2021]easynode
随机推荐
Redis set 结构命令
@3-1 CCF 2020-09-1 scale detection point query
OC -- Foundation -- dictionary
Student management system (summary)
2022年的个人技术选型梳理
@2-1 safety index predicted by CCF at the end of December 1, 2020
[code source] daily question simple fields and
Data preprocessing
Indexes, views and transactions of MySQL
Operation 7.19 sequence table
关于C和OC
How to deploy the jar package to the server? Note: whether the startup command has nohup or not has a lot to do with it
How to write Android switching interface with kotlin
Redis list 结构命令
OC -- first acquaintance
OC--Foundation--数组
A brief introduction to the interest of convolutional neural networks
Android 如何使用adb命令查看应用本地数据库
单例模式(Singleton)
初识Opencv4.X----方框滤波