'Returns the corners for the smallest rotated rectangle to enclose the blob.
The points are returned as a list of  (x,y) tupples.'

def minRect(self):

    ang = self.mMinRectangle[2]
    ang = ((2 * pi) * (float(ang) / 360.0))
    tx = self.minRectX()
    ty = self.minRectY()
    w = (self.minRectWidth() / 2.0)
    h = (self.minRectHeight() / 2.0)
    derp = np.matrix([[cos(ang), ((-1) * sin(ang)), tx], [sin(ang), cos(ang), ty], [0, 0, 1]])
    tl = np.matrix([((-1.0) * w), h, 1.0])
    tr = np.matrix([w, h, 1.0])
    bl = np.matrix([((-1.0) * w), ((-1.0) * h), 1.0])
    br = np.matrix([w, ((-1.0) * h), 1.0])
    tlp = (derp * tl.transpose())
    trp = (derp * tr.transpose())
    blp = (derp * bl.transpose())
    brp = (derp * br.transpose())
    return ((float(tlp[(0, 0)]), float(tlp[(1, 0)])), (float(trp[(0, 0)]), float(trp[(1, 0)])), (float(blp[(0, 0)]), float(blp[(1, 0)])), (float(brp[(0, 0)]), float(brp[(1, 0)])))
