Merge pull request #1041 from abidrahmank:master

This commit is contained in:
Roman Donchenko 2013-06-26 16:38:54 +04:00 committed by OpenCV Buildbot
commit 53afdb4b30
4 changed files with 32 additions and 0 deletions

View File

@ -9,6 +9,8 @@ Creates a trackbar and attaches it to the specified window.
.. ocv:function:: int createTrackbar( const String& trackbarname, const String& winname, int* value, int count, TrackbarCallback onChange=0, void* userdata=0)
.. ocv:pyfunction:: cv2.createTrackbar(trackbarName, windowName, value, count, onChange) -> None
.. ocv:cfunction:: int cvCreateTrackbar( const char* trackbar_name, const char* window_name, int* value, int count, CvTrackbarCallback on_change=NULL )
:param trackbarname: Name of the created trackbar.
@ -181,6 +183,8 @@ Sets mouse handler for the specified window
.. ocv:function:: void setMouseCallback( const String& winname, MouseCallback onMouse, void* userdata=0 )
.. ocv:pyfunction:: cv2.setMouseCallback(windowName, onMouse [, param]) -> None
.. ocv:cfunction:: void cvSetMouseCallback( const char* window_name, CvMouseCallback on_mouse, void* param=NULL )
:param winname: Window name

View File

@ -522,6 +522,24 @@ The function calculates and returns the minimum-area bounding rectangle (possibl
boxPoints
-----------
Finds the four vertices of a rotated rect. Useful to draw the rotated rectangle.
.. ocv:function:: void boxPoints(RotatedRect box, OutputArray points)
.. ocv:pyfunction:: cv2.boxPoints(box[, points]) -> points
.. ocv:cfunction:: void cvBoxPoints( CvBox2D box, CvPoint2D32f pt[4] )
:param box: The input rotated rectangle. It may be the output of .. ocv:function:: minAreaRect.
:param points: The output array of four vertices of rectangles.
The function finds the four vertices of a rotated rectangle. This function is useful to draw the rectangle. In C++, instead of using this function, you can directly use box.points() method. Please visit the `tutorial on bounding rectangle <http://docs.opencv.org/doc/tutorials/imgproc/shapedescriptors/bounding_rects_circles/bounding_rects_circles.html#bounding-rects-circles>`_ for more information.
minEnclosingCircle
----------------------
Finds a circle of the minimum area enclosing a 2D point set.

View File

@ -1318,6 +1318,9 @@ CV_EXPORTS_W double contourArea( InputArray contour, bool oriented = false );
//! computes the minimal rotated rectangle for a set of points
CV_EXPORTS_W RotatedRect minAreaRect( InputArray points );
//! computes boxpoints
CV_EXPORTS_W void boxPoints(RotatedRect box, OutputArray points);
//! computes the minimal enclosing circle for a set of points
CV_EXPORTS_W void minEnclosingCircle( InputArray points,
CV_OUT Point2f& center, CV_OUT float& radius );

View File

@ -398,3 +398,10 @@ cvMinAreaRect2( const CvArr* array, CvMemStorage* /*storage*/ )
return (CvBox2D)rr;
}
void cv::boxPoints(cv::RotatedRect box, OutputArray _pts)
{
_pts.create(4, 2, CV_32F);
Mat pts = _pts.getMat();
box.points((Point2f*)pts.data);
}