ImageEn, unit ievision

TIEVisionLibrary.createObjectsFinder

TIEVisionLibrary.createObjectsFinder


Declaration

function createObjectsFinder(): TIEVisionObjectsFinder; safecall;


Description

Creates an object finder.




Example

var
  objectsFinder: TIEVisionObjectsFinder;
  rects: TIEVisionVectorRect;
...
// load two face detectors
objectsFinder := IEVisionLib.createObjectsFinder();
objectsFinder.addClassifier('face detector 1', IEVisionLib.createCascadeClassifier(IEVC_FRONTAL_FACE_ALT_TREE));
objectsFinder.addClassifier('face detector 2', IEVisionLib.createCascadeClassifier(IEVC_FRONTAL_FACE_DEFAULT));

// detect objects
objectsFinder.findIn(ImageEnView1.IEBitmap.GetIEVisionImage());

// merge intersecting rectangles of all searched objects
rects := objectsFinder.mergeAllRects();

// loop among rectangles
for i := 0 to rects.size-1 do
begin
  ImageEnView1.ObjPenWidth[-1] := 2;
  with rects.getRect(i) do
  begin
    ... do something with the rectangle coordinates and size
  end;
end;