How to detect vehicle license plates in photos in Node.js

For this task, we want to be able to automatically detect the location and inscription on a vehicle license plate, for example in this photo:

Image for post
Image for post

The first step is to add a reference to the library we need:

"dependencies": {
"cloudmersive-image-api-client": "^1.1.4"
}

Now, all we need to do is call the recognizeDetectVehicleLicensePlates method:

var CloudmersiveImageApiClient = require('cloudmersive-image-api-client');
var defaultClient = CloudmersiveImageApiClient.ApiClient.instance;

And this will give us our desired output:

{
"Successful": true,
"DetectedLicensePlates": [
{
"LocationX": 290,
"LocationY": 341,
"Width": 186,
"Height": 81,
"LicensePlateText_BestMatch": "0MG77",
"LicensePlateText_RunnerUp": "B0MG77",
"LicensePlateRecognitionConfidenceLevel": 0.849610595703125
}
],
"DetectedLicensePlateCount": 1
}

That’s all there is to it. No we can process license plates easily.

Written by

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store