OpenCV with RGB 16bits
问题 I have a data (unsigned char*) with RGB 16 bits format R:5 G:6 B:5 How can I set this data to IplImage format? I can start with: unsigned char* data = ...data...; IplImage *img = cvCreateImage(cvSize(800,480), IPL_DEPTH_8U, 3); // Should it be 16? cvSetData(img,data,800*2); // Here is where I am not sure 回答1: You are going to need to convert from IPL_DEPTH_16U (single-channel) to IPL_DEPTH_8U (three-channel). Below is some code I wrote up quickly (this should work, but I don't have a 565