ImageEn, unit ievision

TIEVisionImage.floodFill

TIEVisionImage.floodFill


Declaration

procedure floodFill(outMask: TIEVisionImage; startingPoint: TIEVisionPoint; loDiff: TIEVisionScalar; upDiff: TIEVisionScalar; connectivity: int32_t = 4; fixedRange: bool32 = false); safecall;


Description

Fills specified mask with a connected pixels. Connected pixels will have 255 value in the mask, 0 otherwise.

Parameter Description
outMask Output gray scale mask
startingPoint Starting pixel of source image
loDiff Maximal lower brightness/color difference
upDiff Maximal upper brightness/color difference
connectivity Determines which neighbors of a pixel are considered
fixedRange If True only the difference between the current pixel and starting pixel is considered


Example

// makes transparent all connected pixels starting from x = 10, y = 10
var mask: TIEVisionImage;
ImageEnView1.IO.LoadFromFile('test.jpg');
mask := IEVisionLib.createImage();
ImageEnView1.IEBitmap.GetIEVisionImage().floodFill(mask, IEVisionPoint(10, 10), IEVisionScalar(4, 4, 4), IEVisionScalar(4, 4, 4));
mask.opNot(mask);
ImageEnView1.IEBitmap.AlphaChannel.AssignIEVisionImage(mask);
imageEnview1.Update();