'**DESCRIPTION**
Sobel operator for edge detection
**PARAMETERS**
* *xorder* - int - Order of the derivative x.
* *yorder* - int - Order of the derivative y.
* *doGray* - Bool - grayscale or not.
* *aperture* - int - Size of the extended Sobel kernel. It must be 1, 3, 5, or 7.
**RETURNS**
Image with sobel opeartor applied on it
**EXAMPLE**
>>> img = Image("lenna")
>>> s = img.sobel()
>>> s.show()'

def sobel(self, xorder=1, yorder=1, doGray=True, aperture=5, aperature=None):

    aperture = (aperature if aperature else aperture)
    retVal = None
    try:
        import cv2
    except:
        logger.warning("Can't    do    Sobel    without    OpenCV    >=    2.3.0")
        return None
    if ((aperture != 1) and (aperture != 3) and (aperture != 5) and (aperture != 7)):
        logger.warning('Bad    Sobel    Aperture,    values    are    [1,3,5,7].')
        return None
    if doGray:
        dst = cv2.Sobel(self.getGrayNumpy(), cv2.cv.CV_32F, xorder, yorder, ksize=aperture)
        minv = np.min(dst)
        maxv = np.max(dst)
        cscale = (255 / (maxv - minv))
        shift = ((-1) * minv)
        t = np.zeros(self.size(), dtype='uint8')
        t = cv2.convertScaleAbs(dst, t, cscale, (shift / 255.0))
        retVal = Image(t)
    else:
        layers = self.splitChannels(grayscale=False)
        sobel_layers = []
        for layer in layers:
            dst = cv2.Sobel(layer.getGrayNumpy(), cv2.cv.CV_32F, xorder, yorder, ksize=aperture)
            minv = np.min(dst)
            maxv = np.max(dst)
            cscale = (255 / (maxv - minv))
            shift = ((-1) * minv)
            t = np.zeros(self.size(), dtype='uint8')
            t = cv2.convertScaleAbs(dst, t, cscale, (shift / 255.0))
            sobel_layers.append(Image(t))
        (b, g, r) = sobel_layers
        retVal = self.mergeChannels(b, g, r)
    return retVal
