Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Building Computer Vision Projects with OpenCV 4 and C++

You're reading from   Building Computer Vision Projects with OpenCV 4 and C++ Implement complex computer vision algorithms and explore deep learning and face detection

Arrow left icon
Product type Course
Published in Mar 2019
Publisher
ISBN-13 9781838644673
Length 538 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (4):
Arrow left icon
Roy Shilkrot Roy Shilkrot
Author Profile Icon Roy Shilkrot
Roy Shilkrot
David Millán Escrivá David Millán Escrivá
Author Profile Icon David Millán Escrivá
David Millán Escrivá
Vinícius G. Mendonça Vinícius G. Mendonça
Author Profile Icon Vinícius G. Mendonça
Vinícius G. Mendonça
Prateek Joshi Prateek Joshi
Author Profile Icon Prateek Joshi
Prateek Joshi
Arrow right icon
View More author details
Toc

Table of Contents (28) Chapters Close

Title Page
Copyright and Credits
About Packt
Contributors
Preface
1. Getting Started with OpenCV FREE CHAPTER 2. An Introduction to the Basics of OpenCV 3. Learning Graphical User Interfaces 4. Delving into Histogram and Filters 5. Automated Optical Inspection, Object Segmentation, and Detection 6. Learning Object Classification 7. Detecting Face Parts and Overlaying Masks 8. Video Surveillance, Background Modeling, and Morphological Operations 9. Learning Object Tracking 10. Developing Segmentation Algorithms for Text Recognition 11. Text Recognition with Tesseract 12. Deep Learning with OpenCV 13. Cartoonifier and Skin Color Analysis on the RaspberryPi 14. Explore Structure from Motion with the SfM Module 15. Face Landmark and Pose with the Face Module 16. Number Plate Recognition with Deep Convolutional Networks 17. Face Detection and Recognition with the DNN Module 18. Android Camera Calibration and AR Using the ArUco Module 19. iOS Panoramas with the Stitching Module 20. Finding the Best OpenCV Algorithm for the Job 21. Avoiding Common Pitfalls in OpenCV 1. Other Books You May Enjoy Index

Plate recognition


The second step in license plate recognition aims to retrieve the characters of the license plate with OCR. 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 of possibles characters 
    vector< vector< Point...
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 $19.99/month. Cancel anytime
Banner background image