OCR with Webcam

OCR with Ubiquitous Webcam

Optical Character Recognition (OCR) technology has matured to include digital image processing and with the kind of processing power available in the average Personal computer, it should come as no surprise that in these days the accuracy of the OCR exceeds 99 %.

 

Typically most software commercial or free would require that you use a TWAIN compliant scanner to capture the image you want to use for converting to editable text. For best results this might be the only way as you need to present the best possible image for the OCR software to work upon. You will need to acquire black and white or grayscale image as color information would confound the OCR process.

 

In case your software has any issues working with your scanner, you can still save the scanned image in a TIFF (Tagged Image File Format) format and invoke the OCR software with this TIFF file. Most image editing tools will have no problem converting the images to this TIFF format.

 

When you are in the office, it would not be an issue to use the services of a desktop scanner to convert the magazine page or newspaper page to electronic format. Many a time you would see when you are traveling – a magazine article or a newspaper page which would be ideal to illustrate your stand. Only thing that would stop you is the lack of accessibility to a desktop scanner. You don’t have to wring your hand in despair anymore.

Your Laptop may already be equipped to take care of not only the means of capturing the newspaper/magazine page, but also the requisite software to convert the acquired image to editable text format. I wanted to do a bit of test in this line and this is what I found out.

 

I have a Laptop with barebones software installed and not too many techno wiz attachments. The notebook is equipped with a 1.3 mega pixel (extrapolated resolution) Web camera and MS Office installed amongst other things. A typical scenario.

 

I used the webcam to “capture” this image displayed here from an old magazine. You can see from the faded sepia toned color that the magazine must have been sitting at the shelf for ages. Again the choice of this torn page was deliberate to demonstrate that if we can get any decent result from such a faded magazine page, you should get far better results with a better recent subject.

OCR with Webcam

Now you need an OCR software to complete the conversion process. You need to look no further than the standard MS office software suite for this.

Click on All Programs – > Microsoft Office – > Microsoft Office Tools – > Microsoft Document Imaging

You will have a “free” OCR software here and it will take the above image acquired from the Webcam. Just click on Page from the top menu and select the and you will get the following page:

OCR software

Click on Tools – > Recognize Text using OCR and it will have converted the image into editable text ready to be ported to MS Word. Click again on Tools – > Send Text to Word and your MS Word will fire up with the converted text.

This is what mine did at the end of the exercise:

A T one tirn, p!opIe
did&t daw to svar
t3eMhe’r—go1d’ look. But
rw dlnw gold teamed
with
pLItinuTn or white
ldz so in, and Ioks so
good, u
wonder why it
took u so long. At InterCold. there i a .triking rngi. of unfussy, elcg.mt jcseItery — rings. earrin. chair . and pvidant in theit very f fordable Career Carals range. embellished with diamond and pearls. Prices begin at R 3.)OO. And for tho thinking of tying the knot, it you haven’t chcn our wedding nng yet, take a peek at the ‘Rings for E1rnitv’ range. You’ll go mad trying to make up your mind…

Not too good – You would say. But you had supplied a color image in the first place. With a bit of image manipulation and a grayscale image the eventual outcome is almost 85 % accurate. Not bad for a basic web cam based OCR.

Network Surveillance Cameras

Linux video camera Security II

A few months back we have dwelled on using a web camera to augment the security of our premises. We have talked about using the ubiquitous web camera to double up as a security camera. But there are several drawbacks in using a standard web camera for security applications:

It has a limited angle of vision – Originally a web camera is designed to have a 45 degree of view. It comes with a pre focused lens and the lens quality is not enough to provide adequate resolution for security purposes.

Even with a higher resolution web camera which provides 2 mega pixel resolution, the required resolution is still limited with the kind of illumination available at a typical office environment.

The illumination level required to provide sufficient detail for security is not enough with ordinary run-of-the-mill web cameras. So we will look at other options – Network Surveillance Cameras (network cameras and IP cameras) in this installment.

In this category we have a bewildering array of cameras available with many connectivity options – Wifi, built-in Network card with/without Image compression software to obviate the need for one at your server end. Many come equipped with optical zoom and Pan/Tilt head assembly. The camera can be controlled through a control panel in the built-in server.

