Why so many nan values appear when depth image convert to cv::mat
My ROS version is Kinetic
I am using rotor_simulator package.
I subscribe the topic "pelican/visensor/cameradepth/depth/disparity"
and the topic type is sensor/image, and encoding is 32fc1
I try to convert the msg to cv::mat
cv_bridge::CvImageConstPtr cv_ptr;
cv::Mat imgDepth;
try
{
cv_ptr = cv_bridge::toCvShare(msg, sensor_msgs::image_encodings::TYPE_32FC1);
}
catch (cv_bridge::Exception& e)
{
ROS_ERROR("cv_bridge exception: %s", e.what());
return;
}
imgDepth = cv_ptr->image;
Now I print the value in "img"
there are so many nan values, and the image I strored is all black
In rviz view, the depth image is normal
So why so many nan values appear and how to store a normal image?
Asked by roovie on 2020-03-16 14:09:26 UTC
Comments
Try subscribing to
../depth/image_raw"
well it worked for meAsked by rayane on 2020-09-26 12:00:14 UTC