1 | initial version |
It is easy to convert any kind of image to OpenCV format as long as you have pointer to buffer where the image is stored. For example:
Mat imageWrap(Size(width,height), CV_8UC3, buffer, step);
CV_8UC3 - defines that the image should be of unsigned chars (8U) and 3-channel (C3).
step - is step/stride/pitch (or whatever you name it) between subsequent rows in buffer.
This operation does not perform any coping operations, so any changes that will be applied to imageWrap are actaully applied to original buffer.