1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 23:33:05 +04:00

Fix ml::KDTree::findNearest

This commit is contained in:
MaximSmolskiy
2025-10-16 22:58:55 +03:00
parent c75cd1047b
commit 98a12515fe
2 changed files with 21 additions and 3 deletions
+15 -2
View File
@@ -396,8 +396,21 @@ public:
{
Mat _res, _nr, _d;
tr.findNearest(test_samples.row(i), k, Emax, _res, _nr, _d, noArray());
res.push_back(_res.t());
_results.assign(res);
if( _results.needed() )
{
res.push_back(_res.t());
_results.assign(res);
}
if( _neighborResponses.needed() )
{
nr.push_back(_nr.t());
_neighborResponses.assign(nr);
}
if( _dists.needed() )
{
d.push_back(_d.t());
_dists.assign(d);
}
}
return result; // currently always 0