18 November 2008

algoritma histogram (listing)

algoritma histogram

ALGORITMA HISTOGRAMUntuk citra misal ukuran 128 x 128 dengan 256 graylevel (0 s/d 255)

Var
i,j,w,g : integer ;
hist : array[0..255] of integer;
beginfor w := 0 to 255 do hist[w] := 0;
for i := 0 to 127 dofor j := 0 to 127 dog := image[i,j];
hist[g] := hist[g] + 1;
end;
end;
end;
ALGORITMA BRIGHTNESSVartemp,c,i,j : integer ;
beginfor i := 0 to 127 dofor j := 0 to 127 dobegintemp := image[i,j] + c;
if temp>255 then temp:= 255;
if temp<0 then temp:=0;
imagehasil[i,j] := temp;
end;
end;
end;

0 komentar: