ImageEn, unit iexHelperFunctions

TIEBitmapHelper.DetectPeople

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
Delphi/C++ 2005 or newer is required to use helper classes
You can draw the rects to a canvas using DrawRects
If the bitmap is not ie24RGB, it will be converted
Object detection requires IEVision. You will need to register it before calling the method

Method Behavior

The following call:
rects := ImageEnView1.IEBitmap.DetectPeople();

Is the same as calling:
peopleDetector := IEVisionLib.createPeopleDetector();
vrects := peopleDetector.detect( ImageEnView1.IEBitmap.GetIEVisionImage() );

Demo

Demo  Demos\ImageEditing\EveryMethod\EveryMethod.dpr

Example

// 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();