filter2d BORDER_WRAP on certain texturefilter

asked 2017-05-05 04:09:58 -0500

mlanus gravatar image

I am running filter2d on an image with a filter that I was given. I have several filters, ranging from 3_3_5bit to 17_17_12bit. For some reason, whenever I run my software on a filter that has dimensions smaller than 9, I will received this error:

libc++abi.dylib: terminating with uncaught exception of type cv::Exception: /tmp/B3p0_301755_83026/build-maci64.maci64.301755.r000/B3p0/maci64/OpenCV/modules/imgproc/src/filter.cpp:166: error: (-215) columnBorderType != BORDER_WRAP in function init

Abort trap: 6

My program works for all other filters, except for any smaller than 9. However, these filters will work on any different bordertype, other than WRAP, but to have my software do its job, it needs BORDER_WRAP. Any help would be greatly greatly appreciated! If code would be helpful to see, I can show some

edit retag flag offensive close merge delete


opencv version ? can you show, how you invoke it ?

berak gravatar imageberak ( 2017-05-05 06:25:31 -0500 )edit

OpenCV 2

I am invoking it as such: cv::filter2D(image, ci, CV_64FC1, tmpcv, cv::Point(-1, -1 ), 0, BORDER_WRAP);

Once again, it works on certain filters, but ones that have dimensions smaller than 9 receive this error

mlanus gravatar imagemlanus ( 2017-05-05 08:05:35 -0500 )edit

there's some code like:

if kernel.width*kernel.height < 50 : 
     use the filterengine (trouble), 
     use the dft based implementation.(no trouble)

9x9=81, 7x7=49.

unfortunately - no idea here, why the BORDER_WRAP limitation (and only for the columnBorderType) exists.

berak gravatar imageberak ( 2017-05-06 08:05:06 -0500 )edit

hmmmmm - how odd... Well thank you! no way to get around this I presume?

mlanus gravatar imagemlanus ( 2017-05-06 11:59:16 -0500 )edit