Sometimes you want to know if an image is valid before using the receipt analysis. This process allows some filtering before analyzing receipts and its quick answer can be useful for example to interact with the end-user who sent the receipt to be analyzed.
Using this tool before the receipt analysis also help you to be automatically compliant with our best practices about receipt picture guide here.
What does this route do?
This feature receives an image as an input, and responds with a quality analysis of the image. This analysis tells you if this image is good enough to pass through our receipt analysis process.
Various properties of an image are checked that could potentially lead to bad analysis results:
- Is this a receipt?
- Is the image resolution good enough for the text to be read?
- Are the sharpness, the brightness and the contrast correct?
And the route answers with a set of data that are similar to classic receipt analysis routes.
How to send an image for Quality checking?
-
We will send this image as a good example:
-
You need to make a POST request to the following URL
https://api.kweeri.io/documents/check
with the image you want to test asbody
http -f POST https://api.kweeri.io/documents/check?name={document_identifier_created_by_you} \ @./image.jpg
You should get an answer like this one if your image is ok:
HTTP/1.1 200 OK { "uid": "16852419-7ad2-4985-bd7c-80c2103215c0", "name": "{document_identifier_created_by_you}", "status": "EXPLOITABLE", "processReport": "NO_ERROR", "imageQuality": { "blurness": 106, "contrast": 29, "goodSize": true, "luminosity": 172 } }
Some sample responses
Good image size, but not a receipt!
Source image
Response:
{
"uid": "68a77ee6-813d-4221-b664-9c18a163355c",
"name": "chicken-test",
"status": "NOT_EXPLOITABLE",
"processReport": "NOT_RECEIPT",
"imageQuality": null
}
Receipt but the resolution is insufficient
Source image
Response:
{
"uid": "58649e0a-424d-4d3d-b0c8-511d3ba2bbb8",
"name": "test-doc-2",
"status": "NOT_EXPLOITABLE",
"processReport": "BAD_QUALITY_IMAGE",
"imageQuality": {
"blurness": 962,
"contrast": 69,
"goodSize": false,
"luminosity": 177
}
}
Comments
0 comments
Please sign in to leave a comment.