0

I've been trying to detect if a printed image has any defects(shape and color) when compared to either a proof of another printed image which has no defects or the digital version of the image, which also has no defects. I'm using opencv(cv2) and python.

I first take a picture of the printed image. Then, I perform perspective transformation to get the picture of the printed image cropped sufficiently. I am then using Zernike moments, SSIM, and color histograms to compare the color and shape of the image. However, the resulting values vary too much and I am not able to create a threshold for a misprinted image.

I have also tried to subdivide the image into smaller sections and compare those. This is also not creating distinguishable values to determine if there is a misprint or not.

The differences in the print can be subtle or very apparent. Are there any other techniques that I can try? Thanks!

This is an example of a correctly printed image:

This is an example of a correctly printed image

This is an example of an incorrectly printed image, it has too much blue ink on the right side:

This is an example of an incorrectly printed image, it has too much blue ink on the right side

This is another example of a correct print: This is an example of a misprint when compared to the one above:

Danthony
  • 5
  • 4
  • summarize pixels values... – Proxytype Jul 16 '17 at 20:41
  • can you add some more different samples of correctly printed images to get an idea of intra-class variance? – Micka Jul 17 '17 at 07:26
  • Are the sample images backwards? I added them inline in the order you originally had them but the top image looks like it has more blue than the bottom one. – beaker Jul 17 '17 at 15:12
  • How are you controlling factors which will have effects on the pictures, for example all the light falling on the image you are taking a picture of? – DisappointedByUnaccountableMod Jul 17 '17 at 17:59
  • @beaker Yes I made a mistake just fixed it. Thanks. – Danthony Jul 18 '17 at 00:49
  • @barry, I am not necessarily controlling many factors like lighting, however, all of the pictures of each print are taken within a small amount of time meaning all images of prints should have similar lighting and other factors. – Danthony Jul 18 '17 at 00:52
  • @Proxytype Can you elaborate some more. – Danthony Jul 18 '17 at 01:01
  • @Micka I added another example. The variance will be somewhat subtle, such as too much color and slight shape dis-figuration. – Danthony Jul 18 '17 at 01:01
  • it's kind of complex, you should to check different between the pixels from the original image and from the printed image, you also need to compare with the color plate of the printer... if you transfer from RGB to CYMK there is different between the colors... – Proxytype Jul 18 '17 at 19:57
  • Are your example pictures at the real camera resolution? Seems very low-res, also using jpg is likely to make your job much harder because it is lossy, which means in practice it changes colours in the image adding to your problems, but simple to solve use a lossless format like PNG. You will need to use a decent camera to minimise noise and decent resolution. Using bright lights to illuminate the target will help the quality of the images and also help remove variations due to e.g. someone walking past the camera station. – DisappointedByUnaccountableMod Jul 19 '17 at 11:42
  • I loaded one of your pictures into Paint.net, go to Adjustments->Levels to see the pixel histogram. These pictures really are atrocious, the colour components are all in the range 80-160 (which is like 8-bit colour when in principle you could have 24-bit colour with 8 bits/pixel), combined with JPEG compression noise - about as much use for the problem of colour discrimination you are trying to solve as a chocolate teapot is for holding hot tea. The histograms do look different, but you are making life very hard for yourself starting from these. – DisappointedByUnaccountableMod Jul 19 '17 at 12:04
  • Oops "like 8-bit colour" should have been "like 18-bit colour" – DisappointedByUnaccountableMod Jul 19 '17 at 12:17
  • @Proxytype Can you explain a little more how I would summarize pixel values. Isn't that the same as a color histogram? – Danthony Jul 20 '17 at 13:11
  • first it's not possible to compare printed version with digitized version (CYMK, RGB), you need to make indexing for the pixels of the best quality printed version using vision and compare them with the copy version, for example: original pixel (109, 26 ,26) (#6d1a1a), copy pixel (127, 32, 32) (#7f2020) this suppose to be red pixel there little offset but it's still red any other color is defect, you can define your own color offset limit before declare as defect, this depend the printer quality, – Proxytype Jul 20 '17 at 15:39

0 Answers0