Grooper Help - Version 25.0
25.0.0017 2,127
  • Overview
  • Help Status

Warp

IP Command Grooper.IP

Warps a quadrilateral region of an image to a rectangular output, correcting for perspective distortion and enabling extraction of skewed or angled content.

Remarks

The Warp command transforms a user-defined quadrilateral region of an image into a rectangular output, correcting for perspective distortion. This is especially useful for "flattening" photographed or scanned documents that were captured at an angle, making the result appear as if it were scanned or photographed head-on.

How Warp Works

The command takes four corner points—'Top Left', 'Top Right', 'Bottom Right', and 'Bottom Left'—that define the quadrilateral region to extract from the source image. The region is then mapped to a rectangle, with the output image sized to best fit the transformed area. The transformation corrects for perspective, making the content suitable for OCR, data extraction, or further processing.

The 'Interpolation Mode' property controls the quality and speed of the transformation, while 'Apply Edge Smoothing' can be enabled to reduce jagged edges along the boundaries of the warped region.

Supported Pixel Formats

The Warp command supports all common pixel formats, including Pixel1bppIndexed (binary), Pixel8bppGrayscale, and Pixel24bppBgr (color). Images are automatically converted as needed for the warp operation.

Diagnostics

When run in diagnostic mode, Warp generates an annotated image showing the selected quadrilateral region, helping users verify that the correct area is being extracted and transformed.

Classification Features

Warp does not generate classification features directly, but by correcting perspective, it improves the reliability of downstream feature extraction and classification processes.

Configuration and Usage

To use Warp, add it to an IP Profile or configure it as a property of a Grooper object. Set the four corner properties to define the region to extract. Adjust 'Interpolation Mode' and 'Apply Edge Smoothing' for the desired balance of quality and speed. For most use cases, it is recommended to use higher-level commands or features that automatically detect and configure the quadrilateral region.

Example Workflow:

  1. Use a detection command to identify the document corners in a photographed image.
  2. Set the 'Top Left', 'Top Right', 'Bottom Right', and 'Bottom Left' properties to match the detected points.
  3. Run the Warp command to produce a flattened, rectangular image suitable for OCR or further processing.

Properties

NameTypeDescription
General
Corner Offsets
Command Info

See Also

Used By

Notification