Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Mastering OpenCV 3

You're reading from   Mastering OpenCV 3 Get hands-on with practical Computer Vision using OpenCV 3

Arrow left icon
Product type Paperback
Published in Apr 2017
Publisher
ISBN-13 9781786467171
Length 250 pages
Edition 2nd Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
 Saragih Saragih
Author Profile Icon Saragih
Saragih
Arrow right icon
View More author details
Toc

Plate recognition


The second step in License Plate Recognition aims to retrieve the characters of the license plate with Optical Character Recognition. For each detected plate, we proceed to segment the plate for each character and use an Artificial Neural Network machine learning algorithm to recognize the character. Also, in this section, you will learn how to evaluate a classification algorithm.

OCR segmentation

First, we will obtain a plate image patch as an input to the OCR segmentation function with an equalized histogram. We then need to apply only a threshold filter and use this threshold image as the input of a Find Contours algorithm. We can observe this process in the following image:

This segmentation process is coded as follows:

      Mat img_threshold; 
      threshold(input, img_threshold, 60, 255, CV_THRESH_BINARY_INV); 
      if(DEBUG) 
      imshow("Threshold plate", img_threshold); 
      Mat img_contours; 
      img_threshold.copyTo(img_contours); 
      //Find contours...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at £13.99/month. Cancel anytime
Visually different images