Items with no label
3338 Discussions

Hello, I recently bought the intel D435, I have an issue where sometimes the function "deproject _from_pixel_to_point" returns zero ? the camera is using factory calibration.

YAboE
Beginner
2,627 Views
 
0 Kudos
7 Replies
MartyG
Honored Contributor III
1,937 Views

Is the discussion in the link below of any help to you, please?

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

0 Kudos
YAboE
Beginner
1,937 Views

Thanks for the fast reply, I've thoroughly read the discussion and made sure that I'm passing the arguments as the RS team specified but still the same issue occurs, also at the end of the discussion omer says that the issue is solved but didn't mention how it was solved

0 Kudos
MartyG
Honored Contributor III
1,937 Views

When you say that rs2_deproject_pixel_to_point returns zero, do you mean that the value of rs2_deproject_pixel_to_point is zero?

 

Or do you mean that you are using rs2_project_pixel_to_point in your program, and you are seeing '0' values for the depth of the pixels, please?

0 Kudos
YAboE
Beginner
1,937 Views
vector<float> dist_3d(const rs2::depth_frame& frame, pixel u) { float upixel[2]; // From pixel float upoint[3]; // From point (in 3D)   // Copy pixels into the arrays (to match rsutil signatures) upixel[0] = u.first; upixel[1] = u.second;   auto udist = frame.get_distance(upixel[0], upixel[1]);   // Deproject from pixel to point in 3D rs2_intrinsics intr = frame.get_profile().as<rs2::video_stream_profile>().get_intrinsics(); // Calibration data rs2_deproject_pixel_to_point(upoint, &intr, upixel, udist);   vector<float> point; point.push_back(upoint[0]); point.push_back(upoint[1]); point.push_back(upoint[2]);   return point; }

I've attached the function I'm using, this uses rs2_deproject_pixel_to_point to return XYZ position from camera frame, upoint[0],[1] & [2] sometimes contain 0 and -0 values, this is my issue, why does this happen ? note that for the same pixel sometimes 0 and -0 values are returned and sometimes actual correct distance is returned

 

0 Kudos
MartyG
Honored Contributor III
1,937 Views

If a pixel has a depth of '0' then it usually means either that there is no detail in that area for the camera to see, or that the camera cannot currently perceive the detail in that area.

 

The official SDK documentation for projection describes it like this: "If a device fails to determine the depth of a given image pixel, a value of zero will be stored in the depth image. This is a reasonable sentinel for "no depth" because all pixels with a depth of zero would correspond to the same physical location, the location of the imager itself".

 

https://github.com/IntelRealSense/librealsense/wiki/Projection-in-RealSense-SDK-2.0

 

If the same area is sometimes '0' and other times correct, it suggests that there is a problem with the camera reading the detail in that area of the image under certain circumstances. For example, if a light source is shining on a reflective surface on the observed object then it may temporarily make that area of the object harder for the camera to read.

 

 

YAboE
Beginner
1,937 Views

Thank you this information is very helpful to me, thank you for your time.

0 Kudos
MartyG
Honored Contributor III
1,937 Views

You are totally welcome. I'm really glad I could help! :)

0 Kudos
Reply