Skip to main content

Configuration

See the table below for advanced options in using Plate Recognizer Blur, such as:

  • Using the Snapshot SDK instead of CloudAPI
  • Setting a blur intensity
  • Using a custom LOGO as an overlay overy the blurred plates
  • Blurring human faces
  • Specifying a threshold so that inaccurate detections are ignored
  • Running the blur script as a server exposing a REST API
note

All the parameters below are required unless specified as optional.

Blur Container Parameters#

-e KEY=pass#

Specify the container password

Format: -e KEY=passcode Example: -e KEY=password123

-v (optional if running as a server)#

Specify the directory containing the images. Format: -v path-to-images-folder:/images Example: -v /home/brian/VehicleLicensePlates:/images

-e SERVER=1 (optional)#

Run the Script as a REST API server that only gives back the unskewed bounding box. The API endpoint is accessible at http://localhost:8001/ and the allowed request method is POST. The request format requires sending a file and any of these optional params:

  • detection_rule_strict: Only consider plates that have a vehicle bb detected
  • regions (multiple) : Regions to format plates in.
  • region_strict: Only consider plates that match regions format
  • skip_regexp (multiple): Skip plates that match these regexes.
  • threshold_d: Skip any detection whose confidence is lower.

Specifying any of these params overrides any set as an env var in the run command. The response is in JSON format. Check for error key existence in responses to verify success of the request.

-e BLUR= (optional)#

Control the blur intensity applied. Default is 4.

  • Min Blur -e BLUR=10
  • Max Blur -e BLUR=1

-e LOGO= (optional)#

Use an image to cover the plate area instead of blurring. Examples:

  • Default logo(Platerecognizer): -e LOGO=
  • Custom logo:
    1. Share your logos directory by adding this option to the run command: -v /tmp/logos:/logos
    2. Any file named logo.png in your logos directory will act as the default
    3. If there is no default you should specify a different file like so -e LOGO=’/logos/logo2.png’

-e FACES= (optional)#

Used with -e BLUR. Also blur faces in the images.

-e REGIONS= (optional)#

Specify the regions used in detection. Format: -e REGIONS=<region1,region2,region3>

Example: -e REGIONS=gb Example: -e REGIONS=in,us

-e REGION_STRICT= (optional)#

Used with -e REGIONS. Blur only plates that match the region's format. Format: -e REGION_STRICT=

-e DETECTION_STRICT= (optional)#

Blur only plates that have a vehicle bounding box. Format: -e DETECTION_STRICT=

-e SHAPE= (optional)#

Used with -e FACES. Specify the shape used for blurring. Format: -e SHAPE=<shape> Shape can be any of the below options

  1. ellipse (default)
  2. circle
  3. square

Example: -e SHAPE=circle

-e SDK_URL= (optional)#

Use Snapshot SDK rather than CloudAPI (default).

Format: -e SDK_URL=’<protocol>://<host>:<port>’ Example: -e SDK_URL='http://localhost:8080'

Full Example:

docker run -it -e KEY=password123 -v /home/brian/images:/images -e TOKEN=MY_TOKEN -e SDK_URL='http://localhost:8080' platerecognizer/skew-correction

-e TOKEN= (optional if using Snapshot SDK)#

Provide the Cloud API Token

Format: -e TOKEN=########### Example: -e TOKEN=22333f3e33r3##################

Full Example:

docker run -it -e KEY=password123 -v /home/brian/images:/images -e TOKEN=MY_TOKEN -e BLUR=10 platerecognizer/skew-correction

-e PLATE_DETECTION_THRESHOLD=t (optional)#

Specify a threshold for plate confidence to be included in the results. Format -e PLATE_DETECTION_THRESHOLD=<t>

The value t should be between 0.1 and 1 Example -e PLATE_DETECTION_THRESHOLD=0.7

-e FACE_DETECTION_THRESHOLD=t (optional)#

Specify a threshold for face confidence to be included in the results. Format -e FACE_DETECTION_THRESHOLD=<t>

The value t should be between 0.1 and 1 Example -e FACE_DETECTION_THRESHOLD=0.7

Command Examples#

  1. Providing a different Snapshot SDK URL:
docker run -it -e KEY=password123 -v /home/brian/images:/images -e TOKEN=MY_TOKEN -e SDK_URL='http://localhost:8080' platerecognizer/skew-correction

  1. Example of providing blur intensity of 7:
docker run -it -e KEY=password123 -v /home/brian/images:/images -e TOKEN=MY_TOKEN -e BLUR=7 platerecognizer/skew-correction
  1. Example of running as a server and uploading images using the REST API. Note: that this only gives back the unskewed bounding box(s) and so you’ll need to perform blurring externally.
docker run -it -p 3000:8001 -e KEY=password123 -e SERVER=1 platerecognizer/skew-correction
  1. Example of using CURL to send an image to blur for the skew-corrected bounding box.

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

Sample Response from 4 above:


{"results":[{"polygon":[[203.859375,81.90625],[344.734375,78.84375],[359.28125,146.984375],[205.390625,161.53125]],"result":{"box":{"xmax":354,"xmin":191,"ymax":152,"ymin":70},"candidates":[{"plate":"0x83j3","score":0.907},{"plate":"ox83j3","score":0.905},{"plate":"0xb3j3","score":0.762},{"plate":"oxb3j3","score":0.76}],"dscore":0.99,"plate":"0x83j3","region":{"code":"us-tn","score":0.871},"score":0.907,"vehicle":{"box":{"xmax":1014,"xmin":117,"ymax":577,"ymin":31},"score":0.292,"type":"Sedan"}}}]}