dougsm / ggcnn

Generative Grasping CNN from "Closing the Loop for Robotic Grasping: A Real-time, Generative Grasp Synthesis Approach" (RSS 2018)
BSD 3-Clause "New" or "Revised" License
484 stars 138 forks source link

Error while converting pcd to depth image #19

Closed pranav2481 closed 4 years ago

pranav2481 commented 4 years ago

Hi, I am getting this error while converting pcd to depth image using generate_cornell_depth.py.

OpenCV Error: Unsupported format or combination of formats (Only 8-bit 1-channel and 3-channel input/output images are supported) in cvInpaint, file /build/opencv-L2vuMj/opencv-3.2.0+dfsg/modules/photo/src/inpaint.cpp, line 751
Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/pranav/GRASPING/ggcnn/utils/dataset_processing/generate_cornell_depth.py", line 19, in <module>
    di.inpaint()
  File "/home/pranav/GRASPING/ggcnn/utils/dataset_processing/image.py", line 185, in inpaint
    self.img = cv2.inpaint(self.img, mask, 1, cv2.INPAINT_NS)
cv2.error: /build/opencv-L2vuMj/opencv-3.2.0+dfsg/modules/photo/src/inpaint.cpp:751: error: (-210) Only 8-bit 1-channel and 3-channel input/output images are supported in function cvInpaint

Please help.

dougsm commented 4 years ago

Hi, Inpainting of float-valued arrays is only supported in opencv version >=3.3.0. Looks like you have version 3.2. Try upgrading to a newer opencv version.

pranav2481 commented 4 years ago

It works in opencv version 4.1.2. Thank you for the help.