Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

break line text opencv

    position = (30, 30)
    text = "Some text including newline 
 characters."
    font_scale = 0.75
    color = (255, 0, 0)
    thickness = 3
    font = cv2.FONT_HERSHEY_SIMPLEX
    line_type = cv2.LINE_AA

    text_size, _ = cv2.getTextSize(text, font, font_scale, thickness)
    line_height = text_size[1] + 5
    x, y0 = position
    for i, line in enumerate(text.split("
")):
        y = y0 + i * line_height
        cv2.putText(frame,
                    line,
                    (x, y),
                    font,
                    font_scale,
                    color,
                    thickness,
                    line_type)
Comment

PREVIOUS NEXT
Code Example
Python :: del no of elements in lis 
Python :: pylatex add package 
Python :: merge df datacamp 
Python :: python dt error only use with datetimelike values 
Python :: python to java converter 
Python :: discord.py embed length greater than 1024 
Python :: python diccionario setdefault 
Python :: logarithmic 2d histogram 
Python :: pandas to latex table newline not working 
Python :: check status of subprocess 
Python :: multigreading sys.exit does not work 
Python :: python read vcf file line by line 
Python :: how to check if a word is a palindrome in python 
Python :: python chunks 
Python :: Using np.unravel_index on argmax output 
Python :: description of imdb dataset python 
Python :: Split the string using the default arguments 
Python :: List Get a Element-2 
Python :: interval time specification 
Python :: if the answer satisfiest the condition so how to stop it to run further ahead in python 
Python :: how to run a seaborn plot on pycharm 
Python :: back of list 
Python :: Python - Cara Memisahkan String Berdasarkan Beberapa Delimiter 
Python :: merge_sort 
Python :: discord.py custom status 
Python :: remove cooldown discord python 
Python :: implementing a bubble sort in python 
Python :: pyglet on close 
Python :: networkx select edge 
Python :: how to play mp3 file form pygame module 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =