http://www.emgu.com
Fills a connected component with given color.

Namespace: Emgu.CV
Assembly: Emgu.CV (in Emgu.CV.dll) Version: 2.4.0.1717 (2.4.0.1717)

Syntax

C#
public static void cvFloodFill(
	IntPtr src,
	Point seedPoint,
	MCvScalar newVal,
	MCvScalar loDiff,
	MCvScalar upDiff,
	out MCvConnectedComp comp,
	int flags,
	IntPtr mask
)
Visual Basic
Public Shared Sub cvFloodFill ( _
	src As IntPtr, _
	seedPoint As Point, _
	newVal As MCvScalar, _
	loDiff As MCvScalar, _
	upDiff As MCvScalar, _
	<OutAttribute> ByRef comp As MCvConnectedComp, _
	flags As Integer, _
	mask As IntPtr _
)
Visual C++
public:
static void cvFloodFill(
	IntPtr src, 
	Point seedPoint, 
	MCvScalar newVal, 
	MCvScalar loDiff, 
	MCvScalar upDiff, 
	[OutAttribute] MCvConnectedComp% comp, 
	int flags, 
	IntPtr mask
)

Parameters

src
Type: System..::..IntPtr
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.
seedPoint
Type: System.Drawing..::..Point
The starting point.
newVal
Type: Emgu.CV.Structure..::..MCvScalar
New value of repainted domain pixels.
loDiff
Type: Emgu.CV.Structure..::..MCvScalar
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.Structure..::..MCvScalar
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.
comp
Type: Emgu.CV.Structure..::..MCvConnectedComp%
Pointer to structure the function fills with the information about the repainted domain.
flags
Type: System..::..Int32
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).
mask
Type: System..::..IntPtr
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).

See Also