Unable to open raw image through opencv
I am trying to open a raw color image that I have captured from the camera using opencv. But imread does not seem to be able to open it. Below is my code:
Mat original = Mat(1792,1344, CV_8UC3);
original = imread("image.raw", 1);
if(original.empty()){
cout<<"unable to read image";
waitkey(10);
exit(0);
}
Can someone please help me find the solution?
PS: I am using my own debayering technique to get the raw image from the sensor and writing it to the disk.
And in which format do you write it to the disk?
imread() can't read raw images. you'll have to build your own loading routine for that.
Hello,
is there a way to use the imagedata pointer direct in the Mat class. on slow System, memcpy Need much time.
sample img.create(Height, Width, Format, imagedata)
so no internal malloc, no memcpy, no free is needed.
Johann
@Johann, some things: