Start » Filter Reference » OpenCV » Miscellaneous Image Transformations » cvFloodFill
Module: | OpenCV |
---|
Fills a connected component with the given color.
Name | Type | Description | |
---|---|---|---|
ioSrc | Image | Input image. | |
inMask | Image* | Operation mask that should be a single-channel 8-bit image, 2 pixels wider and 2 pixels taller. The function uses and updates the mask, so you take responsibility of initializing the mask content. Flood-filling cannot 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. It is possible to use the same mask in multiple calls to the function to make sure the filled area does not overlap. | |
inSeed | Location | Starting point. | |
inNewVal | Pixel | New value of the repainted domain pixels. | |
inLoDiff | Pixel | Maximal lower brightness/color difference between the currently observed pixel and one of its neighbors belonging to the component, or a seed pixel being added to the component. | |
inUpDiff | Pixel | Maximal upper brightness/color difference between the currently observed pixel and one of its neighbors belonging to the component, or a seed pixel being added to the component. | |
inConnectivity | RegionConnectivity | Connectivity determines which neighbors of a pixel are considered. | |
inFloodFillFixedRange | Bool | If set, the difference between the current pixel and seed pixel is considered. Otherwise, the difference between neighbor pixels is considered. | |
outRect | Region | ||
outMask | Image | Output operation mask. |
Errors
This filter can throw an exception to report error. Read how to deal with errors in Error Handling.
List of possible exceptions:
Error type | Description |
---|---|
DomainError | Input image must be 1- or 3-channel, UINT8 or REAL image in cvFloodFill. |
DomainError | Mask size must be larger by 2px in width and height than inSrc in cvFloodFill. |
Complexity Level
This filter is available on Basic Complexity Level.