Commit 3b1803f6 authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

Merge pull request #6989 from mself:gftt-deterministic-sort

parents f96b5652 72672c29
...@@ -54,7 +54,8 @@ struct greaterThanPtr : ...@@ -54,7 +54,8 @@ struct greaterThanPtr :
public std::binary_function<const float *, const float *, bool> public std::binary_function<const float *, const float *, bool>
{ {
bool operator () (const float * a, const float * b) const bool operator () (const float * a, const float * b) const
{ return *a > *b; } // Ensure a fully deterministic result of the sort
{ return (*a > *b) ? true : (*a < *b) ? false : (a > b); }
}; };
#ifdef HAVE_OPENCL #ifdef HAVE_OPENCL
...@@ -66,7 +67,8 @@ struct Corner ...@@ -66,7 +67,8 @@ struct Corner
short x; short x;
bool operator < (const Corner & c) const bool operator < (const Corner & c) const
{ return val > c.val; } // Ensure a fully deterministic result of the sort
{ return (val > c.val) ? true : (val < c.val) ? false : (y > c.y) ? true : (y < c.y) ? false : (x > c.x); }
}; };
static bool ocl_goodFeaturesToTrack( InputArray _image, OutputArray _corners, static bool ocl_goodFeaturesToTrack( InputArray _image, OutputArray _corners,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment