GithubHelp home page GithubHelp logo

How to correct the distortion in D405, I found that when the object is too large or not in the center, the x,y coordinates of the detected point are not quite correct about librealsense HOT 13 OPEN

ybefe avatar ybefe commented on June 19, 2024
How to correct the distortion in D405, I found that when the object is too large or not in the center, the x,y coordinates of the detected point are not quite correct

from librealsense.

Comments (13)

MartyG-RealSense avatar MartyG-RealSense commented on June 19, 2024

Hi @ybefe The D405 camera model is designed for close-range depth sensing, with an ideal depth range of 7 cm to 50 cm. The D405 therefore has a different default depth scale value (0.01) to the rest of the models in the RealSense 400 Series range (which have a default depth scale of 0.001).

If you are using the camera at a distance from the object then you could therefore try using the rs.option.depth_units instruction to change the depth scale to 0.001 to see whether it makes a difference.

depth_sensor.set_option(rs.option.depth_units, 0.001)

The accuracy of the x and y coordinates can also drift when moving away from the center if the get_distance() instruction is used in the program script.

from librealsense.

ybefe avatar ybefe commented on June 19, 2024

I did use get_distance() to get the 3D coordinates of the point, so how do I fix this? @MartyG-RealSense

from librealsense.

MartyG-RealSense avatar MartyG-RealSense commented on June 19, 2024

Are you performing depth to color alignment before calling the get_distance() instruction?

from librealsense.

ybefe avatar ybefe commented on June 19, 2024

align = rs.align(rs.stream.color)
frames = pipeline.wait_for_frames()
aligned_frames = align.process(frames)
aligned_color_frame = aligned_frames.get_color_frame()
aligned_depth_frame = aligned_frames.get_depth_frame() I think I'm supposed to be aligned

from librealsense.

MartyG-RealSense avatar MartyG-RealSense commented on June 19, 2024

Yes, it is correct to use depth to color alignment. Either the aligned intrinsics or the color intrinsics should be used, as using the depth intrinsics can cause the inaccuracy at the outer edges of the image that you experienced. This is because the origin point of depth changes to the color stream's origin point when depth to color alignment is performed.

from librealsense.

ybefe avatar ybefe commented on June 19, 2024

So how to use the aligned intrinsics or the color intrinsics

from librealsense.

MartyG-RealSense avatar MartyG-RealSense commented on June 19, 2024

A Python get_distance() script at the link below that uses color intrinsics should be a helpful reference.

https://support.intelrealsense.com/hc/en-us/community/posts/23541262437011/comments/23566066750355

color_intrin = aligned_color_frame.profile.as_video_stream_profile().intrinsics

from librealsense.

ybefe avatar ybefe commented on June 19, 2024

align = rs.align(rs.stream.color)->align = rs.align(rs.stream.depth)
dis, camera_coordinate = get_3d_camera_coordinate(depth_pixel, aligned_depth_frame, depth_intrin)->
dis, camera_coordinate = get_3d_camera_coordinate(depth_pixel, aligned_depth_frame, color_intrin)
It's probably just using color alignment, and then using the camera parameters to find the 3D coordinates,right?

from librealsense.

MartyG-RealSense avatar MartyG-RealSense commented on June 19, 2024

When using align_to(), the alignment calculations are handled by a software routine in the SDK called the align processing block that performs automated adjustments, such as adjusting for differences in resolution between the streams or resizing the depth's field of view size to match the field of view size of color.

Things are a little more complicated on the D405 model, as it does not have a dedicated RGB sensor and its color is provided by the depth sensor and passed through an Image Signal Processor (ISP) chip to produce the final color image. The color intrinsics should still be different from the depth intrinsics though.

from librealsense.

ybefe avatar ybefe commented on June 19, 2024

So I should use align = rs.align(rs.stream.color) and color_intrin ,right?

from librealsense.

MartyG-RealSense avatar MartyG-RealSense commented on June 19, 2024

Yes, align to color and use color intrinsics.

from librealsense.

ybefe avatar ybefe commented on June 19, 2024

Thank you very much!

from librealsense.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.