Ask Your Question
0

HOW TO OPEN RAW IMAGE IN OPENCV

asked 2019-03-13 07:54:01 -0600

AlmaBaro gravatar image

Hi! I have an image in raw format (.raw) and I want to use it in Opencv (for several transformations). Is there any way to open and read it, or maybe to convert it into an appropiate format (jpg, bmp)? Thanks in advance!!

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
1

answered 2019-03-13 08:24:23 -0600

HYPEREGO gravatar image

updated 2019-03-13 08:26:15 -0600

There's a library that I think can be used alongside OpenCV to manage raw images, it's called LibRAW

I never used it but a friend of mine told me that.

Also, here in this forum there is an example regarding RAW images handling in OpenCV: http://answers.opencv.org/question/58...

edit flag offensive delete link more

Comments

1

hope, you don't mind me converting thisto an answer ;)

berak gravatar imageberak ( 2019-03-13 08:27:28 -0600 )edit

Thank you then @berak ! I really appreciate that

HYPEREGO gravatar imageHYPEREGO ( 2019-03-13 08:31:49 -0600 )edit
0

answered 2019-03-13 08:18:04 -0600

berak gravatar image

no, unfortunately there isn't.

there is even no clear definition, what raw means here, it can be anything from plain pixels (in which format ?) to something nested with proprietary headers, -- you're all on your own here.

try to look up the specs / documentation of the device, you get it from, then use native c++ methods (ifstream, etc) to slurp in the data. once you have it in memory, you can construct a cv::Mat like:

Mat m(height, width, type, pixelPointer);
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2019-03-13 07:54:01 -0600

Seen: 15,381 times

Last updated: Mar 13 '19