Instruments & Meters

When Packaging Text Must Stay Exact, Image Processing Needs an Outside Reference

Petra DahlbergOctober 25, 20265 min read4 views

At a glance

  • A German online retailer’s carton-image workflow shows how generative retouching can silently alter mandatory text and why deterministic processing plus independent checks is safer.
  • A small e-commerce image-processing case found that a generative model changed legally required carton text even when told to preserve every character. The team replaced it with deterministic processing and checked outputs against an early reference using OCR comparison and a pixel-level ink check before publication.
A concept illustration shows an unmarked carton panel and a reference print side by side under inspection lighting, with a magnifying lens and a clean processing workspace.

Cleaning up a phone photo of a carton back panel for an online product page looks like ordinary image work. When the panel carries a manufacturer name, an importer address, warning language and contact details, however, the printed characters are the information that matters. Justin Flick of SOMUVA UG, which runs a German-language online shop, describes a small e-commerce case that applies a quality-control principle from factory inspection: an automated result is only as trustworthy as the independent reference used to check it. The case responds to a Metrology News article by Gleb Tsipursky on disagreement audits for automated inspection.

Text was the measurand, not the look of the image

The task was to convert carton back panels into straightened images on white backgrounds. The panels included legally required information and contact details. The images could be improved, but the information had to remain unchanged. In measurement terms, the measurand was the printed text rather than the visual appearance. That distinction sets the acceptance criterion: a cleaner image that changes a character is a failed image, not a cosmetic success.

A professional-looking result with altered characters

The first attempt used a generative image model. The team supplied a straightened carton image and instructed the model to keep every character, number and symbol identical. The output looked polished, with sharp print, even lighting and a clean background. A comparison with the source found changes: the digits 2801 had become 2001, a phone number contained wrong digits, and commas and full stops had been exchanged. These errors were plausible enough to escape a quick visual check. Because the information was mandatory, the generated images were discarded and none was published. The practical lesson was that a generative model can produce text that looks plausible rather than the text that was printed; unaided visual inspection is too weak to serve as the reference.

Deterministic processing kept every glyph tied to photographed pixels

The replacement was a deterministic chain. The carton face was rectified with a perspective transform based on four corner points. Uneven lighting was reduced by estimating the background illumination and dividing it out, followed by white balancing to a target tone. Denoising was kept gentle and edge-preserving. Text blocks were marked as protected regions so their pixels passed through background clean-up unchanged. The result was then placed on a white background with a soft shadow. Nothing on the carton was redrawn or re-typeset; every character in the final panel came from photographed pixels.

An early reference and two measurement principles

For each image, the team retained a reference made from the same crop after rectification and the illumination and white-balance steps, before denoising or clean-up. Each processed carton face was compared with that reference before being placed on the background. Two different principles were used. The first was an OCR diff: both images were upscaled and read by an open-source OCR engine with German and English language data, and the resulting word sequences were aligned so that deviations could be listed. The second was an ink check that did not depend on reading text. Pixels clearly darker than the carton background in the reference counted as print; if such pixels became light in the processed image and most of a connected group disappeared, the group was flagged as a lost character.

Classical filters also failed the gate

The checks showed that conventional filters are not automatically safe. A speckle filter turned 130 into 30 and removed colons. A threshold clean-up step erased the dot in a web address. Both stages were dropped. The underlying problem is that any step which decides what counts as noise can also decide that a full stop is noise. Deterministic processing reduced the risk of invented characters, but it did not remove the need for verification.

OCR itself has measurement uncertainty

An OCR diff is also a measurement system with its own error. On small print, the OCR misread the reference image, for example reading a 5 as an S. A raw OCR diff therefore reports disagreements that the processing did not cause. Accepting those differences at face value would create false rejects; ignoring them wholesale would hide real changes and create false accepts. The team used a gauge-study analogy: before attributing variation to the part, separate the variation of the measurement system. The OCR misreads of the reference had to be distinguished from changes introduced by processing. The independent ink check and a separate review step did that work. This follows Tsipursky's point about identifying the source of a disagreement instead of assuming that the person or model must be wrong. The operating rule was to treat each disagreement as a stop to be resolved, not as a similarity score to be averaged away.

Independent review, backups and the delivered file

A separate automated review, independent of the processing chain, checked the images in two rounds. In the first round, a composite image failed because one inserted line could not be verified reliably. The composite was removed and the genuine information block from the carton was used instead. Before any image was replaced, the previous state was backed up so it could be restored. After publication, the team downloaded the files as delivered and compared them with its own versions. At reduced resolution, the mean absolute greyscale difference was well under one grey level. The published file is the last link in the chain and merits the same check as earlier steps.

What the case implies for quality teams

The case is small and sits outside factory inspection, so it should not be read as evidence about every automated inspection system. Its value is in the control logic. Teams working with images that carry mandatory text should define the measurand as the characters, keep a separate reference from the earliest reliable processing step, and avoid comparing an output only with itself. Two measurement principles, such as an OCR text diff and a pixel-level ink check, give a better chance of catching different failure modes. OCR errors on the reference should be characterised before its verdicts are trusted. Classical filters should be tested as rigorously as AI tools. An independent second review, removal of unverifiable elements, backups before changes and pixel comparison of published files all belong in the same discipline.

The input also matters: frontal, unwrapped, frame-filling photos taken in daylight make later steps easier. Generative models remain useful where nothing has to be read. For images carrying mandatory information, the team now uses classical processing plus a text comparison against the original. Tsipursky's question for quality leaders applies directly: when the machine and a qualified person disagree, do we know who was right, why, and what changed afterward? For processed images, the same answer is needed before publication.

Reported by Petra Dahlberg, Thermal and Fluid Equipment Specialist.