ARTICLE AD BOX
I use cv2.FlannBasedMatcher to detect some objects. I got good accuracy and would like to get (x, y) of group of points.
What I have:

What i'd like to get

There is my function:
def detect(self): haystack = cv2.cvtColor(self.haystack, cv2.COLOR_BGR2GRAY) template = cv2.cvtColor(self.template, cv2.COLOR_BGR2GRAY) kp1, des1 = sift.detectAndCompute(haystack, None) kp2, des2 = sift.detectAndCompute(template, None) matches = flann.knnMatch(des1, des2, k=2) good_matches = [] for m, n in matches: if m.distance < self.threshold * n.distance: good_matches.append(m) # there's I need to calculate x and y relative to haystack image # h, w = template.shape[:2] # return (x, y, h, w)What shall I do?
Explore related questions
See similar questions with these tags.
