1 | initial version |
Be aware that clone() function creates a new pointer to the exact memory location. If you want to copy the containings of a Mat element to a new Mat element it is better to use the cvCopy() function.
This error basically can exist by two reasons:
So basically I am guessing that in your code, you are cloning a pointer, then removing the original image by closing the function due to C++ garbage collector, creating a dangling pointer, which is then accessed.