'**SUMMARY**
Convolution performs a shape change on an image.  It is similiar to
something like a dilate.  You pass it a kernel in the form of a list, np.array, or cvMat
**PARAMETERS**
* *kernel* - The convolution kernel. As a cvArray, cvMat, or Numpy Array.
* *center* - If true we use the center of the kernel.
**RETURNS**
The image after we apply the convolution.
**EXAMPLE**
>>> img = Image("sampleimages/simplecv.png")
>>> kernel = [[1,0,0],[0,1,0],[0,0,1]]
>>> conv = img.convolve()
**SEE ALSO**
http://en.wikipedia.org/wiki/Convolution'

def convolve(self, kernel=[[1, 0, 0], [0, 1, 0], [0, 0, 1]], center=None):

    if isinstance(kernel, list):
        kernel = np.array(kernel)
    if (type(kernel) == np.ndarray):
        sz = kernel.shape
        kernel = kernel.astype(np.float32)
        myKernel = cv.CreateMat(sz[0], sz[1], cv.CV_32FC1)
        cv.SetData(myKernel, kernel.tostring(), (kernel.dtype.itemsize * kernel.shape[1]))
    elif (type(kernel) == cv.mat):
        myKernel = kernel
    else:
        logger.warning('Convolution    uses    numpy    arrays    or    cv.mat    type.')
        return None
    retVal = self.getEmpty(3)
    if (center is None):
        cv.Filter2D(self.getBitmap(), retVal, myKernel)
    else:
        cv.Filter2D(self.getBitmap(), retVal, myKernel, center)
    return Image(retVal)
