opencv_contrib
opencv_contrib copied to clipboard
neighbor_responses and dist matrixes are not filled in KNearest/KDTree.
System information (version)
- OpenCV => trunk
- Operating System / Platform => any
- Compiler => any
Detailed description
In the KDTree version of KNearest, the neighbour-response and distance matrices are not filled as the result matrix is. The result is that the neighbor_responses and dist matrices are empty after return.
opencv/modules/ml/src/knearest.cpp:
for (int i=0; i<test_samples.rows; ++i)
{
Mat _res, _nr, _d;
tr.findNearest(test_samples.row(i), k, Emax, _res, _nr, _d, noArray());
res.push_back(_res.t());
_results.assign(res);
}