Barcode Detection and Barcode Removal: Difference between revisions

From Grooper Wiki
Line 10: Line 10:
# Returns detected barcodes as part of the command result, storing them as layout data for downstream use.
# Returns detected barcodes as part of the command result, storing them as layout data for downstream use.


=== Use cases for barcode detection ===
=== Use cases for Barcode Detection ===


Grooper can use Barcode Detection to use data encoded in barcodes for numerous purposes. This includes:
Grooper can use Barcode Detection to use data encoded in barcodes for numerous purposes. This includes:

Revision as of 08:28, 7 August 2025

This article explains the purpose, configuration, and usage of the Barcode Detection and Barcode Removal IP Commands in Grooper. It also highlights their similarities and differences, helping users understand when and how to use each command in document processing workflows.

What is Barcode Detection?

Barcode Detection is an IP Command in Grooper. It can be added to a step in an IP Profile or IP Group. The Barcode Detection command is designed to identify a wide range of barcode types—including 1D, 2D, and postal barcodes—on scanned images or digital documents. Barcodes are commonly used for indexing, routing, and automating document workflows. When the Barcode Detection command is executed, it:

  1. Optionally preprocesses the image (such as binarization or cropping to a region of interest).
  2. Applies one or more barcode readers to detect and decode barcodes.
  3. Returns detected barcodes as part of the command result, storing them as layout data for downstream use.

Use cases for Barcode Detection

Grooper can use Barcode Detection to use data encoded in barcodes for numerous purposes. This includes:

  • Extracting barcode values for indexing or validation.
  • Automating document separation based on a barcodes presence or value.
  • Automating document classification based on barcode presence or value.
  • Capturing barcode data for integration with external systems.
  • Routing documents based on barcode content.

Configuration and usage

To use Barcode Detection:

  1. Right-click an IP Profile or IP Group to add a Barcode Detection IP Step.
  2. Select "Add Command" then "Feature Detection" then "Barcode Detection".
  3. Enable and configure Barcode Readers to match the barcode symbologies present in your documents.
  4. Set preprocessing options (if needed)
    • "Binarization Settings" control how the image is temporarily converted to a black and white image. Barcode Detection must occur on a black and white image. However, this adjustment only occurs in preprocessing. It will not affect the final image.
    • "Region of Interest" restricts detection to a predefined zone on the page.
  5. Test the IP Step/IP Group/IP Profile using the "Tester" tab. Use the Diagnostics panel's images and files to visualize results.
    • Ensure barcodes are detected as you expect. Review the "Barcodes.jpeg" diagnostic. Detected barcodes are highlighted.
    • Ensure barcodes are decoded as you expect. Review the "Execution Log.txt" diagnostic. This will list all detected barcodes and their values.
    • Fine-tune the Barcode Detection settings as needed.
  6. The Barcode Detection step will execute as part of the IP Profile's execution flow.

The detected barcode information is stored as layout data, making it available for downstream activities such as data extraction, classification, or routing.

What is Barcode Removal?

Barcode Removal is the process of detecting and masking barcode regions on an image, effectively removing them from the document. The Barcode Removal IP Command is used to eliminate unwanted barcode content before downstream processing, such as OCR or data extraction, where barcodes may interfere with results.

When the Barcode Removal command is executed, it:

  1. Applies the configured barcode detection settings to locate barcode regions.
  2. Generates a mask to cover each detected barcode.
  3. Optionally removes regions that resemble barcodes but could not be decoded (useful for cleaning up barcode-like noise).
  4. Expands the mask by a configurable border to ensure the entire barcode and its quiet zone are removed.
  5. Drops out the masked regions from the image using the selected dropout method.

Use cases for barcode removal

  • Cleaning up document images before OCR to prevent barcodes from interfering with text recognition.
  • Removing barcode-like noise or damaged barcodes that cannot be decoded.
  • Ensuring that only relevant content remains on the image for downstream processing.

Configuration and usage

To use barcode removal:

  • Add the Barcode Removal command to an IP Profile.
  • Configure the "Barcode Detection Settings" property to specify which barcode types to detect and how detection is performed.
  • Enable "Remove Regions" to also remove "barcode-like" regions.
  • Adjust "Border Expand" to ensure the entire barcode and its quiet zone are masked out.
  • Use diagnostic mode to review the mask and output image, ensuring only unwanted barcode regions are removed.

Barcode Readers

