Ejemplo n.º 1
0
        #imshow(patch)
        progress += 1
    print('')
    new_img = helpers.norm_zero_one(new_img)
    return new_img


def show_signature(img_path, fignum=1):
    print('Showing signature: ' + img_path)
    img = plt.imread(join(imgdir, img_path))
    sig_img = sliding_window_signature(img)
    fig = plt.figure(fignum)
    ax1 = fig.add_subplot(1, 2, 1)
    ax2 = fig.add_subplot(1, 2, 2)
    ax1.imshow(img)
    ax2.imshow(sig_img)
    fig.show()
    fig.canvas.draw()


image_list = np.array(os.listdir(imgdir), dtype=object)
img_path = image_list[0]
samplex = np.random.choice(range(len(image_list)), 5)
print samplex
sample = image_list[samplex]
for gx, img_path in enumerate(sample):
    show_signature(img_path, fignum=gx)

#set_cmap('gray')
df2.present()
Ejemplo n.º 2
0
        #if progress < 10 and False:
            #figure(progress)
            #imshow(patch)
        progress += 1
    print('')
    new_img = helpers.norm_zero_one(new_img)
    return new_img

def show_signature(img_path, fignum=1):
    print('Showing signature: '+img_path)
    img = plt.imread(join(imgdir, img_path))
    sig_img = sliding_window_signature(img)
    fig = plt.figure(fignum)
    ax1 = fig.add_subplot(1,2,1)
    ax2 = fig.add_subplot(1,2,2)
    ax1.imshow(img)
    ax2.imshow(sig_img)
    fig.show()
    fig.canvas.draw()

image_list =  np.array(os.listdir(imgdir), dtype=object)
img_path = image_list[0]
samplex = np.random.choice(range(len(image_list)), 5)
print samplex
sample = image_list[samplex]
for gx, img_path in enumerate(sample):
    show_signature(img_path, fignum=gx)

#set_cmap('gray')
df2.present()