Settings for Deskew. Values fall back through three levels: document → SDK → built-in default. Writes target the document only when set on a document’s settings, otherwise the SDK globally when set on SdkSettings.
Tags: Vision, Advanced
from nutrient_sdk import DeskewSettingsConstruction
DeskewSettings is accessed through a Document instance for per-document overrides, or via SdkSettings for SDK-wide defaults.
# Per-document overridewith Document.open("input.pdf") as doc: settings = doc.settings.deskew_settings settings.some_field = new_value # mutate fields directly
# SDK-wide default (applies to all documents)SdkSettings.deskew_settings.some_field = new_valueSettings are configured by writing to fields on the returned object. The settings property itself cannot be reassigned — doc.settings.deskew_settings = other_settings is rejected.
Properties
enable_deskew
@propertydef enable_deskew(self) -> bool
@enable_deskew.setterdef enable_deskew(self, value: bool) -> NoneIndicates whether automatic deskewing is enabled. Honored by the recognition pipelines. An explicit page-level deskew call always runs, since requesting it is already the decision this setting would gate.
Type: bool
Default: true
enable_orientation_correction
@propertydef enable_orientation_correction(self) -> bool
@enable_orientation_correction.setterdef enable_orientation_correction(self, value: bool) -> NoneIndicates whether model-based cardinal orientation correction is enabled before fine deskewing. This is independent from VisionSettings.EnableOcr. Honored by the recognition pipelines only — orientation correction is model-based and does not run on an explicit page-level deskew.
Type: bool
Default: true
force_orientation_correction
@propertydef force_orientation_correction(self) -> bool
@force_orientation_correction.setterdef force_orientation_correction(self, value: bool) -> NoneForces cardinal orientation correction to run even on born-digital pages, which are otherwise skipped because a rendered text layer implies the page is already upright. Enable this when the source may still be rotated (for example a PDF with a rotated page box) and orientation correction must run regardless. Honored by the recognition pipelines only.
Type: bool
Default: false
inverse_deskew
@propertydef inverse_deskew(self) -> bool
@inverse_deskew.setterdef inverse_deskew(self, value: bool) -> NoneIndicates whether the inverse deskew transform is enabled. When disabled, bounding boxes remain in deskewed-image coordinates. Applies to the recognition pipelines only. A page-level deskew rotates the page content itself, so there are no detected coordinates to map back.
Type: bool
Default: true
optimistic_skew_detection
@propertydef optimistic_skew_detection(self) -> bool
@optimistic_skew_detection.setterdef optimistic_skew_detection(self, value: bool) -> NoneIndicates whether skew detection runs in optimistic mode. Optimistic mode relaxes the confidence heuristics that suppress a detected angle, so a skew is reported in cases a conservative pass would discard. Enable it when the source is known to be skewed; on clean pages it increases the chance of correcting a page that wasn’t actually skewed. Honored everywhere skew is detected.
Type: bool
Default: false
orientation_correction_confidence_threshold
@propertydef orientation_correction_confidence_threshold(self) -> float
@orientation_correction_confidence_threshold.setterdef orientation_correction_confidence_threshold(self, value: float) -> NoneMinimum model confidence required before applying cardinal orientation correction. Predictions below this threshold are recorded but not applied. Honored by the recognition pipelines only.
Type: float
Default: 0.3f
skew_binarization_method
@propertydef skew_binarization_method(self) -> str
@skew_binarization_method.setterdef skew_binarization_method(self, value: str) -> NoneBinarization method for skew detection. Supported values: “default” (internal Modified Otsu), “sauvola” (better for poor contrast), “otsu” (explicit Modified Otsu). Honored everywhere skew is detected. Only “sauvola” changes behavior — “default” and “otsu” both let the detector threshold with Modified Otsu itself.
Type: str
Default: "default"
skew_tolerance
@propertydef skew_tolerance(self) -> float
@skew_tolerance.setterdef skew_tolerance(self, value: float) -> NoneMaximum skew angle tolerance in degrees. Skew larger than this is not corrected. Honored everywhere skew is detected.
Type: float
Default: 15.0f