Author Topic: Machine Vision on Microcontroller  (Read 8035 times)

0 Members and 1 Guest are viewing this topic.

Offline yanirTopic starter

  • Regular Contributor
  • *
  • Posts: 216
  • Country: us
Machine Vision on Microcontroller
« on: February 16, 2014, 12:56:49 am »
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
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 27017
  • Country: nl
    • NCT Developments
Re: Machine Vision on Microcontroller
« Reply #1 on: February 16, 2014, 01:02:35 pm »
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.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline yanirTopic starter

  • Regular Contributor
  • *
  • Posts: 216
  • Country: us
Machine Vision on Microcontroller
« Reply #2 on: February 16, 2014, 08:55:48 pm »
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
 

Offline senso

  • Frequent Contributor
  • **
  • Posts: 951
  • Country: pt
    • My AVR tutorials
Re: Machine Vision on Microcontroller
« Reply #3 on: February 16, 2014, 09:10:36 pm »
Using a Freescale iMX233 would no add THAT much cost, and a stripped linux will boot in a couple of seconds at most.
 

Offline yanirTopic starter

  • Regular Contributor
  • *
  • Posts: 216
  • Country: us
Machine Vision on Microcontroller
« Reply #4 on: February 16, 2014, 09:38:00 pm »
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
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Machine Vision on Microcontroller
« Reply #5 on: February 16, 2014, 10:00:29 pm »
Depending on what vision you ate talking about, the simplest could be done with two photo resistors and a 555.
================================
https://dannyelectronics.wordpress.com/
 

Offline yanirTopic starter

  • Regular Contributor
  • *
  • Posts: 216
  • Country: us
Machine Vision on Microcontroller
« Reply #6 on: February 16, 2014, 10:13:03 pm »
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
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 27017
  • Country: nl
    • NCT Developments
Re: Machine Vision on Microcontroller
« Reply #7 on: February 16, 2014, 10:25:05 pm »
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.
« Last Edit: February 16, 2014, 10:27:17 pm by nctnico »
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline AlfBaz

  • Super Contributor
  • ***
  • Posts: 2184
  • Country: au
Re: Machine Vision on Microcontroller
« Reply #8 on: February 16, 2014, 10:46:03 pm »
Quote
Couple of seconds is 2 seconds too long for this application.
Considering your requirements this may not  be appropriate but thought I'd post this anyway.

STM32F429 UcLinux port

They say a couple of seconds boot time but if memory serves me well it seemed almost instantaneous when I tried it
 

Offline yanirTopic starter

  • Regular Contributor
  • *
  • Posts: 216
  • Country: us
Re: Machine Vision on Microcontroller
« Reply #9 on: February 16, 2014, 11:29:56 pm »

They say a couple of seconds boot time but if memory serves me well it seemed almost instantaneous when I tried it

That's pretty nice. I'll check it out. Thanks
 

Offline yanirTopic starter

  • Regular Contributor
  • *
  • Posts: 216
  • Country: us
Re: Machine Vision on Microcontroller
« Reply #10 on: February 16, 2014, 11:34:22 pm »
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.

I 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.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf