diff --git a/modules/imgproc/doc/structural_analysis_and_shape_descriptors.rst b/modules/imgproc/doc/structural_analysis_and_shape_descriptors.rst index e95a38cee..7dc3ef0b2 100644 --- a/modules/imgproc/doc/structural_analysis_and_shape_descriptors.rst +++ b/modules/imgproc/doc/structural_analysis_and_shape_descriptors.rst @@ -572,19 +572,15 @@ Finds a triangle of minimum area enclosing a 2D point set. .. ocv:pyfunction:: cv2.minEnclosingTriangle(points[, triangle]) -> triangle, area -.. ocv:cfunction:: void cvMinEnclosingTriangle( const CvArr* points, CvArr* triangle, double* area ) - :param points: Input vector of 2D points with depth ``CV_32S`` or ``CV_32F``, stored in: * ``std::vector<>`` or ``Mat`` (C++ interface) - * ``CvSeq*`` or ``CvMat*`` (C interface) - * Nx2 numpy array (Python interface) :param triangle: Output vector of three 2D points defining the vertices of the triangle. The depth of the OutputArray must be ``CV_32F``. - :param area: The area of the minimum enclosing triangle. The ``C`` interface of the function allows providing a ``NULL`` pointer for this parameter in order for the value of the area not to be returned. + :param area: The area of the minimum enclosing triangle. The output for a given 2D point set is shown in the image below. The 2D points are depicted in *red* and the enclosing triangle in *yellow*. @@ -717,9 +713,9 @@ See below a sample output of the function where each image pixel is tested again .. [Hu62] M. Hu. *Visual Pattern Recognition by Moment Invariants*, IRE Transactions on Information Theory, 8:2, pp. 179-187, 1962. -.. [KleeLaskowski85] Klee, V. and Laskowski, M.C., *Finding the smallest triangles containing a given convex polygon*, Journal of Algorithms, vol. 6, no. 3, pp. 359–375 (1985) +.. [KleeLaskowski85] Klee, V. and Laskowski, M.C., *Finding the smallest triangles containing a given convex polygon*, Journal of Algorithms, vol. 6, no. 3, pp. 359-375 (1985) -.. [ORourke86] O’Rourke, J., Aggarwal, A., Maddila, S., and Baldwin, M., *An optimal algorithm for finding minimal enclosing triangles*, Journal of Algorithms, vol. 7, no. 2, pp. 258–269 (1986) +.. [ORourke86] O’Rourke, J., Aggarwal, A., Maddila, S., and Baldwin, M., *An optimal algorithm for finding minimal enclosing triangles*, Journal of Algorithms, vol. 7, no. 2, pp. 258-269 (1986) .. [Sklansky82] Sklansky, J., *Finding the Convex Hull of a Simple Polygon*. PRL 1 $number, pp 79-83 (1982) diff --git a/modules/imgproc/include/opencv2/imgproc/imgproc_c.h b/modules/imgproc/include/opencv2/imgproc/imgproc_c.h index 40e8b4e44..4e2dc7142 100644 --- a/modules/imgproc/include/opencv2/imgproc/imgproc_c.h +++ b/modules/imgproc/include/opencv2/imgproc/imgproc_c.h @@ -377,10 +377,6 @@ CVAPI(double) cvContourArea( const CvArr* contour, CVAPI(CvBox2D) cvMinAreaRect2( const CvArr* points, CvMemStorage* storage CV_DEFAULT(NULL)); -/* Finds minimum enclosing triangle for a set of points */ -CVAPI(void) cvMinEnclosingTriangle( const CvArr* points, - CvArr* triangle, double* area ); - /* Finds minimum enclosing circle for a set of points */ CVAPI(int) cvMinEnclosingCircle( const CvArr* points, CvPoint2D32f* center, float* radius ); diff --git a/modules/imgproc/src/min_enclosing_triangle.cpp b/modules/imgproc/src/min_enclosing_triangle.cpp index 0c9d23bb3..a952fe46e 100644 --- a/modules/imgproc/src/min_enclosing_triangle.cpp +++ b/modules/imgproc/src/min_enclosing_triangle.cpp @@ -1310,29 +1310,4 @@ static bool lessOrEqual(double number1, double number2) { return ((number1 < number2) || (almostEqual(number1, number2))); } -}; - - -////////////////////////////////////////////// C API /////////////////////////////////////////// - - -//! Find the minimum enclosing triangle and its area for the given set of points -/*! -* @param points Set of points -* @param triangle Minimum area triangle enclosing the given set of points -* @param area Area of the minimum area enclosing triangle -*/ -CV_IMPL void -cvMinEnclosingTriangle( const CvArr* _points, CvArr* _triangle, double* _area ) { - cv::Mat points = cv::cvarrToMat(_points); - cv::Mat triangle = cv::cvarrToMat(_triangle); - double area = 0; - - cv::minEnclosingTriangle(points, triangle, area); - - if (_area) { - *_area = area; - } -} - -/* End of file. */ +}; \ No newline at end of file