Skip to content

Incorrect types 16S for ximgproc::DisparityFilter in documentation #4003

@Rektino

Description

@Rektino

Describe the doc issue

OpenCV version : 4.5.4
OS : Ubuntu 22.04

I was following this example https://docs.opencv.org/4.x/d3/d14/tutorial_ximgproc_disparity_filtering.html
to implement a WLS filter on a disparity map.

The doxygen comments on the function virtual void cv::ximgproc::DisparityFilter::filter() mention that the left disparity and left view images should be of type CV_16S. It also mentions that right disparity map is optional. I ran into runtime assertion fail when trying that, which was :

[bash-5] terminate called after throwing an instance of 'cv::Exception'
[bash-5] what(): OpenCV(4.5.4) ./contrib/modules/ximgproc/src/disparity_filters.cpp:301: error: (-215:Assertion failed) !disparity_map_right.empty() && (disparity_map_right.depth() == CV_32F) && (disparity_map_right.channels() == 1) in function 'filter
'_

Fix suggestion

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions