'Custom distance with FLANN in OpenCV

Is there a way to define our own distance for FLANN tool in OpenCV. This question has been asked here but remains not answered for more than 6 years.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source