'This method performs a threshold operation on the input image and then
extracts and returns the blobs.
img       - The input image (color or b&w)
threshval - The threshold value for the binarize operation. If threshval = -1 adaptive thresholding is used
minsize   - The minimum blob size in pixels.
maxsize   - The maximum blob size in pixels. 0=uses the default value.
threshblocksize - The adaptive threhold block size.
threshconstant  - The minimum to subtract off the adaptive threshold'

def extract(self, img, threshval=127, minsize=10, maxsize=0, threshblocksize=3, threshconstant=5):

    if (maxsize <= 0):
        maxsize = (img.width * img.height)
    blobs = self.extractFromBinary(img.binarize(threshval, 255, threshblocksize, threshconstant).invert(), img, minsize, maxsize)
    retVal = sorted(blobs, key=(lambda x: x.mArea), reverse=True)
    return FeatureSet(retVal)
