ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Finding related face from multiple image files using FaceRecognizer
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

kerk

Malaysia
11 Posts

Posted - Sep 18 2024 :  03:02:19  Show Profile  Reply
Dear sir/madam,

I'm new to the ImageEn & IEVision components. I was looking for a sample coding for searching/finding similar face which provided at the first stage, and continue for searching function with multiple image files and list them out to the listbox.

Kerk

kerk

xequte

38607 Posts

Posted - Sep 18 2024 :  18:39:14  Show Profile  Reply
Hi Kerk

Please see the demo at:

\Demos\IEVision\FaceRecognizer\FaceRecognizer.dpr

It is available compiled at:

https://www.imageen.com/files/demos/run/IEVision/FaceRecognizer/FaceRecognizer.zip

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

kerk

Malaysia
11 Posts

Posted - Sep 20 2024 :  22:53:45  Show Profile  Reply
Dear Nigel,

I had tried the sample application and also read out some of the features and functions. But still can't figure out how to match or search/compare from provided image and searching thru the image files in the subfolder each by each which match the provided image function.

Can you guide me thru it? I'm rushing out to create the Demo application for my client.

Thanks a lot for your help.

Kerk
Go to Top of Page

kerk

Malaysia
11 Posts

Posted - Sep 20 2024 :  23:34:02  Show Profile  Reply
Hi Nigel,

I had uses 2 ImageEnView component for open two different image files and my codes as below to find/search/compare the two files:

var
  i : Integer;
  objectsFinder: TIEVisionObjectsFinder;
  rects: TIEVisionVectorRect;
  r: TIEVisionRect;
  Text_Color: String;
begin
  objectsFinder := IEVisionLib.createObjectsFinder();
  objectsFinder.addClassifier('face detector 5', IEVisionLib.createCascadeClassifier(IEVC_PROFILE_FACE));
  objectsFinder.findIn(ImageEnView2.IEBitmap.GetIEVisionImage());
  rects := objectsFinder.mergeAllRects();  // merge intersecting rectangles
  for i := 0 to rects.size() - 1 do
  begin
    r := rects.getRect(i);

    with ImageEnView1.IEBitmap.Canvas do
    begin
      Pen.Width := 2;
      Pen.Color := clRed;
      Brush.Style := bsClear;
      Rectangle( r.x, r.y, r.x + r.width, r.y + r.width );
    end;
  end;
  ImageEnView2.Proc.TextOut( Align_Text_Near_LEft, Align_Text_Near_Top, Format( 'Found: %d', [ rects.size ]), 'Arial', 12, clWhite, [fsBold]);
  ImageEnView2.Update();
Go to Top of Page

xequte

38607 Posts

Posted - Sep 21 2024 :  17:35:47  Show Profile  Reply
Sorry, I'm not sure if there is much more detail I can add over what is shown in the FaceRecognizer.dpr demo.

To generate a database you would need to use a standard method to iterate the files in a folder (e.g. FindFirstFile/FindNextFile) and then:

1. Load the image into a TImageEnView or TIEBitmap
2. Call a method like ExtractFaces() (in the demo) to extract all the faces in the image
3. Pass each face to a method like AddFace() (in the demo) to add the face to the database


To find a matching face in the database you would:

1. Load the image into a TImageEnView or TIEBitmap
2. Call a method like ExtractFaces() (in the demo) to extract the faces in the image
3. Assign one of the face rects to a TIEBitmap, e.g. faceBitmap.AssignRect( ImageEnView1.IEBitmap, IEVisionRectToTRect(Rect) );
4. Pass the bitmap to TIEVisionFaceRecognizer.detect() to get the matching name and confidence

recName := m_faceRecognizer.detect( faceBitmap.GetIEVisionImage(), confidence );


Nigel
Xequte Software
www.imageen.com
Go to Top of Page

kerk

Malaysia
11 Posts

Posted - Sep 25 2024 :  00:59:14  Show Profile  Reply
Hi Nigal,

I had tried according to your guides. But when I try to run the application is ok, but when pressing and load the image for next step, it shown the error Access violation at address 009A251C in module. When i try to debug and run it, it stop at the