The Barcode Detection and Barcode Removal commands both support the same Barcode Reader engines. The different Barcode Readers are designed to read different sets of barcode symbologies, locating the barcode on a page and decoding their value. Understanding the differences helps you select the right reader(s) for your documents.

Standard Reader

  • Purpose: General-purpose barcode detection using Grooper's standard engine. Supports s broad range of symbologies, including types not covered by the specialized readers.
  • Use cases: For symbologies not covered by the specialized readers, serves as the primary Barcode Reader. Acts as a fallback or supplement for the specialized readers.
  • Barcode Symbologies:
    • Australia Post
    • Codabar
    • Code 11
    • Code 128
    • Code 32
    • Code 39
    • Code 93
    • Data Matrix
    • EAN-13
    • EAN-8
    • Interleaved 2 of 5 (I2of5)
    • Intelligent Mail
    • ITF-14
    • Micro QR
    • Patch
    • PDF417
    • PLANET
    • Postnet
    • Plus 2 (2-digit supplementals)
    • Plus 5 (5-digit supplementals)
    • QR Code
    • Royal Mail 4-State (RM4SCC)
    • RSS 14
    • RSS Limited
    • Telepen
    • UPC-A
    • UPC-E
    • Aztec
    • Pharmacode

1D Reader

  • Purpose: Advanced detection of linear (one-dimensional) barcodes.
  • Use cases: Ideal for documents with shipping labels, inventory tags, or forms using linear barcodes.
  • Barcode Symbologies:
    • Codabar
    • Code 128
    • Code 39
    • Pharmacode

2D Reader

  • Purpose: Advanced detection of two-dimensional barcodes.
  • Use cases: Suitable for forms, packaging, or documents containing Data Matrix codes.
  • Barcode Symbologies:
    • Data Matrix

Postal Reader

  • Purpose: Specialized detection of postal barcode symbologies.
  • Use cases: Designed for mail pieces, envelopes, or documents used in postal automation and tracking.
  • Barcode Symbologies:
    • Intelligent Mail
    • Postnet

Similarities and differences between Barcode Detection and Barcode Removal

Similarities

The big takeaway: Both Barcode Detection and Barcode Removal detect barcodes.

  • Both commands detect barcodes and store their locations and encoded values in the Batch Page's layout data.
  • Both commands use the same Barcode Readers
    • They use the same barcode detection technology to locate barcode regions on images.
    • They support the same range of barcode symbologies and can be configured to target specific types.
  • Both can operate on all common pixel formats and convert images for preprocessing as needed (Both have the same "Binarization Settings").
  • Both provide diagnostic output to assist with configuration and troubleshooting.
  • Both are included as steps in an IP Profile, allowing them to be combined with other image processing operations.

Differences

The big takeaway: Barcode Detection does not alter the image. Barcode Removal does alter the image.

  • Both Barcode Detection and Barcode Removal detect barcodes and store their information in the Batch Page's layout data.
  • Only Barcode Removal barcode regions from images, masking them out before further processing.
    • This is most useful for image cleanup prior to OCR.
    • Barcodes will be removed from an image permanently when Barcode Removal is applied by the Image Processing activity.
    • Barcodes will be removed in-memory prior to OCR when Barcode Removal is applied by the Recognize activity.
  • Only Barcode Removal has Feature Removal properties such as "Remove Regions", "Border Expand" and "Dropout Method"

When to use each command

  • Use Barcode Detection when you only need to extract barcode values for indexing, validation, or workflow automation without altering the image.
  • Use Barcode Removal when you want to eliminate barcodes or to remove barcode-like noise prior to OCR. Barcode Removal will extract barcode values as well.

When are IP Profiles executed?

An IP Profile is executed whenever Grooper needs to process an image using a defined sequence or hierarchy of image processing operations. Execution typically occurs in the following scenarios:

  • By the Image Processing activity: The Image Processing activity will apply the IP Profile and permanantly alter the image.
  • By an OCR Profile: OCR Profiles configured with an IP Profile will run the IP Profile on an image prior to handing it to the OCR image. The image will not be permanently altered.
  • By the Recognize activity's "Alternate IP" configuration: IP Profiles executed by this configuration will only execute feature detection commands (such as Barcode Detection) to collect layout data.
  • During a Review step: Users can manually execute an IP Profile from the Thumbnail Viewer (if configured to allow the user to do so).

Execution follows the order and logic defined in the IP Profile, including any conditional flow control or branching. Each step or group within the profile is applied in sequence, transforming the input image and producing results for further processing.