Items with no label
3338 Discussions

I want to know the coordinates of a point on the depth map, and find the three-dimensional coordinates corresponding to the point on the generated point cloud.

tguan
New Contributor I
4,224 Views

I use:

     Cloud = pcl.load_XYZRGB('data/points/points7.ply')

     Visual = pcl.pcl_visualization.CloudViewing()

     visual.ShowColorCloud(cloud, b'cloud')

display point cloud, I want to know how to display the point cloud in real time after collecting data through sr300

 I want to know the coordinates of a point on the depth map, and find the three-dimensional coordinates corresponding to the point on the generated point cloud.

I also want to know some tutorials on using pix on python, such as I want to do some painting on the point cloud, draw the line operation

0 Kudos
9 Replies
tguan
New Contributor I
3,134 Views

I alread know the coordinates of a point on the depth map, i want to fin the three-dimensional coordinates corresponding to this point on the generated point cloud.

0 Kudos
MartyG
Honored Contributor III
3,134 Views

A Python tutorial for generating a point cloud can be found at the link below:

 

https://github.com/dorodnic/binder_test/blob/master/pointcloud.ipynb

 

You can get the 3D coordinates from a point cloud with an instruction called rs2_deproject_pixel_to_point

 

https://github.com/IntelRealSense/librealsense/issues/1413

 

3D lines can be drawn on a point cloud using a type of function called a polyline. This can be done with the OpenCV software.

 

https://www.tutorialspoint.com/opencv/opencv_drawing_polylines.htm

 

 

 

 

 

0 Kudos
tguan
New Contributor I
3,134 Views

捕获.PNGsorry,I want to display point clouds in real time, through video frames。

# Tell pointcloud object to map to this color fram

pc.map_to(color_frame) #problem:The color map does not match on the top, I don't know what this is for.

# Generate the pointcloud and texture mapping

cloud = pc.calculate(depth_frame)

points.export_to_ply("data/point/15.ply",color_frame)

#visualization,I only read the cloud data of this location to visualize, I don't know how to display the point cloud through real-time streaming.

 

cloud = pcl.load_XYZRGB('data/point/15.ply')

visual = pcl.pcl_visualization.CloudViewing()

visual.ShowColorCloud(cloud, b'cloud')

flag = True

while flag:

flag != visual.WasStopped()

0 Kudos
MartyG
Honored Contributor III
3,134 Views

Dorodnic the RealSense SDK Manager recommends using Open3D for real-time point cloud visualization.

 

http://www.open3d.org/docs/tutorial/Basic/pointcloud.html

 

An Open3D wrapper for RealSense SDK 2.0 to enable closer integration with Open3D is coming but I do not have a date for when it will be available.

 

0 Kudos
tguan
New Contributor I
3,134 Views

Thank you very much for your help.

I have got the 3D coordinates on the point cloud. I want to draw the line on the point cloud.

you gave the information of the polyline , but it seems that I can't operate on the point cloud.

To pcl there is a PCLVisualizer, pcl::visualization::PCLVisualizer can draw lines on the point cloud and display the point cloud in real time. Do you have a tutorial on python?

0 Kudos
MartyG
Honored Contributor III
3,134 Views

I recently suggested to another user that they draw the poyline using the OpenCV software with an instruction called cv2_polylines

 

If you wish to use Python, here are a couple of example tutorials for drawing a polyline:

 

https://pysource.com/2018/01/22/drawing-and-writing-on-images-opencv-3-4-with-python-3-tutorial-3/

 

http://opencvinpython.blogspot.com/2014/09/basic-drawing-examples-drawing-line-cv2.html

 

 

 

0 Kudos
tguan
New Contributor I
3,134 Views

image = cv2.imread("red_panda.jpg")

cv2.polylines(image, [points], True, yellow, thickness=3)

this is operated on an image ,i am fingding​ a way to draw lines and circles on pointcloud and display the it in real time like a video

0 Kudos
MartyG
Honored Contributor III
3,134 Views

I would recommend asking about it at the RealSense GitHub, as if the solution involves Open3D then it is beyond my current knowledge to provide an answer, unfortunately. You can post at the GitHub by visiting the link below and clicking the New Issue button.

 

https://github.com/IntelRealSense/librealsense/issues

0 Kudos
tguan
New Contributor I
3,134 Views
0 Kudos
Reply