Robotics StackExchange | Archived questions

openni2_camera published encoding wrong?

I noticed a potential bug (minor) in the indigo shadow build of the openni2camera. 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: imageview 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");

Asked by robojoe on 2014-04-30 08:38:07 UTC

Comments

Answers