Declarationproperty SendImageWidth: Integer;
Specifies the size (in pixels) that the image should be sent to the server.
Specifying a value for this property will provide faster processing of images (you must also specify SendImageHeight
If the value of SendImageWidth or SendImageHeight
) is 0, the image will be sent full size.
If a valid size is specified and the image is larger than this, it will be reduced to the specified size (with an optional resampling filter
Google API Recommendations
To enable accurate image detection within the Vision API, images should generally be a minimum of 640 x 480 pixels (about 300k pixels). Full details for different types of Vision API Feature requests are shown below:
|Vision API Feature ||Recommended Size ||Notes |
|iegrFaceDetection ||1600 x 1200 ||Distance between eyes is most important |
|iegrLandmarkDetection ||640 x 480 || |
|iegrLogoDetection ||640 x 480 || |
|iegrLabelDetection ||640 x 480 || |
|iegrTextDetection/iegrDocumentTextDetection ||1024 x 768 ||OCR requires more resolution to detect characters |
|iegrSafeSearchDetection ||640 x 480 || |
Vision API requires images to be a sufficient size so that important features within the request can be easily distinguished. Sizes smaller or larger than these recommended sizes may work. However, smaller sizes may result in lower accuracy, while larger sizes may increase processing time and bandwidth usage without providing comparable benefits in accuracy. Image size should not exceed 75M pixels (length x width) for OCR analysis.
These recommended sizes differ based on the feature being detected. For example, iegrFaceDetection requests generally requires larger image sizes because the features being detected (faces) are smaller than the image itself. iegrLabelDetection requests, on the other hand, generally evaluate an entire image.
In practice, a standard size of 640 x 480 pixels works well in most cases; sizes larger than this may not gain much in accuracy, while greatly diminishing throughput. When at all possible, enable scaling
to reduce image sending size to these minimum standards.
More Information: cloud.google.com/vision/docs/supported-files
Example// Send images at the recommended size
fGoogleVision.SendImageWidth := 640;
fGoogleVision.SendImageHeight := 480;