A = ia.haarmatrix(128) ia.adshow(ia.normalize(A),'Haar matrix 128x128') # ### Example 3 # In[4]: if testing: f = mpimg.imread('../data/cameraman.tif') A = ia.haarmatrix(f.shape[0]) B = ia.haarmatrix(f.shape[1]) F = np.dot(np.dot(A, f), np.transpose(B)) nb = ia.nbshow(2) nb.nbshow(f,'Imagem original') nb.nbshow(ia.normalize(np.log(abs(F)+1)),'Haar transform') nb.nbshow() # In[ ]: # In[ ]:
for table in tables: Tc = ia.colormap(table) plt.plot(Tc[:, 0]) plt.plot(Tc[:, 1]) plt.plot(Tc[:, 2]) plt.title(table) plt.show() # ### Example 3 # # With image # In[5]: if testing: nb = ia.nbshow(3) f = mpimg.imread('../data/retina.tif') for table in tables: Tc = ia.colormap(table) g = ia.applylut(f, Tc).astype('uint8') if len(g.shape) == 3: g = g.transpose(1, 2, 0) nb.nbshow(g, table) nb.nbshow() # ## See Also # # - [ia636:applylut](applylut.ipynb) Lookup Table application # # ## References #
import ea979.src as ia # ### Example 1 # In[3]: if testing: get_ipython().magic('matplotlib inline') import matplotlib.pyplot as plt import matplotlib.image as mpimg f = mpimg.imread('../data/cameraman.tif') g07 = ia.logfilter(f, 0.7) nb = ia.nbshow(3) nb.nbshow(f, 'Imagem original') nb.nbshow(ia.normalize(g07), 'LoG filter') nb.nbshow(g07 > 0, 'positive values') nb.nbshow() # ### Example 2 # In[4]: if testing: g5 = ia.logfilter(f, 5) g10 = ia.logfilter(f, 10) nb = ia.nbshow(2, 2) nb.nbshow(ia.normalize(g5), 'sigma=5')
m, t = ia.sobel(f) print('m:\n', m) print('t:\n', t) # ### Image examples # ### Example 1. # In[3]: if testing: f = mpimg.imread('../data/cameraman.tif') (g, a) = ia.sobel(f) nb = ia.nbshow(2) nb.nbshow(ia.normalize(g), title='Sobel') nb.nbshow(ia.normalize(np.log(g + 1)), title='Log of sobel') nb.nbshow() # ### Example 2. # In[4]: if testing: f = ia.circle([200, 300], 90, [100, 150]) m, t = ia.sobel(f) dt = np.select([m > 2], [t]) nb = ia.nbshow(3)