Is there anyway to compare 2 similar images (not the same) in Delphi.
here are some examples:
 &
&
Its obvious here that we cant compare pixel by pixel, So my idea was to sum the pixels values of each image, the compare them:
function CalcPix( img : TImage) : longint;
var
  s : longint;
  i, j : integer;
begin
  s := 0;
  for i := 0 to img.Height do
  begin
     for j := 0 to img.Width do
     begin
      if img.Canvas.Pixels[i,j] <> clWhite then
        s := s + img.Canvas.Pixels[i, j];
     end;
  end;
  Result := S;
end;
the results are:
1)14836072057
2)16750850318
as you see they are not that close, and if i do this process with 4 - 5 image at a time it always give me wrong results.
Is there anyother way? like changing the color or contrast etc.
 
     
    