Response of cv::filter2D

asked 2013-06-14 05:37:23 -0600

Hansg91 gravatar image

Hello everyone,

I am trying to convolve a linear SVM weighting filter over a patch. The filter (or kernel) is 16x16, the window I am trying to get a response over is 5x5, so as a response I was expecting a 5x5 matrix. I expected that I would need to get a (5+16)x(5+16) sample from the image and convolve over this sample to get my response, but this gives me a 21x21 response (once again, I was expecting 5x5).

I was looking into the different border types for filter2D but I am not sure this is exactly what I need. I noticed that for cv::copyMakeBorder it says that if the patch is a ROI of a bigger image, it will sample from that image. Does the same hold for filter2D? Should I just give it a 5x5 ROI and will it sample the other pixels from the image? What if my 5x5 ROI is right at the edge of that image and there is nothing more to sample?

Best regards, Hans

edit retag flag offensive close merge delete