Vehicle registry
Image input standards: The system achieves the best results in both quality and processing speed with images in HD resolution (1280x720)
1. Extract vehicle registry information with image URL input
API:
Method | URL |
---|---|
GET | https://cloud.computervision.com.vn/api/v2/ocr/vehicle_inspection |
Params:
Key | Value | Description |
---|---|---|
img | https://example.com/image.png | URL of photo |
format_type | url | Type of data to pass in, receive value: url , file , base64 |
get_thumb | true /false | Returns a aligned image |
Demo Python:
import requestsapi_key = "YOUR_API_KEY"api_secret = "YOUR_API_SECRET"image_url = 'https://example.com/image.png'response = requests.get("https://cloud.computervision.com.vn/api/v2/ocr/vehicle_inspection?img=%s&format_type=%s&get_thumb=%s"% (image_url, 'url', 'false'),auth=(api_key, api_secret))print(response.json())
2. Extract vehicle registry information with image file input
API:
Method | URL | content-type |
---|---|---|
POST | https://cloud.computervision.com.vn/api/v2/ocr/vehicle_inspection | multipart/form-data |
Params:
Key | Value | Description |
---|---|---|
format_type | file | Type of data to pass in, receive value: url , file , base64 |
get_thumb | true /false | Returns a aligned image |
Body:
Key | Type | Value | Description |
---|---|---|---|
img | file | example.jpg | Image file |
Demo Python:
import requestsapi_key = "YOUR_API_KEY"api_secret = "YOUR_API_SECRET"image_path = '/path/to/your/example.jpg'response = requests.post("https://cloud.computervision.com.vn/api/v2/ocr/vehicle_inspection?format_type=file&get_thumb=false",auth=(api_key, api_secret),files={'img': open(image_path, 'rb')})print(response.json())
3. Extract vehicle registry information with JSON input
API:
Method | URL | content-type |
---|---|---|
POST | https://cloud.computervision.com.vn/api/v2/ocr/vehicle_inspection | application/json |
Params:
Key | Value | Description |
---|---|---|
format_type | base64 | Type of data to pass in, receive value: url , file , base64 |
get_thumb | true /false | Returns a aligned image |
Body:
{"img": "iVBORw0KGgoAAAANSU..." // string base64 of the image or pdf to extract}
Demo Python:
import base64import ioimport requestsfrom PIL import Imagedef get_byte_img(img):img_byte_arr = io.BytesIO()img.save(img_byte_arr, format='PNG')encoded_img = base64.encodebytes(img_byte_arr.getvalue()).decode('ascii')return encoded_imgapi_key = "YOUR_API_KEY"api_secret = "YOUR_API_SECRET"img_name = "path_img"encode_cmt = get_byte_img(Image.open(img_name))response = requests.post("https://cloud.computervision.com.vn/api/v2/ocr/vehicle_inspection?format_type=base64&get_thumb=false",auth=(api_key, api_secret),json={'img' : encode_cmt})print(response.json())
4. Response
The response will be a JSON with the following format:
{"data": [xxxx],"errorCode": string,"errorMessage": string}
Where the data
field is a list, each element in the list corresponds to a vehicle registry (a vehicle registry can be one or more pages). Each of these elements is a JSON formatted as follows:
{"type": "picertificate","info": [xxxx]}
Vehicle registry - picertificate
chassis_number
chassis_number_confidence
commercial_use
commercial_use_confidence
design_pay_load
design_pay_load_confidence
design_towed_mass
design_towed_mass_confidence
engine_number
engine_number_confidence
inside_cargo_container_dimension
inside_cargo_container_dimension_confidence
issued_on
issued_on_confidence
issued_on_code
life_time_limit
life_time_limit_confidence
manufactured_country
manufactured_country_confidence
manufactured_year
manufactured_year_confidence
mark
mark_confidence
model_code
model_code_confidence
modification
modification_confidence
permissible_no
permissible_no_confidence
regis_date
regis_date_confidence
registration_number
registration_number_confidence
seri
seri_confidence
tire_size
tire_size_confidence
type
type_confidence
valid_until
valid_until_confidence
wheel_form
wheel_form_confidence
capacity
capacity_confidence
report_number
report_number_confidence
authorized_pay_load
authorized_pay_load_confidence
lying_place
lying_place_confidence
seat_place
seat_place_confidence
stand_place
stand_place_confidence
image
Error code table:
Code | Message |
---|---|
0 | Success |
1 | The photo does not contain content |
2 | Url is unavailable |
3 | Incorrect image format |
4 | Out of requests |
5 | Incorrect api_key or api_secret |
6 | Incorrect format type |