Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Vision API - Json Query.

Please help in understanding the usage of "boundingPoly" while calling  the https://vision.googleapis.com/v1/images:annotate API.
When passing values for this boundingPoly in the request json of the API as shown below, the response returns the entire json structure and not values pertaining to the boundingPoly vertices passed. 

Request json : 
 {
"parent": "",
"requests": [
{
"image": {
"content": "my_image_Base64_value"
},
"features": [
{
"type": "TEXT_DETECTION"
}
],
"imageContext": {
"productSearchParams": {
"boundingPoly": {
"vertices": [
{
"x": 40,
"y": 35
},
{
"x": 127,
"y": 35
},
{
"x": 127,
"y": 57
},
{
"x": 49,
"y": 57
}
]
}
}
}
}
]
}

1 1 539
1 REPLY 1

Good day @KrishnaKarthik,

Based on your request, you are trying to perform a text detection from a photo, please note that some parameters are feature specific, in your example, the field productSearchParams that you are currently trying to use is only used if you want to add parameters for product search requests, since you are performing text detection request you will not be able to use this field. If you want to control the text detection requests, you can use the field TextDetectionParams, however, you won't be able to use the boundingpoly since it is a parameter from the productSearchParams and it can only be used for product search requests. You can check this link for more information: https://cloud.google.com/vision/docs/reference/rest/v1/ImageContext
If you want to know what are the parameters that can be used to control the text detection feature, you can check this link: https://cloud.google.com/vision/docs/reference/rest/v1/ImageContext#textdetectionparams

Hope this helps!