Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python opencv write text on image

# Python program to explain cv2.putText() method
    
# importing cv2
import cv2
    
# path
path = r'C:UsersRajnishDesktopgeeksforgeeksgeeks.png'
    
# Reading an image in default mode
image = cv2.imread(path)
    
# Window name in which image is displayed
window_name = 'Image'
  
# font
font = cv2.FONT_HERSHEY_SIMPLEX
  
# org
org = (50, 50)
  
# fontScale
fontScale = 1
   
# Blue color in BGR
color = (255, 0, 0)
  
# Line thickness of 2 px
thickness = 2
   
# Using cv2.putText() method
image = cv2.putText(image, 'OpenCV', org, font, 
                   fontScale, color, thickness, cv2.LINE_AA)
   
# Displaying the image
cv2.imshow(window_name, image)
Comment

PREVIOUS NEXT
Code Example
Python :: remove non-alphabetic pandas python 
Python :: pandas rename column 
Python :: pandas group by concat 
Python :: sum of all nan values pandas 
Python :: discord.py status 
Python :: py get days until date 
Python :: python print dict pretty 
Python :: string of numbers to list of integers python 
Python :: python read url 
Python :: transpose a matrix using list comprehension 
Python :: python: transform as type numeirc 
Python :: pygame fullscreen 
Python :: image capture from camera python 
Python :: django how to set a navbar active 
Python :: how to remove coma in python 
Python :: python merge pdfs 
Python :: how to play music on pygame 
Python :: how to update sklearn using conda 
Python :: how to get distinct value in a column dataframe in python 
Python :: how to plot 2 decimal values in axis python 
Python :: divide two columns pandas 
Python :: series datetime64 seconds to 0 
Python :: python object to json file 
Python :: xgboost feature importance 
Python :: fix ImportError: No module named PIL 
Python :: remove x label matplotlib 
Python :: calculate euclidian distance python 
Python :: xpath beautifulsoup 
Python :: import all images from folder python 
Python :: LookupError: unknown encoding: idna python 
ADD CONTENT
Topic
Content
Source link
Name
7+1 =