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 @ 2022-05-31 11:28  小小灰迪  阅读(430)  评论(0编辑  收藏  举报