Declaration
procedure DrawRects(Rects: TList; LineColor: TColor = clNone; LineWidth: Integer = -1; Ellipses: Boolean = False; BrushStyle: TBrushStyle = bsClear); overload;
procedure DrawRects(Rects: TIERectArray; LineColor: TColor = clNone; LineWidth: Integer = -1; Ellipses: Boolean = False; BrushStyle: TBrushStyle = bsClear); overload;
procedure DrawRects(Rects: TIEVisionVectorRect; LineColor: TColor = clNone; LineWidth: Integer = -1; Ellipses: Boolean = False; BrushStyle: TBrushStyle = bsClear); overload;
procedure DrawRects(KeyPoints: TIEVisionVectorKeyPoint; LineColor: TColor = clNone; LineWidth: Integer = -1; Ellipses: Boolean = False; BrushStyle: TBrushStyle = bsClear); overload;
procedure DrawRects(EllipseList: TIEVisionVectorScalarFloat; LineColor: TColor = clNone; LineWidth: Integer = -1; Ellipses: Boolean = True; BrushStyle: TBrushStyle = bsClear); overload;
Description
Draw a list of rects to the canvas as boxes or ellipses.
Rects can be one of:
◼A TList of TRects, e.g. from
SeparateObjects
◼An array of TRects, e.g. from
FindObjects
◼A
TIEVisionVectorRect object, e.g. from
IEVision methods such as
createVectorRect,
getRegions,
detectObjects, etc.
◼A
TIEVisionVectorKeyPoint object, e.g. from the
IEVision method
detect
◼A
TIEVisionVectorScalarFloat object, e.g. from the
IEVision method
houghCircles
You can optionally specify a line color and width (if you have not already specified these using
Pen).
Examples
objRects := ImageEnView1.Proc.SeparateObjects( 4, True, 10 );
ImageEnView1.IEBitmap.IECanvas.DrawRects( RectsList, clRed, 2 );
ImageEnView1.Update();
for i := 0 to objRects.Count - 1 do
dispose( PRect( objRects[i] ));
objRects.free();

// Find circles in an image using the Hough algorithm
ImageEnView1.IO.LoadFromFile( 'D:\TestImage.jpg' );

ImageEnView1.Proc.SaveState();
ImageEnView1.IEBitmap.PixelFormat := ie8g;
ImageEnView1.IEBitmap.GetIEVisionImage().blur( IEVisionSize(3, 3), IEVisionPoint(-1, -1) );
circles := ImageEnView1.IEBitmap.GetIEVisionImage().houghCircles( ievGRADIENT_ALT, 1.5, 10, 300, 0.9, 0, 0 );
ImageEnView1.IEBitmap.RestoreState(); // Restore image to full color
ImageEnView1.IEBitmap.IECanvas.DrawRects( circles, clBlack, 3 );
ImageEnView1.Proc.TextOut( Align_Text_Near_Left, Align_Text_Near_Top, Format( 'Circles: %d', [ circles.size() ]), 'Arial', 14, clBlack, [fsBold] );
ImageEnView1.Update(); // Show changes to canvas
