MajorAlvega

OCRobot - a robot control with text cards

Recommended Posts

This is a robot I made almost two years ago as a proof of concept after a talk with a friend. He wanted to use a Raspberry Pi to extract some data from invoices written on paper and I searched a few OCR tools for him to use - he took a photo with his mobile phone and the the tool extracted the text. We also used Google Docs for the same purpose.

Then I realized that if we could do it with a RPi we could also do it with an EV3:

k4utNnWFU5bLhD2L9cQChOnBavetUQtnUXRmiql0

 

 

The robot waits for the user to press the touch sensor then turns the Power Function lights ON over the cartridge and uses an old LEGOcam to take a photo of the inner part.

Common linux tools are used: fswebcam to take the phot, ImageMagick and textclean to improve the image and tesseract-ocr to get the text. In between it says a few things with espeak to prevent us to fall asleep because the ARM processor of the EV3 is slow.

There is a USB hub because I was using Wi-Fi and the LEGOcam at the same time but it isn't really needed if you choose to use Bluetooth (or choose to use no communications at all).

Being linux, you can use other webcams instead of the LEGOcam with it's long and thick USB cable (like the Logitech C170) as long as the kernel recognizes them (most UVC-based work).

 

Share this post


Link to post
Share on other sites

This is very good as usual !

Can you give us a link for the cam ?

Share this post


Link to post
Share on other sites

Thanks!
There were two LEGOcams:

https://www.bricklink.com/v2/catalog/catalogitem.page?P=x86&idColor=14#T=C&C=14

https://www.bricklink.com/v2/catalog/catalogitem.page?P=x86px1#T=C

 

They were electrical the same, just athe color of the top cover and the "focus" mechanism were different.

The first was part of the MINDSTORMS RCX Vision Command:

9731-1.jpg

And the second one was part of LEGO Studios (DACTA Education division) and also Steve Spielber Moviemaker set:

9647-1.jpg

1349-1.jpg

You might have problems using them in current Windows but they still work with linux, including the Raspberry Pi.

Just 2 notes:

- the EV3 USB port is 1.x so bandwidth is not enough for full webcam capabilities. I'm not sure now but I think the best you can get from it is 320x160 or so.

- image quality is bad - you need good light (I used Power Functions lights) and also needd to manual focus to get something useful

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.