def test3(): desc = np.random.rand(128) desc = desc / np.sqrt((desc**2).sum()) desc = np.round(desc * 255) print desc fig = df2.figure(fignum=43) ax = df2.plt.gca() ax.set_xlim(-1,1) ax.set_ylim(-1,1) df2.draw_sift(desc)
def draw_keypoint_patch(rchip, kp, sift=None, warped=False, **kwargs): #print('--------------------') #print('[extract] Draw Patch') if warped: wpatch, wkp = get_warped_patch(rchip, kp) patch = wpatch subkp = wkp else: patch, subkp = get_patch(rchip, kp) #print('[extract] kp = '+str(kp)) #print('[extract] subkp = '+str(subkp)) #print('[extract] patch.shape = %r' % (patch.shape,)) color = (0, 0, 1) fig, ax = df2.imshow(patch, **kwargs) df2.draw_kpts2([subkp], ell_color=color, pts=True) if not sift is None: df2.draw_sift(sift, [subkp]) return ax
def draw_one_kp(patch, kp, plotx, color, desc=None): fig, ax = df2.imshow(patch, plotnum=(num_rows, num_cols, plotx)) df2.draw_kpts2([kp], ell_color=color, pts=True) if not desc is None and not '--nodesc' in sys.argv: df2.draw_sift(desc, [kp]) df2.draw_border(ax, color, 1)