Watch, Follow, &
Connect with Us

Please visit our new home
community.embarcadero.com.


Welcome, Guest
Guest Settings
Help

Thread: Compare image/face one versus one



Permlink Replies: 4 - Last Post: Apr 21, 2018 1:41 AM Last Post By: roca robin Threads: [ Previous | Next ]
roca robin

Posts: 140
Registered: 9/10/06
Compare image/face one versus one
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 10, 2018 6:22 AM
I used this link
http://www.mrsoft.org/home/downloads.html

then downloaded this,
http://www.mrsoft.org/Delphi/EMTest.zip

I don't understand why I can't compare image 1 isto 1

has anyone played this?
Dave Nottage

Posts: 1,850
Registered: 1/7/00
Re: Compare image/face one versus one
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 16, 2018 4:43 PM   in response to: roca robin in response to: roca robin
I don't understand why I can't compare image 1 isto 1

You might want to explain more about what you mean. I don't see any image 1 in that test app.

--
Dave Nottage [TeamB]
Find hints tips and tricks at Delphi Worlds blog: http://www.delphiworlds.com
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Compare image/face one versus one
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 16, 2018 5:45 PM   in response to: Dave Nottage in response to: Dave Nottage
Dave Nottage wrote:
You might want to explain more about what you mean. I don't see any image 1 in that test app.

I read Roca's statement was saying "compare images 1:1" aka "compare images 1-to-1".

--
Remy Lebeau (TeamB)
Dave Nottage

Posts: 1,850
Registered: 1/7/00
Re: Compare image/face one versus one
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 16, 2018 6:13 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
I read Roca's statement was saying "compare images 1:1" aka "compare images 1-to-1".

Still needs more explanation :-)

--
Dave Nottage [TeamB]
Find hints tips and tricks at Delphi Worlds blog: http://www.delphiworlds.com
roca robin

Posts: 140
Registered: 9/10/06
Re: Compare image/face one versus one
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 21, 2018 1:38 AM   in response to: roca robin in response to: roca robin
@David, the TestApp Folder has images of Faces, so that's what I test.

Actually I mailed the owner of the Library,

he helped me for a few samples,

here:

unit Unit1;
 
interface
 
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, matrix;
 
type
  TForm1 = class(TForm)
    Button1: TButton;
    memLog: TMemo;
    procedure Button1Click(Sender: TObject);
  private
    { Private-Deklarationen }
    function mtxFromImg( bmpFn : string) : IMatrix;
  public
    { Public-Deklarationen }
  end;
 
var
  Form1: TForm1;
 
implementation
 
uses corr;
 
{$R *.dfm}
 
{ TForm1 }
 
function TForm1.mtxFromImg(bmpFn: string): IMatrix;
var bmp : TBitmap;
    pScanline : PRGBTriple;
    x, y : integer;
begin
     bmp := TBitmap.Create;
     bmp.LoadFromFile(bmpFn);
 
     bmp.PixelFormat := pf24bit;
     Result := TDoubleMatrix.Create(bmp.Width, bmp.Height);
 
     for y := 0 to bmp.Height - 1 do
     begin
          pScanLine := bmp.ScanLine[y];
 
          for x := 0 to bmp.Width - 1 do
          begin
               Result[x, y] := Round(pScanline^.rgbtBlue*0.1140 + pScanline^.rgbtRed*0.2989 + pScanline^.rgbtGreen*0.5870);
               inc(pScanLine);
          end;
     end;
     bmp.Free;
end;
 
procedure TForm1.Button1Click(Sender: TObject);
var ref : IMatrix;
    bmp1, bmp2, bmp3 : IMatrix;
    cr : double;
begin
     memLog.Lines.Add('loading reference file');
     ref := mtxFromImg('bmpRef.bmp');
 
     memLog.Lines.Add('loading similar file');
     bmp1 := mtxFromImg('bmpSim.bmp');
 
     memLog.Lines.Add('loading 2nd similar file');
     bmp2 := mtxFromImg('bmpSim2.bmp');
 
     memLog.Lines.Add('loading 2nd face');
     bmp3 := mtxFromImg('2ndface.bmp');
 
 
     with TCorrelation.Create do
     try
        cr := Correlate(ref, bmp1);
        memLog.Lines.Add(Format('Correlation 1 %.3f', [cr]));
 
        cr := Correlate(ref, bmp2);
        memLog.Lines.Add(Format('Correlation 2 %.3f', [cr]));
 
        cr := Correlate(ref, bmp3);
        memLog.Lines.Add(Format('Correlation 2 %.3f', [cr]));
     finally
            Free;
     end;
end;
 
end.


But didn't help it out, it's not the way I want, OpenCv Object Recognizer is more Accurate than it was expected.
AGAIN,
But, I still don't noticed why SVM or NEURO not been used in the samples he gave.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02