IntelRealSense / realsense-ros

ROS Wrapper for Intel(R) RealSense(TM) Cameras
http://wiki.ros.org/RealSense
Apache License 2.0
2.44k stars 1.71k forks source link

D435i emitter_on_off problem #3155

Open davidlmljll opened 4 days ago

davidlmljll commented 4 days ago

D435i set emitter_on_off still appear projection points in left and right grayscale images


Required Info
Camera Model { D435i }
Firmware Version (librealsense-2.54.2)
Operating System & Version { Linux (Ubuntu 22)}
Kernel Version (Linux Only) (5.15.122-tegra)
Platform NVIDIA Jetson orin nano
Librealsense SDK Version { librealsense-2.54.2}
Language {C++}
Segment {Robot }
ROS Distro {Humble}
RealSense ROS Wrapper Version {4.54.1}

Issue Description

When setting emitter_on_off to true, the projector can be seen in the on-off state using the realsense SDK, but in the off state, the left and right grayscale images still have projection points caused by the projector. How to solve this problem? In addition, does setting frame_laser_power_mode=1 mean that the projector is turned off? This parameter setting seems to be different from the previous version? Projector off status(frame_laser_power_mode=1): 截图 2024-07-04 15-32-41

Projector on status(frame_laser_power_mode=0): 截图 2024-07-04 15-32-24

MartyG-RealSense commented 3 days ago

Hi @davidlmljll emitter_on_off alternates the emitter rapidly on-off on a per-frame basis (one frame on, one frame off, one frame on, etc). So it can be difficult to capture an image of a frame where the dot pattern is completely off unless program code is used to save each individual frame instead of trying to snapshot the screen in the Viewer.

The easiest way to capture an off-frame in the Viewer is to start the Infrared stream, enable Emitter On Off and then tap the keyboard space bar repeatedly to pause and unpause the stream until you pause on a frame that has no pattern.

https://github.com/IntelRealSense/librealsense/pull/3066 has information about the emitter on-off alternating mode. The page has an animated image with a fast-strobing light, so please be aware if you have epileptic sensitivity.

When laser_power is set to '1', the visibility of the dots is at its absolute minimum but the projector is still enabled. Setting laser_power to '0' disables the projector. '0' has always been the value that turns the projector off.

If you are using ROS2 and need to obtain individual frames, you could perhaps record the camera streams to a rosbag file with rosbag record and then use the export feature of the ROS2 bag tools at the link below to export the bag frames to jpg or png image file.

https://github.com/AIT-Assistive-Autonomous-Systems/ros2bag_tools?tab=readme-ov-file#export

davidlmljll commented 3 days ago

The recorded ros2bag has been converted to a single frame message, but projection points still appear 1720146007484525391

MartyG-RealSense commented 2 days ago

If i is showing a single frame, could it be a frame where emitter_on_off is in the on state instead of the off state?

davidlmljll commented 9 hours ago

Yes, it is on, the off state image is as follows: 1720146007467726563

MartyG-RealSense commented 3 hours ago

Is the off-frame easier to capture if you use 6 FPS instead of 30?

davidlmljll commented 2 hours ago

After setting the FPS to 6, there are still shadow points and exposure issues image

MartyG-RealSense commented 58 minutes ago

If you are using the RealSense ROS2 wrapper then the only remaining option that is likely to work is to turn off the emitter completely instead of alternating it, and if possible increase the strength of lighting illumination in the scene. RealSense 400 Series cameras can make use of ambient light in the scene to analyze surfaces for depth information, so increased lighting could act as an alternative depth-analysis aid to projecting a dot pattern.