(API) Cam2D_Snapshot depth image returns incorrect depth values- Printable Version +- RoboDK Forum (//www.sinclairbody.com/forum) +-- Forum: RoboDK (EN) (//www.sinclairbody.com/forum/Forum-RoboDK-EN) +--- Forum: RoboDK bugs (//www.sinclairbody.com/forum/Forum-RoboDK-bugs) +--- Thread: (API) Cam2D_Snapshot depth image returns incorrect depth values (/Thread-API-Cam2D-Snapshot-depth-image-returns-incorrect-depth-values)
Pages:
1
2
|
(API) Cam2D_Snapshot depth image returns incorrect depth values-hn-cso-05-18-2022 To reproduce:Place a camera in a scene and point it at a 30x50x10 mm block (attached). Take a depth image of it with:
Code:
from robodk import robolink
Expected result:the resulting pointcloud is a rectangular block and has dimensions 30x50x10. Actual result:the resulting pointcloud does not have dimensions 30x50x10 and has angles that are not 90 degrees. Fixing z-distortion:if I insert the following line just after normalizing img to be between 0 and 1:
Code:
img = img / (2 - img)
RE: (API) Cam2D_Snapshot depth image returns incorrect depth values-Albert-05-26-2022 Thank you for your detailed feedback. After some internal discussions and testing we were able to fix the depth map with the latest version of RoboDK. You can download the latest version of RoboDK (version 5.4.3, only Windows binaries have been updated for now): //www.sinclairbody.com/download It should now be very accurate when you use this formula (32 bit floating-point numerical accuracy): img = img * FAR_LENGTH - NEAR_LENGTH Note this is the distance from the sensor plane (the location of the reference frame your camera is attached to). Let us know if this is confusing or not what you were looking for. RE: (API) Cam2D_Snapshot depth image returns incorrect depth values-hn-cso-05-30-2022 Thanks. I don't see anything like "NEAR_LENGTH" in the docs; do you mean focal length? And it looks like the range of possible values after your suggested translation will be [-NEAR_LENGTH, FAR_LENGTH - NEAR_LENGTH), is that correct? RE: (API) Cam2D_Snapshot depth image returns incorrect depth values-Albert-05-31-2022 By NEAR_LENGTH I meant the focal distance. The FAR_LENGTH is the focal length plus the working distance. For example, if you set the focal length to 10 mm and the Working distance is 2000 mm:
Let us know if something doesn't make sense. RE: (API) Cam2D_Snapshot depth image returns incorrect depth values-Sam-06-20-2022 For those interested, this example shows how to retrieve the depth map by socket, create a mesh from the point cloud and import it back into RoboDK:https://github.com/RoboDK/RoboDK-API/blob/master/Python/Examples/Macros/Open3D_Depth_Camera.py Thank you hn-cso for your contribution. RE: (API) Cam2D_Snapshot depth image returns incorrect depth values-hn-cso-06-20-2022 Thanks. I have access only to macOS and linux so I haven't had a chance to try out the changes. The version I'm on is 5.4.1.21935 — can I expect the new version (returned by RDK.Version()) to have the form 5.4.3.xxxxx, or will it be date-based? (Your example script refers to a version "5.4.3-2022-06-20".) I want to conditionally rescale depending on the version since I might not be able to update everywhere all at once. RE: (API) Cam2D_Snapshot depth image returns incorrect depth values-Sam-06-21-2022 We will publish a new version for Linux and macOS this week. RDK.Version() will return 5.4.3.22248 or higher. RE: (API) Cam2D_Snapshot depth image returns incorrect depth values-hn-cso-07-16-2022 Any updates on the macOS download? I'm seeing a "last modified" of February 21 for the .dmg download. % http HEAD//www.sinclairbody.com/downloads/Install-RoboDK.dmg HTTP/1.1 200 OK Accept-Ranges: bytes Cache-Control: max-age=86400 Connection: Upgrade, Keep-Alive Content-Encoding: br Content-Type: application/x-apple-diskimage Date: Sat, 16 Jul 2022 04:23:43 GMT ETag: "2ee006c-a309f39-5d88e697205a7-br" Expires: Sun, 17 Jul 2022 04:23:43 GMT 点火电极:超时= 5 Last-Modified: Mon, 21 Feb 2022 22:04:09 GMT Server: Apache Upgrade: h2,h2c Vary: Accept-Encoding RE: (API) Cam2D_Snapshot depth image returns incorrect depth values-Albert-07-17-2022 I'm sorry for the delays, it takes a bit longer for us to produce an update for MacOS. This can still take a few days. I'll keep you posted. The Linux version should have been updated recently. Let us know if you still have blocking issues on Linux. RE: (API) Cam2D_Snapshot depth image returns incorrect depth values-Albert-08-15-2022 We just updated RoboDK for MacOS. You can take the download here: //www.sinclairbody.com/download The latest MacOS version supports loading STEP and IGES files. |