image #
The image
is of course the most essential request parameter for the Blicker
reading endpoint, and is the only parameter that is required, besides the
subscription key.
Best practices #
An image is expected to contain a single meter. Blicker is trained to read out meters in any kind of condition. However, optimal readout performance can be achieved by making sure that the image is not zoomed in or out too much, making sure that the image shows a frontal view of the meter, and by controlling the lighting conditions to prevent low contrast or flash. It should not matter how the meter is rotated with respect to the image plane of the camera. Blicker should be able to read out the meter in all 360 degrees.
Requirements #
An image should be at least 320 pixels on each side.
Smaller images will result in a 400 (bad request) status code.
An image may be at most 20MB (compressed) or 0.5GB (uncompressed) in terms
of file size.
Larger images will result in a 413 (payload too large) status code.
Furthermore, there is a soft limit of 2,000 pixels on any side.
If an image is larger than 2,000 pixels on any side, Blicker will scale it down
to improve processing speed.
More information on reducing the image size, both in terms of pixels and
file size, can be found in the
image resizing and compression tutorial.
Supported image file formats #
Blicker supports many of the most common image encoding formats. It is not required to send the correct MIME type in the request. Blicker will infer the image file format from the image data itself.
File format | MIME type |
---|---|
JPEG Image | image/jpeg |
JPEG 2000 Image | image/jp2 |
Portable Network Graphics (PNG) | image/png |
Bitmap Image File (BMP) | image/bmp |
Tagged Image File Format (TIFF) | image/tiff |
WebP Image | image/webp |
Example requests #
The image and any other request parameters, except for the
subscription key,
are sent using multipart/form-data
.
curl -X 'POST' \
'https://api.blicker.ai/blicker/2020-10-01' \
-H 'subscription-key: <your subscription key>' \
-F 'image=@test_image.jpg'
from pathlib import Path
from pprint import pprint
import requests
response = requests.post(
"https://api.blicker.ai/blicker/2020-10-01",
headers={"subscription-key": "<your subscription key>"},
files={"image": ("test_image.jpg", Path("test_image.jpg").read_bytes())},
)
pprint(response.json())