Help About Image Processing.

Thread Starter

yellowcloud

Joined Jun 30, 2013
32
Can I make a measurement of an image with using only a microcontroller?

i.e. i have these image of a box and i need to know the length of the box and its width.

if there is any link or pdfs that can make me understand how this will happen. please help. :D

THANKS!
 

MrChips

Joined Oct 2, 2009
30,824
No, it is not possible with no other pieces of information.
You need to know the focal length of the lens, the distance from the object, the resolution of the optical sensor or some way of calibrating the image.
 

Thread Starter

yellowcloud

Joined Jun 30, 2013
32
No, it is not possible with no other pieces of information.
You need to know the focal length of the lens, the distance from the object, the resolution of the optical sensor or some way of calibrating the image.
Do you mean that it is not possible by using only a microcontroller??
 

MrChips

Joined Oct 2, 2009
30,824
Whether you use a microcomputer or the most advanced Cray computer you cannot measure the size of an object in an image without some form of calibration.
 

shteii01

Joined Feb 19, 2010
4,644
You need a sensor. The sensor is connected to microcontroller (uC).

Example:
Let say we have white surface. There is a box whose border is made with black color line.
Sensor senses white, it sends 2 volt signal to uC. Then sensor moves X cm. When sensor encounters black, it sends 3 volts to uC. The program in uC registers the 3 volt signal and starts the count. When sensor sends second 3 volt signal (this tells us that the other side of the box have been reached), the count is stopped. Now you take the count and multiply by X cm, this tells you one of the dimensions of the box.
 

Thread Starter

yellowcloud

Joined Jun 30, 2013
32
You need a sensor. The sensor is connected to microcontroller (uC).

Example:
Let say we have white surface. There is a box whose border is made with black color line.
Sensor senses white, it sends 2 volt signal to uC. Then sensor moves X cm. When sensor encounters black, it sends 3 volts to uC. The program in uC registers the 3 volt signal and starts the count. When sensor sends second 3 volt signal (this tells us that the other side of the box have been reached), the count is stopped. Now you take the count and multiply by X cm, this tells you one of the dimensions of the box.
BTW. I plan to use camera as a sensor. and i will measure moving objects. like fish.
 

wayneh

Joined Sep 9, 2010
17,498
To estimate the size of a fish, you'll need software for edge detection and pattern recognition - kind of like how smart cameras these days detect faces - plus the calibration already mentioned. That might be a bit much for a typical DIY micro project but maybe they're more powerful than I assume.
 

djsfantasi

Joined Apr 11, 2010
9,163
I had mentioned this idea to the OP in another thread, with the caveat that I had not done it myself. However, I have seen other projects use this technique and felt it may apply to his problem. Also, I had done some research into edge detection and object recognition in the late 60s.

Yellowcloud PMed me about this, as I had seen a couple of projects use OpenCV libraries and image tracking on microcontrollers. The others comments here are very useful. Yellowcloud, particularly pay attention to the issues of edge detection. Also, note the idea of security cameras and the measurements painted on the door frames of convenience stores. If to replace your array of LDRs with a color coded grid that the fish swim by, you can get a good estimate of size.

Here are the links I provided Yellowcloud in a PM.
yellowcloud said:
Thank you for the idea in using the image processing than ldr arrays. Do you have useful links on how will I make theses image processing on microcontroller?
The project that made me think of using image processing actually ran on a PC. It used the OpenCV library to process the images from a web cam like device (Foscam). The description of this open source project can be found on Wikipedia at http://en.m.wikipedia.org/wiki/OpenCV, which contains links to documentation and code.

Although, a PC may not be necessary. This project (with code for a microprocessor) may also be a resource for you. Check out the video - it is impressive.
http://www.lynxmotion.net/viewtopic.php?f=9&t=5580&hilit=video+tracking
 

Alec_t

Joined Sep 17, 2013
14,335
So you want to use the camera to sense a moving object, process the image to recognise the object against a possibly complex background, measure the object with reference to some calibration image, and do all that in real time (more or less)? If so, methinks you'll need a very powerful microcontroller, possibly even the Cray Mr Chips mentioned in post #4 :).
 

mcgyvr

Joined Oct 15, 2009
5,394
you can save yourself TONS of time and pick up a cognex camera (checker 4g,etc..) and the software.. It does measurement like this out of the box..
 

Thread Starter

yellowcloud

Joined Jun 30, 2013
32
I have read all your thread replies. and I am reading some of the articles and documents online. As of now, this is what i got..

I will design a box which will be open on both sides to serve as an entrance of the fishes. also i will put a calibration ruler or pattern or grid opposite to the camera inside the box. I will have a sensor that will tell the microcontroller that there is an object that crossed the entrance and that will trigger the uC to capture an image. And I will compare the image captured on a certain binary image of the fish to detect if its raelly a fish that i had capture or its only some dirt. If it passed. I will process now the image to know its dimension.

Is this Good enough? Can a microcontroller process this without an external memory? I dont have to store the images. After I got its measurements, i will delete it. i will only need the measurements.

PS. This should be a stand alone system.
 

MrChips

Joined Oct 2, 2009
30,824
It is doable. But it depends on your definition of a microcontroller.
In my books, a STM32F407 is still a microcontroller and should have the power to do what you require.
 
Top