fixed rotated rectangle (center instead of corner)

pull/2396/head
Martin Dlouhy 11 years ago
parent 0a90d6dde6
commit 8f6ebc2427
  1. 2
      doc/py_tutorials/py_imgproc/py_contours/py_contour_features/py_contour_features.rst

@ -123,7 +123,7 @@ Let (x,y) be the top-left coordinate of the rectangle and (w,h) be its width and
7.b. Rotated Rectangle
-----------------------
Here, bounding rectangle is drawn with minimum area, so it considers the rotation also. The function used is **cv2.minAreaRect()**. It returns a Box2D structure which contains following detals - ( top-left corner(x,y), (width, height), angle of rotation ). But to draw this rectangle, we need 4 corners of the rectangle. It is obtained by the function **cv2.boxPoints()**
Here, bounding rectangle is drawn with minimum area, so it considers the rotation also. The function used is **cv2.minAreaRect()**. It returns a Box2D structure which contains following detals - ( center (x,y), (width, height), angle of rotation ). But to draw this rectangle, we need 4 corners of the rectangle. It is obtained by the function **cv2.boxPoints()**
::
rect = cv2.minAreaRect(cnt)

Loading…
Cancel
Save