๐Ÿ‡น๐Ÿ‡ญAPI Documentation for Thai LPR

Postman Example:

https://www.getpostman.com/collections/6c040f0d4770a27b84a4

1. (On-Cloud, On-Premise) Image License Plate Recognition

  • On Cloud - one request at a time.

  • On Premise - unlimited requests.

  • API sends external requests to the LPR system.

Input Image (Sample)

Post Image

POST https://api.iapp.co.th/license-plate-recognition/file

This endpoint allows you to send a picture that consists of minimum one vehicle that OCR must be performed. The Response will be the licence plate number of the vehicle(s) on the picture.

Headers

NameTypeDescription

apikey*

string

Your API key to call this API

Request Body

NameTypeDescription

vehicle_image*

object

Picture consists of a vehicle

{
    "conf": 94.56048584,
    "infer_time(s)": 0.1770620346069336,
    "is_missing_plate": "no",
    "is_vehicle": "yes",
    "lp_number": "6เธเธœ40",
    "message": "success",
    "province": "th-10:Bangkok (เธเธฃเธธเธ‡เน€เธ—เธžเธกเธซเธฒเธ™เธ„เธฃ)",
    "status": 200,
    "vehicle_body_type": "sedan-compact",
    "vehicle_brand": "nissan",
    "vehicle_color": "white",
    "vehicle_model": "nissan_sentra",
    "vehicle_orientation": "0",
    "vehicle_year": "2015-2019"
}

This endpoint allows you to send a picture that consists of minimum one vehicle that OCR must be performed. The Response will be the licence plate number of the vehicle(s) on the picture.

ParameterTypeDescriptionRequired

apikey

string

Your API key to call this API

Required

file

string

Picture consists of a vehicle

Required

Response Explanation

ParametersExplanation

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.List of Supported Body Type

vehicle_brand

Brand of the recognized vehicle. List of Supported Vehicle Brand

vehicle_color

Color of the recognized vehicle. List of Supported Color

vehicle_model

Model of the recognized vehicle. List of Supported Vehicle Model

vehicle_orientation

Orientation of the recognized vehicle in the image. List of Supported Orientation

vehicle_year

Year range of the recognized vehicle model. List of Supported Year Ranges

Sample Response

{
    "conf": 94.56048584,
    "infer_time(s)": 0.1770620346069336,
    "is_missing_plate": "no",
    "is_vehicle": "yes",
    "lp_number": "6เธเธœ40",
    "message": "success",
    "province": "th-10:Bangkok (เธเธฃเธธเธ‡เน€เธ—เธžเธกเธซเธฒเธ™เธ„เธฃ)",
    "status": 200,
    "vehicle_body_type": "sedan-compact",
    "vehicle_brand": "nissan",
    "vehicle_color": "white",
    "vehicle_model": "nissan_sentra",
    "vehicle_orientation": "0",
    "vehicle_year": "2015-2019"
}

Sample Request

import requests

url = "https://api.iapp.co.th/license-plate-recognition/file"
path = "path/to/your/input/image"
file_name = "your input image name"

payload={}
files=[
  ('file_name',(path, 'rb'), 'image/jpeg'))
]
headers = {
  'apikey': '----Your API Key----'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)

2. (On-Premise only) Live Camera License Plate Recognition

  • On premise only.

  • LPR system post's detection to a specific URL internally.

  • External post requests to LPR system is not available in this version.

Post Detection Results

POST https://{URL}/new-detection/license-plate-number/

This endpoint allows you to save your detection according to the number of seconds you choose the results to be saved on the GUI or configuration file.

Request Body

NameTypeDescription

Output_image

object

Vehicle frame printed with detected parameters.

lp_number*

string

License plate number. (Thai letters + Numbers)

vehicle_type

string

Bus, truck, car, pickup, van, SUV...

vehicle_brand

string

Toyota, Nissan, Mazda, Mercedes-Benz...

vehicle_color

string

RGB Format. (1 sec delay added)

province*

string

License plate registered province.

date_time*

string

Vehicle detected date and time

source*

string

Camera port or a video file or live stream URL

nickname_source*

string

Front-camera, Back-camera, My-camera, My-video...

{    "lp_number": "เธกเธ‚4320",    
     "vehicle_type": "car",    
     "vehicle_brand": "toyata",    
     "vehicle_color": "unknown",    
     "province": "เธเธฃเธธเธ‡เน€เธ—เธžเธกเธซเธฒเธ™เธ„เธฃ",    
     "date_time": "2021 September 20 Monday at 16:34:34",    
     "source": "test/book.mp4 is a video file",    
     "name_source": "book"     
}

This endpoint allows you to save your detection according to the number of seconds you choose the results to be saved on the GUI or configuration file.

ParameterTypeDescriptionRquired

output_image

object

Vehicle frame printed with detected parameters.

Optional

lp_number

string

License plate number. (Thai letters + Numbers)

Rquired

vehicle_type

string

Bus, truck, car, pickup, van, SUV...

Optional

vehicle_brand

string

Toyota, Nissan, Mazda, Mercedes-Benz...

Optional

vehicle_color

string

RGB Format. (1 sec delay added)

Optional

province

string

License plate registered province.

Required

date_time

string

Vehicle detected date and time

Optional

source

string

Camera port or a video file or live stream URL

Rquired

nickname_source

string

Front-camera, Back-camera, My-camera, My-video...

Rquired

{    "lp_number": "เธกเธ‚4320",    
     "vehicle_type": "car",    
     "vehicle_brand": "toyata",    
     "vehicle_color": "unknown",    
     "province": "เธเธฃเธธเธ‡เน€เธ—เธžเธกเธซเธฒเธ™เธ„เธฃ",    
     "date_time": "2021 September 20 Monday at 16:34:34",    
     "source": "test/book.mp4 is a video file",    
     "name_source": "book"     
}

Last updated