Skip to content

Commit 964dda2

Browse files
committed
Merge pull request opencv#9503 from sovrasov:convex_hull_disable_inplace
2 parents 4ee3034 + 91e56ab commit 964dda2

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

modules/imgproc/include/opencv2/imgproc.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3977,6 +3977,8 @@ returns convex hull points. Otherwise, it returns indices of the convex hull poi
39773977
output array is std::vector, the flag is ignored, and the output depends on the type of the
39783978
vector: std::vector\<int\> implies returnPoints=false, std::vector\<Point\> implies
39793979
returnPoints=true.
3980+
3981+
@note `points` and `hull` should be different arrays, inplace processing isn't supported.
39803982
*/
39813983
CV_EXPORTS_W void convexHull( InputArray points, OutputArray hull,
39823984
bool clockwise = false, bool returnPoints = true );

modules/imgproc/src/convhull.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ void convexHull( InputArray _points, OutputArray _hull, bool clockwise, bool ret
130130
{
131131
CV_INSTRUMENT_REGION()
132132

133+
CV_Assert(_points.getObj() != _hull.getObj());
133134
Mat points = _points.getMat();
134135
int i, total = points.checkVector(2), depth = points.depth(), nout = 0;
135136
int miny_ind = 0, maxy_ind = 0;

0 commit comments

Comments
 (0)