Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python OpenCv cv2 equivalent for CV_FILLED

Tags:

This works as expected:

cv2.rectangle(image, pt1, pt2, color, thickness=cv2.cv.CV_FILLED)

But I have not been able to find the equivalent constant in the cv2 interface. I know this is simply some negative value (from the documentation), but I like the readability of the constant in the code and would like to write the equivalent function in pure cv2.

like image 597
craastad Avatar asked Mar 11 '13 13:03

craastad


People also ask

Is cv2 same as OpenCV Python?

CV2 is OpenCV. OpenCV and PIL both have image processing tools such as: Image filters (blur, sharpen, etc.)

Is cv2 the same as OpenCV?

cv2 (old interface in old OpenCV versions was named as cv ) is the name that OpenCV developers chose when they created the binding generators. This is kept as the import name to be consistent with different kind of tutorials around the internet.

What is lineType in OpenCV?

OpenCV provides the line() function to draw the line on the image. It draws a line segment between ptr1 and ptr2 points in the image. The image boundary clips the line. cv2.line(img, pt1, pt2, color[, thickness[, lineType[, shift]]])

What is cv2 addWeighted?

The addWeighted function is a function that helps in adding two images and also blending those by passing the alpha, beta and gamma values. In order to analyse images, this helps in adjusting the gradients and in the processing of the image.


1 Answers

There is no equivalent at the moment. Most likely it will be added in next major release (2.5) and will be named cv2.FILLED.

Any way it is safe to assume that the exact value (cv2.cv.CV_FILLED == -1) will not be changed.

like image 168
Andrey Kamaev Avatar answered Sep 24 '22 07:09

Andrey Kamaev