Open kristjankorjus opened 10 years ago
1)first we should crop the string as to remove first 33 lines and last (210-193) lines. If the string is filled with pixels line by line, this should be sth like:
cropped_pixs=pixs[160_33_2:160_193_2]
2)dividing the string into substrings of length 2: hexs=[cropped_pixs[i_2:i_2+2] for i in range(len(cropped_pixs)/2)]
3)getting the grayscale values
map(lambda x: my_array[int(x[0],16),int(x[1],16)],hexs)
4)np.reshape to 160*160 5)thumbnail
(Probably) parallelised with commit bd6fc46b486a4e97c967c3d56ff811b308925314.
Needs profiling.
for each frame, the loop in preprocessor.py must run for 210*160 times, which is bit inefficient:
Fill the PIL image object with the correct pixel values