'**SUMMARY**
This private method peforms the discrete Fourier transform on an input image.
The transform can be applied to a single channel gray image or to each channel of the
image. Each channel generates a 64F 2 channel IPL image corresponding to the real
and imaginary components of the DFT. A list of these IPL images are then cached
in the private member variable _DFT.
**PARAMETERS**
* *grayscale* - If grayscale is True we first covert the image to grayscale, otherwise
we perform the operation on each channel.
**RETURNS**
nothing - but creates a locally cached list of IPL imgaes corresponding to the real
and imaginary components of each channel.
**EXAMPLE**
>>> img = Image(\'logo.png\')
>>> img._doDFT()
>>> img._DFT[0] # get the b channel Re/Im components
**NOTES**
http://en.wikipedia.org/wiki/Discrete_Fourier_transform
http://math.stackexchange.com/questions/1002/fourier-transform-for-dummies
**TO DO**
This method really needs to convert the image to an optimal DFT size.
http://opencv.itseez.com/modules/core/doc/operations_on_arrays.html#getoptimaldftsize'

def _doDFT(self, grayscale=False):

    if (grayscale and ((len(self._DFT) == 0) or (len(self._DFT) == 3))):
        self._DFT = []
        img = self._getGrayscaleBitmap()
        (width, height) = cv.GetSize(img)
        src = cv.CreateImage((width, height), cv.IPL_DEPTH_64F, 2)
        dst = cv.CreateImage((width, height), cv.IPL_DEPTH_64F, 2)
        data = cv.CreateImage((width, height), cv.IPL_DEPTH_64F, 1)
        blank = cv.CreateImage((width, height), cv.IPL_DEPTH_64F, 1)
        cv.ConvertScale(img, data, 1.0)
        cv.Zero(blank)
        cv.Merge(data, blank, None, None, src)
        cv.Merge(data, blank, None, None, dst)
        cv.DFT(src, dst, cv.CV_DXT_FORWARD)
        self._DFT.append(dst)
    elif ((not grayscale) and (len(self._DFT) < 2)):
        self._DFT = []
        r = self.getEmpty(1)
        g = self.getEmpty(1)
        b = self.getEmpty(1)
        cv.Split(self.getBitmap(), b, g, r, None)
        chans = [b, g, r]
        width = self.width
        height = self.height
        data = cv.CreateImage((width, height), cv.IPL_DEPTH_64F, 1)
        blank = cv.CreateImage((width, height), cv.IPL_DEPTH_64F, 1)
        src = cv.CreateImage((width, height), cv.IPL_DEPTH_64F, 2)
        for c in chans:
            dst = cv.CreateImage((width, height), cv.IPL_DEPTH_64F, 2)
            cv.ConvertScale(c, data, 1.0)
            cv.Zero(blank)
            cv.Merge(data, blank, None, None, src)
            cv.Merge(data, blank, None, None, dst)
            cv.DFT(src, dst, cv.CV_DXT_FORWARD)
            self._DFT.append(dst)
