(self, contours, com, cube=(250, 250, 250), tol=0.)
return cube
Estimate hand size from contours
        :param contours: contours of hand
        :param com: center of mass
        :param cube: default cube
        :param tol: tolerance to be added to all sides
        :return: metric cube for cropping (x, y, z)
Estimate hand size from contours
        :param contours: contours of hand
        :param com: center of mass
        :param cube: default cube
        :param tol: tolerance to be added to all sides
        :return: metric cube for cropping (x, y, z)
Estimate hand size from contours : param contours : contours of hand : param com : center of mass : param cube : default cube : param tol : tolerance to be added to all sides : return : metric cube for cropping ( x y z )
def estimateHandsize(self, contours, com, cube=(250, 250, 250), tol=0.):
        """
        Estimate hand size from contours
        :param contours: contours of hand
        :param com: center of mass
        :param cube: default cube
        :param tol: tolerance to be added to all sides
        :return: metric cube for cropping (x, y, z)
        """
        x, y, w, h = cv2.boundingRect(contours)

        # drawing = numpy.zeros((480, 640), dtype=float)
        # cv2.drawContours(drawing, [contours], 0, (255, 0, 244), 1, 8)
        # cv2.rectangle(drawing, (x, y), (x+w, y+h), (244, 0, 233), 2, 8, 0)
        # cv2.imshow("contour", drawing)

        # convert to cube
        xstart = (com[0] - w / 2.) * com[2] / self.fx
        xend = (com[0] + w / 2.) * com[2] / self.fx
        ystart = (com[1] - h / 2.) * com[2] / self.fy
        yend = (com[1] + h / 2.) * com[2] / self.fy
        szx = xend - xstart
        szy = yend - ystart
        sz = (szx + szy) / 2.
        cube = (sz + tol, sz + tol, sz + tol)

        return cube
def estimateHandsize ( self , contours , com , cube = ( 250 , 250 , 250 ) , tol = 0. ) : x , y , w , h = cv2 . boundingRect ( contours ) # drawing = numpy.zeros((480, 640), dtype=float) # cv2.drawContours(drawing, [contours], 0, (255, 0, 244), 1, 8) # cv2.rectangle(drawing, (x, y), (x+w, y+h), (244, 0, 233), 2, 8, 0) # cv2.imshow("contour", drawing) # convert to cube xstart = ( com [ 0 ] - w / 2. ) * com [ 2 ] / self . fx xend = ( com [ 0 ] + w / 2. ) * com [ 2 ] / self . fx ystart = ( com [ 1 ] - h / 2. ) * com [ 2 ] / self . fy yend = ( com [ 1 ] + h / 2. ) * com [ 2 ] / self . fy szx = xend - xstart szy = yend - ystart sz = ( szx + szy ) / 2. cube = ( sz + tol , sz + tol , sz + tol ) return cube