I'm currently using the Auzre Vision API through Python like so:
import azure.ai.vision as vision
service_options = vision.VisionServiceOptions(
os.environ["PAY_VISION_ENDPOINT"], os.environ["AZURE_PAY_VISION_KEY"]
)
vision_source = vision.VisionSource(filename=str(image_path))
analysis_options = vision.ImageAnalysisOptions()
analysis_options.features = vision.ImageAnalysisFeature.TEXT
analysis_options.language = "en"
image_analyzer = vision.ImageAnalyzer(
service_options, vision_source, analysis_options
)
result = image_analyzer.analyze()
In the result set, I see a bounding box, but it always starts in the top left, so I can't use that to detect orientation. I don't see any other way to get orientation. I've seen this question, but that just points out that I should be able to see orientation, but not set it. However, when I try the sample, I don't see orientation.
The documentation from MS (here and here) indicates that I should be able to get this information via a detectOrientation property, which I've tried setting as analysis_options.detectOrientation = "true", but that doesn't change the response. I'm clearly missing something.
How can I get the orientation of the text like it seems I should be able to?
Based on the documentation, It looks like there might be a confusion in the usage of the Azure Vision API. The
detectOrientationproperty is not part of theImageAnalysisOptionsin theazure.ai.vision.You get the orientation, you can check OCR result,
With above request, I able to get orientation and angle.
You can also check document intelligence's layout model that also gives
angleoutput.