上面这个代码是我最近在网上找的代码中出现的一部分,这里用到了circle这个函数,本来没什么好说的,但是就是运行不过去,一直提示
后面去网上搜了下说CV_AA是opencv3里的用法,没办法我就只能改代码,然后去搜circle的详细参数了
网上找了一圈说这个参数表示的是圆边界的类型,那么我改代码的话应该填一个什么值进去?
找了半天没找到,最后只能去看文档了,下面附上官方文档的描述,和文档链接。
void cv::circle(InputOutputArray img,Point center,int radius,const Scalar & color,int thickness = 1
,int lineType = LINE_8
,int shift = 0
)
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. |
几个参数分别表达的含义是,画圆的图、圆心、半径、圆的颜色、画圆的线条的粗细、画圆的线的类型、中心坐标和半径值中的小数位数。
其中参数lineType可填入的值可以在官方文档中查找到,不过多讲述。
所以根据官方文档CV_AA应该改成cv2.LINE_AA。
官方文档链接:https://docs.opencv.org/4.1.2/d6/d00/tutorial_py_root.html