(baseimg, direction, line_positions, line_color, line_width=None)
Draw a list of lines <line_positions> on <baseimg> in direction <direction> using <line_color> and <line_width>.
Draw a list of lines <line_positions> on <baseimg> in direction <direction> using <line_color> and <line_width>.
Draw a list of lines <line_positions > on <baseimg > in direction <direction > using <line_color > and <line_width > .
def draw_lines_in_dir(baseimg, direction, line_positions, line_color, line_width=None):
        """
        Draw a list of lines <line_positions> on <baseimg> in direction <direction> using <line_color> and <line_width>.
        """
        if direction not in (DIRECTION_HORIZONTAL, DIRECTION_VERTICAL):
            raise ValueError("invalid value for 'direction': '%s'" % direction)
        
        if not line_width:
            line_width = ImageProc.DRAW_LINE_WIDTH
    
        h, w = baseimg.shape[:2]
        
        for pos in line_positions:
            pos = int(round(pos))
            
            if direction == DIRECTION_HORIZONTAL:
                p1 = (0, pos)
                p2 = (w, pos)
            else:
                p1 = (pos, 0)
                p2 = (pos, h)
            
            cv2.line(baseimg, p1, p2, line_color, line_width)
def draw_lines_in_dir ( baseimg , direction , line_positions , line_color , line_width = None ) : if direction not in ( DIRECTION_HORIZONTAL , DIRECTION_VERTICAL ) : raise ValueError ( "invalid value for 'direction': '%s'" % direction ) if not line_width : line_width = ImageProc . DRAW_LINE_WIDTH h , w = baseimg . shape [ : 2 ] for pos in line_positions : pos = int ( round ( pos ) ) if direction == DIRECTION_HORIZONTAL : p1 = ( 0 , pos ) p2 = ( w , pos ) else : p1 = ( pos , 0 ) p2 = ( pos , h ) cv2 . line ( baseimg , p1 , p2 , line_color , line_width )