def __init__(self, orig_image, dpi, save_image):
        """Initializes a Sheet instance.

        Args:
            orig_image: cv.Mat instance with the original sheet image.
            dpi: optional (x resolution, y resolution) tuple or None.
                If set to None, will try to guess dpi.
            save_image: A callback to save debug images with args (name, img)
        """

        self._shreds = None
        self.orig_img = orig_image

        self.save_image = save_image

        self._fg_mask = None
        self._shreds = None

        if dpi is None:
            self.res_x, self.res_y = self._guess_dpi()
        else:
            self.res_x, self.res_y = dpi
def __init__ ( self , orig_image , dpi , save_image ) : self . _shreds = None self . orig_img = orig_image self . save_image = save_image self . _fg_mask = None self . _shreds = None if dpi is None : self . res_x , self . res_y = self . _guess_dpi ( ) else : self . res_x , self . res_y = dpi
Initializes a Sheet instance.

        Args:
            orig_image: cv.Mat instance with the original sheet image.
            dpi: optional (x resolution, y resolution) tuple or None.
                If set to None, will try to guess dpi.
            save_image: A callback to save debug images with args (name, img)