openni2_camera published encoding wrong?

asked 2014-04-30 08:38:07 -0500

robojoe gravatar image

I noticed a potential bug (minor) in the indigo shadow build of the openni2_camera. The encoding published in the topic appears to be "rgb8" but I think in reality the encoding is "bgr8". I would submit a bug report but can someone verify this first? Note: image_view still shows the correct encoding (but I think that is because it falls back to the opencv default "bgr8" and isn't using the encoding published in the topic message).

The piece of code I'm using to get the error is:

cv_bridge::CvImageConstPtr cv_ptr_rgb;<p>
cv_ptr_rgb = cv_bridge::toCvShare(rgb_msg_in, rgb_msg_in->encoding);

If I replace the second line with the following it works properly:

cv_ptr_rgb = cv_bridge::toCvShare(rgb_msg_in, "bgr8");
edit retag flag offensive close merge delete