OpenCV 画点/圆/文本/直线/十字

Point

cv::circle 官方文档地址

void cv::circle	(InputOutputArray 	img,
	Point 	center,
	int 	radius,
	const Scalar & 	color,
	int 	thickness = 1,
	int 	lineType = LINE_8,
	int 	shift = 0 
  )

Parameters

img Image where the circle is drawn.
center Center of the circle.
radius Radius of the circle.
color Circle color.
thickness Thickness of the circle outline, if positive. Negative values, like FILLED, mean that a filled circle is to be drawn.
lineType Type of the circle boundary. See LineTypes
shift Number of fractional bits in the coordinates of the center and in the radius value.

demo

int thickness = 1;
cv::Mat showMarker = cv::imread(rgb_path);
cv::circle(showMarker, cv::Point2i(int(charuco_u), int(charuco_v)), 10, cv::Scalar(0,0,255), thickness,LINE_8);
cv::namedWindow("marker", WINDOW_NORMAL);
cv::resizeWindow("marker", int(1920), int(1080));
cv::imshow("marker", showMarker);
cv::waitKey(0);

Line

cv::line(showProj, cv::Point(u, v), cv::Point(leftImg.cols + cur_u, cur_v), Scalar(0, 0, 255), 3);

text

opencv-putText

Parameters

img Image.
text Text string to be drawn.
org Bottom-left corner of the text string in the image.
fontFace Font type, see HersheyFonts.
fontScale Font scale factor that is multiplied by the font-specific base size.
color Text color.
thickness Thickness of the lines used to draw a text.
lineType Line type. See LineTypes
bottomLeftOrigin When true, the image data origin is at the bottom-left corner. Otherwise, it is at the top-left corner.
cv::putText(src,"Hello ",Point(100,100),FONT_HERSHEY_SIMPLEX,2,Scalar(0,0,255),4,8);
posted @   小小灰迪  阅读(442)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· winform 绘制太阳,地球,月球 运作规律
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 上周热点回顾(3.3-3.9)
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
点击右上角即可分享
微信分享提示