[C++] ipcamera -> cv::Map -> RGB24

asked 2015-01-03 06:14:04 -0600

roboxx gravatar image

Hello,

I am using OpenCV for the first time and what i have to do is to convert the image data I get from the camera in RGB24 format. I get the data in a cv::Map in CV_8UC3 format. (that's what i get from the Type() method) I need to convert it in RGB24 format, and i don't know how I can do that from the Map data.

Thank you very much

Roboxx

edit retag flag offensive close merge delete

Comments

1

Which data type does your original image have? Is it already a cv::Mat? cv::cvtColor is normally used to change the types. In your case, the flag COLOR_BGR2RGB could be all you need.

FooBar gravatar imageFooBar ( 2015-01-03 06:29:10 -0600 )edit

the original data type is 8 bit what i have to do is to create a buffer of raw RGB24 data and i have no idea of the underlying data structure of the cv::Mat and how to to convert it to that raw RGB24 buffer.

The original image is already in the cv::Mat in unsigned 8 bit and 3 channel. I am going to have a look at the COLOR_BGR2RGB flag you're taking about.

roboxx gravatar imageroboxx ( 2015-01-03 08:51:25 -0600 )edit