def select_ith_keypoint(fx): print('-------------------------------------------') print('[interact] viewing ith=%r keypoint' % fx) kp = kpts[fx] sift = desc[fx] np.set_printoptions(precision=5) df2.cla() fig1 = df2.figure(state.fnum, **kwargs) df2.imshow(rchip, pnum=(2,1,1)) #df2.imshow(rchip, pnum=(1,2,1), title='inv(sqrtm(invE*)') #df2.imshow(rchip, pnum=(1,2,2), title='inv(A)') ell_args = {'ell_alpha':.4, 'ell_linewidth':1.8, 'rect':False} df2.draw_kpts2(kpts[is_valid], ell_color=df2.ORANGE, **ell_args) df2.draw_kpts2(kpts[fx:fx+1], ell_color=df2.BLUE, **ell_args) ax = df2.gca() #ax.set_title(str(fx)+' old=b(inv(sqrtm(invE*)) and new=o(A=invA)') scale = np.sqrt(kp[2]*kp[4]) printops = np.get_printoptions() np.set_printoptions(precision=1) ax.set_title(chip_title) ax.set_xlabel(chip_xlabel) extract_patch.draw_keypoint_patch(rchip, kp, sift, pnum=(2,2,3)) ax = df2.gca() ax.set_title('affine feature\nfx=%r scale=%.1f' % (fx, scale)) extract_patch.draw_keypoint_patch(rchip, kp, sift, warped=True, pnum=(2,2,4)) ax = df2.gca() ax.set_title('warped feature\ninvA=%r ' % str(kp)) golden_wh = lambda x:map(int,map(round,(x*.618 , x*.312))) Ooo_50_50 = {'num_rc':(1,1), 'wh':golden_wh(1400*2)} np.set_printoptions(**printops) #df2.present(**Ooo_50_50) #df2.update() fig1.show() fig1.canvas.draw()
def _draw_patch(**kwargs): return extract_patch.draw_keypoint_patch(rchip, kp, sift, **kwargs)