Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Draw a Rectangle | Fundamentals of Image Manipulation with Python
Fundamentals of Image Manipulation with Python
course content

Contenido del Curso

Fundamentals of Image Manipulation with Python

bookDraw a Rectangle

In OpenCV, the cv2.rectangle() function is used to draw a rectangle on an image. The function requires five parameters:

  • the image to be modified;
  • the top-left corner coordinates of the rectangle (specified as a tuple of x and y coordinates);
  • the bottom-right corner coordinates of the rectangle (specified as a tuple of x and y coordinates);
  • the color of the rectangle (specified as a tuple of Red, Green, Blue values);
  • the thickness of the rectangle, which is optional and can be set to a negative value to fill the rectangle.
Tarea
test

Swipe to show code editor

  1. Use the correct function to draw a rectangle on image1.

Congratulations on completing your Python project on handling images! Your hard work and dedication to learning and mastering the tools and techniques of image processing is truly impressive. I hope you enjoyed the journey and look forward to seeing the amazing things you will create with your newfound skills. Keep up the good work!

Mark tasks as Completed
Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

In OpenCV, the cv2.rectangle() function is used to draw a rectangle on an image. The function requires five parameters:

  • the image to be modified;
  • the top-left corner coordinates of the rectangle (specified as a tuple of x and y coordinates);
  • the bottom-right corner coordinates of the rectangle (specified as a tuple of x and y coordinates);
  • the color of the rectangle (specified as a tuple of Red, Green, Blue values);
  • the thickness of the rectangle, which is optional and can be set to a negative value to fill the rectangle.
Tarea
test

Swipe to show code editor

  1. Use the correct function to draw a rectangle on image1.

Congratulations on completing your Python project on handling images! Your hard work and dedication to learning and mastering the tools and techniques of image processing is truly impressive. I hope you enjoyed the journey and look forward to seeing the amazing things you will create with your newfound skills. Keep up the good work!

Mark tasks as Completed
Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
Sección 1. Capítulo 11
AVAILABLE TO ULTIMATE ONLY
We're sorry to hear that something went wrong. What happened?
some-alt