Results of CvKNearest::find_nearest
The function CvKNearest::find_nearest(const Mat& samples, int k, Mat& results, Mat& neighborResponses, Mat& dists)
returns 3 results:
Mat& results
,Mat& neighborResponses
,Mat& dists
From the docs, I don't understand exactly what results
and neighborResponses
are.
With k=1
, they are identical - the index of the nearest neighbor.
With k>1
, results
seems to hold the indices of the nearest neighbor, and neighborResponses
hold the indices of all k
nearest neighbors.
Hence, results
is always the first column of neighborResponses
.
So why have both as outputs?