I’m trying to speed up keypoint detection by pre-generating the keypoints of the objects I want to detect before passing them into FLANN for detection.
I’m getting the keypoints and descriptors but when I try and select them with
keypoint_needle = needle_kp1_desc and
descriptors_needle = needle_kp1_desc I’m expecting
keypoint_needle to be a KeyPoint value like:
<KeyPoint 000001EEFF0CB5A0> and
descriptors_needle to be an array while I’m actually getting both as KeyPoint values.
 would select array column/list (unsure what it’s called when multiple lists are appended to the same array) item 0 and
 would select column/list item 1 as in the below image.
But it looks like I’m getting object 1 and 2 from
0. How do I reference object
1 if not with
def loadImages(directory): image_list =  for i in directory: img = cv.imread(i, cv.IMREAD_UNCHANGED) image_list.append(img) return image_list def preProcessNeedle(image_list): needle_kp1_desc =  for i in image_list: orb = cv.ORB_create(edgeThreshold=0, patchSize=32) keypoints_needle, descriptors_needle = orb.detectAndCompute(i, None) needle_kp1_desc.append((keypoints_needle, descriptors_needle)) return needle_kp1_desc def kpDetection(needle_kp1_desc): # Object Detection for i in needle_kp1_desc: keypoint_needle = needle_kp1_desc descriptors_needle = needle_kp1_desc
Looks like you’re iterating over elements in your
needle_kp1_desc, but you never do anything with
def kpDetection(needle_kp1_desc): # Object Detection for i in needle_kp1_desc: keypoint_needle = i descriptors_needle = i
Note, you should also find a more descriptive name for