-
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
Retreive depth from depthframe #10833
Comments
Hi @Zumbalamambo In the issue that you linked to, one of the commenters at #7754 (comment) used the following definition for depth:
|
@MartyG-RealSense May I know what is |
@MartyG-RealSense i used the following code to retrieve the depth.
But it is a VideoStreamProfile and not a float point value (depth). It's something else. How do I retrieve the depth? |
It looks as though you are using a script that originated from the Mapping 2D to 3D section of a C# / Unity guide at the link below (I have quoted this guide in cases on this forum in the past). https://lightbuzz.com/intel-realsense-coordinate-mapping/ In the paragraph of that guide just before the script, they state that "the depth of the desired point can be found by calling the GetDistance() method of the DepthFrame class". float depth = depthFrame.GetDistance(x, y); |
@MartyG-RealSense the retrieved XYZ data is totally wrong. Is there any example of click and know depth using Unity Realsense? |
Also, how do I flip the frame horizontally or vertically? |
Unity RealSense example scenes render depth visually but do not have accompanying numeric depth values as an overlay. This is because the Unity wrapper converts the camera data into a Unity material so that it can be viewed on-screen as a graphical representation of the data. Non-RealSense pointcloud generation tools in the Unity Asset Store are also typically visual-only with no display of the numeric values. For example: https://assetstore.unity.com/packages/tools/utilities/point-cloud-viewer-and-tools-16019 The link below is a project that gives greater control over generating a pointcloud with RealSense data by using a Unity Visual Effect Graph, but again it does not return real-time numeric depth values. https://github.com/keijiro/Rsvfx In regard to flipping the orientation of the Unity RealSense material, I am not aware of a way to do so unfortunately. It is possible to perform a vertical flip of the orientation of the main camera image though by simply changing the Z rotation value of the main camera object from '0' to '180'. If it were possible to flip the image instead of the camera then although the image would appear flipped, its calibration data and other parameters would not be flipped with it, as described by a RealSense team member at #6023 (comment) |
Feature Request: An example to select a point in the Image and get the XYZ position via Unity. |
I have forwarded your Unity example feature request to my Intel RealSense colleagues to seek their feedback. Thanks! |
Hi @Zumbalamambo After discussion with my RealSense colleagues, an official feature request has been created for a Unity example program that performs the function of providing a depth value when the image is clicked on. This case should be kept open whilst the feature request is active, but you do not need to take any further action. Thanks very much for the request! |
The feature request for the creation of a Unity example has been closed because the RealSense team are no longer updating the RealSense Unity wrapper due to an increase in Unity licence fees. |
I'm using the following code to retrieve the depth point from the colour image pixel point (X,Y). I used this as a reference
https://github.com/IntelRealSense/librealsense/issues/7754
I managed to retrieve the color intrinsic as follows,
colorCamIntrinsic = ActiveProfile.GetStream(Stream.Color).As<VideoStreamProfile>().GetIntrinsics();
Now what should be the depth value that needs to be passed to
Map2DTo3D
The text was updated successfully, but these errors were encountered: