Camera integration

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
JimTal001
Posts: 176
Joined: Thu Jul 30, 2015 4:59 pm

Camera integration

Post by JimTal001 » Wed Oct 07, 2015 10:33 pm

Has anyone had success integrating a camera to the pyboard? It would be nice to find something like the pi camera.

Adafruit has a Miniature TTL Serial JPEG Camera with NTSC Video
http://www.adafruit.com/products/1386?g ... oCCzrw_wcB

User avatar
cagiva
Posts: 22
Joined: Wed Dec 14, 2016 4:49 pm

Re: Camera integration

Post by cagiva » Thu Oct 12, 2017 6:40 am

Check the OpenMV cam.

https://openmv.io/

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

OpenMV

Post by pythoncoder » Thu Oct 12, 2017 6:49 am

Indeed, as far as I know OpenMV is the only game in town. I briefly experimented with their newest board. It runs a rather old version of MicroPython. Some of the more advanced features like face recognition were a bit flaky when I tested but the basic product works OK.

Connecting a camera to the Pyboard is not really feasible as it lacks the necessary high speed interface.
Peter Hinch
Index to my micropython libraries.

CharlesFr
Posts: 6
Joined: Mon Oct 22, 2018 6:16 pm

Re: Camera integration

Post by CharlesFr » Mon Oct 22, 2018 8:25 pm

Hi,

It seems to be you can make what you want with the CircuitPython of Adafruit. If it's possible with this card, I think you can make it with the pyboard? With the same resolution (low). The OpenMV is for machine learning and I think this is why we need another card. (for image processing)

I don't think Circuit python is more powerful than the pyboard? so so.

You can maybe wire the adafruit camera to the pyboard in the same way. But the firmware is only available to the CircuitPython. I'm quite a newbie... but someone have an Idea?

https://learn.adafruit.com/ttl-serial-c ... thon-usage

All the best,

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Camera integration

Post by pythoncoder » Tue Oct 23, 2018 6:19 am

My comments above were intended to relate to video. That Adafruit board is for still images only and could be interfaced to the Pyboard. It would need someone to port the CircuitPython driver to MicroPython - as far as I know nobody has done this. At a glance it looks straightforward but it probably isn't a task for a novice.

CircuitPython is Adafruit's modified version of the MicroPython software. It isn't "more powerful" - its intention is to be easier for newbies. Where performance is paramount it's probably best to use mainline MicroPython.
Peter Hinch
Index to my micropython libraries.

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

Re: Camera integration

Post by OutoftheBOTS_ » Tue Oct 23, 2018 7:08 am

OpenMV have a new camera about to be realsed that is built around the STM32H7, I think the kickstarter might be finished now and they r in the processing of producing the boards.

The cameras most commonly used for these type of purposes are the sensors from Omni Vision see https://www.ovt.com/

These cameras have a I2C type interface for the settings of the camera and then a 8 bit parallel interface with a number of control lines for the data transfer.

Many of the STM32 chips do have a digital camera interface (DCMI) that is a hardware peripheral designed to interface with these cameras. I have used this peripheral on a STM32F407VET black board but I programmed it in C not micro python.

I am not sure if any of the pyboards have this peripheral or if the needed pins r broken out.

I have seen the Arduino guys bit bang in software these cameras on a STMF103 (blue pill). I do believe there is way in MicroPython to do the same thing by reading 8 pins in parallel on A port in Viper mode by reading the GPIO->IDR register.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Camera integration

Post by pythoncoder » Tue Oct 23, 2018 7:22 am

For the benefit of @CharlesFr the Adafruit still camera he wants to use employs a serial UART interface only. Electrical connection is therefore simple, it's just the driver software which may need a little work.
Peter Hinch
Index to my micropython libraries.

CharlesFr
Posts: 6
Joined: Mon Oct 22, 2018 6:16 pm

Re: Camera integration

Post by CharlesFr » Tue Oct 23, 2018 7:41 am

Hi,

First, thank you for you feedback. :D

I have found this github with python scripts. Maybe I can take the getimage.py and rewrite it with MicroPython? What do you think about?

https://github.com/oskarirauta/Adafruit ... ra-Library

If I draw a while loop with this image maybe I will have a basic video camera with a low resolution at the beginning.

By the way, I will test it as soon as possible. I let you know if I found something bigger :D

All the best,

User avatar
deshipu
Posts: 1388
Joined: Thu May 28, 2015 5:54 pm

Re: Camera integration

Post by deshipu » Tue Oct 23, 2018 9:15 am

pythoncoder wrote:
Tue Oct 23, 2018 6:19 am
CircuitPython is Adafruit's modified version of the MicroPython software. It isn't "more powerful" - its intention is to be easier for newbies. Where performance is paramount it's probably best to use mainline MicroPython.
Where performance is paramount it is best to steer clear from MicroPython and all its versions, and implement it in C or assembly. Having said that, CircuitPython is not more or less performant (though it does avoid memory fragmentation better) than MicroPython, it simply has more and better libraries for everything, mostly because the project encourages and helps the people who write them, as opposed to mainline.

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

Re: Camera integration

Post by OutoftheBOTS_ » Tue Oct 23, 2018 9:52 am

CharlesFr wrote:
Mon Oct 22, 2018 8:25 pm
Hi,

It seems to be you can make what you want with the CircuitPython of Adafruit. If it's possible with this card, I think you can make it with the pyboard? With the same resolution (low). The OpenMV is for machine learning and I think this is why we need another card. (for image processing)

I don't think Circuit python is more powerful than the pyboard? so so.

You can maybe wire the adafruit camera to the pyboard in the same way. But the firmware is only available to the CircuitPython. I'm quite a newbie... but someone have an Idea?

https://learn.adafruit.com/ttl-serial-c ... thon-usage

All the best,
The OpenMV is for machine learning and I think this is why we need another card
This isn't correct OpenMV is for image processing the latest additions to OpenMV funtoins does allow NN image processing but it retains all the other image processing functions. It is designs to do high frame rate image processing from the camera, it both has the 8bit parallel interface to the camera but also the image processing functions implemented in C then wrapped up to call in Python. You will also find they offer really great support on their forums too.

Post Reply