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
.
CV2 is OpenCV. OpenCV and PIL both have image processing tools such as: Image filters (blur, sharpen, etc.)
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.
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]]])
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With