能否向MS手写识别API传入图像特定坐标以识别指定区域手写内容
Great question! Let's break this down clearly:
Yes, you absolutely can target specific regions of an image for handwritten text recognition using Microsoft's handwritten recognition APIs—specifically the Azure Computer Vision Read API, which is the primary service for this task.
Here are your two main options:
Use the
regionsparameter (API v3.2 and newer)
The latest versions of the Read API support aregionsfield in your request body. This lets you define bounding boxes for the exact areas you want to process, instead of scanning the entire image. Each region is specified as a JSON object with relative values (ranging from 0 to 1, based on the image's overall dimensions) forleft,top,width, andheight. For example, to target a region starting at 10% of the image's width and height, covering 40% of the width and 30% of the height, your region object would look like:{ "left": 0.1, "top": 0.1, "width": 0.4, "height": 0.3 }You can even specify multiple regions in a single request if you need to process several distinct areas at once.
Pre-crop the image (compatible with all API versions)
If you're working with an older API version that doesn't support theregionsparameter, pre-processing your image is a reliable workaround. Simply crop the image to the specific area you want to analyze, then pass the cropped version to the API. This method works just as well and is compatible with every release of the API.
A quick note to keep in mind: When using the regions parameter, make sure your bounding boxes are accurately defined—misaligned or overly small boxes might cause the API to miss part of the handwritten text.
内容的提问来源于stack exchange,提问作者Abhinav Mohan

