Blur API Reference
Welcome to the Plate Recognizer Blur API! Use our API to blur license plates and faces in images.
Check detailed instructions on how to install Blur SDK.
Blur forwards images to Snapshot API then uses the detected plate bounding box to perform accurate blurring.
Authentication
No authentication is required to access Blur API endpoints
Blur Endpoint
POST http://localhost:8001
POST Parameters
Parameter | Required | Description |
---|---|---|
upload | Yes | The file to be uploaded. optional if upload_url param is present. |
upload_url | No | The url of file to be uploaded. Given priority over upload param. |
regions | No | Regions forwarded to Snapshot |
skip_regexp | No | Override configuration SKIP_REGEXP. Can be specified multiple times. |
faces | No | Override configuration FACES. |
plates | No | Override configuration PLATES |
logo | No | Logo file. If sent, Logo file path is ignored. |
logo | No | Logo file path. Overrides configuration LOGO |
config | No | Extends configuration CONFIG. |
et | No | Exclude a percentage margin of image height at the top. |
el | No | Exclude a percentage margin of image width at the left. |
eb | No | Exclude a percentage margin of image height at the bottom. |
er | No | Exclude a percentage margin of image width at the right. |
xmin | No | Excluded region bounding box xmin. |
ymin | No | Excluded region bounding box ymin. |
xmax | No | Excluded region bounding box xmax. |
ymax | No | Excluded region bounding box ymax. |
split | No | Split image into horizontal chunks before blur. Use on panoramic images |
overlap | No | Overlap percentage if splitting image. Default is 20. |
camera_id | No | Override configuration CAMERA_ID. |
snapshot_filename | No | Custom file name sent to Snapshot, Default is the uploaded file name. |
Request Format
- Shell
- Python
# Process an image from a URL
curl -o /tmp/blur-car.jpg -d 'upload_url=https://app.platerecognizer.com/static/demo.jpg' -d 'faces=10' -d 'plates=10' http://localhost:8001/
# Get back unskewed bounding box in JSON format and skip burring
curl -d 'upload_url=https://app.platerecognizer.com/static/demo.jpg' http://localhost:8001/
# Download a test picture
curl -o /tmp/car.jpg https://app.platerecognizer.com/static/demo.jpg
# Upload to API for blurring
curl -F 'upload=@/tmp/car.jpg' -o /tmp/blur-car.jpg -F 'faces=10' -F 'plates=10' http://localhost:8001/
# Upload image and logo
curl -F 'upload=@/tmp/car.jpg' -F 'logo=@/tmp/logo.jpg' -o /tmp/blur-car.jpg -F 'faces=10' -F 'plates=10' http://localhost:8001/
# Curl on Windows
curl -X POST -F upload=@car.jpg -o blur-car.png http://localhost:8001/
import requests
files = {
'upload': open('/tmp/car.jpg', 'rb'),
'plates':'10',
'faces':'10',
}
response = requests.post('http://localhost:8001/', files=files)
with open('/tmp/blur-car.jpg', 'wb') as f:
f.write(response.content)
Response Formats
There are two possible response formats depending on the configuration and request params.
- Polygon points around the plates and faces in JSON. This is the default format.
- Blurred image if you include
faces
orplates
params or set a blur intensities more than 0 in configuration.
Response Schema
{
"faces": [
{
"box": {
"xmax": 326,
"xmin": 300,
"ymax": 137,
"ymin": 100
},
"score": 0.7088521122932434
}
],
"plates": [
{
"polygon": [
[
157.375,
494.484375
],
[
272.546875,
544.453125
],
[
268.890625,
581.625
],
[
153.109375,
531.65625
]
],
"result": {}
}
]
}
Attribute | Description |
---|---|
faces/box | Face detection bounding box |
faces/score | Face detection score between 0-1. 0 means low confidence and 1 is the highest confidence |
plates/polygon | Accurate plate polygon |
plates/result | Original plate detection result from Snapshot |
Error codes
Code | Meaning |
---|---|
400 | An error occurred, check response body for more info on the error. |
Error Response Schema
{"error":"Invalid Blur intensity. Both faces and plates should not be skipped entirely."}