Straightening documents with the .NET MAUI Document Scanner
The Document Enhancer can straighten scanned documents by removing paper deformations such as creases, curl, folds, and crinkles, and correcting perspective distortion.
It supports two straightening modes:
| Mode | Description |
|---|---|
NONE | Crops the document based on estimated perspective distortion. Very fast. |
STRAIGHTEN | Removes paper deformations in addition to perspective correction. |
Document straightening is available across multiple integration points in the Scanbot SDK, allowing flexibility depending on your workflow.
You can use it:
- As part of the Ready-to-Use (RTU) Document Scanner UI for automatic processing during capture
- On individual scanned pages for manual or selective post-processing
- Via the Document API for full programmatic control and custom pipelines
Usage in the RTU UI Document Scanner
The document straightening can be configured in the RTU UI Document Scanner.
By default, the captured document pages are automatically straightened. The result includes the straightening parameters applied to the page. When disabled, the cropped images are returned without straightening applied.
- MAUI
- .NET Android
- .NET iOS
loading...
loading...
loading...
Straightening a scanned page
A scanned page can be straightened directly for more control.
- Straighten after capture
- Re-process existing pages
- Keep original and processed versions
This allows flexible integration into custom review and editing workflows.
- MAUI
- .NET Android
- .NET iOS
loading...
loading...
loading...
Straightening an image
You can also straighten an image directly using the DocumentEnhancer API, providing full control over the enhancement process.
- MAUI
- .NET Android
- .NET iOS
loading...
loading...
loading...
Configuration options
The DocumentStraighteningParameters class provides the following options:
| Parameter | Type | Default | Description |
|---|---|---|---|
straighteningMode | DocumentStraighteningMode | STRAIGHTEN | The type of straightening to apply. |
aspectRatios | AspectRatio[] | Empty | Expected aspect ratios for the document. The closest matching ratio from the list is used. |