ros opencv cannot recive kinect2's depth image

asked 2019-08-27 05:50:09 -0500

lixz123007 gravatar image

updated 2019-08-28 01:03:50 -0500

I am trying to make a ros to recive kinect2's depth image.But it show error:

[16UC1] is not a color format. but [mono16] is. The conversion does not make sense

There is a very samiliar question: CvBridgeError: [8SC1] is not a color format. but [mono8] is. The conversion does not make sense [closed]. But he closed without anyone answer him. Here is my core code:

cv_ptr = cv_bridge::toCvShare(msg, sensor_msgs::image_encodings::MONO16);

I although try :

cv_ptr = cv_bridge::toCvShare(msg, sensor_msgs::image_encodings::MONO8);

other is in my github:image_tansport.cpp Hope to get any suggestions!Thanks!

edit retag flag offensive close merge delete