+ 2
What are the programs (python code) that we use to convert a binary list into specific information like(pictures, words, sound)?
I need to build such a code, how let me explain, I am using a laser that modulates light into binary (when the light is on, it means 1 and when it turns off it is 0.) this binary data is received thanks to my solar panel, which I will link to a computer. I am willing to make a python code that decodes this data depending on the information I need to convert. If it is a picture, a text or sound. Could someone help me? Thank you very much for helping me.
3 Respostas
+ 2
I might be writing in my low amount of knowledge in this area, but for images, you can use OpenCV to read images as array.
You would use the function cv2.imread to convert the image into array. You can use cv2.imshow to show an image from an array.
As for words, I don't know if they use each letter's ASCII representation for their numbers. In python you can convert a letter using the ord function to its number, and then you can use bin to convert that number to binary. Viceversa: use int(number, base=2) to convert binary to decimal, then chr function to get letter.
For Sound, I can't really help you there... I wish you success!
+ 2
Thank you for your help! I will try this for now.
0
Yh