|
Scanbot SDK
|
API for document cleanup. More...
Public Member Functions | |
| None | __init__ (self, *, ImageRef image, Optional[DocumentCleanupConfiguration] configuration=None) |
| Initializes the document cleanup. | |
| DocumentCleanupResult | run (self, *, ImageRef mask) |
| cleans the masked areas up. | |
| ImageRef | undo (self) |
| Reverts the last cleanup operation. | |
| ImageRef | redo (self) |
| Re-applies the last undone cleanup operation. | |
| ImageRef | reset (self) |
| Restores the original image, and clears the undo/redo history. | |
| bool | can_undo (self) |
| Returns whether an undo operation is currently available. | |
| bool | can_redo (self) |
| Returns whether a redo operation is currently available. | |
API for document cleanup.
Required licence feature(s): ImageProcessing.
| None __init__ | ( | self, | |
| * | , | ||
| ImageRef | image, | ||
| Optional[DocumentCleanupConfiguration] | configuration = None ) |
Initializes the document cleanup.
When the keepText option is enabled (see DocumentCleanupConfiguration), text detection will be run, which can be time-consuming. For better user experience, consider running the document cleanup constructor asynchronously.
| image | The image to process. |
| configuration | The document cleanup configuration. |
| bool can_redo | ( | self | ) |
Returns whether a redo operation is currently available.
This is true when at least one undo operation has been performed and not yet overwritten by a new cleanup.
| bool can_undo | ( | self | ) |
Returns whether an undo operation is currently available.
This is true when at least one cleanup operation has been performed and not yet fully undone.
| ImageRef redo | ( | self | ) |
Re-applies the last undone cleanup operation.
If no operations are available to redo, returns the current image unchanged. Performing a new cleanup operation after undo will clear the redo history.
| ImageRef reset | ( | self | ) |
Restores the original image, and clears the undo/redo history.
After reset, both canUndo and canRedo return false.
| DocumentCleanupResult run | ( | self, | |
| * | , | ||
| ImageRef | mask ) |
cleans the masked areas up.
| mask | Specifies the regions to clean up. Non-zero pixels indicate the region to be cleaned up. |
| ImageRef undo | ( | self | ) |
Reverts the last cleanup operation.
If no operations are available to undo, returns the current image unchanged. The number of available undo operations is limited by maxUndoRedoStackSize. When the operation limit is exceeded, the oldest operations cannot be undone.