Axis-Aligned Distortion (AAD) in Dewarping
- Axis-Aligned Distortion (AAD) is a metric that measures how well dewarped documents realign textual and graphical features along fixed horizontal and vertical axes.
- It employs dense optical flow and Sobel gradient weighting to enforce row-wise and column-wise consistency, specifically capturing residual non-straightness.
- AAD demonstrates high correlation with human assessments of straightness and remains robust under illumination and geometric perturbations, as shown in benchmark comparisons.
Searching arXiv for the specified papers and closely related work on Axis-Aligned Distortion. Axis-Aligned Distortion (AAD) denotes, in document dewarping, a metric for quantifying how closely distorted textual and graphical feature lines have been restored to the horizontal and vertical axes of the image grid. In "Axis-Aligned Document Dewarping" (Wang et al., 20 Jul 2025), AAD is defined from dense optical flow between a ground-truth image and a dewarped image, with row-wise and column-wise flow consistency weighted by Sobel edge strength. In a broader raster-scanned setting, the same acronym also appears in connection with axis-aligned, scan-line distortions whose dominant degrees of freedom are per-line shifts, as summarized in "Joint denoising and line distortion correction for raster-scanned image series" (Berkels et al., 2024). The common theme is that distortion is characterized relative to privileged image axes rather than by unrestricted nonparametric warp error.
1. Conceptual basis
AAD is motivated by the observation that a well-dewarped document should have its textual and graphical feature lines aligned as closely as possible to the horizontal and vertical image axes. This reflects the axis-aligned nature of the discrete grid geometry in planar documents. Within that setting, the metric is intended to have direct geometric meaning in terms of row-wise and column-wise flow alignment, to be weighted by edge strength so that meaningful features dominate the score, to correlate with human judgments of straightness, and to remain robust under mild illumination or geometric perturbations (Wang et al., 20 Jul 2025).
A central distinction from earlier evaluation criteria is explicit in the formulation. Existing metrics such as MS-SSIM, Local Distortion (LD), and Aligned Distortion (AD) quantify global similarity or point-wise misalignment, but do not directly measure the axial alignment of content lines, nor do they weight errors by perceptually salient edges. AAD therefore targets a more specific failure mode: residual non-straightness of content after dewarping. A common misconception is to treat AAD as merely another image-similarity index; the underlying construction instead evaluates whether the recovered geometry is axis-consistent along rows and columns.
2. Mathematical definition
Let the ground-truth image be and the dewarped image be . A dense optical-flow field from to is first obtained via SIFT-flow, yielding horizontal and vertical components and . The Sobel directional gradients of are then computed and normalized as follows (Wang et al., 20 Jul 2025):
For each row and column , the gradient-weighted mean flow is defined by
0
The per-pixel row and column deviations are then
1
These are combined into a single per-pixel distortion,
2
and the final metric is the image-wide average over all 3 pixels:
4
The metric is therefore a nonnegative scalar, with lower values indicating better dewarping.
3. Geometric interpretation
The geometric justification follows directly from the properties of an ideal dewarping map. On each horizontal scanline, the vertical flow component 5 should be constant, because the line should move straight up or down rather than bend internally. Likewise, on each column, the horizontal flow component 6 should be constant. Row-wise constant 7 implies zero deviation from a row mean, and column-wise constant 8 implies zero deviation from a column mean (Wang et al., 20 Jul 2025).
Edge weighting by the normalized Sobel magnitudes 9 and 0 modifies this purely geometric notion by emphasizing high-contrast text strokes and graphical boundaries. As a result, errors on strong edges contribute more heavily than errors in smooth or empty regions. This is the mechanism by which the metric is said to align with human visual perception of straightness. The term 1 in the denominators avoids division by zero in empty or smooth regions.
This construction also clarifies what AAD is not measuring. It is not a raw magnitude of optical flow, nor an unrestricted warp discrepancy. Uniform row-wise or column-wise motion can be compatible with low AAD so long as axial consistency is preserved. The metric therefore prioritizes intra-row and intra-column coherence over global displacement magnitude.
4. Computation and implementation
The practical computation of AAD follows a fixed sequence. Given 2 and 3, one computes dense optical flow using SIFT-flow, computes Sobel derivatives 4 and 5, normalizes these to obtain 6 and 7, evaluates the row-wise means 8, evaluates the column-wise means 9, computes 0 and 1, combines them into 2, and finally averages to obtain 3 (Wang et al., 20 Jul 2025).
Several implementation details are specified. The Sobel operator uses standard 4 kernels for horizontal and vertical gradients. Gradient normalization divides by the global maximum absolute gradient in each channel. The parameter 5 is set to a small constant, for example 6, to avoid division by zero. The SIFT-flow configuration uses the default parameterization from Liu et al. (2010). No additional thresholds are required.
Because the output is a scalar defined by a deterministic sequence of flow estimation, gradient weighting, and averaging, AAD is suitable both for numerical benchmark comparison and for spatial visualization through per-pixel heatmaps. In the latter use, the map 7 localizes where axis misalignment persists after dewarping.
5. Perceptual properties and benchmark behavior
The paper reports that AAD shows the highest linear correlation 8 with known ground-truth distortions under purely geometric warping, and the lowest normalized standard deviation under added color and shadow perturbations, with 9 versus 0 for AD. These results are presented as evidence that AAD has improved stability to illumination changes while retaining geometric sensitivity (Wang et al., 20 Jul 2025).
In quantitative comparisons, the method in which AAD is introduced achieves the lowest AAD on three standard datasets. The reported benchmark values are as follows:
| Dataset | Previous best AAD 1 Ours | Relative reduction |
|---|---|---|
| DocUNet (25 OCR images) | 2 | 3 |
| DIR300 (90 images) | 4 | 5 |
| UVDoc (20 images) | 6 | 7 |
The qualitative interpretation is consistent with the scalar values. Overlaying AAD heatmaps on dewarped results shows visibly fainter error bands along text and table lines for the stronger method. This indicates reduced residual curvature or waviness along the very structures that dominate perceived document quality. A plausible implication is that AAD is especially informative when failure cases are concentrated on line structure rather than on diffuse appearance changes.
6. Relation to broader axis-aligned distortion models
In raster-scanned imaging, axis-aligned distortion is formulated differently but rests on the same structural premise: distortions are constrained by the scan geometry rather than being arbitrary two-dimensional warps. In "Joint denoising and line distortion correction for raster-scanned image series" (Berkels et al., 2024), each of 8 frames 9 is modeled as a noisy sampling of an underlying continuous image 0 on a Cartesian grid
1
Each scan-line 2 in frame 3 has a constant 4D offset 5 identical for all 6 in that line, written as
7
The associated inverse problem jointly estimates the denoised image 8, per-frame rigid transforms 9, and the scan-line shifts 0. The data fidelity term is Poisson-type,
1
up to an additive constant, and the shift field is regularized by a Brownian-motion-like quadratic term 2 together with a Tikhonov-type penalty 3 on shift magnitudes. The image 4 is parameterized by tensor-product cubic B-splines, and the optimization is solved by an alternating or staged minimization consisting of initialization, rigid alignment, shift estimation, image update, and iteration to convergence.
The paper explicitly states that the same ideas carry over to generic Axis-Aligned Distortion contexts in any raster-scanned imaging system in which the fast scan direction exhibits constant per-line shifts, the slow direction exhibits independent shifts per line, the noise model is Poisson or Gaussian, and the regularization encodes the relevant physics such as Brownian motion, mechanical hysteresis, or electrical drift. Concretely, one introduces per-line 5D offsets 6, chooses a noise model 7, penalizes jumps in 8 via a 9D random-walk regularizer, and solves the same joint objective by alternating image-update and shift-update. This suggests that the document-dewarping metric AAD and raster-scan AAD models are linked by a shared emphasis on axis-constrained distortion structure, even though one is an evaluation functional and the other a forward-modeling and correction framework.