Is there a way to write a program that can identify photos vs. graphic images in a folder of jpg files?

sample photo http://dansdemos.info/clips/samples/photo.jpg

sample graphic image http://dansdemos.info/clips/samples/graphic.jpg

I was thinking ImageMagic compare could do it, if it was provided a set of samples it could use to calculate differences between images. I was thinking coming up with that might be tricky, so I was hoping there might be a simpler approach. Maybe something as simple as a Google search I have not thought of. Any help or comment would be much appreciated. Thank you.

有帮助吗?

解决方案

You could have the program check for Exif data of various kinds, like the camera manufacturer.

It wouldn't be foolproof, but it would probably work in most cases, as long as the Exif data hasn't been removed from photos by some postprocessing step.

It worked just fine on your two sample images. E.g. your photo of guinea fowl has Exif data for camera maker, camera model, f-stop, exposure, etc. The graphic.jpg appears to have none of those.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top