def vtool_adapt_rotation(img_fpath, kpts): """ rotation invariance in python """ import vtool.patch as ptool import vtool.image as gtool imgBGR = gtool.imread(img_fpath) kpts2 = ptool.find_kpts_direction(imgBGR, kpts) vecs2 = extract_vecs(img_fpath, kpts2) return kpts2, vecs2
def TEST_ptool_find_kpts_direction(imgBGR, kpts): import vtool.patch as ptool hrint = utool.horiz_print print('[rotinvar] +---') print('[rotinvar] | 3) Find dominant orientation in histogram') hrint('[rotinvar] | * kpts.shape = ', (kpts.shape,)) hrint('[rotinvar] | * kpts = ', kpts) kpts2 = ptool.find_kpts_direction(imgBGR, kpts) hrint('[rotinvar] | * kpts2.shape = ', (kpts.shape,)) hrint('[rotinvar] | * kpts2 = ', kpts2) print('[rotinvar] L___') return kpts2
def TEST_ptool_find_kpts_direction(imgBGR, kpts): from plottool import draw_func2 as df2 from plottool.viz_keypoints import _annotate_kpts, show_keypoints from plottool.viz_featrow import draw_feat_row import vtool.patch as ptool hrint = utool.horiz_print print('[rotinvar] +---') print('[rotinvar] | 3) Find dominant orientation in histogram') hrint('[rotinvar] | * kpts.shape = ', (kpts.shape, )) hrint('[rotinvar] | * kpts = ', kpts) kpts2 = ptool.find_kpts_direction(imgBGR, kpts) hrint('[rotinvar] | * kpts2.shape = ', (kpts.shape, )) hrint('[rotinvar] | * kpts2 = ', kpts2) print('[rotinvar] L___') return kpts2