'**SUMMARY**
Find Skintone mask will look for continuous
regions of Skintone in a color image and return a binary mask where the white pixels denote Skintone region.
**PARAMETERS**
* *dilate_iter* - the number of times to run the dilation operation.
**RETURNS**
Returns a binary mask.
**EXAMPLE**
>>> img = Image("lenna")
>>> mask = img.findSkintoneMask()
>>> mask.show()'

def getSkintoneMask(self, dilate_iter=0):

    if (self._colorSpace != ColorSpace.YCrCb):
        YCrCb = self.toYCrCb()
    else:
        YCrCb = self
    Y = (np.ones((256, 1), dtype=uint8) * 0)
    Y[5:] = 255
    Cr = (np.ones((256, 1), dtype=uint8) * 0)
    Cr[140:180] = 255
    Cb = (np.ones((256, 1), dtype=uint8) * 0)
    Cb[77:135] = 255
    Y_img = YCrCb.getEmpty(1)
    Cr_img = YCrCb.getEmpty(1)
    Cb_img = YCrCb.getEmpty(1)
    cv.Split(YCrCb.getBitmap(), Y_img, Cr_img, Cb_img, None)
    cv.LUT(Y_img, Y_img, cv.fromarray(Y))
    cv.LUT(Cr_img, Cr_img, cv.fromarray(Cr))
    cv.LUT(Cb_img, Cb_img, cv.fromarray(Cb))
    temp = self.getEmpty()
    cv.Merge(Y_img, Cr_img, Cb_img, None, temp)
    mask = Image(temp, colorSpace=ColorSpace.YCrCb)
    mask = mask.binarize((128, 128, 128))
    mask = mask.toRGB().binarize()
    mask.dilate(dilate_iter)
    return mask
