2
\$\begingroup\$

Is it possible to do image processing (to extract numbers and text) using a microcontroller? If not, what are the alternatives to do this task?

\$\endgroup\$
  • \$\begingroup\$ You should asq questions for image processing : How do we get the image in microcontroller? How are images stored (memory size)? How do we perform operations on them (encoding ex jpeg)? Can we do this fast enough (Max frame rate)? \$\endgroup\$ – R Djorane Nov 17 '14 at 16:07
  • \$\begingroup\$ you should use a DSP with some specific functions for image processing like MAC and SIMD used for image processing and transforms function FFT, DCT...etc \$\endgroup\$ – R Djorane Nov 17 '14 at 16:22
1
\$\begingroup\$

Yes, image processing can be done using Microcontrollers and Microprocessors. You can either do image Processing using Arduino with OpenCV or MatLab. Or if you are more interested in Microprocessors you can use a embedded computer such as the Raspberry Pi(RPi) or Beaglebone(BB) which is more suitable for powerful image processing projects. RPi has an inbuilt GPU which is better for your applications but BBB can also be used for image Processing application considering the fact that it has a better and faster ARM processor. Since BB and RPi both run on linux you can use the most common OpenCV or simpleCV to do the task.

You can use Image Processing using BBB and OpenCV or RPi and OpenCV. OpenCV is an It has C++, C, Python and Java interfaces and supports Windows, Linux, Mac OS, iOS and Android.. I would suggest you to use OpenCV that uses C++ for BBB (C++ is faster compared to RPi and BBB doesnt have GPU so there is a chance to slow down processing) and use OpenCV that uses Python for RPi (python is much easier to code and RPi has a GPU) . I have used both RPi and BBB in the past but I would suggest you to buy a RPi for your application since its cheaper and has a huge Documentation online.

Update : There are many OCR based algorithm's available online for OpenCV but are not that reliable. I think best Open Source OCR Engine is Tesseract. You can get more idea about this from the thread Tesseract or OpenCV for OCR.

\$\endgroup\$
  • \$\begingroup\$ At present I am using OpenCV-python for RPi but I find it difficult to find documentation related to Text extraction techniques.I tried to implement stroke width tranform based algo in python but I got nothing. Can you suggest best algo to implement and why openCV is preferred over Scikit-image and PIL ? \$\endgroup\$ – lokhesh Jan 5 '15 at 18:09
  • \$\begingroup\$ I have updated the thread ,Please mark this thread as complete if this is what you were looking for. Regards. :) \$\endgroup\$ – Anto Dominic Jan 6 '15 at 18:18
0
\$\begingroup\$

It is really depending on which kind of microcontroller and peripherals we are talking about, as well of what kind of image processing. You should ask yourself following questions (and answer them of course)
1) First problem is to get the image data into the processing unit - how will it be done? Where is the data is coming from? Where is it stored?
2) How fast the processing should be?
3) Does the image have to be fully loaded to processing unit memory in order to be processed or just part of it is enough? It will lead to memory requirements
4) What are you going to do with the processed data?

In general, image processing is done on a special kind of microcontrollers/processors, called DSP (digital signal processors) that are optimized to process large arrays of digital data. So after you have answered the above questions, look into these.

\$\endgroup\$
0
\$\begingroup\$

Extracting numbers and text from a document is called Optical Character Recognition (OCR). This is a fairly complex topic, and there are several approaches to performing OCR. Although the term OCR implies using some sort of camera to image the text, more often than not the characters are "read" from an existing document, such as a Word or PDF file, a FAX, or a scanner output (which maybe an image file such as a jpeg). So in all of these cases, the format of the file has to be taken into considerations.

In any case, there is usually a pre-processing stage, in which the characters are de-skewed (aligned so they are vertical for example), and then edge detection is performed.

If the characters are known to be created from a particular font, such as Times Roman, or from a few known fonts, pattern recognition can be used. This is fairly easy but requires quite a bit of fixed memory (which can be in flash). If the characters are from a variety of fonts, this becomes more difficult. In that case feature extraction may be used instead. The hardest challenge is if the characters are free-form handwritten.

If it is known that only numbers are being input in a particular field, this also makes things much easier. Likewise, a dictionary may be used to help recognize words (once again, this would require a lot of flash memory.)

Given enough memory, both flash and RAM, there is no reason a microcontroller cannot perform OCR, although it probably would not be able to do so in real-time -- it would need to be an off-line task. In addition, a 32-bit processor is highly recommended.

OCR as mentioned above is primarily a pattern recognition task, and does not necessarily require DSP; however DSP could be useful in cleaning up the characters before OCR post-processing, such as removing noise.

\$\endgroup\$
0
\$\begingroup\$

Basically, no. Do it with an embedded computer such as the Raspberry Pi or Beaglebone. These are great for embedded computer vision, are very cheap, and the Beaglebone has reference schematics so you design your own system after prototyping stages are over.

Text recognition algorithms probably have many open source libraries available now, but they will all be for proper linux OS, rather than a real-time microcontroller OS. It's just much easier with a full CPU style architecture.

On the raspberry pi (using OpenCV 2/3 with Python bindings) I got 20-30 frames per second on object recognition and tracking with slightly down-sampled images from the Pi camera module.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.