Machine Vision on Microcontroller - Page 1
Forum section: electronics / projects

author: yanir
author_rank: Regular Contributor
timestamp: February 16, 2014, 12:56:49 am
content: Anyone do any work with machine vision? I'm looking to implement some basic machine vision tasks on an STM32F4 (ARM cortex M4). I'd like to use OpenCV but it may not compile for this part. Can anyone point me to some libraries or resources. I've read that I may need to implement the algorithms my self. Not out of the question but it would be nice to save the time.Thanks

author: nctnico
author_rank: Super Contributor
timestamp: February 16, 2014, 01:02:35 pm
content: What kind of algorithms do you need? Do you really want to use a microcontroller for this? OpenCV needs lot of memory but it does come with almost every algorithm you'd need. If you want to develop fast then a board with some kind of Linux would be the best option.

author: yanir
author_rank: Regular Contributor
timestamp: February 16, 2014, 08:55:48 pm
content: This is for a custom board I'm designing that is cost sensitive. And I don't want to spend time booting into an OS. The stm32f4 is quite capable and there are examples of face tracking projects implemented on it.I don't need every algorithm. Id strip out most of it, but id like basic image manipulation, compression, and algorithms related to basic object recognition. I am adding ram beyond what is available on the part.I'd also use other libraries if you have a recommendation.Sent from my iPhone using Tapatalk 2

author: senso
author_rank: Frequent Contributor
timestamp: February 16, 2014, 09:10:36 pm
content: Using a Freescale iMX233 would no add THAT much cost, and a stripped linux will boot in a couple of seconds at most.

author: yanir
author_rank: Regular Contributor
timestamp: February 16, 2014, 09:38:00 pm
content: Couple of seconds is 2 seconds too long for this application.I've worked with an imx23 on a prior project and it's not a good part to use on new designs.Sent from my iPhone using Tapatalk 2

author: dannyf
author_rank: Super Contributor
timestamp: February 16, 2014, 10:00:29 pm
content: Depending on what vision you ate talking about, the simplest could be done with two photo resistors and a 555.

author: yanir
author_rank: Regular Contributor
timestamp: February 16, 2014, 10:13:03 pm
content: I'm using a CMOS camera.One application is to wait for an object of interest to be detected, take a full frame snapshot to be retrieved later.What options I have to 'detect' will be determined by how much of the library I can support. Has anyone compiled opencv for a similar processor?Sent from my iPhone using Tapatalk 2

author: nctnico
author_rank: Super Contributor
timestamp: February 16, 2014, 10:25:05 pm
content: I have compiled standard applications on an ARM microcontroller before (like PolarSSL). You'll likely need a POSIX compliant environment providing stubs for syslog, fread, fwrite, fopen, etc and support for malloc, realloc and free. Implementing malloc, free, realloc is not difficult although the biggest challenge is to prevent memory fragmentation. Maybe you need threads/multitasking as well. The easiest way to get multitasking is using an RTOS (realtime OS). Booting will be quick. You have to analyse what OpenCV needs in terms of memory management and threads first. If some processing task takes a long time it will help to have multitasking in order to keep the user and/or communication interface going.In my last OpenCV project I created some simple C++ classes around the coordinate lists used by OpenCV so the memory gets freed automagically when the list goes out of scope. AFAIK there is also a standard C++ inteface to OpenCV but the documentation for that is even more scarse than the documentation on OpenCV itself.

author: AlfBaz
author_rank: Super Contributor
timestamp: February 16, 2014, 10:46:03 pm
content: QuoteConsidering your requirements this may not be appropriate but thought I'd post this anyway.STM32F429 UcLinux portThey say a couple of seconds boot time but if memory serves me well it seemed almost instantaneous when I tried it

author: yanir
author_rank: Regular Contributor
timestamp: February 16, 2014, 11:29:56 pm
content: Quote from: AlfBaz on February 16, 2014, 10:46:03 pmThat's pretty nice. I'll check it out. Thanks

author: yanir
author_rank: Regular Contributor
timestamp: February 16, 2014, 11:34:22 pm
content: Quote from: nctnico on February 16, 2014, 10:25:05 pmI don't get why it's so poorly documented. I was first introduced to opencv over 10 years ago and I would have expected this to improve over that time.RTOS does seem like the way to go. I'd like to get some proof of concept stuff done quickly however.