thanks for looking at my question.
Basically what I’m trying to do is find all images that look like the first and the third image here: https://i.stack.imgur.com/Nl5lp.jpg
and remove all the ones that don’t look like that (2,4).
I’ve tried several libraries to no avail.
Another acceptable way to do this is to check if the images contain “Code:”, as that string is in each one that I have to sort out.
Thank you,
Steve
EDIT: Although the 1st and 3rd images seem like they are the same size, they are not.
If those are the actual images you’re going to use, it looks like histogram similarity will do the job. The first and third are very contrasty, the second and fourth, especially the fourth, have a wide range of different intensities.
You could easily make a histogram of the shades of grey in the image and then apply thresholds to the shape of the histogram to classify them.
EDIT: To actually do this: you can iterate through every pixel and create an array of pixel value => number of times found. As it’s greyscale you can take either the R, G or B channel. Then divide each number by the number of pixels in the image to normalise, so it will work for any size. Each entry in the histogram will then be a fraction of the number of pixels used. You can then measure the number of values above a certain threshold. If there are lots of greys, you’ll get a large number of small values. If there aren’t, you’ll get a small number of large values.