Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Okay so after a while I managed to get it working. What I did was the following:

  • I made cv::Mat image; as global variable, so in that way it doesn't remove itself from the memory when it's 'done', which is the case now. (Sorry, I should've known that. It is documented in the docs section of OpenCV.)

  • In the line where I return my Bitmap, I changed 4 * matToConvert.rows to matToConvert.step1(). Because what @berak said about the stride is broken is totally right and since I changed that line I didn't have any problems since.

Thanks.