'QT causing cv::circle() Assertion Failed when given inputs within range
I have a QT GUI for controlling a camera, and I'm using OpenCV 4.5.5 to track a circle within the video from the camera, however when I go to display the circle on the image, the cv::circle function displays the following error:
The code:
circle(binary_plus_color, Point(X_Point, Y_Point), Center_Radius, col, Thickness, LINE_8, Shift);
The error:
terminate called after throwing an instance of 'cv::Exception'
what(): OpenCV(4.5.1) ../modules/imgproc/src/drawing.cpp:1884: error: (-215:Assertion failed) radius >= 0 && thickness <= MAX_THICKNESS && 0 <= shift && shift <= XY_SHIFT in function 'circle'
I first checked the binary_plus_color Mat, and it is created and displays properly when the circle code is removed.
I then checked the values of all the inputs into the function, to make sure they're within the range, which they are:
X_Point: 404
Y_Point: 298
Center_Radius: 1
col: Scalar(0, 255, 0)
Thickness: 1
Shift: 0
I tested the same code outside of QT, and the code ran as expected. I have tried calling it as cv::circle() to force the use of the OpenCV function, which did not solve the problem. So it appears that QT is causing the issue, but I do not know why/how.
Any help is appreciated.
Edit: The full source code can be seen here.
Solution 1:[1]
Unfortunately I was unable to find a solution, but I was able to solve the issue by uninstalling OpenCV 4.5.5 and installing OpenCV 4.5.1.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | C. Morris |
