1 | initial version |
You can use cvtColor function to change color space. All color code conversions are here
Now in memory mat structure is here
I don't understand what you want array_buffer. You can use split to get B plane, G plane and R plane in three mat.
if mat is continuous in memory you don't need a loop :
memcpy(array_buffer, Mat_frame.ptr(0), Mat_frame.cols*Mat_frame.rows * sizeof(uint8_t)*3);