关于Azure手写识别API无置信度返回值及结果准确性的问询
Hey there! Let's break down your questions about the Azure Computer Vision handwritten recognition API clearly:
1. Does the API support returning confidence values?
Great question! By default, the standard response from the handwritten recognition (Read API) doesn't include confidence scores in the JSON output—this lines up with the response structure you shared:
"status": "Succeeded","succeeded": true,"failed": false,"finished": true,"recognitionResult": {"lines": [{"boundingBox": [ .....]}]
But there's a straightforward fix: if you use Read API version 3.1-preview.3 or later, add the includeConfidence=true parameter to your API request. Once enabled, each word object inside the lines array of the recognitionResult will include a confidence field with a value between 0 and 1 (1 representing the highest confidence level).
Here's a snippet of what the modified response would look like:
"recognitionResult": { "lines": [ { "boundingBox": [10, 20, 60, 20, 60, 40, 10, 40], "text": "Hello World", "words": [ { "boundingBox": [10, 20, 35, 20, 35, 40, 10, 40], "text": "Hello", "confidence": 0.97 }, { "boundingBox": [40, 20, 60, 20, 60, 40, 40, 40], "text": "World", "confidence": 0.95 } ] } ] }
2. Quick tips to boost recognition accuracy
Since you mentioned some results are inaccurate, here are a few practical tweaks to try:
- Prioritize image quality: Make sure your handwritten images are well-lit, sharp, and free of blurriness or shadows that obscure text.
- Structure content clearly: Keep lines of handwriting spaced out, avoid overlapping characters, and write as neatly as possible.
- Specify the language: Use the
languageparameter in your request (e.g.,language=enfor English) to help the model focus on the correct character set. - Split complex content: If you're scanning a long document or dense handwriting, split the image into smaller sections before sending it to the API—this helps the model process each segment more precisely.
内容的提问来源于stack exchange,提问作者user1411636

