Skip to main content

Using the Android Document Scanner SDK's cleanup UI screen

Overview​

The Scanbot SDK includes a Cleanup Screen to draw over objects and document marks and then remove them from the document. This is particularly useful when users want to remove document artifacts precisely.

Example configuration of the Cleanup UI​

Using Cleanup UI
loading...

Cleanup engine configuration options​

Configure the cleanup behavior of the underlying engine through DocumentCleanupConfiguration. In the Ready-to-Use UI, pass it as screens.cleanup.engineConfiguration.

PropertyTypeDefaultDescription
keepTextBooleantrueIf true, the SDK keeps detected text intact while the user erases around it. Text detection runs once up front and can take a moment, so construct the cleanup pipeline asynchronously to keep the UI responsive.
maxUndoRedoStackSizeInt10How many undo and redo steps the SDK keeps in memory. Use at least 1 so that reset can always restore the original image. When the limit is reached, the SDK merges the two oldest steps into one. The user can still return to the original image, but with fewer steps in between.
maxCleanupResolutionInt0Caps the brushed area the SDK processes in one cleanup step, as width × height in pixels. Larger areas are processed at a lower resolution and scaled back up, which saves memory but can soften the edges near the stroke. 0 means no limit. For example, 1200000 keeps peak memory at about 0.5 GB for a 12 MP image. Prefer cleaning smaller areas over relying on this limit.

Want to scan longer than one minute?

Generate a free trial license to test the Scanbot SDK thoroughly.

Get free trial license