Product images are often cleaned for online catalogs, but the task changes when the image carries legally required text. A recent Metrology News commentary by Gleb Tsipursky on disagreement audits framed the issue for a small e-commerce team: an automated result is only as trustworthy as the independent reference used to check it. The team’s case involved carton back panels photographed with phones and prepared for product pages.
The failure mode: plausible text, not printed text
The panels contained manufacturer and importer names and addresses, warning texts and contact details such as phone numbers. The team wanted straighter images on a white background. The information had to remain unchanged; the measurement target was the printed characters, not the image’s appearance. A first attempt used a generative image model. The model received a straightened carton image and an explicit instruction to preserve every character, number and symbol. The output looked professional, with sharp print, even light and a clean background. Comparison with the source found otherwise: “2801” had become “2001”, a phone number contained wrong digits, and commas and full stops had been swapped. The errors were plausible and therefore easy to miss. Because the information was mandatory, the team discarded the images and published none. The lesson was that a generative model produces text that looks plausible, not necessarily the text that was printed. Visual inspection is a weak check against plausible errors and cannot serve as the reference.
A deterministic pipeline with protected text
The replacement was a deterministic chain. The carton face was rectified with a perspective transform from four corner points. Uneven lighting was flattened by estimating 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 where pixels passed through background cleanup unchanged. The result was 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. The gate showed, however, that classical filters are not automatically safe. A speckle filter turned “130” into “30” and removed colons. A threshold cleanup step erased the dot in a web address. Both stages were dropped, because any step that decides what counts as noise can also decide that a full stop is noise.
The reference and the gate
For each image the team kept a reference: the same crop after rectification and the illumination and white-balance step only, before denoising or cleanup. Each processed carton face was compared with that reference before being placed on the background, using two 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 word sequences were aligned and deviations 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. This second principle mattered because it could catch changes that OCR might rationalize or miss.
OCR is a measurement system, too
An OCR diff has its own error. On small print, the engine misread the reference as well, for example reading a “5” as an “S”. A raw OCR diff therefore reports disagreements that processing did not cause. Taken at face value, those reports produce false rejects; ignored wholesale, they hide real changes and produce false accepts. The analogy with a gauge study is useful: before attributing variation to the part, one separates the variation of the measurement system. In this case, OCR misreads of the reference had to be separated from changes introduced by processing. The ink check and a separate review step did that work. This follows Tsipursky’s third step, which calls for identifying the source of a disagreement rather than assuming the person or the model must be wrong. The operational principle was to treat each disagreement as a stop to be resolved, not as a similarity score to be averaged away.
Second review 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 team removed the composite and used the genuine information block from the carton. 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. 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 earlier step.
Practical takeaways for quality teams
- Define the measurement target. For images with mandatory text, characters matter more than appearance.
- Keep an early reference. Use a separate image from the earliest reliable processing step and never compare an output only with itself.
- Use two measurement principles. Combine an OCR text diff with a pixel-level ink check.
- Characterize OCR error. Measure the OCR’s own misreads on the reference before trusting its verdicts.
- Treat disagreement as a stop. Do not average it into a similarity score.
- Test classical filters as rigorously as AI tools. Deterministic steps can still delete punctuation or digits.
- Add independent review. Remove anything that cannot be verified.
- Back up and compare the published file. Pixel-compare delivered files after publication.
- Improve the input. Frontal, unwrapped, frame-filling daylight photos make later steps easier.
- Match the method to the content. Generative models remain useful where nothing has to be read; for mandatory information, use classical processing plus text comparison against the original.
