Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: BMP: Drawing or photograph?by Anonymous Monk |
on Oct 29, 2012 at 12:35 UTC ( [id://1001353]=note: print w/replies, xml ) | Need Help?? |
Just pull a histogram on a random sample of the pixels, then measure the standard deviation. If it's low, i.e. if the histogram is well-distributed between highs and lows, and especially among colors, it's a photograph. If it's high, and tends toward white or black pixels, it's a drawing. Asssemble a test set of a few hundred of both types for algorithm-training purposes.
In Section
Seekers of Perl Wisdom
|
|