ImageEn, unit ievision

TIEVisionObjectsFinder.mergeRects

TIEVisionObjectsFinder.mergeRects


Declaration

function mergeRects(name1: PAnsiChar; name2: PAnsiChar): TIEVisionVectorRect; safecall;


Description

Merges rectangles that intersect of the specified objects detectors.

Parameter Description
name1 Name of an object detector
name2 Name of an object detector


Example

// detect objects
objectsFinder.findIn(image);

// merge intersecting rectangles of "face1" and "face2" detectors
rects := objectsFinder.mergeRects("face1", "face2");

// 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', [ lines.size ]), 'Arial', 12, clYellow, [fsBold] );
ImageEnView1.Update();


See Also

findIn
getFoundRect
getFoundRectCount
mergeAllRects
DrawRects