Skip to main content

Plate Recognizer Blur

Plate Recognizer Blur lets you blur partial, dented, upside-down and other types of vehicle license plates and faces. See examples of Blur in action.

caution

Before running Blur, make sure:

  1. You have signed the ParkPow Technical Evaluation Agreement.
  2. You have a decryption key. Passed as an env variable to the container. -e KEY=password

Contact us if you have any questions regarding above requirements.

Install#

Plate Recognizer Blur is packaged as a Docker container that you can pull from the docker hub registry by running this command:

docker pull platerecognizer/skew-correction

If your hardware doesn't support AVX instructions, use platerecognizer/skew-correction:no-avx

Upgrade#

To update to a newer version of the container, just run:

docker container stop skew-correctiondocker pull platerecognizer/skew-correction:latest

Run#

Blur container provides different modes of usage:

  1. CLI - As a Command Line Application processing a folder of images
  2. API - As a Server exposing a REST API.
note

CLI is the default run mode, To use API run mode, Include -e SERVER=1 option in the run command.

CLI Mode#

With the images in a directory such as /home/brian/VehicleLicensePlates, run this command from a terminal:

docker run \    -it \    -e KEY=password123 \    -v  /home/brian/VehicleLicensePlates:/images \    -e TOKEN=MY_TOKEN \    platerecognizer/skew-correction
note
  • Replace MY_TOKEN in the command above with your Snapshot Cloud API token.
  • Replace password123 with the decryption key shared seprately.

The container sends images to the Snapshot API and use the detected plate bounding boxes to perform blurring.
After processing, you will see new files in the same images folder with blur- prepended to the original file names.
To specify a different output directory, use the --output param

To use the OnPremise Snapshot SDK, replace -e TOKEN=MY_TOKEN with -e SDK_URL='URL' where URL is url to Snapshot SDK such as http://localhost:8080.

tip

For http://localhost:8080 to work, switch to host networking on blur container by adding --net=host to the run command.

API Mode#

The server exposes a single API endpoint at the root of the server (e.g http://localhost:8001/)
The allowed request method is POST. Any errors in processing will return a status code of 400
The server listens on port 8001, map it to a different or same port on the host by adding -p 3000:8001

docker run \    -it \    -p 3000:8001 \    -e KEY=password123 \    -e SERVER=1 \    -e TOKEN=MY_TOKEN \    -e BLUR=1    platerecognizer/skew-correction

Upload an image to blur.

curl -F '[email protected]/tmp/car.jpg' -o /tmp/car-blur.jpg http://localhost:3000/

The API response is a binary output of the blurred image.
To skip blurring and get back a JSON of the skew corrected bounding boxes, Exclude -e BLUR=1 in the run command and exclude blur from the API params.

{  "faces": [    {      "box": {        "xmax": 326,        "xmin": 300,        "ymax": 137,        "ymin": 100      },      "score": 0.7088521122932434    }  ],  "results": [    {      "polygon": [        [          157.375,          494.484375        ],        [          272.546875,          544.453125        ],        [          268.890625,          581.625        ],        [          153.109375,          531.65625        ]      ],      "result": {}    }  ]}
AttributeDescription
faces/boxFace detection bounding box
faces/scoreFace detection confidence level
results/polygonUnskewed plate detection Polygon
results/resultOriginal plate detection result from Snapshot
note

Face bounding boxes won't be included in the JSON by default. Use any of these 2 options to include faces:

  1. Include the env variable -e FACES=1 when running the container
  2. Include the param faces=true when making an API call