Hi @massi-ang,
I had a rather similar issue some time ago. When using OpenCv objects (images, matrices, ...), you need to clone those objects via the OpenCv cloning functions.
As you can see in this old discussion, I have been experimenting with custom cloning. However due to free time constraints, I had to quit this. Keep in mind that it was a quick test, so it might be a bad design!!
It would be nice if cloning could somehow been customized in the future. But I assume this will probably not that easy, because it has to work in a lot of different scenarios. And it should be fast, because this code is being called all over the place.
Bart