http://www.emgu.com
Fills a connected component with given color.
Namespace: Emgu.CVAssembly: Emgu.CV.World (in Emgu.CV.World.dll) Version: 3.2.0.2682 (3.2.0.2682)
Syntax public 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.
Lower bits contain connectivity value, 4 (by default) or 8, used within the function.
Connectivity determines which neighbors of a pixel are considered.
Upper bits can be 0 or combination of the following flags:
CV_FLOODFILL_FIXED_RANGE - if set the difference between the current pixel and seed pixel is considered,
otherwise difference between neighbor pixels is considered (the range is floating).
CV_FLOODFILL_MASK_ONLY - if set, the function does not fill the image (new_val is ignored),
but the fills mask (that must be non-NULL in this case).
Return Value
Type:
Int32[Missing <returns> documentation for "M:Emgu.CV.CvInvoke.FloodFill(Emgu.CV.IInputOutputArray,Emgu.CV.IInputOutputArray,System.Drawing.Point,Emgu.CV.Structure.MCvScalar,System.Drawing.Rectangle@,Emgu.CV.Structure.MCvScalar,Emgu.CV.Structure.MCvScalar,Emgu.CV.CvEnum.Connectivity,Emgu.CV.CvEnum.FloodFillType)"]
See Also