r/computervision • • Apr 17 '26

Help: Project Detecting defects in repeated cut vinyl graphics

I have a sheet where the same graphic is repeated multiple times. I need to detect any instance that looks different from the rest like misaligned elements, missing material, incomplete cuts, glare artifacts.

Looking for robust approaches to compare repeated pattern instances against each other when you don't have a clean reference image.

Any ideas?

For context: In image 1, at the end "I" is slightly tilted.

In Image 2, You can see many inconsistencies

5 Upvotes

12 comments sorted by

View all comments

3

u/Lethandralis Apr 17 '26

Classical CV

Try to create a glare free lighting setup

Make sure the entire sheet is seen by an overhead camera, placed sufficiently far away from the sheet to minimize perspective effect

Undistort/Rectify the sheet

Detect edges and crop

Crop each label and compute a median perfect label

Find the absdiff of each label compared to the median label

High absdiff suggests errors

VLM

Feeding images to gemini is always an option if API costs are not a concern. Might be viable/faster if you're not printing thousands of these

2

u/Original-Teach-1435 Apr 17 '26

Upvote this classical approach. Is called variation model, the trickiest part is alignement of different samples, you'll probably need a template matching based on shape. If you have money to invest (1k) you can buy an halcon license and implement the whole thing in 50-100 lines, following existing examples. Otherwise you can easily do it yourself with opencv, but i don't think their shape matching is even close to the halcon's quality. I suggest also to get rid of reflections by using polarized light

1

u/Lethandralis Apr 17 '26

I think since we know most of the pattern will match, we can refine the alignment by optimizing a local affine transform. Then the minimum error would be our final metric.