Browse our Products

Aspose.OCR for Java 26.9.0 - Release Notes

What was changed

KeySummaryCategory
OCRJAVA‑476Improved region detection and expanded the number of detectable region types by updating the document structure detection model from aspose-ocr-document-structure-detection-v1.ocr to aspose-ocr-document-structure-detection-v2.ocr.Enhancement

Public API changes and backwards compatibility

This section lists all public API changes introduced in Aspose.OCR for Java 26.9.0 that may affect the code of existing applications.

Added public APIs:

No changes.

Updated public APIs:

The following public APIs have been updated in this release:

com.aspose.ocr.models.DetectAreasMode.MULTICOLUMN - updated behavior

The MULTICOLUMN region detection mode now uses the updated aspose-ocr-document-structure-detection-v2.ocr model. The updated model improves region detection and supports a wider set of content region types.

com.aspose.ocr.AsposeOCR.DetectDocumentLayout - updated behavior

Document layout detection now uses the updated document structure detection model. The public method signature remains unchanged.

com.aspose.ocr.AsposeOCR.DetectRectangles - updated behavior

Text area, paragraph, and line detection now use the updated document structure detection model where automatic region detection is needed. The public method signatures remain unchanged.

Removed public APIs:

No changes.

Examples

The code sample below illustrates the changes introduced in this release:

Use the updated Multicolumn region detection mode

import com.aspose.ocr.AsposeOCR;
import com.aspose.ocr.InputType;
import com.aspose.ocr.OcrInput;
import com.aspose.ocr.RecognitionResult;
import com.aspose.ocr.RecognitionSettings;
import com.aspose.ocr.models.DetectAreasMode;

import java.util.ArrayList;

public class MulticolumnRegionDetectionExample {
    public static void main(String[] args) throws Exception {
        RecognitionSettings settings = new RecognitionSettings();
        settings.setDetectAreasMode(DetectAreasMode.MULTICOLUMN);

        OcrInput input = new OcrInput(InputType.SingleImage);
        input.add("document.png");

        try (AsposeOCR api = new AsposeOCR()) {
            ArrayList<RecognitionResult> results = api.Recognize(input, settings);
            RecognitionResult result = results.get(0);

            System.out.println("--- full text ---");
            System.out.println(result.recognitionText);

            if (result.recognitionRegionsResult != null) {
                for (RecognitionResult.RegionResult region : result.recognitionRegionsResult) {
                    System.out.println("--- region ---");
                    System.out.println("Type: " + region.regionType);
                    System.out.println("Rectangle: " + region.region);
                    System.out.println("Text: " + region.textInRegion);
                }
            }
        }
    }
}