As these cameras are designed for security applications, they have low light sensitivity – often as low as 0.05 lux and coupled with optical zoom in the range of 10 X – you have a decent security camera that can “identify” the license plate number of a visitor’s car in the driveway.

One thing we have noticed in our camera is that the camera lens soon picks up enough dust (possibly owing to the power supply providing a positive electro static charge) which results in a grainy image. So for best results, keep your camera lens/assemblies scrupulously clean.

We also provided a bank of Infra Red LEDs to provide additional illumination wherever required (indoors). Needless to say, almost all cameras we tested contained enough sensitivity in the infra red region. In case you have a doubt, use any infra-red remote control to shine at the camera. You should see a line of white light being emitted from the remote control.

Some web cameras deliberately use an infra-red filter between the pickup device and the lens.

But as we have decided to use specifically crafted Surveillance Cameras, this would not be an issue.

Network Surveillance Cameras

As this is a Hands-on approach to the installation and maintenance of Network Surveillance Cameras, we will start with the selection of cameras first. For outdoor surveillance it would be prudent to go in for a robust enclosure to house the camera and in these days, there are quite a number of manufacturers who build specially designed metal enclosures with industry grade mounting brackets.

Compared with a traditional type CCTV camera installation, Network type camera installation offers several advantages:

1 Cost – Compared with low loss video type coaxial cables, Data networking cables are cheaper.

2. CCTV cameras which provide CVBS (Composite Video with Blanking Signal) output need to have a short run to the distribution amplifier or monitor to avoid high frequency signal loss. All analog systems suffer from this cable distance issues Network cameras use a data encoding system to send binary data across a shared network.

3. Advanced Functionality is easy to implement using software in the case of Network cameras while you need expensive dedicated hardware for the traditional CCTV network.

4. Easy scalability – you can add as many cameras as you require – limited only by the software. You can add individual units as you go.

5. Remote Monitoring and ease of storage: With dropping prices of hard disks and vast quantities of storage space available, you can save to disk all of the outputs from the cameras for later analysis. With suitable authentication, you can monitor your office half way across the globe through internet.

Linux video camera security

Part I

Our commercial video surveillance system had a problem last week. The mains supply unit that feeds the camera, which in turn uses a CCD (Charge Coupled Device) and transmits to the receiver through microwave (2.4 GHz) had failed. To add to our woes, the multiple camera switcher unit had failed as well – possibly owing to a disastrous power supply fault.

It would take some time to sort out this issue and procure replacement units to handle the security of the premises. Someone suggested that we explore using the ubiquitous webcams lying around in our office, coupled with some open source (or commercial) software to handle the perimeter security.

A quick search in the Google for the term – “linux video camera security” returned some 9 million pages. Zoneminder appeared to suit our requirement though our needs were more modest. The site mentions that it is a complete “ all in one Linux GPL’d security camera solution” .

Basically what we needed was as enumerated below:

  1. Option of using inexpensive USB webcams
  2. Option of using a Multi camera setup
  3. Software driven Motion detection
  4. Video streaming through the Net
  5. Option of storing the images generated in the high capacity Network File Server

Browsing through the supplied manual (readme.pdf) showed that Zoneminder would more than suit our requirements.

There are many ways you can download and install the software package.

You can download and compile the source code or download your distro specific RPM to install. You will find that most of the code is written in Perl, which makes managing/ fault finding that much easy for people conversant with Perl.

Linux Video camera security

You will need amongst other things – an Apache server with PHP and Mysql installation. There are other essentials too – libjpeg.a , libpcre.a , ffmpeg or the Berkeley MPEG encoder – if you plan to generate MPEG video. Fortunately if you are with any modern distros, you can use any of their built-in updating to obtain the required libraries.

We will explore how we built from the ground up a very versatile video camera security system with little more than a Linux box and a few readily available Webcams in our subsequent parts.

Our Parent site TargetWoman - the leading women portal presents painstakingly researched extensive information in the form of thousands of condensed pages. It offers the widest and the most detailed information on subjects women care.