(self, rot_or_skew_type, rot_or_skew_radians)
return self.lines_hough
Apply a found page rotation or skew to the detected lines in order to fix their rotation / skew.
        You can pass the output of find_rotation_or_skew into this method.
Apply a found page rotation or skew to the detected lines in order to fix their rotation / skew.
        You can pass the output of find_rotation_or_skew into this method.
Apply a found page rotation or skew to the detected lines in order to fix their rotation / skew . You can pass the output of find_rotation_or_skew into this method .
def apply_found_rotation_or_skew(self, rot_or_skew_type, rot_or_skew_radians):
        """
        Apply a found page rotation or skew to the detected lines in order to fix their rotation / skew.
        You can pass the output of find_rotation_or_skew into this method.
        """
        if rot_or_skew_type is None or rot_or_skew_radians is None:
            return self.lines_hough
        
        if rot_or_skew_type == ROTATION:
            filter_line_dir = None
        else:  # skew
            filter_line_dir = DIRECTION_HORIZONTAL if rot_or_skew_type == SKEW_Y else DIRECTION_VERTICAL
        
        lines_hough_deskewed = []
        for rho, theta, theta_norm, line_dir in self.lines_hough:
            if filter_line_dir is None or (filter_line_dir is not None and line_dir == filter_line_dir):
                theta += rot_or_skew_radians
                theta_norm = normalize_angle(theta)
            
            lines_hough_deskewed.append((rho, theta, theta_norm, line_dir))
        
        self.lines_hough = lines_hough_deskewed
        
        return self.lines_hough
def apply_found_rotation_or_skew ( self , rot_or_skew_type , rot_or_skew_radians ) : if rot_or_skew_type is None or rot_or_skew_radians is None : return self . lines_hough if rot_or_skew_type == ROTATION : filter_line_dir = None else : # skew filter_line_dir = DIRECTION_HORIZONTAL if rot_or_skew_type == SKEW_Y else DIRECTION_VERTICAL lines_hough_deskewed = [ ] for rho , theta , theta_norm , line_dir in self . lines_hough : if filter_line_dir is None or ( filter_line_dir is not None and line_dir == filter_line_dir ) : theta += rot_or_skew_radians theta_norm = normalize_angle ( theta ) lines_hough_deskewed . append ( ( rho , theta , theta_norm , line_dir ) ) self . lines_hough = lines_hough_deskewed return self . lines_hough