Skip to content

Calling bilateralFilter with sigmaColor=0 produces the same result as sigmaColor=1 #22886

@RunDevelopment

Description

@RunDevelopment

System Information

OpenCV python version: 4.6.0.66
Operating System: Win 10 64bit
Python version: 3.9.7

Detailed description

When calling bilateralFilter in python with a sigmaColor value of 0, the function produces the same result as if sigmaColor were 1. This is a huge problem for images stored as 0 to 1 float32 values.

Here is an example:

diameter=10, sigmaColor=0.39, sigmaSpace=100
image

diameter=10, sigmaColor=0.039, sigmaSpace=100
image

diameter=10, sigmaColor=0.0039, sigmaSpace=100
image

diameter=10, sigmaColor=0, sigmaSpace=100
image

diameter=10, sigmaColor=1, sigmaSpace=100
image

This behavior is not documented.

Steps to reproduce

Have any image that is a numpy array with float32 values between 0 and 1.

diameter=10
sigma_color=0.0
sigma_space=100
cv2.bilateralFilter(
            image,
            diameter,
            sigma_color,
            sigma_space,
            borderType=cv2.BORDER_REFLECT_101,
        )

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

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions