About 8,370,000 results
Open links in new tab
  1. Python OpenCV | cv2.rectangle() method - GeeksforGeeks

    Aug 12, 2024 · method is used to draw a rectangle on any image. Syntax: cv2.rectangle (image, start_point, end_point, color, thickness) Parameters:image: It is the image on which rectangle …

  2. opencv - How can I draw a rectangle around a colored object in open cv

    Nov 30, 2017 · In the cv2.rectange () function, the first argument corresponds to the image on which you want to draw, fourth argument specifies the color and fifth specifies the thickness of …

  3. Python OpenCV cv2.rectangle() Guide - PyTutorial

    Jan 15, 2025 · Learn how to use Python OpenCV cv2.rectangle() to draw rectangles on images. This guide includes examples, code, and explanations for beginners.

  4. How to Draw Rectangles in OpenCV and Python - Aleksandar Haber

    Dec 9, 2023 · In this Python and OpenCV tutorial, we explain how to draw rectangles. We explain how to draw both filled rectangles and rectangles with only boundary lines. In addition to this, …

  5. How to Draw a Rectangle Using OpenCV Module in Python

    Feb 2, 2024 · Refer to the following code for an example. img=image, pt1=start_point, pt2=end_point, color=color, thickness=thickness. The above code first loads the image from …

  6. Learn to Draw Rectangle in OpenCV Python using cv2.rectangle

    Oct 1, 2021 · In this tutorial, we are going to show you how we can draw rectangles in OpenCV Python by using cv2.rectangle () function. Rectangles are commonly used to create a …

  7. Drawing Functions in OpenCV for Line, Rectangle, Circle ... - Python

    cv2.rectangle(img, pt1, pt2, color, thickness, lineType, shift) Parameters. Img: Source image or image over which we have to draw the line. Pt1: Starting coordinate of the rectangle. Pt2: …

  8. python - OpenCV: draw a rectangle around a region - Stack Overflow

    Jun 7, 2023 · The code for drawing a rectangle on an image is: cv2.rectangle(image, pt1, pt2, color, thickness) where pt1 is starting point-->(x,y) and pt2 is end point-->(x+w,y+h).

  9. How to Draw Shapes (Lines, Circles, Rectangles) on Images Using OpenCV

    Apr 9, 2025 · 3. Draw a Rectangle. Use cv2.rectangle( ) to draw a rectangle: # Draw a green rectangle cv2.rectangle(image, (100, 100), (400, 300), (0, 255, 0), thickness=3) Explaintation: …

  10. Python OpenCV: how to draw rectangles on an image

    Dec 29, 2020 · To draw a rectangle with OpenCV, we simply need to use the rectangle function. This function receives the following arguments: The image where to draw the rectangle. We …

Refresh