detector_type, pyramid=pyramid, grid=grid) _img = df2.cv2_draw_kpts(test_img, cvkpts) df2.imshow(_img, fignum=fignum + xx, title='%s #kpts=%d ' % (detector_args, len(cvkpts)), figtitle=detector_type) except Exception as ex: print(repr(ex)) def compute_all_desc_extrac_permutations(): print('Computing all descriptor / extractor permutations') test_img = test_img1() # Try all combinations of feature detectors / extractors feat_type_perms = itertools.product(fc2.cv2_detector_types, fc2.cv2_extractor_types) for detector_type, extract_type in feat_type_perms: print('Testing detector+extractor=%s+%s' % (detector_type, extract_type)) kpts, desc = fc2.cv2_feats(test_img, extract_type, detector_type) print(' * (descriptor --- extractor) array shape: %r --- %r ' % (kpts.shape, desc.shape)) if __name__ == '__main__': show_all_detector_types(fignum=0, compare=True) #compute_all_desc_extrac_permutations() df2.present()
show_all_detector_types(fignum=1.224, pyramid=True, grid=True) return test_img = test_img1() for xx, detector_type in enumerate(fc2.cv2_detector_types): detector_args = ['','+grid'][grid]+['','+pyramid'][pyramid] print('Testing detector=%s' % (detector_type+detector_args)) try: cvkpts = fc2.cv2_kpts(test_img, detector_type, pyramid=pyramid, grid=grid) _img = df2.cv2_draw_kpts(test_img, cvkpts) df2.imshow(_img, fignum=fignum+xx, title='%s #kpts=%d ' % (detector_args, len(cvkpts)), figtitle=detector_type) except Exception as ex: print(repr(ex)) def compute_all_desc_extrac_permutations(): print('Computing all descriptor / extractor permutations') test_img = test_img1() # Try all combinations of feature detectors / extractors feat_type_perms = itertools.product(fc2.cv2_detector_types, fc2.cv2_extractor_types) for detector_type, extract_type in feat_type_perms: print('Testing detector+extractor=%s+%s' % (detector_type, extract_type)) kpts, desc = fc2.cv2_feats(test_img, extract_type, detector_type) print(' * (descriptor --- extractor) array shape: %r --- %r ' % (kpts.shape, desc.shape)) if __name__ == '__main__': show_all_detector_types(fignum=0, compare=True) #compute_all_desc_extrac_permutations() df2.present()
df2.show_keypoints(rchip2, kpts2, fignum + 3, _title4) # Run through the pipelines print('vsmany') res_vsmany = (rchip1, rchip2, kpts1, kpts2, fm, fs, fm_V, fs_V) aug_vsmany = (100, 'vsmany') arg_vsmany = res_vsmany + aug_vsmany show_match_results(*arg_vsmany) print('Warped using vsmany') res_vsmany_W = fmatch_warp(rchip1, rchip2, H_vsmany) aug_vsmany_W = (200, 'Warped using vsmany inliers') arg_vsmany_W = res_vsmany_W + aug_vsmany_W show_match_results(*arg_vsmany_W) print('vsone') res_vsone, H_vsone = fmatch_vsone(rchip1, rchip2, kpts1, kpts2, desc1, desc2) aug_vsone = (300, 'vsone') arg_vsone = res_vsone + aug_vsone show_match_results(*arg_vsone) print('Warped using vsone') res_vsone_W = fmatch_warp(rchip1, rchip2, H_vsone) aug_vsone_W = (400, 'Warped using vsone inliers') arg_vsone_W = res_vsone_W + aug_vsone_W show_match_results(*arg_vsone_W) # FREAK exec(df2.present())
df2.show_keypoints(rchip1, kpts1, fignum+2, _title3) df2.show_keypoints(rchip2, kpts2, fignum+3, _title4) # Run through the pipelines print('vsmany') res_vsmany = (rchip1, rchip2, kpts1, kpts2, fm, fs, fm_V, fs_V) aug_vsmany = (100, 'vsmany') arg_vsmany = res_vsmany + aug_vsmany show_match_results(*arg_vsmany) print('Warped using vsmany') res_vsmany_W = fmatch_warp(rchip1, rchip2, H_vsmany) aug_vsmany_W = (200, 'Warped using vsmany inliers') arg_vsmany_W = res_vsmany_W + aug_vsmany_W show_match_results(*arg_vsmany_W) print('vsone') res_vsone, H_vsone = fmatch_vsone(rchip1, rchip2, kpts1, kpts2, desc1, desc2) aug_vsone = (300, 'vsone') arg_vsone = res_vsone + aug_vsone show_match_results(*arg_vsone) print('Warped using vsone') res_vsone_W = fmatch_warp(rchip1, rchip2, H_vsone) aug_vsone_W = (400, 'Warped using vsone inliers') arg_vsone_W = res_vsone_W + aug_vsone_W show_match_results(*arg_vsone_W) # FREAK exec(df2.present())