(self, direction, clusters_w_vals, orig_img_as_background=True)
return baseimg
Draw detected clusters of lines in direction <direction> using <clusters_w_vals>.
Draw detected clusters of lines in direction <direction> using <clusters_w_vals>.
Draw detected clusters of lines in direction <direction > using <clusters_w_vals > .
def draw_line_clusters(self, direction, clusters_w_vals, orig_img_as_background=True):
        """
        Draw detected clusters of lines in direction <direction> using <clusters_w_vals>.
        """
        if direction not in (DIRECTION_HORIZONTAL, DIRECTION_VERTICAL):
            raise ValueError("invalid value for 'direction': '%s'" % direction)
        
        baseimg = self._baseimg_for_drawing(orig_img_as_background)
        
        n_colors = len(clusters_w_vals)
        color_incr = max(1, round(255 / n_colors))
        
        for i, (_, vals) in enumerate(clusters_w_vals):
            i += 2
            
            line_color = (
                (color_incr * i) % 256,
                (color_incr * i * i) % 256,
                (color_incr * i * i * i) % 256,
            )
            
            self.draw_lines_in_dir(baseimg, direction, vals, line_color)
        
        return baseimg
def draw_line_clusters ( self , direction , clusters_w_vals , orig_img_as_background = True ) : if direction not in ( DIRECTION_HORIZONTAL , DIRECTION_VERTICAL ) : raise ValueError ( "invalid value for 'direction': '%s'" % direction ) baseimg = self . _baseimg_for_drawing ( orig_img_as_background ) n_colors = len ( clusters_w_vals ) color_incr = max ( 1 , round ( 255 / n_colors ) ) for i , ( _ , vals ) in enumerate ( clusters_w_vals ) : i += 2 line_color = ( ( color_incr * i ) % 256 , ( color_incr * i * i ) % 256 , ( color_incr * i * i * i ) % 256 , ) self . draw_lines_in_dir ( baseimg , direction , vals , line_color ) return baseimg