Difference between revisions of "Software"

From FabLabGenovaWiki
Jump to: navigation, search
(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...")
 
(Replaced content with "preliminary python code")
Line 1: Line 1:
 
preliminary python code
 
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-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>
 

Revision as of 19:15, 8 February 2013

preliminary python code