-
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
How can I get the aligned infrared image? #12371
Comments
Hi @hosea7456 There is no need to perform alignment between infrared and depth if you do not want a combined image. This is because the left infrared image is already perfectly time-syncronized and pixel-perfect aligned with the depth image by default, This is because the left infrared sensor is also the origin point of the depth image. |
Thank you for your prompt response! I got it, I've been using "rs2::frame infrared_frame = frames.get_infrared_frame(2)" by default. |
You are very welcome. Index '2' is the right-side infrared stream, whilst '1' is the left stream that is aligned with depth. You do not need to use an index number if only using one infrared stream though as the left stream is used by default when there is no index number specified. |
Hi @hosea7456 Do you require further assistance with this case, please? Thanks! |
Case closed due to no further comments received. |
Just wondering, is it possible to align the infrared frame to the color frame? The image I got from this process seems to be off with the color frame.
|
Hi @jwwang0-0 When using align_to, one of the two streams that is being aligned has to be depth. However, because the infrared stream is already aligned with the depth stream it is possible to produce a combined depth, color and infrared image. An example of doing so in Python is at #5093 |
Thanks! Your answer is quick, great and useful 😆. Sorry if I may ask one more question, is the focal point located at (0,0,0) of the depth frame? |
When depth is unaligned, its 0,0,0 origin is the center-line of the left infrared sensor. But when depth is aligned to color, the depth origin becomes the center-line of the RGB color sensor. |
Cool! Thank you for your explanation. |
The last question: I am doing some accuracy tests of the D455. The official document said that its accuracy is less than 2% within 4m. From my test result, an object moved 20mm in real; based on realsense, it moved 18mm. I think it is quite good in this case. Do you have more data about the accuracy of it? 1m with 2% is 2cm which is quite poor. |
Error starts at around zero at the front glass of the camera and increases linearly as distance of an observed object / surface from the camera increases. This is called RMS Error. The D455 camera model has 2x the accuracy over distance of the D435 models. For example, at 6 meters distance from the camera the D455 has the same accuracy as a D435 has at only 3 meters. |
Issue Description
How can I get the aligned infrared image but not the infrared image overlaid with the depth image(as following image)?
My code is:
rs2::frameset frames1 = pipeline.wait_for_frames();
rs2::align align_to_depth(RS2_STREAM_DEPTH);
rs2::frameset frames = align_to_depth.process(frames1);
rs2::frame infrared_frame = frames.get_infrared_frame();
cv::Mat infrared_img(cv::Size(frame_width, frame_height), CV_8UC1, (void*)infrared_frame.get_data(), cv::Mat::AUTO_STEP);
The text was updated successfully, but these errors were encountered: