'**SUMMARY**
Apply the DFT filter to given image.
**PARAMETERS**
* *image*     - SimpleCV.Image image
* *grayscale* - if this value is True we perfrom the operation on the
DFT of the gray version of the image and the result is
gray image. If grayscale is true we perform the
operation on each channel and the recombine them to
create the result.
**RETURNS**
Filtered Image.
**EXAMPLE**
>>> notch = DFT.createNotchFilter(dia1=200, cen=(200, 200),
size=(512, 512), type="highpass")
>>> img = Image(\'lenna\')
>>> notch.applyFilter(img).show()'

def applyFilter(self, image, grayscale=False):

    if ((self.width == 0) or (self.height == 0)):
        warnings.warn('Empty    Filter.    Returning    the    image.')
        return image
    (w, h) = image.size()
    if grayscale:
        image = image.toGray()
    fltImg = self._image
    if (fltImg.size() != image.size()):
        fltImg = fltImg.resize(w, h)
    filteredImage = image.applyDFTFilter(fltImg)
    return filteredImage
