Azure认知服务OCR给出不同的结果-如何补救? [英] Azure Cognitive Services OCR giving differing results - how to remedy?
问题描述
Azure CS在以下位置具有OCR演示(西向中枢端点)
Azure CS has an OCR demo (westcentralus endpoint) at
https://azure.microsoft.com/en-us/services/cognitive-services/computer-vision/?v = 18.05
在不良的测试图像上(恐怕我不能发布,因为它是身份证明文件),我得到的OCR结果实际上与三个测试用例的实际文本都100%匹配-了不起.
On a poor test image (which I'm afraid I can't post because it's an identity document), I get OCR results that 100% match the actual text for three test cases in fact - remarkable.
但是,当我在下面的URL上使用Westeurope端点跟踪示例时,我得到的OCR结果更差-缺少一些文本:
However, when I follow the sample at the URL below, with the westeurope endpoint, I get poorer OCR results - some text is missing:
这是为什么?更重要的是-如何访问v = 18.05端点?
Why is this? More to the point - how do I access the v=18.05 endpoint?
感谢所有快速的帮助.
推荐答案
我想我明白了:您在提到的两个页面之间没有使用相同的操作.
I think I got your point: you are not using the same operation between the 2 pages you mention.
If you read the paragraph just above the working demo you are mentioning here it says:
开始全面使用OCR服务,并发现下面的新预览OCR引擎(通过识别"文字"API操作),具有更好的文本识别结果,英语.
Get started with the OCR service in general availability, and discover below a sneak peek of the new preview OCR engine (through "Recognize Text" API operation) with even better text recognition results for English.
And if you have a look to the other documentation you are pointing at (this one), they are using the OCR operation:
vision_base_url = "https://westcentralus.api.cognitive.microsoft.com/vision/v2.0/"
ocr_url = vision_base_url + "ocr"
因此,如果要使用此新的预览版本,请将操作更改为 recognizeText
So if you want to use this new preview version, change the operation to recognizeText
它在西欧地区可用(请参见),然后我进行了一个快速测试:Azure演示页上提供的示例正在使用此操作,而不是另一个.
It is available in West Europe region (see here), and I made a quick test: the samples provided on Azure demo page are working with this operation, and not in the other one.
但这一次该操作需要2个调用:
But this time the operation needs 2 calls:
- 一个POST操作来提交您的请求(
recognizeText
操作),在那里您将得到一个202 Accepted
答案以及一个operationId
- 一个GET操作符与上一步中的OperationId一起获得结果(
textOperations
操作).例如:https://westeurope.api.cognitive.microsoft.com/vision/v2.0/textOperations/yourOperationId
- One POST operation to submit your request (
recognizeText
operation), where you will have a202 Accepted
answer with anoperationId
- One GET opertaion to get the results (
textOperations
operation), with your OperationId from the previous step. For example:https://westeurope.api.cognitive.microsoft.com/vision/v2.0/textOperations/yourOperationId
对于来自Microsoft演示的CLOSED标志:
For the CLOSED sign from Microsoft Demos:
OCR操作的结果:
{
"language": "unk",
"orientation": "NotDetected",
"textAngle": 0.0,
"regions": []
}
带有RecognizeText的结果:
{
"status": "Succeeded",
"recognitionResult": {
"lines": [{
"boundingBox": [174, 488, 668, 675, 617, 810, 123, 622],
"text": "CLOSED",
"words": [{
"boundingBox": [164, 494, 659, 673, 621, 810, 129, 628],
"text": "CLOSED"
}]
}, {
"boundingBox": [143, 641, 601, 811, 589, 843, 132, 673],
"text": "WHEN ONE DOOR CLOSES, ANOTHER",
"words": [{
"boundingBox": [147, 646, 217, 671, 205, 698, 134, 669],
"text": "WHEN"
}, {
"boundingBox": [230, 675, 281, 694, 269, 724, 218, 703],
"text": "ONE"
}, {
"boundingBox": [291, 697, 359, 722, 348, 754, 279, 727],
"text": "DOOR"
}, {
"boundingBox": [370, 726, 479, 767, 469, 798, 359, 758],
"text": "CLOSES,"
}, {
"boundingBox": [476, 766, 598, 812, 588, 839, 466, 797],
"text": "ANOTHER"
}]
}, {
"boundingBox": [56, 668, 645, 886, 633, 919, 44, 700],
"text": "OPENS.ALL YOU HAVE TO DO IS WALK IN",
"words": [{
"boundingBox": [74, 677, 223, 731, 213, 764, 65, 707],
"text": "OPENS.ALL"
}, {
"boundingBox": [233, 735, 291, 756, 280, 789, 223, 767],
"text": "YOU"
}, {
"boundingBox": [298, 759, 377, 788, 367, 821, 288, 792],
"text": "HAVE"
}, {
"boundingBox": [387, 792, 423, 805, 413, 838, 376, 824],
"text": "TO"
}, {
"boundingBox": [431, 808, 472, 824, 461, 855, 420, 841],
"text": "DO"
}, {
"boundingBox": [479, 826, 510, 838, 499, 869, 468, 858],
"text": "IS"
}, {
"boundingBox": [518, 841, 598, 872, 587, 901, 506, 872],
"text": "WALK"
}, {
"boundingBox": [606, 875, 639, 887, 627, 916, 594, 904],
"text": "IN"
}]
}]
}
}
这篇关于Azure认知服务OCR给出不同的结果-如何补救?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!