How can I automatically determine whether an image file depicts a photo or a 'graphic'?
问题 How can I automatically determine whether an image file depicts a photo or a 'graphic'? For example using Imagemagick? 回答1: I am somewhat at the limits of my knowledge here, but I read a paper and have worked out a way to calculate image entropy with ImageMagick - some clever person might like to check it! #!/bin/bash image=$1 # Get number of pixels in image px=$(convert -format "%w*%h\n" "$image" info:|bc) # Calculate entropy # See this paper www1.idc.ac.il/toky/imageProc-10/Lectures/04