Rearrange bytes to 24-bit pixel data in OpenCV

67 Views Asked by At

I am receiving raw Bayer pixel data from imager in an uint8_t buffer. Each pixel size is 3 bytes i.e. 01 23 45 from uint8_t buffer forms one pixel 012345. Is there an elegant way to convert/copy this data to an OpenCV MAT where each pixel represents 3 bytes of uint8_t buffer. The pixel size of OpenCV MAT would be 4 bytes since there is no 24-bit pixel format in OpenCV.

0

There are 0 best solutions below