API: Cropping with respect to car size
Detects the size of a car, and crops the image such that this car has a given size. An online tool is available for this API call.
Request
POST /process/crop-car?aspectRatio=2%3A1&cropSize=1& input=0a6677...
input | The input image ID. The image is supposed to show a car in the central part of the image (but not necessarily exactly centered) in front of a fairly neutral background. |
aspectRatio | The aspect ratio of the picture, written as a width:height (e.g. 16:10), or as width-height ratio (e.g. 1.6). |
cropSize | The crop size with respect to the car size, written as percentage (e.g. 180%), or as ratio (e.g. 1.8). |
outputFormat | The desired output format. Valid formats are PNG and JPEG. |
outputQuality | The desired JPEG compression quality, an integer between 50 and 100. The default value is 95 (high quality). Values below 85 may lead to visible compression artefacts. |
Response
200 OK
{ "car": [645.46875, 329.0625, 759.375, 459.84375], "crop": [487, 223, 1076, 672], "desiredCrop": [487.265625, 222.802734375, 1075.78125, 672.36328125], "output": "a1b002..." }
car | The detected car rectangle (x, y, width, height). |
desiredCrop | The desired crop rectangle (x, y, width, height). This rectangle may be outside of bounds of the original image. |
crop | The applied crop rectangle (x, y, width, height). |
output | The produced image. |
outputFormat |
The format of the output image:
|