-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does the D405 require alignment between RGB and depth streams? #11784
Comments
Hi @xEnVrE The D405 camera model does not have a separate RGB sensor component and RGB is instead provided by the depth sensor. This means that RGB is already in alignment with the left IR sensor that depth originates from. It is fine to use D405 with depth-color alignment scripts such as rs-align for C++ and align_depth2color.py for Python to create an aligned image of both depth and RGB data, D405 uses a different depth unit scale scaling factor to other 400 Series models. Most models have a default depth scale of 0.001, whilst the default scale of D405 is 0.01. Does the alignment occur correctly without your resolution modification, please? I note that your firmware version at the top of this case is listed as 5.12.14.100. The firmware version that must be used with SDK 2.53.1 is 5.14.0.0. Kernel version 6.2.7 is not supported by the RealSense SDK. The newest supported kernel at the time of writing this is 5.15. The SDK can be used with an unsupported kernel but there may be unpredictable consequnences in regards to stability. If you are unable to change your kernel version then you can build the SDK from source code with the RSUSB backend installation method so that the kernel is bypassed and the SDK does not need to be kernel-patched. |
Hi @MartyG-RealSense thank you for your the prompt answer.
Thanks, then we can avoid using the alignment software-side.
We are aware of it however we did not change any scale within the
To avoid any confusion we moved to another setup with Kernel
We repeated our tests. The original However, I think - please correct me if I am wrong - that the software-based alignment should work as well with a different resolution. Then we changed these lines librealsense/examples/align/rs-align.cpp Lines 40 to 52 in b874e42
to
in order to test it with the resolution we are interested in, i.e., 640 x 480. We got this result: where the alignment is - according to us - not correct. Indeed, by modifying the Thank you for your help! |
You are very welcome! Can you confirm whether modifying rs-align to not perform alignment resolves your problem, please? |
It seems so @MartyG-RealSense. However, I was just wondering why using the Thank you |
I believe that you are the first person to report an issue with the C++ based rs-align example when using D405, as D405 users have always used the Python-based equivalent example align_depth2color.py example up until now. rs-align and align_depth2color.py both perform alignment using the align_to instruction. I have just tested the Windows version of rs-align with a D405 and not seen misalignment though, but was using the pre-built executable version and so had not modified the resolution. |
Indeed, with the pre-built executable we also don't have problem. However It would be great if it worked also with other resolutions :) Thanks |
Which cfg stream configuration instructions are you using to define 640x480 resolution in your rs-align custom version? Is it something like this:
|
Posting here the first lines of the custom version of
In summary, yes it is the same as you posted. |
Is it still misaligned if you change the window size back to 1280x270 instead of using 640x480 but still keep the streams at 640x480
|
Hi @xEnVrE Do you require further assistance with this case, please? Thanks! |
Hi @MartyG-RealSense, we kind of solved by disabling the alignment. However the problem still persists for those who want to use the alignment for whatever reason. I will try to perform the last test you asked today, sorry for the delay. |
That's no problem at all. I look forward to your next report. Thanks very much for the update! |
The above images do not look as though they are misaligned. The black silhouette around the object is a common effect that occurs when depth and color are mapped together. It is called occlusion. The occlusion in this image is actually good quality, as the silhouette surrounds the object evenly on all sides instead of the shadow being off to one side of the object in particular. |
Dear @MartyG-RealSense thank you for your comment. Unfortunately, I cannot agree with you on the fact that both images are not misaligned. To me, if you consider the second image, it is clear that the alignment is very good. For example, the boundaries of the cup match when comparing RGB and depth: Instead, if you take the first image - where the Please, let me know what do you think! Thank you |
Thanks very much for the clarification. It looks though as though your workaround for using rs-align with D405 without alignment is going to be the best approach for using a custom resolution. |
Hi @xEnVrE Do you require further assistance with this case, please? Thanks! |
I would say no, we made the tests you asked for and we were waiting for a fix from your side. As you stated, one solution is to disable alignment. However I think it should be stated somewhere that the software-based alignment is broken for some resolutions with the D405 so that other people are aware of it. Thanks |
The alignment on rs-align became incorrect for you when a custom resolution of 640x480 was set and worked normally when using its default 1280x720 resolution. So the example program is working as intended when the program is unmodified. I understand your concern though in regard to your wish to be able to customize the resolution used with alignment. It is certainly an issue that can be returned to at a future date if others experience a similar issue with their D405. |
For sure. However the problem is not with the specific executable per se, rather on the alignment procedure that your SDK offers. The fact that This issue is more about the alignment of the D405 in general rather than the |
It's no trouble at all. I have highlighted your issue to my Intel RealSense colleagues to seek their advice regarding whether a custom resolution can be set with D405. |
My Intel RealSense colleagues responded that this issue with D405 mis-alignment is known to them and an internal report to look at the problem has already been created. In the meantime they suggested using 640x360 or 848x480 resolution instead of 640x480, though this may not be an option for you as the rest of your application relies on 640x480. |
Thank you for the update! We could actually use those other resolutions if the alignment works with them. Moving from 640x480 to 640x360 should not be a big deal for us. Thanks again for the update. Looking forward towards a final resolution for the issue. |
Hi @xEnVrE Were you able to make use of 640x360 resolution to provide correct alignment, please? Thanks! |
Hi @MartyG-RealSense, unfortunately I do not have access to the camera setup these days. If possible, I will update the issue with the tests once ready. Thank you |
Thanks very much @xEnVrE for the update. |
Hi @Daa98 The RealSense Viewer tool does not support alignment in its 2D mode (shown above). It only maps two different streams together in its 3D pointcloud mode. On the D405 camera model, RGB color is provided by the left infrared sensor, so the left infrared and RGB images have the same viewpoint. The two images are not having alignment performed on them. |
Hello, @MartyG-RealSense |
Hi @Daa98 I can see the misalignment in your RGB and Infrared 1 images above. I performed repeated tests and observed a very slight misalignment in my own camera on each test. Perfect alignment between depth and between RGB color from the left infrared sensor is promised in point number 2 of the section of Intel's camera tuning paper at the link below. The D405 is a unique situation though, as it is the only RealSense model with built-in RGB that obtains it from the depth sensor instead of a separate RGB sensor and so the same match-up promise cannot be guaranteed for Infrared 1 and RGB. The RGB image obtained from the depth sensor is also passed though an Image Signal Processor (ISP) chip in the camera's hardware to produce the final image, and this adjustment cannot be bypassed. |
Hello, @MartyG-RealSense . |
Alignment between RGB and infrared is not usually an issue with RealSense cameras, as alignment between those stream types is not supported. One of the two stream types has to be Depth (depth to color, or depth to infrared). The only available solutions for color to infrared alignment are to follow the complicated advice at #1556 (comment) or to align three streams including depth using the method at #5093 |
Hi @xEnVrE Do you require further assistance with this case, please? Thanks! |
At the moment we are happy with the solution consisting of disabling the software alignment. Any future software update will be welcome of course. Thanks for the support thus far! |
You are very welcome! As you do not require further assistance right now, I will close this issue. Please feel free to re-open it at a future date or create a new issue. Thanks again! |
Issue Description
I made some experiments using the
rs-align
example in C++. I have modified it so that I can run it using the native resolution of my application, i.e. 640x480, and I can disable the alignment completely if needed.It seems that using a D405 camera the software-based alignment is not working as expected.
I am attaching a video which shows the behavior.
test_rs_alignment_2-2023-05-09_11.20.39.mp4
As you can see, when I enable the alignment the depth and RGB streams get not aligned and the depth is kinda zoomed.
Is such behavior of the
rs2::align
software block normal? Do I need to use alignment at all with the D405 camera?Thank you
cc @MartyG-RealSense
The text was updated successfully, but these errors were encountered: