Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Filter2d is definitely the wrong function.

Simply create an image the size of your spectrum of the same data type (CV_32F) and use the circle function to draw a binary circle.

Mat mask = Mat(rows, cols, CV_32F);
mask.setTo(0);
circle(mask, Point(rows/2, cols/2), 50, 1.0, -1);  //50 is the radius, 1.0 is the color, -1 means filled.

Then multiply your amplitude by the mask. Remember to undo the fft quadrant shift before doing the inverse DFT.