Convert Image To Pixel Array Function

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
Post Reply
varun847
Posts: 1
Joined: Sun Jun 23, 2019 8:19 pm

Convert Image To Pixel Array Function

Post by varun847 » Sun Jun 23, 2019 8:21 pm

Hi Team,
I am working on a project which involves OpemMv M7 and NodeMCU. I Would like to capture image using OpenMv and Store It to Nodemcu SpiFFs memory using UART, So far I am Able To communicate with openmv and nodemcu using UART also when I try to send image to nodemcu using RXD And TXD Pins I am able to send some strange alphanumeric codes from openmv to nodemcu. Now what I want to do is to convert the image to array list and then send the values to nodemcu for storage so that I can upload it to web and then convert the array to image again but I am not able to convert the image to array using any function as I am not sure if there exist any function which can convert image to string array in micropython openmv library. Please Help me if someone can suggest how to do it.

OutoftheBOTS_
Posts: 847
Joined: Mon Nov 20, 2017 10:18 am

Re: Convert Image To Pixel Array Function

Post by OutoftheBOTS_ » Mon Jun 24, 2019 7:37 am

I have used both OpenMV cam and NodeMCU with Micro-Python.

All RAM is linear so any array including 2d image array is stored in memory as linear bytes. You should be able to send the image from OpenMV straight to the UART without any formatting then have the NodeMCU forward it on to the web before formatting it back there into a image.
something like this

Code: Select all

img = sensor.snapshot()
uart.write(img)
Also do be aware that OpenMV can compress the image into a JPG that is much smaller to make sending it ot the web easier.

Also do be aware if your just trying to get an image to the web then the ESP32CAM can do it all for you in 1 hit see https://www.aliexpress.com/af/esp32-cam ... y&jump=afs

Post Reply