简体   繁体   中英

OpenCV Error: Assertion failed (ksize.width > … for GaussianBlur

when I call Imgproc.GaussianBlur(dst, dst ,new Size(3,3),1); in my application it works perfectly fine. As soon as I increase the kernel size to new Size(4,4) or else I get an

 OpenCV Error: Assertion failed (ksize.width > 0 && ksize.width % 2 == 1 && ksize.height > 0 && ksize.height % 2 == 1) in cv::createGaussianFilter, file 

........\\opencv\\modules\\imgproc\\src\\smooth.cpp, line 816 Caused by: CvException [org.opencv.core.CvException: cv::Exception: ........\\opencv\\modules\\imgproc\\src\\smooth.cpp:816: error: (-215) ksize.width > 0 && ksize.width % 2 == 1 && ksize.height

0 && ksize.height % 2 == 1 in function cv::createGaussianFilter ] at org.opencv.imgproc.Imgproc.GaussianBlur_1(Native Method) at org.opencv.imgproc.Imgproc.GaussianBlur(Imgproc.java:533)

Can please someone put me on the right track for this? I have no idea where/what to look for this.

Thx.

我从跟踪中了解到,只允许使用new Size(x,y) ,其中xy是奇数

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM