I don't know How to run 'numpy' to change that the image to binary bits in MicroPython
I saw that someone said we cannot use numpy in micro python board
then, is there any other way to convert image to binary?
and Second, Can I 'run' in PyCharm?
because When coding, I have to code while watching the result, but I have to press ctrl+D in putty, but it is very inconvenient to execute.
Below is that I want to execute, But the 'with open('C:\\Users\PKNU\Desktop\photo4.jpg', 'rb') as b:
data = b.read()' this part is also cannot run in putty
Thanks to read my questions
If you can afford it, thank you for your answer
Code: Select all
import numpy as np
with open('C:\\Users\PKNU\Desktop\photo4.jpg', 'rb') as b:
data = b.read()
encoded = np.frombuffer(data, dtype=np.uint8)
length=len(encoded)
for i in range(length):
a=format((encoded[i]),'b')
print('%08d'%int(a))