Exemple #1
0
def main_show():
    import matplotlib.pyplot as plt
    rng = np.random.RandomState(1)
    coords = prototype_coords(rng)
    img = render_coords(coords)
    img3 = render_coords(distort(coords, '3', rng))
    img6 = render_coords(distort(coords, '6', rng))
    plt.imshow(np.asarray([img, img3, img6]).T,
               cmap='gray',
               interpolation='nearest')
    plt.show()
Exemple #2
0
def main_show():
    import matplotlib.pyplot as plt
    rng = np.random.RandomState(1)
    coords = prototype_coords(rng)
    img = render_coords(coords)
    img3 = render_coords(distort(coords, '3', rng))
    img6 = render_coords(distort(coords, '6', rng))
    plt.imshow(np.asarray([img, img3, img6]).T,
               cmap='gray',
               interpolation='nearest')
    plt.show()
Exemple #3
0
def render_coords_uint8_channels(coords):
    n_points, n_dims = coords.shape
    assert n_dims == 2
    rval = render_coords(coords)
    rval *= 255
    rval = rval.astype('uint8')
    rval = rval[:, :, np.newaxis]
    return rval
Exemple #4
0
def render_coords_uint8_channels(coords):
    n_points, n_dims = coords.shape
    assert n_dims == 2
    rval = render_coords(coords)
    rval *= 255
    rval = rval.astype('uint8')
    rval = rval[:, :, np.newaxis]
    return rval