-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Intel RealSense Depth_image problem #1098
Comments
@Ahrovan the depth images should be saved at 16bit png files. Are there any .png files in the images folder? |
@Ezward |
@Ahrovan This must have gotten broken when the tub format was updated. |
It is in version 4.1, but that saves the old tub format. I'll port the code snippet to latest at lunch and you can try on a branch.
That snipped needs to be added to tub_v2.py at around line 65, after the donkeycar/donkeycar/parts/tub_v2.py Line 65 in c4d9091
|
@Ahrovan I went ahead and made that change. it is is this branch 1098-fix-saving-D435-depth-image. From inside your donkeycar repo folder you can checkout the branch it that should fix the problem |
@Ezward thank you. I will check and send result here |
@Ahrovan any results yet? |
@Ezward
for cv ColorMap (realsense435i.py)
cv2.COLORMAP_JET can use as parameter in myConfig.py. and for modify image size (manage.py)
|
The issue with |
cv2.convertScaleAbs() function returns uint8. In this case, np.uint16 gives an error. should be changed to uint8. The main problem is the need to use COLORMAP_JET or more precisely colormap. Yes, uint16 has better quality. But the problem is that the depth output does not have a suitable range, it must be corrected. Duplicate values can be seen on depth. |
@Ahrovan "Duplicate values can be seen on depth" What do you mean? There will certainly be some pixels that have the same depth as others; that would be normal. To be clear, the depth image is NOT a visualization. It is data. It is the depth of each pixel in the RGB image as a 12bit value. |
You can see that the test program does create a visualization; donkeycar/donkeycar/parts/realsense435i.py Line 290 in c4d9091
|
There is an issue though; I don't save off the depth scale; without the depth scale it can't be converted back into meters. The driver does print out the depth scale when it runs, but it is not saved anywhere. A better format would just save out a 2d array of floats which represent the depth in meters for each pixel in the RGB image. This librealsense github issue has code to show how to convert the depth data to meters. That would be easy to do. So if we want we can save both a depth visualization image and the data array as depth im meters.
The issue also indicates, "on all 400 Series camera models except D405 the default depth unit scale is 0.001. So if the pixel depth value was 6000 then 6000 x 0.01 would give a real-world distance of 6 meters." So we could use that value reliably. However it is probably better to just save the array a floats. |
For now I'm going to save the data as-is, as a 16bit grayscale png. The data can be easilly loaded by opencv or other that will load a png and the resulting image can be queried by pixel to get the distance in centimeters of that pixel. See PR #1106 |
@Ahrovan can you confirm that the greyscale data is being saved using the branch? https://github.com/autorope/donkeycar/tree/1098-fix-saving-D435-depth-image |
closed as unresponsive. |
Hello
Only color_images are saved. Depth_image are not saved. Please suggest a simple solution. Thank you
Related My CAR CONFIG (D435i+donkey v4.4.dev4)
I see Depth_image clear in Code like this, but not saved
The text was updated successfully, but these errors were encountered: