add_noise script does not work for my synthetic depth images
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:
(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
@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]