Skip to content

add_noise script does not work for my synthetic depth images #3

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

Open
Me817 opened this issue Nov 14, 2021 · 1 comment
Open

add_noise script does not work for my synthetic depth images #3

Me817 opened this issue Nov 14, 2021 · 1 comment

Comments

@Me817
Copy link

Me817 commented Nov 14, 2021

Hey,

thank you for the great code to add noise to depth images. I tried the add_noise.py script with some depth images I generated with Unity but I always run into the following error:

python add_noise.py
Traceback (most recent call last):
  File "add_noise.py", line 130, in <module>
    h, w = depth_uint16.shape
ValueError: too many values to unpack (expected 2)
libpng warning: iCCP: known incorrect sRGB profile

Here you can see my depth image:
test1_depth
(Resolution: 640x576, NFOV Unbinned von Azure Kinect)

Is there a specific format for the depth images? Could you help to solve this problem?

Thank you in advance.
Best,
Me817

@fishbotics
Copy link

fishbotics commented Aug 23, 2022

@Me817 : if you're still interested in this (I know it's been a year), the issue is that your depth image is stored with three channels (similar to a regular image). But, it looks like all three channels have the same value. You can recover the depth image in the format required by the code by using this line to load the image (remember to change the file path)

depth_uint16 = cv2.imread(FILE_PATH, cv2.IMREAD_UNCHANGED)[:, :, 0]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants