Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from PIL import Image
- import numpy as np
- import matplotlib.pyplot as plt
- image = np.asarray(Image.open("text.png"))
- q = []
- for i in range(100):
- for j in range(100):
- if (int(image[i][j][0]) + int(image[i][j][1]) + int(image[i][j][2]) != 765):
- q.append([(j)/20 + np.random.uniform(-0.025, 0.025), (100-i)/20 + np.random.uniform(-0.025, 0.025)])
- qq = np.array(q, dtype=np.float32)
- with open("iad4.csv", "w") as out:
- np.savetxt(out, qq, fmt="%f", delimiter=",")
- plt.scatter(qq[:, 0], qq[:, 1])
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement