Software
From FabLabGenovaWiki
Revision as of 19:14, 8 February 2013 by Alberto (talk | contribs) (Created page with "preliminary python code <code> import matplotlib.pyplot as plt import matplotlib.image as mpimg import numpy as np img=mpimg.imread('C:\Users\Alberto Parmiggiani\Desktop\lenna...")
preliminary python code
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
img=mpimg.imread('C:\Users\Alberto Parmiggiani\Desktop\lenna-lg_BW.png')
- imgplot = plt.imshow(img)
- plt.show()
idx = np.where(img == 0) nodes = np.vstack((idx[0],idx[1])) print idx, idx[0] print print np.concatenate((idx[0],idx[1]), axis=0) print print
np.savetxt('program_path.txt', nodes.T, fmt='%u', delimiter=' ', newline='\n')
file=open('program_path','w')
- file.write(initial)
file.close() <\code>