Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

cv2.rectangle

import cv2

cv2.rectangle(img, (x1, y1), (x2, y2), (255,0,0), 2)


x1,y1 ------
|          |
|          |
|          |
--------x2,y2
Comment

how to draw a rectangle in cv2

cv2.rectangle(image, start_point, end_point, color, thickness)
cv2.rectangle(Face, (x, y), (x+w, y+h), (255, 255, 255), thickness)


x,y-----------x+w
|
|
|
y+h

and the rest cv2.rectangle() will draw for you.

#P.S the x and y are coordinates and the w and h are width and height
Comment

PREVIOUS NEXT
Code Example
Python :: measure execution time in jupyter notebook 
Python :: how to flatten a nested list in python 
Python :: python os.name mac 
Python :: python ssh connection 
Python :: isidentifier method in python 
Python :: python try then change something and try again if fails 
Python :: pandas difference between dates 
Python :: django urlpattern 
Python :: combine two dictionary adding values for common keys 
Python :: check if anything in a list is in a string python 
Python :: pandas dataframe delete column 
Python :: pause python 
Python :: pandas sort by date descending 
Python :: python pyramid 
Python :: blender python select object by name 
Python :: python render_template 
Python :: pandas to latex 
Python :: convert string to dictionary python 
Python :: checking if a string is in alphabetical order in python 
Python :: python reverse list complexity 
Python :: sys.path[0] 
Python :: create a dataframe python 
Python :: How to Get the Difference Between Sets in Python 
Python :: filter function in pandas stack overflow 
Python :: loop through list of tuples python 
Python :: pandas dataframe remove rows by column value 
Python :: python get first n elements of dict 
Python :: how to update python 
Python :: mouse bottom in pygame 
Python :: np to tuple 
ADD CONTENT
Topic
Content
Source link
Name
2+4 =