OpenCV KNearest function not calculating distances when using the KDTree variant of the algorithm
I am trying to use OpenCV’s KNearest function (OpenCV 4.5.1, C++) to calculate the distance to the nearest neighbor. I am not interested in either classification or regression, simply measuring this distance. I am able to accomplish this when using the ‘Brute Force’ version of the algorithm but not the ‘KDTree’ version.