Skip to content
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 to calibrate lidar l515 and how to use pointcloud in python #10641

Closed
saisatheesh5 opened this issue Jul 1, 2022 · 6 comments
Closed

how to calibrate lidar l515 and how to use pointcloud in python #10641

saisatheesh5 opened this issue Jul 1, 2022 · 6 comments

Comments

@saisatheesh5
Copy link

  • Before opening a new issue, we wanted to provide you with some useful suggestions (Click "Preview" above for a better view):

  • All users are welcomed to report bugs, ask questions, suggest or request enhancements and generally feel free to open new issue, even if they haven't followed any of the suggestions above :)


Required Info
Camera Model { L515}
Firmware Version (Open RealSense Viewer --> 2.50
Operating System & Version {Linux (Ubuntu 18)
Kernel Version (Linux Only) (5.4)
Platform PC
SDK Version { legacy / 2.0 }
Language {python }
Segment {Robot/Smartphone/VR/AR/others }

Issue Description

Hai, I am using L515 lidar camera. In my case, I need to measure the distance between two points in an object and I need to measure the angle of the bending object. suggest some links to solve my issue. i think I want to use the point cloud to detect the particular pixel point is correct? and how to calibarate my camera to measure the accurate result.

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Jul 1, 2022

Hi @saisatheesh5 A Python script for measuring the distance between two points is provided at the link below.

https://github.com/soarwing52/RealsensePython/blob/master/separate%20functions/measure_new.py

For measuring the angle of a bending object, a discussion at #9297 about measuring an object's height by calculating its angle from the ground may be a helpful reference.

In regard to calibration, the L515 camera model does not have a calibration tool for its depth and RGB sensors.

@saisatheesh5
Copy link
Author

Thank you so much MartyG. How do I get a particular pixel value in an object automatically using the point cloud?

@saisatheesh5
Copy link
Author

def calculate_distance(self,x,y):
color_intrin = self.color_intrin
ix,iy = self.ix, self.iy
udist = self.depth_frame.get_distance(ix,iy)
vdist = self.depth_frame.get_distance(x, y)
#print udist,vdist

    point1 = rs.rs2_deproject_pixel_to_point(color_intrin, [ix, iy], udist)
    point2 = rs.rs2_deproject_pixel_to_point(color_intrin, [x, y], vdist)
    #print str(point1)+str(point2)

    dist = math.sqrt(
        math.pow(point1[0] - point2[0], 2) + math.pow(point1[1] - point2[1],2) + math.pow(
            point1[2] - point2[2], 2))
    #print 'distance: '+ str(dist)
    return dist

In this program it will return the distance in mm or inches?

@MartyG-RealSense
Copy link
Collaborator

The RealSense SDK's get_distance() instruction returns distance in meters.

https://intelrealsense.github.io/librealsense/doxygen/classrs2_1_1depth__frame.html#a5090d69d04ade6dd67175cae9b6bee9c

@MartyG-RealSense
Copy link
Collaborator

Hi @saisatheesh5 Do you require further assistance with this case, please? Thanks!

@MartyG-RealSense
Copy link
Collaborator

Thanks very much @saisatheesh5 for the update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants