Skip to content

fix findMinEnclosingTriangle#20912

Merged
opencv-pushbot merged 1 commit intoopencv:3.4from
AleksandrPanov:fix_findMinEnclosingTriangle
Oct 21, 2021
Merged

fix findMinEnclosingTriangle#20912
opencv-pushbot merged 1 commit intoopencv:3.4from
AleksandrPanov:fix_findMinEnclosingTriangle

Conversation

@AleksandrPanov
Copy link
Copy Markdown
Contributor

@AleksandrPanov AleksandrPanov commented Oct 20, 2021

Fixes #20890
Add test for #20676

There was problem in this lines:

std::vector<cv::Point2f> resultingTriangle, polygon;
convexHull(points, polygon, true, true);

convexHull use same type for points and hull(variable polygon in this case). If the types are different, a problem occurs.
Using cv::Mat fix this problem.

Pull Request Readiness Checklist

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

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or other license that is incompatible with OpenCV
  • The PR is proposed to proper branch
  • There is reference to 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.
  • The feature is well documented and sample code can be built with the project CMake

@alalek
Copy link
Copy Markdown
Member

alalek commented Oct 20, 2021

Please add corresponding simple regression_20890 test with mentioned types (from the issue).

@AleksandrPanov AleksandrPanov force-pushed the fix_findMinEnclosingTriangle branch 2 times, most recently from 0e90769 to 893b611 Compare October 21, 2021 15:05
@AleksandrPanov
Copy link
Copy Markdown
Contributor Author

Please add corresponding simple regression_20890 test with mentioned types (from the issue).

Thx, added test for #20890
Also to avoid regression added test for #20676 and cv::Mat usage test regression_mat_with_diff_channels.

@AleksandrPanov AleksandrPanov force-pushed the fix_findMinEnclosingTriangle branch from 893b611 to d21622b Compare October 21, 2021 15:13
Copy link
Copy Markdown
Member

@alalek alalek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you 👍

@opencv-pushbot opencv-pushbot merged commit 12507aa into opencv:3.4 Oct 21, 2021
@alalek alalek mentioned this pull request Oct 23, 2021
@alalek alalek mentioned this pull request Dec 30, 2021
@alalek alalek mentioned this pull request Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

minEnclosingTriangle() raises an error when input is vector<Point>

3 participants