datable-be / AI4C_ContentAnalysis

AI4Culture project: content analysis tools
MIT License
1 stars 0 forks source link

error in gray scale or B/W detection #3

Closed hvanstappen closed 4 months ago

hvanstappen commented 4 months ago

(tested with http://localhost:8000/ui/color) With the Blip-vqa-base method, the Warning messages for black&white or grayscale images seem wrong:

Although it seems the internal method uses the same function, in this case the gray scale or B/W detection seems to be correct

TomDeneire commented 4 months ago

The difference is in the fact that with internal labeling the image is resized in the function determine_image, whereas with blip this does not occur. I don't see why that should matter to the is_quasi_monochrome_with_rgb function (specifically the values for r.getextrema() == g.getextrema() == b.getextrema() are different), but will investigate further.

TomDeneire commented 4 months ago

https://github.com/datable-be/AI4C_ContentAnalysis/commit/6cd6afdb3cffba75fc2e898e92deff452b84ba73

Implemented new algorithm to detect black-and-white and/or grayscale images. Also included test corpus of 13 images which are all detected correctly by the algorithm.