3 examples of 'cv2.rectangle python' in Python

Every line of 'cv2.rectangle python' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
348def rectangle(image, corner1, corner2, color=(255, 255, 255), linewidth=-1):
349 cv2.rectangle(image, corner1, corner2, color, linewidth)

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

7def outlineRect(image, rect, color):
8 if rect is None:
9 return
10 x, y, w, h = rect
11 cv2.rectangle(image, (x, y), (x + w, y + h), color)
110def draw_rectangle(src_filename, dst_filename, pt1, pt2, color=green_color, thickness=line_thickness):
111 src_image = cv2.imread(src_filename, cv2.IMREAD_GRAYSCALE)
112 x1, y1 = pt1.get('x'), pt1.get('y')
113 x2, y2 = pt2.get('x'), pt2.get('y')
114 dst_image = cv2.rectangle(src_image, (x1, y1), (x2, y2), color, thickness)
115 cv2.imwrite(dst_filename, dst_image)

Related snippets