histogram.m
function h=histogram(f,N) % histogram - computes a grey level histogram. % version 1 % Lance Williams % Dept. of Computer Science % Univ. of New Mexico % h(1:N) = 0; rf=size(f,1); cf=size(f,2); for i=0:N-1 h(i+1) = sum(sum(f==i)); end
function h=histogram(f,N) % histogram - computes a grey level histogram. % version 1 % Lance Williams % Dept. of Computer Science % Univ. of New Mexico % h(1:N) = 0; rf=size(f,1); cf=size(f,2); for i=0:N-1 h(i+1) = sum(sum(f==i)); end
call:
답글삭제octave:72> hh=histogram(aa, 256);
octave:73>
octave:73>
octave:73> plot(0:255, hh)