Ask Your Question

Revision history [back]

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:

  1. The pointer, that wants to access memory does not get access.
  2. The memory location you are pointing to doesn't exist anymore.

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.