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

Extract the pixel data of each frame #10621

Closed
Amayess opened this issue Jun 23, 2022 · 6 comments
Closed

Extract the pixel data of each frame #10621

Amayess opened this issue Jun 23, 2022 · 6 comments

Comments

@Amayess
Copy link

Amayess commented Jun 23, 2022

  • 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 D400
Firmware Version 05.13.00.50
Operating System & Version Win 10
Platform PC
SDK Version 2.50.0.0 }
Language C++
Segment Robot

Issue Description

Hi @MartyG-RealSense, I am looking for a way to extract the pixel coordinates (x,y,z) of the first 40 frames, so far now i have been able to extract the pixel data using the RealSense example "Rs-hello" that i modified like this :
frames

Is it possible to have an access to the whole data information of each pixel for each frame ? Thank you

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Jun 23, 2022

Hi @Amayess You can obtain the XYZ of a specific pixel by converting a color pixel to a depth pixel with rs2_project_color_pixel_to_depth_pixel. A C++ example can be found at #2982

If you wish to be able to access the XYZ of all coordinates then generating a point cloud and storing its vertices with the points.get_vertices() instruction to retrieve XYZ from the vertices may a helpful approach, as described at #1783 and #5728

@Amayess
Copy link
Author

Amayess commented Jun 23, 2022

Hi @Amayess You can obtain the XYZ of a specific pixel by converting a color pixel to a depth pixel with rs2_project_color_pixel_to_depth_pixel. A C++ example can be found at #2982
That's what i found too, thank you !
If you wish to be able to access the XYZ of all coordinates then generating a point cloud and storing its vertices with the points.get_vertices() instruction to retrieve XYZ from the vertices may a helpful approach, as described at #1783 and #5728

What if i want to get the distance between every points or pixels contained in a depth frame ?

@MartyG-RealSense
Copy link
Collaborator

The SDK has a C++ example program called rs-measure that can measure the real-world distance between two points. So conceivably you could find the distance between any two points from coordinate A to coordinate B by changing the values of A and B to the coordinates that you want to compare the distance between.

https://github.com/IntelRealSense/librealsense/tree/master/examples/measure

@MartyG-RealSense
Copy link
Collaborator

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

@Amayess
Copy link
Author

Amayess commented Jun 30, 2022

Hi @MartyG-RealSense, I am still working on it.

Can I close it when i will finish ? Thank you

@MartyG-RealSense
Copy link
Collaborator

Yes, it is fine to close it when you are ready to do so. Thanks very much for the update!

@Amayess Amayess closed this as completed Jul 4, 2022
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