Instruments & Meters

Carton Image Cleanup: Why Mandatory Text Needs an Independent Reference

A Germany-based online retailer replaced a generative image model with deterministic processing and dual checks after generated carton images changed legally required text.

Chidi OkonkwoOctober 25, 20265 min read5 views
A clean carton panel with abstract print blocks is examined through a hovering magnifying comparison grid on a white studio surface.

Justin Flick, writing for SOMUVA UG, describes a small image-processing case with a quality-control lesson: when an image carries legally required text, a clean-looking result is not enough. The Lüdenscheid, Germany-based company runs the German-language online shop vapechamp.de. It wanted to turn phone photos of carton back panels into straightened images on a white background for product pages. The panels carry manufacturer and importer names and addresses, warning texts and contact details such as phone numbers. The images could be improved, but the printed information had to remain unchanged. In measurement terms, the measurand was the printed text, not the appearance of the image.

A plausible result that failed

The first attempt used a generative image model. Flick supplied a straightened carton image and instructed the model to keep every printed character, number and symbol identical. The output looked professional, but comparison with the source showed changes: 2801 had become 2001, a phone number contained wrong digits, and commas and full stops had been swapped. The changes were plausible and therefore hard to spot at a glance. For mandatory information, Flick says, that is not cosmetic. The generated images were discarded and none was published. A generative model produces what text plausibly looks like, not what was printed, and visual inspection cannot serve as the reference.

Deterministic processing and a reference

The replacement was a deterministic chain. The carton face is rectified with a perspective transform from four corner points. Uneven lighting is flattened by estimating the background illumination and dividing it out, followed by white balancing. Denoising is gentle and edge-preserving. Text blocks are protected regions where pixels pass through background clean-up unchanged. The result is placed on a white background with a soft shadow. Nothing is redrawn or re-typeset; every character comes from the photographed pixels.

For each image, the team kept a reference: the same crop after rectification and lighting correction only, before denoising or clean-up. Each processed face was compared with that reference before being placed on the background, using two measurement principles. An OCR diff read both images with an open-source engine after upscaling, aligned word sequences and listed deviations. An ink check did not read text: pixels clearly darker than the carton background counted as print, and a disappearing connected group was flagged as a lost character.

Classical filters need testing too

The gate showed that classical filters are not automatically safe. A speckle filter turned 130 into 30 and removed colons. A threshold clean-up erased the dot in a web address. Both stages were dropped. Flick notes that any step deciding what counts as noise can decide that a full stop is noise.

OCR also had measurement uncertainty: on small print it misread the reference, for example reading 5 as S. A raw OCR diff therefore reported disagreements processing had not caused. Taken at face value, these could create false rejects; ignored, they could hide real changes and create false accepts. Flick compares this with a gauge study: measurement-system variation must be separated before variation is attributed to the part. The ink check and a separate review helped separate OCR misreads from processing changes. Drawing on Tsipursky's third step, he says each disagreement should identify its source rather than assume the person or model is wrong, and be treated as a stop, not a score to average away.

Second review and the published file

A separate automated review, independent of the processing chain, checked the images in two rounds. A composite image failed because one inserted line could not be verified reliably; it was removed and the genuine information block from the carton was used. Before any replacement, the previous state was backed up. After publication, the team downloaded the delivered files and compared them with its own; at reduced resolution, the mean absolute greyscale difference was well under one grey level. Flick argues that the published file is the last link in the chain and deserves the same check as every step before it.

What quality teams can take away

Flick's takeaways begin with defining the measurand: for images carrying mandatory text, characters matter, not appearance. Teams should keep a separate reference from the earliest reliable processing step and never compare an output only with itself. Two measurement principles, such as an OCR text diff and a pixel-level ink check, are better than one. OCR's own errors should be characterised on the reference before its verdicts are trusted. Classical filters should be tested as rigorously as AI tools. An independent second review should remove what cannot be verified, and backups plus pixel comparison of published files should close the loop. Better input also helps: frontal, unwrapped, frame-filling photos in daylight make later steps easier. Generative models remain useful where nothing has to be read; for mandatory information, Flick says the company now uses classical processing plus a text comparison against the original. Tsipursky's closing question applies: when machine and qualified person disagree, do we know who was right, why, and what changed afterward? Flick wants that answer before publication.