[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: how to count % color coverage?

On 8/26/05, Teemu Ikonen <tpikonen@gmail.com> wrote:
> On 8/26/05, Paolo Pedaletti <paolo.pedaletti@unimib.it> wrote:
> > (better were if I could count how much (%) of each color [.gif, indexed]
> > is present in the photo, but I can resolve this in other way...)

Oops, should have tested before posting. This should be better:

#! /usr/bin/octave -qf
# Print percentages of colours present in a 256-color image
# given as a command line argument

[x,n] = hist(imread(argv{1})(:), [0:255]+0.5, 100);
disp([floor(n)', x']);


Reply to: