ImageEn, unit ievision

TIEVisionObjectsFinder.findIn

TIEVisionObjectsFinder.findIn


Declaration

procedure findIn(image: TIEVisionImage); safecall;


Description

Loops among all added classifiers to find objects inside the specified image.
Objects found are returned by getFoundRectCount and getFoundRect, or with mergeAllRects.

Parameter Description
image Image where to find the objects



Note: This is available as shortcut method using FindObjects


Example

// Find Faces in image
objectsFinder := IEVisionLib.createObjectsFinder();
objectsFinder.addClassifier('face detector 1', IEVisionLib.createCascadeClassifier(IEVC_FRONTAL_FACE_DEFAULT));
objectsFinder.addClassifier('face detector 2', IEVisionLib.createCascadeClassifier(IEVC_FRONTAL_FACE_ALT_TREE));
objectsFinder.addClassifier('face detector 3', IEVisionLib.createCascadeClassifier(IEVC_FRONTAL_FACE_ALT));
objectsFinder.addClassifier('face detector 4', IEVisionLib.createCascadeClassifier(IEVC_FRONTAL_FACE_ALT_2));
objectsFinder.addClassifier('face detector 5', IEVisionLib.createCascadeClassifier(IEVC_PROFILE_FACE));
objectsFinder.findIn(ImageEnView1.IEBitmap.GetIEVisionImage());
rects := objectsFinder.mergeAllRects();  // merge intersecting rectangles
// Draw rects to image
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;
ImageEnView1.Proc.TextOut( Align_Text_Near_Left, Align_Text_Near_Top, Format( 'Found: %d', [ rects.size ]), 'Arial', 12, Text_Color, [fsBold] );
ImageEnView1.Update();




See Also

getFoundRect
getFoundRectCount
mergeAllRects
mergeRects
DrawRects