Student Projects

cancel
Showing results for 
Search instead for 
Did you mean: 

myRIO Project - myANPR

Overview

ANPR cameras are widely used throughout communities. A camera is used to acquire images, and through image processing, the system can detect and output the alphanumeric characters of a number plate on a vehicle using the process called optical character recognition (OCR).

Police may use such devices to detect insurance fraud or tax evasion by taking the alphanumeric characters detected and inputting them into a database for a vehicle check. Various car parks may use an ANPR camera to detect the duration of stay of a specific vehicle or to log who enters/leaves the car park.

Description

This project uses a myRIO and also the NI Vision Development software to mimic the functionality of the ANPR camera described above. The image processing and OCR process are all deployed on the Real Time target whilst the Host PC deals with logging the detected number plates to a text file.

The project attached below can be run with the myRIO connected by WiFi.

This project was first created in Vision Assistant, before using the tools to create the corresponding LabVIEW VI. One of the functions in the image processing palette searches the image for a shape outlined by a template which outputs a shape report. Using this shape report, you can programmatically generate a ROI descriptor to input into the OCR process.

The Algorithm

There are various methods of building the algorithm to perform the same functionality. The following section describes how this algorithm is applied.

Algorithm Page 1.png

Algorithm Page 2.png

  1. Acquire image through USB Camera and put it into a buffer
  2. Take a colour threshold to look for the colour yellow. This outputs a binary image as shown above
  3. Remove all smaller objects
  4. Remove all border objects
  5. Fill all holes to get a rectangular shape
  6. Use Shape Matching tool to find the rectangular shape (this determines the coordinates of the rectangular object which will come into use later)
  7. Store this binary image into a buffer
  8. Retrieve the original image from the buffer
  9. Take a threshold to find all dark objects (now I am trying to look for the alphanumerics)
  10. Remove all border objects
  11. Retrieve the previous image from the buffer and take the absolute difference of the two images, which leaves us with the alphanumerics
  12. Build a Character Set File using the OCR tools

After this is converted into LabVIEW code, the shape report output in step 6 is manipulated into a region of interest (ROI) and is then an input into the OCR stage of the code. This means that LabVIEW will only try and find alphanumeric characters in the ROI specified programmatically.

Steps to Implement or Execute Code

  1. Open Project and connect the myRIO either by WiFi
  2. Connect the USB camera to the myRIO and direct the camera at a number plate
  3. FTP into the myRIO and enter the two files called 'template.png' and 'myANPR Character Set File.abc' into /C/ni-rt/startup/ located on the myRIO
  4. Deploy the VI under the myRIO in the project, and run the Host PC VI

Once the VI has started running, a text file is generated under My Documents called 'myANPR<date>'.

(Please note: Logging to file still needs a bit of tweaking!)

A video of the project working can be found in the attachments.

Requirements

Software

NI Vision Development Software 14.0

LabVIEW 14.0

Hardware

NI myRIO

Microsoft LifeCam HD 1700 or any USB Camera

Rechargeable Batter for the myRIO (optional)


Additional Images or Video

[UPCOMING VIDEO TO BE UPLOADED]


Picture1.png  Picture2.jpg

Host:

Host PC.png


Host PC - SubVI.png


RT Target:

RT Target.png


RT Target - Img Proc SubVI.png


RT Target - ROI SubVI.png


RT Target - OCR SubVI.png

About the Developer

Name: Hans

Role at NI: Applications Engineer (Intern)

University: Loughborough University

Course: MEng Mechanical Engineering

myRIO Project 2014-2015

Jinfone
Applications Engineer
National Instruments
Comments
ganggadin
Member
Member
on

I don't understand

"FTP into the myRIO and enter the two files called 'template.png' and 'myANPR Character Set File.abc' into /C/ni-rt/startup/ located on the myRIO"

in Steps to Implement or Execute Code.

please, explain in detail.

Thanks

jinfone.t
NI Employee (retired)
on

Hi ganggadin,

Enter the IP address into Windows Explorer, which should open the FTP page for the myRIO. Navigate to /C/ni-rt/startup and upload the image file and Character Set File into the specified location.

Hope this helps.

Jinfone
Applications Engineer
National Instruments
ViDeC
Member
Member
on

I have the same problem.

The error is as in the following image

The software was updated to the last version (labview 14.0 sp1, Vision development module 14.5).

May you help me?

Error.jpg

ohhlalaa
Member
Member
on

What is the purpose of substracting and adding the numbers (100, -20, 40, 40) in the Shape report to ROI conversion SubVI? Thanks

Capture.PNG

YudySuryanto
Member
Member
on

Please ask,
I'm facing a thesis, a thesis I am just like you.

I want ask to you, why when real time (live camera) OCR can not read but otherwise use the path browser can read the characters. I use the same program just changed to the function path.

 

use path

3.png2.png

 

live camera

tampilan.png

 

my program

program.png

help in correction

 

Sincerely,

 

Yudy Suryanto

Contributors