ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Both RGB8 and BGR8 are stored in the data format CV_8UC3. (Depth and channels are exactly identical). If your set "rgb8" or "bgr8" it will convert the channels accordingly, i. e. the channel data in our cv::Mat will be ordered as you told it to be. If you want to do some own image processing you can do this in RGB8 or BGR8, does not matter if you are aware which format you use.
However, OpenCV's highgui functions (cv::imshow, cv::imwrite etc.) always assume BGR8 color space. This means if you use RGB8 the R and B channels will appear to be flipped if you save or show the image using OpenCV highgui methods....