Rectifies a curved, folded, or perspective-distorted document Image with the UVDoc grid network, which regresses a 2D unwarping grid in a single forward pass, then remaps the original frame through it and emits the flattened Image for OCR.
Typical backends
Flatten a phone-captured page before OCR: a file source feeds the image, this component regresses the unwarping grid and remaps the page, and a recognizer reads the cleaned text out as JSON.
Rectify documents from a live HTTP feed and publish the flattened image for visual inspection instead of OCR.
Caveats
- LatencyA single fully-convolutional forward pass plus one bilinear remap runs per frame, so it is far lighter than the diffusion rectifiers; a GPU under
device keeps live throughput high and CPU execution stays usable. - I/O contractThe predicted grid is upsampled to the source resolution and the original frame is remapped through it, so the output is a same-size, same-color-space rectified
Image. - I/O contractAn image smaller than two pixels on a side is returned unchanged; every input always yields exactly one output
Image. - AccuracyThe grid is regressed at a fixed working resolution and upsampled, so very high input resolutions do not recover finer detail; hands, torn edges, and non-document inputs remain common failure cases.
- LimitationThis is a dewarping-only restorer with no deshadow, deblur, or binarize modes; pair it with a dedicated cleanup stage if illumination correction is also required.