Question

I'm totally new in OpenCV so hopefully that's not a too stupid question.

As a result of a OpenCV operation (capturing image data from a device) I get back a IplImage.

Depending on its real size I first have to scale it an next convert it to a plain, raw 24 bit RGB format.

For first operation I guess there is some scaling function available. But how about accessing and converting the raw image data? I could not find anything suitable within IplImage structure - at least I could not identify a member as a pointer to the image data.

Any operation that slowly reads out every songle pixel is not suitable, I have to do that operation very often and therefor need fast access to the data.

Was it helpful?

Solution

First of all why do you use IplImage instead of cv::Mat? It's the best format for saving image.

For your first operation there's function resize.

To convert it to RGB format (if I'm not mistaken OpenCV by default saves images in BGR format) you can youse cvtColor function with code (3'rd parameter) CV_BGR2RGB.

Or if you want to take a pointer to image (pixels) data see this SO question.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top