The problem is that “keypoints.size()” is 658812184411720610 which is a huge amount and then the application crashes. I tried to deal with params but it doesn’t make any changes to this situation!
the below picture is my photo:
Etra Information:
OpenCV version: 3.4.0
IDE: Visual Studio 2017
Operating System: Windows 10 x64
_STL_VERIFY(_Mycont->_Myfirst <= _Ptr && _Ptr < _Mycont->_Mylast,
"can't dereference out of range vector iterator");
As you can see the message is : “can’t dereference out of range vector iterator” I reckon that the high size of vector cause the problem but why the vector size is so high?
please try calling detector->detect(gray, keypoints); instead of detector->detect(frame, keypoints);, see if that works better. I’m not sure if the blob detector can handle actual color pictures.
if that turns out to be the issue and detecting on the gray Mat works, I’d say error checking is insufficient inside of the SimpleBlobDetector class. that would be worthy of a bug report.
Accidently, I change the configuration from debug to release and it works but I don’t know why it works on release but doesn’t work on debug mode.
Do you have any suggestion on this?
Although other functions in openCV work quiet well on both configurations, SimpleBlobDetector cannot work on debug mode.
I have no idea why?
according to below link:
I’ll never get tired of telling people that the C++ OpenCV interface for Windows has the wierdest bugs .
Indeed, I started by using OpenCV 4.5 which is the latest one. However, I wasn’t able to compile it by CUDA support since the extra module in CMake was only for version 3.4.0 and that’s why I switched to 3.4.0. Unlike 4.5 in which I encounter thousands of compiler errors, the 3.4.0 compiled without any problems.
By the way, Thank you again for your time and consideration. However, I don’t know if there is a bug here in OpenCV 3.4.0 debug mode or something else.