cv2.circle()函数及其参数

cv2.circle()函数及其参数

上面这个代码是我最近在网上找的代码中出现的一部分,这里用到了circle这个函数,本来没什么好说的,但是就是运行不过去,一直提示

cv2.circle()函数及其参数

后面去网上搜了下说CV_AA是opencv3里的用法,没办法我就只能改代码,然后去搜circle的详细参数了

网上找了一圈说这个参数表示的是圆边界的类型,那么我改代码的话应该填一个什么值进去?

找了半天没找到,最后只能去看文档了,下面附上官方文档的描述,和文档链接。

void cv::circle(InputOutputArray img,Point center,int radius,const Scalar & color,int thickness = 1,int lineType = <a href="https://docs.opencv.org/4.1.2/d6/d6e/group__imgproc__draw.html#ggaf076ef45de481ac96e0ab3dc2c29a777a5d32eda7017db273a37f158e5b51442a">LINE_8</a>,int shift = 0 )

imgImage where the circle is drawn.centerCenter of the circle.radiusRadius of the circle.colorCircle color.thicknessThickness of the circle outline, if positive. Negative values, like
FILLED

, mean that a filled circle is to be drawn.lineTypeType of the circle boundary. See
LineTypes

shiftNumber of fractional bits in the coordinates of the center and in the radius value.

几个参数分别表达的含义是,画圆的图、圆心、半径、圆的颜色、画圆的线条的粗细、画圆的线的类型、中心坐标和半径值中的小数位数。

其中参数lineType可填入的值可以在官方文档中查找到,不过多讲述。

所以根据官方文档CV_AA应该改成cv2.LINE_AA。

官方文档链接:https://docs.opencv.org/4.1.2/d6/d00/tutorial_py_root.html

Original: https://blog.csdn.net/a892573486/article/details/115047269
Author: a892573486
Title: cv2.circle()函数及其参数

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/704676/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球