OPENCV学习笔记1-6_图像上绘图
2018-01-21 19:43
375 查看
1.1 Related Class
1. Class: OpenCV::CvPointCvPoint:表示一个坐标为整数的二维点,是一个包含integer类型成员x和y的结构体。
typdef struct CvPoint { int x; // X axis int y; // Y axis }
2. Class: OpenCV::CvScalar
CvScalar是一个包含四个元素的结构体变量。Element-value (元素)of one pixel. OpenCV supports the image of 4-channels in the maximum. Therefore, CvScalar has 4-values。
typdef struct CvScalar { double val[4]; } CvScalar;
1.2 Sample code
#include <iostream> #include <opencv2/opencv.hpp> //含了OpenCV中各个模块的头文件 must or not able used circle //#include <opencv2/core/core.hpp> //#include <opencv2/highgui/highgui.hpp> using namespace cv; using namespace std; #define height 480 #define width 600 CvPoint CircleCenter; int Radius; CvScalar Color; int Thickness; int Shift; int main() { Mat image(height, width, CV_8UC3, Scalar(255, 255, 255));//(255, 255, 255); white (0, 0, 0) black CircleCenter = cvPoint(100, 100); Radius = 50; Color = CV_RGB(255, 0, 0); Thickness = 3; Shift = 0; circle(image, CircleCenter, Radius, Color, Thickness, Shift); putText(image, // destination image "This is a circle.", // text Point(40, 200), // text position FONT_HERSHEY_PLAIN, // font type 2.0, // font scale 255, // text color (here white) 2); // text thickness namedWindow("yunfung image", WINDOW_NORMAL); imshow("yunfung image", image); waitKey(0); return 0; }
相关文章推荐
- OpenCV2学习笔记---指针方式历遍图像
- OpenCV学习笔记-显示图像
- OpenCV学习笔记(4)——平滑处理图像
- 【OpenCV学习笔记 004】 图像的缩放、Canny边缘检测和图像的二值化
- OpenCV学习笔记(16)双目测距与三维重建的OpenCV实现问题集锦(一)图像获取与单目定标
- openCV Python 学习笔记(一)图像的基本操作
- OpenCV学习笔记13 OpenCV图像处理模块ImgProc Module. Image Processing(六)
- OpenCv学习笔记(四):使用split函数提取彩色图像的三个通道
- OpenCV学习笔记九——访问图像中的像素
- OpenCV 2 学习笔记(8): 利用邻域处理图像与简单的算术图像处理算法:图像滤波与加权和
- opencv2学习笔记:4.2计算图像直方图
- OpenCV(学习笔记4)-图像模糊
- OpenCV 2 学习笔记(9): 定义ROI(regions of interest):给图像加入水印
- OpenCV 3学习笔记(二) 图像的显示、腐蚀与模糊
- 基础学习笔记之opencv(9):Mat图像扫描
- OpenCV_Python学习笔记--OpenCV中的绘图函数
- OpenCV学习笔记6-图像的基础操作
- opencv学习笔记 在输入图像上寻找并绘制轮廓
- OpenCV学习笔记(二)——Mat,图像的新容器
- opencv学习笔记之两幅图像显式融合