I am working on real time object recognition using Opancv4android, i am able to detect, extract feature points using ORB detector and descriptor extractor from the image i capture using camera . Now, i want to build a Kdtree and train them with these feature points and later i match these feature points in the tree with feature points detected by the camera in real time and recognizance the object . Please help me on how do i go about building a KD tree in opencv or any pointers or references/tutorials on KDtree for opencv will be very helpful.