Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

758
Vistas
How does cv2.boundingRect() function of OpenCV work?

I need the explanation on boundingRect of OpenCV. I have implemented it, it works great. Is there any reference where this function is fully explained please?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

The cv2.boundingRect() function of OpenCV is used to draw an approximate rectangle around the binary image. This function is used mainly to highlight the region of interest after obtaining contours from an image.

As per the documentation there are two types of bounding rectangles:

  1. Straight Bounding Rectangle

Here a simple rectangle is drawn around the contour (ROI). As you can see in the documentation, a green rectangle is drawn around the ROI. Corresponding rectangle coordinates are obtained such that a rectangle completely encloses the contour.

  1. Rotated Rectangle
  • In this case cv2.minAreaRect() function is used to highlight the minimum rectangular area enclosing a contour.
  • cv2.boxPoints() obtains the 4 corner points of the obtained rectangle.
  • np.int0() is done to convert the corrdinates from float to integer format.
  • These points are then used to draw the rectangle. This is depicted by the red rectangle in the documentation.
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda