intel / ros2_intel_realsense

This project is deprecated and no more maintained. Please visit https://github.com/IntelRealSense/realsense-ros for ROS2 wrapper.
Apache License 2.0
140 stars 96 forks source link

Aligned depth image repeats itself #160

Open ItsMeTheBee opened 4 years ago

ItsMeTheBee commented 4 years ago
System Info
Camera Model D435
Firmware Version 05.12.06.00
Operating System & Version Ubuntu 18.04 (host) & Docker Container ros:eloquent
Kernel Version (Linux Only) 5.4.0-47-generic
Platform Desktop x86_64
Language C++

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: color_depth_diff

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!