Search icon CANCEL
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
Computer Vision Projects with OpenCV and Python 3

You're reading from   Computer Vision Projects with OpenCV and Python 3 Six end-to-end projects built using machine learning with OpenCV, Python, and TensorFlow

Arrow left icon
Product type Paperback
Published in Dec 2018
Publisher Packt
ISBN-13 9781789954555
Length 182 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Matthew Rever Matthew Rever
Author Profile Icon Matthew Rever
Matthew Rever
Arrow right icon
View More author details
Toc

Table of Contents (9) Chapters Close

Preface 1. Setting Up an Anaconda Environment FREE CHAPTER 2. Image Captioning with TensorFlow 3. Reading License Plates with OpenCV 4. Human Pose Estimation with TensorFlow 5. Handwritten Digit Recognition with scikit-learn and TensorFlow 6. Facial Feature Tracking and Classification with dlib 7. Deep Learning Image Classification with TensorFlow 8. Other Books You May Enjoy

Result analysis

When we run our code using the best candidate code block, we get the following result:

if len(plate_candidates) > 0: 
plate_candidates.sort(key = lambda plate_candidate:
len(plate_candidate.chars), reverse = True)
best_plate = plate_candidates[0]
print("License plate read: " + best_plate.chars + "\n")

License plate read: LTLDBENZ

Once we get our output, we can display our result using the following code:

figure()
imshow(best_plate.thesholded)

The displayed image will be as follows:

Although there is an extra character, we can see that our displayed image is very close to the plate characters. We can, check it with our other possible plate characters to get the closest result.

Let's try one more license plate, to check how our code works:

input_image = plt.imread('tests/p2.jpg') #use cv2.imread...
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 €18.99/month. Cancel anytime