🚗 Thai Vehicle License Plate OCR
🚗 ระบบ OCR สำหรับอ่านป้ายทะเบียนรถยนต์
Welcome to Thai Vehicle License Plate OCR API, version 2.0, an AI product developed by iApp Technology Co., Ltd. Our API is designed to extract license plate numbers and vehicle information from images with high accuracy and speed. The API supports JPEG, JPG, PNG file formats and can process vehicle images in 1-2 seconds.
Visit our API Portal to test the Thai Vehicle License Plate OCR API with your own images.
Getting Started
-
Prerequisites
- An API key from iApp Technology
- Vehicle images containing license plates
- Supported file formats: JPEG, JPG, PNG
- Maximum file size: 2MB
-
Quick Start
- Fast processing (1-2 seconds per image)
- High accuracy text extraction (92.28% overall accuracy)
- Support for multiple vehicle brands and types
-
Key Features
- Detailed field extraction including:
- License plate number
- Vehicle brand
- Vehicle type
- Vehicle color
- Province registration
- Vehicle detection
- Missing plate detection
- Flexible JSON response format
- Detailed field extraction including:
-
Security & Compliance
- GDPR and PDPA compliant
- No data retention after processing
Please visit API Portal to view your existing API key or request a new one.
Example
1. Sample Vehicle Real Life Application
Example 1
Example 2
Example 3
2. Sample Vehicle File
Request
curl --location 'https://api.iapp.co.th/license-plate-recognition/file' \
--header 'apikey: {YOUR API KEY}' \
--form 'file=@"{YOUR UPLOADED FILE}"'
Response
{
"conf": 93.30192566,
"country": "th",
"infer_time(s)": 0.18,
"is_missing_plate": "no",
"is_vehicle": "yes",
"lp_number": "กร5539",
"message": "success",
"province": "th-14:Phra Nakhon Si Ayutthaya (พระนครศรีอยุธยา)",
"status": 200,
"vehicle_body_type": "tractor-trailer",
"vehicle_brand": "honda",
"vehicle_color": "white",
"vehicle_model": "honda_jazz",
"vehicle_orientation": "135",
"vehicle_year": "2010-2014"
}
Features & Capabilities
Core Features
- License Plate Recognition: Extracts and accurately reads Thai license plate numbers from images.
- Comprehensive Vehicle Information: Identifies and provides details such as:
- License plate number
- Registered province
- Vehicle make (brand)
- Vehicle model
- Manufacturing year
- Vehicle orientation (front, side, rear)
- Vehicle type (e.g., sedan, SUV, truck)
- High Accuracy: Utilizes advanced computer vision algorithms to deliver precise recognition even in challenging lighting and environmental conditions.
Supported Capabilities
- Real-Time Processing: Suitable for time-sensitive applications like toll collection and vehicle tracking.
- Batch Processing: Efficiently handles multiple images for large-scale applications.
- Environmental Adaptability: Works reliably across various scenarios, including low-light and high-glare environments.
Use Cases
- Automatic Toll Collection: Streamline toll payment processes by recognizing vehicles and license plates in real time.
- Parking Management Systems: Automate entry and exit logging for vehicles in parking facilities.
- Vehicle Tracking: Enhance logistics and fleet management by integrating license plate recognition for vehicle identification.
- Security and Surveillance: Improve security systems with vehicle-based tracking and identification.
Additional Capabilities
- Easy Integration: Provides a RESTful API for seamless integration into existing applications.
- Fast and Reliable: Delivers quick response times and consistent performance for real-world deployment.
- Extensible and Scalable: Supports additional features and expansions as per evolving user requirements.
API Reference
Endpoint
POST
https://api.iapp.co.th/license-plate-recognition/file
Headers
Name | Type | Description |
---|---|---|
apikey | String | API Key |
Parameters
Name | Type | In | Required | Description |
---|---|---|---|---|
vehicle_image | object | body | Yes | Picture consists of a vehicle |
Response Explanation
Parameters | Explanation |
---|---|
conf | Confidence score of the license plate recognition in percentage. |
infer_time(s) | Time taken for inference in seconds. |
is_missing_plate | Indicates if there is a license plate missing in the image. Possible values: "yes" or "no". |
is_vehicle | Indicates if a vehicle is present in the image. Possible values: "yes" or "no". |
lp_number | License plate number recognized from the image. |
message | API response message. Possible values: "success" or "error". |
province | Province of the registered vehicle as identified by the license plate. |
status | HTTP status code of the API response. |
vehicle_body_type | Body type of the recognized vehicle. |
vehicle_brand | Brand of the recognized vehicle. |
vehicle_color | Color of the recognized vehicle. |
vehicle_model | Model of the recognized vehicle. |
vehicle_orientation | Orientation of the recognized vehicle in the image. |
vehicle_year | Year range of the recognized vehicle model. |
Code Example
Python
import requests
url = "https://api.iapp.co.th/license-plate-recognition/file"
payload = {}
files=[
('file',('{YOUR UPLOADED FILE NAME}',open('{YOUR UPLOADED FILE PATH}','rb'),'image/png'))
]
headers = {
'apikey': {YOUR API KEY}
}
response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.text)
JavaScript
const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');
let data = new FormData();
data.append('file', fs.createReadStream('{YOUR UPLOADED FILE PATH}'));
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://api.iapp.co.th/license-plate-recognition/file',
headers: {
'apikey': '{YOUR API KEY}',
...data.getHeaders()
},
data : data
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.iapp.co.th/license-plate-recognition/file',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array('file'=> new CURLFILE('{YOUR UPLOADED FILE PATH}')),
CURLOPT_HTTPHEADER => array(
'apikey: {YOUR API KEY}'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Swift
let parameters = [
[
"key": "file",
"src": "{YOUR UPLOADED FILE PATH}",
"type": "file"
]] as [[String: Any]]
let boundary = "Boundary-\(UUID().uuidString)"
var body = Data()
var error: Error? = nil
for param in parameters {
if param["disabled"] != nil { continue }
let paramName = param["key"]!
body += Data("--\(boundary)\r\n".utf8)
body += Data("Content-Disposition:form-data; name=\"\(paramName)\"".utf8)
if param["contentType"] != nil {
body += Data("\r\nContent-Type: \(param["contentType"] as! String)".utf8)
}
let paramType = param["type"] as! String
if paramType == "text" {
let paramValue = param["value"] as! String
body += Data("\r\n\r\n\(paramValue)\r\n".utf8)
} else {
let paramSrc = param["src"] as! String
let fileURL = URL(fileURLWithPath: paramSrc)
if let fileContent = try? Data(contentsOf: fileURL) {
body += Data("; filename=\"\(paramSrc)\"\r\n".utf8)
body += Data("Content-Type: \"content-type header\"\r\n".utf8)
body += Data("\r\n".utf8)
body += fileContent
body += Data("\r\n".utf8)
}
}
}
body += Data("--\(boundary)--\r\n".utf8);
let postData = body
var request = URLRequest(url: URL(string: "https://api.iapp.co.th/license-plate-recognition/file")!,timeoutInterval: Double.infinity)
request.addValue("{YOUR API KEY}", forHTTPHeaderField: "apikey")
request.addValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type")
request.httpMethod = "POST"
request.httpBody = postData
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
return
}
print(String(data: data, encoding: .utf8)!)
}
task.resume()
Kotlin
val client = OkHttpClient()
val mediaType = "text/plain".toMediaType()
val body = MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("file","{YOUR UPLOADED FILE NAME}",
File("{YOUR UPLOADED FILE PATH}").asRequestBody("application/octet-stream".toMediaType()))
.build()
val request = Request.Builder()
.url("https://api.iapp.co.th/license-plate-recognition/file")
.post(body)
.addHeader("apikey", "{YOUR API KEY}")
.build()
val response = client.newCall(request).execute()
Java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("file","{YOUR UPLOADED FILE NAME}",
RequestBody.create(MediaType.parse("application/octet-stream"),
new File("{YOUR UPLOADED FILE PATH}")))
.build();
Request request = new Request.Builder()
.url("https://api.iapp.co.th/license-plate-recognition/file")
.method("POST", body)
.addHeader("apikey", "{YOUR API KEY}")
.build();
Response response = client.newCall(request).execute();
Dart
var headers = {
'apikey': '{YOUR API KEY}'
};
var request = http.MultipartRequest('POST', Uri.parse('https://api.iapp.co.th/license-plate-recognition/file'));
request.files.add(await http.MultipartFile.fromPath('file', '{YOUR UPLOADED FILE PATH}'));
request.headers.addAll(headers);
http.StreamedResponse response = await request.send();
if (response.statusCode == 200) {
print(await response.stream.bytesToString());
}
else {
print(response.reasonPhrase);
}
Accuracy and Performance
Version 1.2 (2022-01-16)
Model Evaluation based on iApp-Vechicle image data (100 images)
Exact Match Accuracy
Model | Accuracy (%) |
---|---|
Vehicle Detection Model | 99.00% |
Vehicle License-plate Detection Model | 99.00% |
License-plate Character + Number Recognition Model | 97.00% |
License-plate Province Model | 99.00% |
Vehicle Brand | 95.00% |
Vehicle Color | 85.00% |
Vehicle Car Model | 72.00% |
Overall Accuracy | 92.28% |
Version 1.1 (2021-12-23)
Model Evaluation based on iApp-vehicle image data (118 images)
Exact Match Accuracy
Model | Accuracy (%) |
---|---|
Vehicle Detection Model | 96.40% |
Vehicle License-plate Detection Model | 95.65% |
License-plate Character + Number Recognition Model | 94.82% |
License-plate Province Model | 90.67% |
Vehicle Brand | 81.30% |
Vehicle Color | 80.50% |
Vehicle Car Model | 66.10% |
Overall Accuracy | 86.49% |
History/Change Logs
Version 1.0 - 2021-09-12
Added
-
First initial version, introducing iApp's license plate OCR.
-
This version also showcases the recognition of vehicle features:
- Vehicle type.
- Vehicle brand.
- Vehicle color.
- Province that the license plate is registered.
Accuracy of these parameters will be improved and released officially in the upcoming version.
Version 1.1 - 2021-12-23
Improved
Accuracy of the following parameters of the API system is improved
- License plate number
- Province
- Vehicle type
- Vehicle Color
- Vehicle Brand
- Vehicle model
Version 1.2 - 2023-01-16
Improved overall accuracy
- License plate number
- Province
- Vehicle color
- Vehicle brand
- Vehicle model
Version 2.0 - 2023-02-16
Add new Features
New features were added as follows:
- Vehicle body type
- Vehicle year ranges
- Vehicle orientation in a image
- Is Vehicle Flag
- Is Missing Plate Flag
Pricing
AI API Service Name | Endpoint | IC Per Request | On-Premise |
---|---|---|---|
Thai Vehicle License Plate Image Recognition (LPR) | iapp_license_plate_recognition_v1_base64 | 0.75 IC/Request | Contact |
iapp_license_plate_recognition_v1_file | 0.75 IC/Request |