Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Response of cv::filter2D

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