- adi_anabel popraw orty ;)
- try
function Porownaj(Image1, Image2: TImage) : integer;
var x, y: integer;
liczba: LongInt;
punkt1, punkt2: PByteArray;
procent: double;
const max_roznica=5;
begin
liczba:=0;
for y:=0 to image1.Picture.Bitmap.height-1 do begin
punkt1:=image1.Picture.Bitmap.scanline[y];
punkt2:=image2.Picture.Bitmap.scanline[y];
for x:=0 to image1.Picture.Bitmap.width-1 do
if abs(punkt1[x]-punkt2[x])>max_roznica then
inc(liczba);
if image1.Picture.Bitmap.height*image1.Picture.Bitmap.width>0 then
procent:=100*(liczba/(image1.Picture.Bitmap.height*
image1.Picture.Bitmap.width))
else
procent:=0;
Result := 100-round(procent);
end;
end;
Label1.Caption:= 'Rysunki podobne są do siebie w '+IntToStr(Porownaj(Image1,Image2))+' procentach';