'**SUMMARY**
Return true if the feature contains  the object, where object can be a bounding box,
bounding circle, a list of tuples in a closed polygon, or any other featutres.
**PARAMETERS**
* *object*
* A bounding box - of the form (x,y,w,h) where x,y is the upper left corner
* A bounding circle of the form (x,y,r)
* A list of x,y tuples defining a closed polygon e.g. ((x,y),(x,y),....)
* Any two dimensional feature (e.g. blobs, circle ...)
**RETURNS**
Returns a Boolean, True if the feature contains the object, False otherwise.
**EXAMPLE**
>>> img = Image("Lenna")
>>> blobs = img.findBlobs()
>>> b = blobs[0]
>>> if( blobs[-1].contains(b) ):
>>>    print "this blob is contained in the biggest blob"
**NOTE**
This currently performs a bounding box test, not a full polygon test for speed.'

def contains(self, other):

    retVal = False
    bounds = self.points
    if isinstance(other, Feature):
        retVal = True
        for p in other.points:
            p2 = (int(p[0]), int(p[1]))
            retVal = self._pointInsidePolygon(p2, bounds)
            if (not retVal):
                break
    elif ((isinstance(other, tuple) and (len(other) == 2)) or (isinstance(other, np.ndarray) and (other.shape[0] == 2))):
        retVal = self._pointInsidePolygon(other, bounds)
    elif (isinstance(other, tuple) and (len(other) == 3)):
        retVal = True
        rr = (other[2] * other[2])
        x = other[0]
        y = other[1]
        for p in bounds:
            test = (((x - p[0]) * (x - p[0])) + ((y - p[1]) * (y - p[1])))
            if (test < rr):
                retVal = False
                break
    elif (isinstance(other, tuple) and (len(other) == 4) and (isinstance(other[0], float) or isinstance(other[0], int))):
        retVal = ((self.maxX() <= (other[0] + other[2])) and (self.minX() >= other[0]) and (self.maxY() <= (other[1] + other[3])) and (self.minY() >= other[1]))
    elif (isinstance(other, list) and (len(other) >= 4)):
        retVal = True
        for p in other:
            test = self._pointInsidePolygon(p, bounds)
            if (not test):
                retVal = False
                break
    else:
        logger.warning('SimpleCV    did    not    recognize    the    input    type    to    features.contains.    This    method    only    takes    another    blob,    an    (x,y)    tuple,    or    a    ndarray    type.')
        return False
    return retVal
