Declaration
TIEVisionFaceRecognizer = interface(TIEVisionBase)
Description
An interface to perform face learning and recognition.
| Demos\IEVision\FaceRecognizer\FaceRecognizer.dpr |
| Demos\IEVision\FaceRecognizerVideo\FaceRecognizerVideo.dpr |
// Train our dataset with faces from a multibitmap (where the name associated with each face has been stored in the image dictionary as "Name")
m_faceRecognizer.clear();
for i := 0 to m_faces.Count - 1 do
m_faceRecognizer.addTrainImage(mbitmap.GetTIEBitmap(i).GetIEVisionImage(), // Face image
PWideChar( mbitmap.ImageDictionary[i].GetString('Name') )); // Face name or label
if m_faces.Count > 0 then
m_faceRecognizer.train();
lblDBSize.Caption := format( 'Face DB Size: %d', [ m_faces.Count ]);
// 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) ]));
See Also
◼createFaceRecognizer