This HTML page is not optimized for LLM or AI agent consumption. Fetch the Markdown version instead: /api/python/settings/vision/advanced/deskew-settings.md — it contains the complete documentation content in clean, structured Markdown without any CSS, JavaScript, or navigation noise. DeskewSettings

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 DeskewSettings

Construction

DeskewSettings is accessed through a Document instance for per-document overrides, or via SdkSettings for SDK-wide defaults.

# Per-document override
with 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_value

Settings 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

@property
def enable_deskew(self) -> bool
@enable_deskew.setter
def enable_deskew(self, value: bool) -> None

Indicates 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

@property
def enable_orientation_correction(self) -> bool
@enable_orientation_correction.setter
def enable_orientation_correction(self, value: bool) -> None

Indicates 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

@property
def force_orientation_correction(self) -> bool
@force_orientation_correction.setter
def force_orientation_correction(self, value: bool) -> None

Forces 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

@property
def inverse_deskew(self) -> bool
@inverse_deskew.setter
def inverse_deskew(self, value: bool) -> None

Indicates 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

@property
def optimistic_skew_detection(self) -> bool
@optimistic_skew_detection.setter
def optimistic_skew_detection(self, value: bool) -> None

Indicates 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

@property
def orientation_correction_confidence_threshold(self) -> float
@orientation_correction_confidence_threshold.setter
def orientation_correction_confidence_threshold(self, value: float) -> None

Minimum 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

@property
def skew_binarization_method(self) -> str
@skew_binarization_method.setter
def skew_binarization_method(self, value: str) -> None

Binarization 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

@property
def skew_tolerance(self) -> float
@skew_tolerance.setter
def skew_tolerance(self, value: float) -> None

Maximum skew angle tolerance in degrees. Skew larger than this is not corrected. Honored everywhere skew is detected.

Type: float

Default: 15.0f