Sometimes our c++ app may supply input dimensions that are incompatible for a Mat ROI, which results in the following exception from the Opencv library.
Although we are able to debug this in a full debugging environment, is there an easy way to detect the faulting line in application code that causes this assertion failure?
Surrounding every opencv api call with Try/catch is something we would like to avoid and have try/catch only at the higher levels; but this does not give us enough information currently for these type of assertion failures.
Exception caught: OpenCV(4.5.3-pre) /home/t1/gani/src/opencv/modules/core/src/matrix.cpp:811: error: (-215:Assertion failed) 0 <= roi.x && 0 <= roi.width && roi.x + roi.width <= m.cols && 0 <= roi.y && 0 <= roi.height && roi.y + roi.height <= m.rows in function ‘Mat’