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

Shade Removal

IP Command Grooper.IP

Removes rectangular shaded regions from a color or grayscale image.

Remarks

The Shade Removal command detects and removes rectangular shaded regions from color or grayscale images. Shaded regions are typically areas with a background color darker than the overall document, such as table headers, field labels, or highlighted form fields. Removing these regions can improve OCR accuracy and downstream data extraction by eliminating visual noise and ensuring a consistent background.

How Shade Removal Works

  1. The input image is converted to grayscale for analysis.
  2. The command detects the background (white point) and foreground (black point) colors, using the 'Black Point Limit' and 'White Point Limit' properties to define allowable deviations from pure black and white.
  3. A range of pixel intensities between the background and foreground is selected as "shading pixels," controlled by the 'Black Offset' and 'White Offset' properties.
  4. Shading pixels are isolated to a temporary image, which is optionally filtered and filled to produce solid shaded regions.
  5. Morphological operations and region filtering are applied to identify rectangular shaded regions of the correct size.
  6. The detected shaded regions are removed from the original image.

Configuration and Usage

  • Use 'Black Point Limit' and 'White Point Limit' to control how strictly the command detects pure black and white.
  • Adjust 'Black Offset' and 'White Offset' to fine-tune the intensity range considered as shading.
  • Use 'Filter Size', 'Maximum Fill Weight', and 'Erosion Factor' to improve detection on noisy or complex documents.
  • Set 'Minimum Size' and 'Minimum Area' to filter out small or irrelevant shaded regions.
  • Review diagnostic images to verify that only the intended shaded regions are being removed.

Supported Pixel Formats

  • Pixel8bppGrayscale
  • Pixel24bppBgr

Images are automatically converted to grayscale for processing if needed.

Diagnostics

When run in diagnostic mode, Shade Removal generates several diagnostic images to assist with configuration:

  • Histogram: Shows the detected intensity ranges and shading pixels.
  • Shading: Isolates all shading pixels to a separate image.
  • Filtered: Displays the result of median filtering.
  • Filled: Shows the effect of filling small white blobs inside shaded regions.
  • Candidates: Displays candidate shaded regions after preprocessing.
  • Binarized: Shows the binarized version of the filtered shading image.
  • Clean: Shows the image after edge repair and cleaning.
  • Background Mask and Foreground Mask: Visualize the masks used for region removal.
  • Log Messages: Reports detection steps, region filtering, and timing.

Use these diagnostics to fine-tune detection parameters and ensure that only the intended shaded regions are removed.

Notes

  • Overly broad settings may remove non-shaded content or miss small shaded regions.
  • Always review diagnostic output to avoid unintentional data loss.
  • Shade Removal does not generate classification features directly, but the results can impact downstream OCR and extraction.

Properties

NameTypeDescription
General
Region Detection
Region Filtering
Command Info

Used By

Notification