How to detect vehicle license plates in photos in Javascript

A little license plate detection never hurt anyone, right? What about the hours of work required to set it up? Well that’s a thing of the past now. Forget all the Deep Learning and coding headaches. We have a full system for photo license plates already set up, all you need to do is use an API call.

Install the API client with this code snippet, which can be added between the head tags of your page or in your HTML file.

<script src=""></script>

To finish, call the API function with this code here.

var CloudmersiveImageApiClient = require('cloudmersive-image-api-client');var defaultClient = CloudmersiveImageApiClient.ApiClient.instance;// Configure API key authorization: Apikeyvar Apikey = defaultClient.authentications['Apikey'];Apikey.apiKey = 'YOUR API KEY';// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)//Apikey.apiKeyPrefix = 'Token';var apiInstance = new CloudmersiveImageApiClient.RecognizeApi();var imageFile = "/path/to/file"; // File | Image file to perform the operation on.  Common file formats such as PNG, JPEG are supported.var callback = function(error, data, response) {if (error) {console.error(error);} else {console.log('API called successfully. Returned data: ' + data);}};apiInstance.recognizeDetectVehicleLicensePlates(imageFile, callback);

Yup, that’s it. Any license plate data will be stripped out of images and given back in this format:

"Successful": true,
"DetectedLicensePlates": [
"LicensePlateText_BestMatch": "string",
"LicensePlateText_RunnerUp": "string",
"LocationX": 0,
"LocationY": 0,
"Width": 0,
"Height": 0,
"LicensePlateRecognitionConfidenceLevel": 0
"DetectedLicensePlateCount": 0
Image for post
Image for post

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