I’m currently working on computing iou on rotated rectangles, and I’m encountering an assertion error when executing
cv2.error: OpenCV(4.2.0) /io/opencv/modules/imgproc/src/intersection.cpp:271: error: (-215:Assertion failed) fabs(normL2Sqr<float>(intersection[minI] - intersection[minJ]) - minD) < 1e-6 in function 'rotatedRectangleIntersection'
The rotated rectangles passed on to the function:
((2.46805033e+05, 4.00232694e+06), (2.64058744e+01, 6.20025761e+00), -6.21015556e+01) ((2.46805122e+05, 4.00232659e+06), (2.74820953e+01, 8.53610030e+00), -5.63376146e+01)
After plotting them, I noticed that some of box A’s corners are nearly blended with box B’s sides, maybe this confuses the algorithm (heavy doubts)
Reading the intersection.cpp file didn’t bring much information other than
ptDistRemap (?) might be “corrupted”.
EDIT: the function runs fine one several rotated rect couples before raising an assertion on those 2.
Didn’t find much topics on the internet of people encountering the same assertion, any clue would be helpful !