m_objectsFinder.findIn(ImageEnView1.IEBitmap.GetIEVisionImage());

Kerk


Go to Top of Page

xequte

38607 Posts

Posted - Sep 26 2024 :  15:03:56  Show Profile  Reply
Hi Kerk

Is this our pre-compiled demo from: www.ImageEn.com/demos/

Or have you compiled itself using the trial? If so, what version of Delphi are you using?

If you are using ImageEn v13.2.0, please use this version of IEVision:

https://imageen.com/files/trial/IEVision_8.1.1_Trial.exe

Are you sure the IEVision-Trial.dll is in the same folder as your EXE. Please right-click it to view the properties and tell me what version it is.

Please forward me some of the images you are testing.




Nigel
Xequte Software
www.imageen.com
Go to Top of Page

kerk

Malaysia
11 Posts

Posted - Sep 27 2024 :  02:25:01  Show Profile  Reply
Hi Nigel,

Yes, even I use the pre-compiled version. I did also copy the IEVision_Trial.dll to the application folder.

Alright, will attach the document for your reference.

Kerk




Go to Top of Page

kerk

Malaysia
11 Posts

Posted - Sep 27 2024 :  02:30:19  Show Profile  Reply
Hi Nigel,

I had tried the latest download of:

If you are using ImageEn v13.2.0, please use this version of IEVision:
https://imageen.com/files/trial/IEVision_8.1.1_Trial.exe

When i try to open the FaceRecognizer from demo folder and try to run it, it shown the attach error.

Kerk

Go to Top of Page

kerk

Malaysia
11 Posts

Posted - Sep 27 2024 :  02:43:19  Show Profile  Reply
Hi Nigel,

After i try to compiled it and run it. Seem like doesn't work as well.

Kerk.









Go to Top of Page

xequte

38607 Posts

Posted - Sep 27 2024 :  02:46:25  Show Profile  Reply
Hi

You are using an old version of ImageEn, so you should be using the matching version of IEVision which is 6.0.3:

https://imageen.com/files/trial/IEVision_6.0.4_Trial.exe

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

kerk

Malaysia
11 Posts

Posted - Sep 27 2024 :  03:53:19  Show Profile  Reply
Hi Nigel,

Ok, downloading now, will try out asap. Thanks ya!

Kerk
Go to Top of Page

kerk

Malaysia
11 Posts

Posted - Sep 27 2024 :  20:47:30  Show Profile  Reply
Hi Nigel,

I had downloaded the 6.0.4, but when i compiled and run it, it shown required 6.0.3.dll.

Kerk



Go to Top of Page

xequte

38607 Posts

Posted - Sep 27 2024 :  21:33:06  Show Profile  Reply
Sorry, I gave you the wrong link for v6.0.3:

https://imageen.com/files/trial/IEVision_6.0.3_Trial.exe

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

kerk

Malaysia
11 Posts

Posted - Sep 29 2024 :  00:16:38  Show Profile  Reply
Hi Nigel,

Now it able to run the trial demo. Thanks for your help. I'll continue with the Demo Application to my client. Hope to hear from the result asap.

Kerk
Go to Top of Page

kerk

Malaysia
11 Posts

Posted - Sep 29 2024 :  01:40:20  Show Profile  Reply
Hi Nigel,

I had managed to run the demo and learned the codes. But I still can't find a way to compare the Face in provided image file and other image files.

For the detect face part is ok. Now only left the checking each files which contain the detected face.

Or is there any command to match detected face or something like that?

Kerk.
Go to Top of Page

xequte

38607 Posts

Posted - Sep 29 2024 :  20:50:27  Show Profile  Reply
Hi Kerk

You can use the detect method:

// look up a face in the database
recName := m_faceRecognizer.detect( faceBitmap.GetIEVisionImage(), confidence );
ShowMessage( Format( 'This face is "%s" (Confidence: %s)', [ recName, FloatToStr(confidence) ]));

http://www.imageen.com/help/TIEVisionFaceRecognizer.detect.html

Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: