Extracting lines with coordinates
Contents
[
Hide
]
Aspose.OCR for Python via .NET returns coordinates of each extracted line in recognition results. This can be useful for highlighting detected lines when previewing an image.
The lines are returned as a list of Rectangle
objects in recognition_lines_result
property of recognition result object.
# Instantiate Aspose.OCR API
api = AsposeOcr()
# Add image to the recognition batch
input = OcrInput(InputType.SINGLE_IMAGE)
input.add("source.png")
# Detect lines
results = api.recognize_characters(source, DetectAreasMode.COMBINE)
lines = results[0].recognition_lines_result