You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you want, you can see the example [detect_faces.py](opencv_draw_tools/detect_faces.py), it also use an open source library called `face_recognition`.
84
-
85
-
86
-
### Manual method
87
-
88
-
```
89
-
import opencv_draw_tools as cv2_tools
90
-
91
-
92
-
"""
93
-
Draw better rectangles to select zones.
94
-
Keyword arguments:
95
-
frame -- opencv frame object where you want to draw
96
-
position -- touple with 4 elements (x1, y1, x2, y2)
97
-
This elements must be between 0 and 1 in case it is normalized
98
-
or between 0 and frame height/width.
99
-
tags -- list of strings/tags you want to associate to the selected zone (default [])
100
-
tag_position -- position where you want to add the tags, relatively to the selected zone (default None)
101
-
If None provided it will auto select the zone where it fits better:
102
-
- First try to put the text on the Bottom Rigth corner
103
-
- If it doesn't fit, try to put the text on the Bottom Left corner
104
-
- If it doesn't fit, try to put the text Inside the rectangle
105
-
- Finally if it doesn't fit, try to put the text On top of the rectangle
106
-
alpha -- transparency of the selected zone on the image (default 0.9)
107
-
1 means totally visible and 0 totally invisible
108
-
color -- color of the selected zone, touple with 3 elements BGR (default (110,70,45) -> dark blue)
109
-
BGR = Blue - Green - Red
110
-
normalized -- boolean parameter, if True, position provided normalized (between 0 and 1) else you should provide concrete values (default False)
111
-
thickness -- thickness of the drawing in pixels (default 2)
112
-
filled -- boolean parameter, if True, will draw a filled rectangle with one-third opacity compared to the rectangle (default False)
113
-
peephole -- boolean parameter, if True, also draw additional effect, so it looks like a peephole
0 commit comments