Instruments & Meters

A Carton-Image Case Shows Why Text Fidelity Needs an Independent Reference

A retailer's failed generative retouch and deterministic replacement show how OCR diffs, ink checks and independent review protect mandatory printed information.

Petra DahlbergOctober 25, 20265 min read0 views
A plain carton panel, a phone photo and a straightened product image are compared under two abstract verification lenses on a white studio surface.

When an online product image carries legally required text, retouching stops being a cosmetic task and becomes a measurement problem. A small e-commerce case outside the factory makes the point clearly. The goal was to turn phone photos of carton back panels into clean, straightened images on a white background for product pages. Those panels carry manufacturer and importer names and addresses, warning texts and contact details such as phone numbers. The images could look better, but the printed information had to remain identical. In measurement terms, the measurand was the text, not the appearance of the carton.

A plausible image that failed the text test

The first attempt used a generative image model. The operator supplied a straightened carton image and an explicit instruction to preserve every printed character, number and symbol. The result looked professional: sharp print, even lighting and a clean background. Comparison with the source revealed a different outcome. The digits 2801 had become 2001; a phone number contained wrong digits; commas and full stops had been exchanged. These were not glaring errors. They were plausible, which made them hard to catch by eye. For mandatory information, plausibility is not a substitute for fidelity. The generated images were discarded and none was published. The lesson was direct: a generative model produces what text plausibly looks like, not necessarily what was printed. Visual inspection is a weak check against plausible errors, so it cannot serve as the reference.

A deterministic chain with protected text

The replacement was a deterministic processing chain. The carton face was rectified with a perspective transform from four corner points. Uneven lighting was flattened by estimating the background illumination and dividing it out, followed by white balancing to a target tone. Denoising was gentle and edge-preserving. Text blocks were marked as protected regions in which pixels passed through the 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 image came from the photographed pixels.

The independent reference and the two-principle gate

For each image, the team kept a reference: the same crop after rectification and the illumination and white-balance step only, before any denoising or clean-up. Each processed carton face was compared with that reference before it was placed on the background. The comparison used two different measurement principles. The first was an OCR diff. Both images were read by an open-source OCR engine with German and English language data after upscaling; the resulting word sequences were aligned and every deviation was 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.

The gate showed that classical 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 wider point is that any step which decides what counts as noise can also decide that a full stop is noise. Classical processing avoided the generative model's rewrite problem, but its individual filters still needed verification against the reference.

OCR is itself a measurement system

An OCR diff is not a perfect arbiter. It is a measurement system with its own error. On small print, the engine misread the reference image as well, for example reading a 5 as an S. A raw OCR diff therefore reported disagreements that the processing did not cause. Taken at face value, those reports would create false rejects; ignored wholesale, they would hide real changes and create false accepts. The useful analogy is a gauge study: before attributing variation to the part, the variation of the measurement system must be separated out. Here, the OCR's misreads of the reference had to be separated from changes introduced by processing. A second, independent principle, the ink check, and a separate review step did that work.

This follows the logic of Gleb Tsipursky's argument that quality teams should identify the source of a disagreement rather than assuming the person or the model must be wrong. The operating principle in the carton case was to treat each disagreement as a stop to be resolved, not as a similarity score to be averaged away. That is a stricter control than asking whether an output looks close enough.

Second review, backups and the published 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 files were downloaded as actually delivered and compared with the team's own copies. 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 deserves the same check as every step before it.

What quality teams can take away

The case offers a practical sequence for images that carry mandatory text:

  • Define the measurand. The characters matter, not the appearance of the image.
  • Keep an independent reference. Use the earliest reliable processing step and never compare an output only with itself.
  • Use two measurement principles. An OCR text diff and a pixel-level ink check cover different failure modes.
  • Characterise the OCR. Measure its errors on the reference before trusting its verdicts.
  • Treat disagreement as a stop. Do not average it into a score.
  • Test classical filters as rigorously as AI tools. A filter that removes noise can also remove punctuation.
  • Add independent review. Remove anything that cannot be verified.
  • Back up and check the published file. Compare delivered files with the controlled copy.
  • Improve the input. Frontal, unwrapped, frame-filling daylight photos make later steps easier.

Generative models remain useful where nothing has to be read. For images carrying mandatory information, the workable approach in this case was classical processing plus a text comparison against the original. The final question is the one Tsipursky poses for quality leaders: when the machine and a qualified person disagree, do we know who was right, why, and what was changed afterward? For processed images, the output and the reference must answer that question before anything is published.