def get_split_keypoint_detector(_template_fn, _temp_inf, _detector, _imgQ): try: with splta.Timer('Lording pickle'): splt_kpQ, splt_descQ = splta.affine_load_into_mesh( _template_fn, _temp_inf.get_splitnum()) except ValueError as e: print(e.args) print('If you need to save {} to file as datavase. ¥n' + ' Execute makedb/make_split_combine_featureDB_from_templates.py') with splta.Timer('Detection and dividing'): splt_kpQ, splt_descQ = splta.affine_detect_into_mesh( _detector, _temp_inf.get_splitnum(), _imgQ, simu_param='asift') return splt_kpQ, splt_descQ
h, w = imgQ.shape[:2] template_fn, ext = os.path.splitext(os.path.basename(fn1_full)) template_information = { "_fn": "tmp.png", "template_img": template_fn, "_cols": w, "_rows": h, "_scols": scols, "_srows": srows, "_nneighbor": 4 } temp_inf = splta.TmpInf(**template_information) try: with splta.Timer('Lording pickle'): splt_kpQ, splt_descQ = splta.affine_load_into_mesh( template_fn, temp_inf.get_splitnum()) except ValueError as e: print(e.args) print('If you need to save {} to file as datavase. ¥n' + ' Execute makedb/make_split_combine_featureDB_from_templates.py') with splta.Timer('Detection and dividing'): splt_kpQ, splt_descQ = splta.affine_detect_into_mesh( detector, temp_inf.get_splitnum(), imgQ, simu_param='asift') mesh_k_num = splta.np.array([len(keypoints) for keypoints in splt_kpQ ]).reshape(temp_inf.get_mesh_shape()) median = splta.np.nanmedian(mesh_k_num) fn, ext = os.path.splitext(os.path.basename(fn2_full)) testset_name = os.path.basename(os.path.dirname(fn2_full)) imgT = splta.cv2.imread(fn2_full, 0)