http://www.emgu.com
Fills a connected component with given color.
Namespace:
Emgu.CV
Assembly:
Emgu.CV.World (in Emgu.CV.World.dll) Version: 4.1.1.3497 (4.1.1.3497)
Syntaxpublic static int FloodFill(
IInputOutputArray src,
IInputOutputArray mask,
Point seedPoint,
MCvScalar newVal,
out Rectangle rect,
MCvScalar loDiff,
MCvScalar upDiff,
Connectivity connectivity = Connectivity.FourConnected,
FloodFillType flags = FloodFillType.Default
)
Public Shared Function FloodFill (
src As IInputOutputArray,
mask As IInputOutputArray,
seedPoint As Point,
newVal As MCvScalar,
<OutAttribute> ByRef rect As Rectangle,
loDiff As MCvScalar,
upDiff As MCvScalar,
Optional connectivity As Connectivity = Connectivity.FourConnected,
Optional flags As FloodFillType = FloodFillType.Default
) As Integer
public:
static int FloodFill(
IInputOutputArray^ src,
IInputOutputArray^ mask,
Point seedPoint,
MCvScalar newVal,
[OutAttribute] Rectangle% rect,
MCvScalar loDiff,
MCvScalar upDiff,
Connectivity connectivity = Connectivity::FourConnected,
FloodFillType flags = FloodFillType::Default
)
static member FloodFill :
src : IInputOutputArray *
mask : IInputOutputArray *
seedPoint : Point *
newVal : MCvScalar *
rect : Rectangle byref *
loDiff : MCvScalar *
upDiff : MCvScalar *
?connectivity : Connectivity *
?flags : FloodFillType
(* Defaults:
let _connectivity = defaultArg connectivity Connectivity.FourConnected
let _flags = defaultArg flags FloodFillType.Default
*)
-> int
Parameters
- src
- Type: Emgu.CVIInputOutputArray
Input 1- or 3-channel, 8-bit or floating-point image. It is modified by the function unless CV_FLOODFILL_MASK_ONLY flag is set. - mask
- Type: Emgu.CVIInputOutputArray
Operation mask,
should be singe-channel 8-bit image, 2 pixels wider and 2 pixels taller than image.
If not IntPtr.Zero, the function uses and updates the mask, so user takes responsibility of initializing mask content.
Floodfilling can't go across non-zero pixels in the mask, for example, an edge detector output can be used as a mask to stop filling at edges.
Or it is possible to use the same mask in multiple calls to the function to make sure the filled area do not overlap.
Note: because mask is larger than the filled image, pixel in mask that corresponds to (x,y) pixel in image will have coordinates (x+1,y+1). - seedPoint
- Type: System.DrawingPoint
The starting point. - newVal
- Type: Emgu.CV.StructureMCvScalar
New value of repainted domain pixels. - rect
- Type: System.DrawingRectangle
Output parameter set by the function to the minimum bounding rectangle of the repainted domain. - loDiff
- Type: Emgu.CV.StructureMCvScalar
Maximal lower brightness/color difference
between the currently observed pixel and one of its neighbor belong to the component
or seed pixel to add the pixel to component.
In case of 8-bit color images it is packed value. - upDiff
- Type: Emgu.CV.StructureMCvScalar
Maximal upper brightness/color difference
between the currently observed pixel and one of its neighbor belong to the component
or seed pixel to add the pixel to component.
In case of 8-bit color images it is packed value. - connectivity (Optional)
- Type: Emgu.CV.CvEnumConnectivity
Flood fill connectivity - flags (Optional)
- Type: Emgu.CV.CvEnumFloodFillType
The operation flags.
Return Value
Type:
Int32The area of the connected component
See Also