ImageEn, unit ievision

TIEVisionObjectsFinder.mergeAllRects

TIEVisionObjectsFinder.mergeAllRects


Declaration

function mergeAllRects(): TIEVisionVectorRect; safecall;


Description

Merges rectangles that intersect of all object detectors.


Example

// detect objects
objectsFinder.findIn(image);

// merge intersecting rectangles
rects := objectsFinder.mergeAllRects();

// 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
mergeRects
DrawRects