TIEVisionFaceDetector.detect
Declaration
function detect(image: TIEVisionImage; const rect: TIEVisionRect): TIEVisionVectorObjRef; safecall;
Description
Finds faces in the specified image.
Returns a list of
TIEVisionDetectedFace objects, highest score first. The list is empty if no faces were found.
| Parameter | Description |
| image | Image to search. 24 bit RGB, 32 bit RGBA, 8 bit gray scale and 1 bit images are supported |
| rect | Rectangle to search. (0, 0, 0, 0) means the whole image. Results are in image coordinates |
Demos
| Demos\IEVision\GetFaces\GetFaces.dpr |
| Demos\ImageEditing\EveryMethod\EveryMethod.dpr |
Example
var
faces: TIEVisionVectorObjRef;
face: TIEVisionDetectedFace;
r: TIEVisionRect;
i: Integer;
begin
faces := IEVisionLib.createFaceDetector().detect( ImageEnView1.IEBitmap.GetIEVisionImage(), IEVisionRect( 0, 0, 0, 0 ));
for i := 0 to faces.size() - 1 do
begin
face := TIEVisionDetectedFace( faces.getObj( i ));
r := face.getRect();
ImageEnView1.LayersAdd( iesRectangle, Rect( r.x, r.y, r.x + r.width, r.y + r.height ), clRed, 2 );
end;
end;
See Also
◼DetectFaces