Skip to content

How to use DepthCleaner class with Python #3273

@andreaceruti

Description

@andreaceruti
System information (version)
  • OpenCV => 4.5.5 contrib
  • Operating System / Platform => Ubuntu 18.04
Detailed description

I would like to use the class in order to clean my deoth image that has some black pixels, the problem is that since documentation is lacking I am unable to use it properly.

Steps to reproduce
import cv2
import numpy as np
image = cv2.imread("depth_image_path")
depthCleaner = cv2.rgbd.DepthCleaner_create(cv2.CV_16U, 7, cv2.rgbd.DepthCleaner_DEPTH_CLEANER_NIL )
output_image = np.copy(image)
depthCleaner.apply(image, output_image)

The problem is then that my output image looks exactly as the input image, so how would I use DepthCleaner class?

If from the snippet above I run

print(dir(depthCleaner))

I see all of its method but I can't understand their connection with the official .cpp implementation since I am not confident in using cpp.
The avaliable methods are
[ 'apply', 'clear', 'create', 'empty', 'getDefaultName', 'getDepth', 'getMethod', 'getWindowSize', 'initialize', 'read', 'save', 'setDepth', 'setMethod', 'setWindowSize', 'write']

Issue submission checklist
  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues,
    forum.opencv.org, Stack Overflow, etc and have not found any solution
  • I updated to the latest OpenCV version and the issue is still there
  • There is reproducer code and related data files: videos, images, onnx, etc

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions