Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I converted to using &refs, and all is working but only using the clone to copy. I stepped through the code, and I don't see why copyTo fails. On line 288/9 of copyTo() in OCV 3.4.0, it creates a local Mat called Dst by calling _dst.create and then _dst.getMat(); create allocates a new databuffer to _dst as it is empty at start-off. It then copies the src data to that new allocated dst data. On return, the ~mat is called, but as the ref is now 2, it DOES NOT deallocate the dst memory! But that memory, after the return, cannot be used. Something is wrong, because this should work!