I have a a raw image file which contains image data from the 5th byte onwards. Each byte in the file represents a 8 bit greyscale pixel intensity. I have been able to store the binary data of the image in a 2-D unsigned char array.
Can anyone tell me how to use the array or the file to display the image in openCV?
Right now I am using this code :
void openRaw() {
cv::Mat img(numRows,numCols,CV_8U,&(image[0][0]);
//img.t();
cv::imshow("img",img);
cv::waitKey();
}
But its displaying a wrong image.
I also tried using the IplImage method, but I am not sure how to pass the pointer to the source image there.
Could anyone provide me with some code for this?
Thanks, Uday