Text Fidelity in Processed Images: Why an Independent Reference Matters
Author: Justin Flick
In “AI Inspection Needs A Disagreement Audit Before Quality Teams Scale It” (Metrology News, 15 September 2026), Gleb Tsipursky argues that quality leaders should “measure disagreements between automated inspection and qualified human judgment before reducing human review”. Our case is small and sits outside the factory, but the principle carried over directly: an automated result is only as trustworthy as the independent reference it has been checked against.
The Task: Clean Images, Unchanged Information
We wanted to turn phone photos of carton back panels into clean, straightened images on a white background for online product pages. These panels carry legally required information – manufacturer and importer names and addresses, warning texts – together with contact details such as phone numbers. The images could look better, but the information on them must not change.
In measurement terms, the measurand was the printed text, not the appearance of the image.
Convincing Result That Did Not Hold Up
Our first attempt used a generative image model. We gave it a straightened image of the carton and an explicit instruction to keep every printed character, number and symbol identical. The output looked professional: sharp print, even light, a clean background.
A comparison with the source told a different story. The digits “2801” had become “2001”. A phone number contained wrong digits. A comma had turned into a full stop, and elsewhere a full stop into a comma. None of this was easy to spot at a glance, because the changes were plausible. For mandatory information, that is not a cosmetic issue, so we discarded the generated images; none of them was published.
The lesson for us was that a generative model produces what text plausibly looks like, not what was printed. Visual inspection is a weak check against plausible errors, which is precisely why it cannot serve as the reference.
Classical Processing: Every Glyph From Photographed Pixels
We replaced the model with 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 to a target tone. Denoising is gentle and edge-preserving. Text blocks are marked as protected regions in which pixels pass through the background clean-up unchanged. The result is then placed on a white background with a soft shadow.
Nothing on the carton is redrawn or re-typeset. Every character of the printed panel in the final image is derived from the photographed pixels.
The Reference and The Gate
For each image we kept a reference: the same crop after rectification and the illumination and white-balance step only, before any denoising or clean-up. Every processed carton face was then compared with that reference, before it was placed on the background, using two different measurement principles.
The first is an OCR diff. Both images are read by an open-source OCR engine with German and English language data, after upscaling. The resulting word sequences are aligned and every deviation is listed.
The second is an ink check that does not depend on reading text at all. Pixels clearly darker than the carton background in the reference count as print. If such pixels become light in the processed image, and most of a connected group of them disappears, that group is flagged as a lost character.
Before anything was published, the gate showed that classical filters are not automatically safe. A speckle filter had turned “130” into “30” and removed colons. A threshold clean-up step had erased the dot in a web address. Both stages were dropped. Any step that decides what counts as noise can decide that a full stop is noise.
OCR has its own measurement uncertainty
An OCR diff is itself a measurement system, with its own error. On small print, it misread the reference image as well, for example reading a “5” as an “S”. A raw OCR diff therefore reports disagreements that the processing did not cause. Taken at face value, these lead to false rejects; ignored wholesale, they hide the real changes, which become false accepts.
The analogy with a gauge study is useful here. Before attributing variation to the part, you separate out the variation of the measurement system. In our case, the OCR’s misreads of the reference had to be separated from changes introduced by the processing. A second, independent principle – the ink check – and a separate review step did that work.
This matches Tsipursky’s third step: “identify the source of the disagreement rather than assuming the person or the model must be wrong“. The principle we took from it: treat each disagreement as a stop to be resolved, not as a similarity score to be averaged away.
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. We removed the composite and used the genuine information block from the carton instead.
Before any image was replaced, the previous state was backed up so it could be restored. After publication, we downloaded the files as actually delivered and compared them with our 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 it deserves the same check as every step before it.
Practical Takeaways For Quality Teams
- Define the measurand. For images that carry mandatory text, the characters matter, not the appearance.
- Keep a separate reference image from the earliest reliable processing step, and never compare an output only with itself.
- Use two measurement principles, such as an OCR text diff and a pixel-level ink check.
- Characterise the OCR’s own errors on the reference before trusting its verdicts.
- Treat any disagreement as a stop, not a score.
- Test classical filters as rigorously as AI tools.
- Add an independent second review, and remove what cannot be verified.
- Back up before every change and pixel-compare the published files.
- Improve the input: frontal, unwrapped, frame-filling photos in daylight make every later step easier.
Generative models remain useful for images where nothing has to be read. For images that carry mandatory information, we now use classical processing plus a text comparison against the original.
Towards the end of his piece, Tsipursky poses a question quality leaders should be able to answer: “when the machine and a qualified person disagree, do we know who was right, why, and what we changed afterward?” For processed images, the question is the same. When the output and the reference disagree, we want that answer before anything is published.
About the author Justin Flick writes for SOMUVA UG (haftungsbeschränkt) in Lüdenscheid, Germany, which runs the German-language online shop vapechamp.de.



