Ask Your Question
0

opencv 3.1 installation and BaseFilter class

asked 2016-09-16 06:35:50 -0600

hovnatan gravatar image

Hi, I tried compiling and installing opencv 3.1 on my Ubuntu box. After the installation I was trying to create a custom filter using the cv::BaseFilter class. But I cannot find the necessary include file for that. Right now I'm including <opencv2/imgproc/imgproc.hpp>. I noticed that there is filterengine.hpp in the source files used for opencv compilation, but I cannot find the same file in the /usr/local/include/opencv2 installation directory. Is this the right include? If yes, how can I install after compilation? Thanks.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2016-09-16 07:40:06 -0600

berak gravatar image

the filterengine was made private to the implementation in opencv3.

unfortunately, you can no more use a custom filter class.

what did your filter do ? would it be possible to re-formulate it as a convolution (kernel) ?

edit flag offensive delete link more

Comments

Ok. So I need to apply box averaging filter that ignores some values in the image that are defined as non-existing. E.g., if the non-existing is defined as 0. then if you box average with size 5 over this array 0 1 1 1 0, then in the middle of the array you will get (1 + 1 + 1)/3 = 1 instead of (0 + 1 + 1 + 1 + 0)/5 in the regular box averaging case.

hovnatan gravatar imagehovnatan ( 2016-09-16 07:45:45 -0600 )edit

what about making it a 5x5 matrix then, and apply with filter2D()

berak gravatar imageberak ( 2016-09-16 07:55:27 -0600 )edit

I can't see how that will work. with filter2D() one needs a fixed kernel. But here fixed kernel won't work since you don't know where your "undefined" values are in the image.

hovnatan gravatar imagehovnatan ( 2016-09-16 07:59:05 -0600 )edit

may be you can use this post

LBerger gravatar imageLBerger ( 2016-09-16 11:34:38 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2016-09-16 06:35:50 -0600

Seen: 459 times

Last updated: Sep 16 '16