Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The issue with your approach is, that just creating a variable of type "CvImagePtr" will not give you anything useful... ;) The "Ptr" means "pointer", in this case boost::shared_ptr. So you have a pointer poing to null. That's what the assertion is trying to tell you.

Maybe it will help, to create a CvImage with new in the follwing way:

CvImagePtr cv_ptr_image_final(new CvImage());

This will give you a shared pointer pointing to some empty CvImage. But I think, before you can really send the image, you need to fill the header and encoding members of your new CvImage, too. In most cases it should be possible to just copy them from the old CvImage.