'**SUMMARY**
Smoothes an image using the normalized box filter.
The optional parameter is window.
see : http://en.wikipedia.org/wiki/Blur
**Parameters**
* *window* - should be in the form a tuple (win_x,win_y).
- By default it is set to 3x3, i.e window = (3x3).
**NOTE**
For OpenCV versions <= 2.3.0
-- this acts as Convience function derived from the :py:meth:`smooth` method. Which internally calls cv.Smooth
For OpenCV versions higher than 2.3.0. i.e >= 2.3.0
-- cv.blur function is called'

def blur(self, window='', grayscale=False):

    try:
        import cv2
        new_version = True
    except:
        new_version = False
        pass
    if is_tuple(window):
        (win_x, win_y) = window
        if ((win_x <= 0) or (win_y <= 0)):
            logger.warning('win_x    and    win_y    should    be    greater    than    0.')
            return None
    elif is_number(window):
        window = (window, window)
    else:
        window = (3, 3)
    if (not new_version):
        grayscale_ = grayscale
        return self.smooth(algorithm_name='blur', aperture=window, grayscale=grayscale_)
    elif grayscale:
        img_blur = cv2.blur(self.getGrayNumpy(), window)
        return Image(img_blur, colorSpace=ColorSpace.GRAY)
    else:
        img_blur = cv2.blur(self.getNumpy()[:, :, ::(-1)].transpose([1, 0, 2]), window)
        img_blur = img_blur[:, :, ::(-1)].transpose([1, 0, 2])
        return Image(img_blur, colorSpace=self._colorSpace)
