In this project you’re going to learn how to build a car recognition system using a Raspberry Pi and Node-RED. For this project we’ll be using a software called OpenALPR (Automatic License Place Recognition) that has an API you can use to identify car plates and car models based on an image. Overview This project is divided into two parts. First, we’ll identify a car using OpenALPR and Node-RED;. Then, we’ll trigger an event based on the detected car (for example, open the garage when it detects that your car arrived home); The following image shows how the detection process will work: In this example, we use a PIR motion sensor to detect that the car arrives home. There are other sensors that may be more suitable to detect a car, for example:.
Hall effect sensor: senses changes in magnetic field when the car is near;. Ultrasonic sensor: detects distance to an object;.
A Java-based visual compiler for GUI recognition and automation. The screens are described in an XML file which contains the definitions of lexemes and the tokens that comprise them. Upon a successful match of a screen, user-defined code is executed.
Active infrared detectors: detects the presence of an object by detecting the reflection of infrared light. ENROLL IN: When the sensor detects motion, the Raspberry Pi camera takes a photo. After that, the Pi sends a request to OpenALPR with the car photo to be identified. Then, the OpenALPR API returns the car details like: plate number, model, color, and the confidence of the results. After identifying a car, we’ll do some verifications, and if we found an authorized car, we’ll trigger an event (that can be open the garage, for example).
The following image contains a flowchart showing the process. Here’s what happens: after the car has been identified by OpenALPR, we’ll check if the license plate and the car model match. If they match, we’ll check if the car is in the list of authorized vehicles. If it is, we’ll trigger an event. For example: open the garage. After that, we wait a determined period of time until the car enters the garage. Then, you need to add several verifications to check if the car has already entered the garage.
If yes, you can close the garage. Prerequisites:. You should be familiar with the Raspberry Pi –. You should have the Raspbian or Raspbian Lite operating system installed in your Raspberry Pi –.
We’ll be using the Raspberry Pi Camera V2 Module, we recommend reading:. You need and If you like home automation and you want to learn more about Node-RED, Raspberry Pi, ESP8266 and Arduino, we recommend that you download our course:. Parts Required For this project you need the following parts (click the links below to find the best price at ):. – read. or. (220 or 330 ohms should work). Note: at the moment, we don’t have an automatic garage, so we’ll use an LED to mimic the event triggering (we know it is not the same thing, but you get the idea).
Connect the Raspberry Pi Camera Module With the Pi shutdown, connect the camera to the Pi CSI port as shown in the following figure. Make sure the camera is connected in the right orientation with the ribbon blue letters facing up (you need to ). You should also have and the: Schematics Assemble the circuit to test this project. Follow these next schematic diagram: After having your Raspberry Pi prepared and Node-RED software configured, you can continue with this project. OpenALPR is an open source Automatic License Plate Recognition library written in C with bindings in C#, Java, Node.js, Go, and Python. They also have the which is a web service running in the cloud that analyzes images of vehicles and responds with license plate, model, color and much more. OpenALPR Cloud API has a free service that allows up to 2000 free recognitions per month.
Note: instead of using their Cloud API that is limited to only 2000 recognitions per month, you can install their Open Source software and use their to write Python scripts to analyse unlimited images. That way you don’t need to use their cloud service and you aren’t restricted to 2000 requests per month. Supported countries OpenALPR contains specialized training data for many plate styles. Currently, OpenALPR supports the following countries: Note:Europe is not a country, but we assume that they support all countries in Europe. If your country is not listed, you may still experience high accuracy rates by using training data for a country that has plates that look similar to yours. Creating a free account To get started with OpenALPR Cloud API, you can. After completing your account creation, you should have access to the following page: Open the Cloud API tab to access your Secret Key.
You need it to make requests to the API. In my case, the secret key is: sk8081041caedd50a——— Save your secret key in a safe place, because you’ll need it in just a moment. Testing the Camera and OpenALPR Service First, you should start by identifying your car using the Pi Camera and the OpenALPR service. So, start with the provided sample flow that takes a photo and makes a request to the OpeALPR Cloud API to identify your car. To import the Node-RED flow provided, go to the or click the figure below to see the raw file, and copy the code provided. Next, in the Node-RED window, at the top right corner, select the menu, and go to Import Clipboard. Then, paste the code provided and click Import.
![License Plate Recognition Source Code Compiler License Plate Recognition Source Code Compiler](/uploads/1/2/5/6/125614985/544183035.jpg)
The next nodes should show up in your flow: Configuring the test flow After importing the flow, you need to make some changes to make it work for you. Open the Take Photo node: Edit the node to have the same settings as shown in the next figure:. File Name: car-photo.jpeg. File default path: No.
File Path: /home/pi/Pictures/ Important: sometimes the previous node might overwrite the default setting. Make sure you double-check that it has the right settings. Then, click the deploy button.
In this tutorial I show how to use the Tesseract - Optical Character Recognition (OCR) in conjunction with the OpenCV library to detect text on a license plate recognition application. Tesseract is an optical character recognition engine for various operating systems. It is free software, released under the Apache License, Version 2.0, and development has been sponsored by Google since 2006. Tesseract is considered one of the most accurate open source OCR engines currently available. The Tesseract engine was originally developed as proprietary software at Hewlett Packard labs in Bristol, England and Greeley, Colorado between 1985 and 1994, with some more changes made in 1996 to port to Windows, and some migration from C to C in 1998. A lot of the code was written in C, and then some more was written in C.
Since then all the code has been converted to at least compile with a C compiler. Very little work was done in the following decade. It was then released as open source in 2005 by Hewlett Packard and the University of Nevada, Las Vegas (UNLV). Tesseract development has been sponsored by Google since 2006. OpenCV was built to provide a common infrastructure for computer vision applications and to accelerate the use of machine perception in the commercial products.
Being a BSD-licensed product, OpenCV makes it easy for businesses to utilize and modify the code. The library has more than 2500 optimized algorithms, which includes a comprehensive set of both classic and state-of-the-art computer vision and machine learning algorithms. These algorithms can be used to detect and recognize faces, identify objects, classify human actions in videos, track camera movements, track moving objects, extract 3D models of objects, produce 3D point clouds from stereo cameras, stitch images together to produce a high resolution image of an entire scene, find similar images from an image database, remove red eyes from images taken using flash, follow eye movements, recognize scenery and establish markers to overlay it with augmented reality, etc. OpenCV has more than 47 thousand people in their user community and an estimated number of downloads exceeding 7 million. The library is used extensively in companies, research groups and by governmental bodies. Email: [email protected] twitter: git: Rodrigo Agundez - Building a live face recognition system in the blink of a very slow eye.
![Plate Plate](/uploads/1/2/5/6/125614985/821507866.jpg)
Text Recognition using Opencv. OpenCV 101: A Practical Guide to the Open Computer Vision Library (1 of 4). OpenCV 3 Windows 10 Installation Tutorial - Part 2 - Python. Real Time object tracking - OpenCV, cvBlob 13ms per loop PWR Wroclaw. Make your own Haar Cascade on Windows Quick & Simple. Image to Text Processing.
Finding the Edges (Sobel Operator) - Computerphile. Lane and Car Tracking with OpenCV and C#. Practical Machine Learning Tutorial with Python Intro p.1.