I´m trying to segment objects by detecting them in the rgb image, cropping the depth image and then converting that image to a pcl.
Doing this I´m facing some issues and you might be able to help me with this one:
The depth image seems to repeat itself instead of actually being aligned to the color image:
This leads to issues when I try to crop and convert the depth image.
Where does this behavior come from? Is there anything I can do about it?
Code to convert the depth image msg to cv::Mat:
cv::Mat image(m_current_depth_msg.height, m_current_depth_msg.width, CV_8UC3, const_cast<unsigned char *>(m_current_depth_msg.data.data()), m_current_depth_msg.step);
Something I noticed is that I can´t visualize the topic "/d435/camera/aligned_depth_to_color/image_raw" in Rviz. The messages get dropped due to some unknown error. The topic "/d435/camera/depth/image_rect_raw" can be visualized just fine but here I´m facing the same issue (plus the image is obviously no aligned so I can´t really use it).
Issue Description
I´m trying to segment objects by detecting them in the rgb image, cropping the depth image and then converting that image to a pcl. Doing this I´m facing some issues and you might be able to help me with this one:
The depth image seems to repeat itself instead of actually being aligned to the color image:
This leads to issues when I try to crop and convert the depth image. Where does this behavior come from? Is there anything I can do about it?
Code to convert the depth image msg to cv::Mat:
cv::Mat image(m_current_depth_msg.height, m_current_depth_msg.width, CV_8UC3, const_cast<unsigned char *>(m_current_depth_msg.data.data()), m_current_depth_msg.step);
Something I noticed is that I can´t visualize the topic "/d435/camera/aligned_depth_to_color/image_raw" in Rviz. The messages get dropped due to some unknown error. The topic "/d435/camera/depth/image_rect_raw" can be visualized just fine but here I´m facing the same issue (plus the image is obviously no aligned so I can´t really use it).
Any help would be appreciated! Thanks in advance!