Skip to content

ipp_GaussianBlur path in cv::GaussianBlur does not set sigmaY=sigmaX when sigmaY=0, just returns #22716

@elpalmer

Description

@elpalmer

System Information

OpenCV version: 4.6.0
Operating System / Platform: Windows 10
Compiler & compiler version: Microsoft Visual Studio 2022 17.2.3

Detailed description

In smooth.dispatch.cpp, ippGaussianBlur checks:
if(sigma1 != sigma2) return false;
This causes the optimization to be skipped when sigma2 == 0 instead of setting sigma1=sigma2. By inspection, this optimization will also not work when both sigmas are zero, where the sigma should be calculated from ksize.

Steps to reproduce

  1. On x64 platform, build with OPENCV_IPP_GAUSSIAN_BLUR=ON.
  2. Test failure case like below. You will need to step through ipp_GaussianBlur in debugger or measure performance to observe the issue since it will fall back to the sepFilter2D path.
	void runCV_Gaussian(const cv::Mat& imSrc, cv::Mat& imDst, int ksize, double sigma)
	{
		cv::GaussianBlur(imSrc, imDst, cv::Size(ksize, ksize), sigma);
	};
  1. Observe workaround behavior like this:
	void runCV_Gaussian(const cv::Mat& imSrc, cv::Mat& imDst, int ksize, double sigma)
	{
		cv::GaussianBlur(imSrc, imDst, cv::Size(ksize, ksize), sigma, sigma); // IPP path requires sigmaY == sigmaX, others set Y to X if Y==0
	};

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

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions