Skip to content

filter2D crashes when using ROI and kernel size > 11 #13179

@jpsml

Description

@jpsml
System information (version)
  • OpenCV 3.4.3
  • Operating System / Platform => Windows 64 Bit
  • Compiler => Visual Studio 2017
Detailed description

The code below is crashing for kernel sizes > 11, if kernel size is <= 11 it works.

Steps to reproduce
    #include <opencv2/opencv.hpp>
    
    int main()
    {
	cv::Mat image = cv::imread("lena.jpg");

	cv::Mat kernel = cv::getGaborKernel(cv::Size(13, 13), 8, 0, 3, 0.25);  // if changed to cv::Size(11, 11), it works

	cv::Mat roi(image, cv::Rect(0, 0, 128, 128));

	cv::Mat filtered(128, 128, roi.type());
	cv::filter2D(roi, filtered, -1, kernel);

	cv::imshow("image", image);
	cv::imshow("filtered", filtered);

	cv::waitKey();

	return 0;
    }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions