1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 00:03:03 +04:00

Merge pull request #25304 from gursimarsingh:geometry_sample_cpp

Geometry C++ sample combining other shape detection samples #25304

Clean Samples #25006
This PR removes adds a new cpp sample (geometry) which combines different methods of finding and drawing shapes in an image. It makes separate samples for convexHull, fitellipse, minAreaRect, minAreaCircle redudant. Shapes can be changed using hotkeys after running the program

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [x] The feature is well documented and sample code can be built with the project CMake
This commit is contained in:
Gursimar Singh
2024-04-16 12:43:34 +05:30
committed by GitHub
parent 869016d8b1
commit 3e561d8353
6 changed files with 270 additions and 553 deletions
+2 -11
View File
@@ -4173,8 +4173,6 @@ The function finds the minimal enclosing circle of a 2D point set using an itera
CV_EXPORTS_W void minEnclosingCircle( InputArray points,
CV_OUT Point2f& center, CV_OUT float& radius );
/** @example samples/cpp/minarea.cpp
*/
/** @brief Finds a triangle of minimum area enclosing a 2D point set and returns its area.
@@ -4209,8 +4207,8 @@ The function compares two shapes. All three implemented methods use the Hu invar
CV_EXPORTS_W double matchShapes( InputArray contour1, InputArray contour2,
int method, double parameter );
/** @example samples/cpp/convexhull.cpp
An example using the convexHull functionality
/** @example samples/cpp/geometry.cpp
An example program illustrates the use of cv::convexHull, cv::fitEllipse, cv::minEnclosingTriangle, cv::minEnclosingCircle and cv::minAreaRect.
*/
/** @brief Finds the convex hull of a point set.
@@ -4291,9 +4289,6 @@ of the other, they are not considered nested and an intersection will be found r
CV_EXPORTS_W float intersectConvexConvex( InputArray p1, InputArray p2,
OutputArray p12, bool handleNested = true );
/** @example samples/cpp/fitellipse.cpp
An example using the fitEllipse technique
*/
/** @brief Fits an ellipse around a set of 2D points.
@@ -4750,10 +4745,6 @@ CV_EXPORTS void polylines(InputOutputArray img, const Point* const* pts, const i
int ncontours, bool isClosed, const Scalar& color,
int thickness = 1, int lineType = LINE_8, int shift = 0 );
/** @example samples/cpp/contours2.cpp
An example program illustrates the use of cv::findContours and cv::drawContours
\image html WindowsQtContoursOutput.png "Screenshot of the program"
*/
/** @example samples/cpp/segment_objects.cpp
An example using drawContours to clean up a background segmentation result