ImageEn, unit iexHelperFunctions |
|
TIEBitmapHelper.DetectPeople
Declaration
function DetectPeople(): TIERectArray;
Description
A shortcut method that creates a
TIEVisionPeopleDetector object and calls
detect.
Note:
◼You must add the iexHelperFunctions unit to your uses clause
◼You can draw the rects to a canvas using
DrawRects◼Object detection requires
IEVision. You will need to
register it before calling the method
Method Behaviour
The following call:
rects := ImageEnView1.IEBitmap.DetectPeople();
Is the same as calling:
peopleDetector := IEVisionLib.createPeopleDetector();
vrects := peopleDetector.detect( ImageEnView1.IEBitmap.GetIEVisionImage() );
| Demos\ImageEditing\EveryMethod\EveryMethod.dpr |
// Detect people in image
rects := ImageEnView1.IEBitmap.DetectPeople();
// Draw rects to image
for i := 0 to Length(rects) - 1 do
begin
r := rects[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;
ImageEnView1.Proc.TextOut( Align_Text_Near_Left, Align_Text_Near_Top, Format( 'Found: %d', [ Length(rects) ]), 'Arial', 12, Text_Color, [fsBold] );
ImageEnView1.Update();