Histogram in Image Processing and Source Code In Delphi

Histogram is The Image Processing Basic That Shows How Much Pixel Value of Red Green And Blue in their Level (usually From 0 to 255) in a Image.


Below is Source Code for Histogram Image in Delphi.


procedure TFormHistogram.Histogram;
var i,j :integer;
temp:PByteArray;

begin
for i:=0 to 255 do
begin
R[i]:=0;
G[i]:=0;
B[i]:=0;
end;
for i:=0 to FormHasil.ImgHasil.Picture.Bitmap.Height-1 do
begin
temp:=FormHasil.ImgHasil.Picture.Bitmap.ScanLine[i];
for j:= 0 to FormHasil.ImgHasil.Picture.Bitmap.Width-1 do
begin
inc(B[temp[3*j]]);
inc(G[temp[3*j+1]]);
inc(R[temp[3*j+2]]);
end;
end;

FormHistogram.ChartR.Series[0].Clear;
FormHistogram.ChartG.Series[0].Clear;
FormHistogram.ChartB.Series[0].Clear;
for i:=0 to 255 do
begin
FormHistogram.ChartR.Series[0].AddXY(i, R[i]);
FormHistogram.ChartG.Series[0].AddXY(i, G[i]);
FormHistogram.ChartB.Series[0].AddXY(i, B[i]);
end;
end;



Please Comment If I’m Wrong. Comment are widely open…!!

Komentar FB


Probably Related Article



2 comments:

Arjuna said...
December 15, 2009 at 11:14 PM

ada source lengkpnya g mas?tertarik nni...

Picas said...
December 18, 2009 at 6:58 AM

ada di hardisk komputer desktop saya..
tapi komputernya tidak bisa hidup..

tapi source diatas tinggal buat sebuah form citra asal, citra hasil di dalamnya.. dan,

3 histrogram dengan 3 warna dalam sebuah form berbeda.

Related Posts by Categories



Widget by