that’s some unusual code.
I won’t bother debugging anything that uses ORB. that’s a lost cause. that type of “distance test” is also not a good idea.
use the samples/python/find_obj.py
example. don’t use ORB, use SIFT or AKAZE. use FLANN, not bruteforce. make sure that Lowe’s ratio test happens. make sure findHomography
happens.