HolesFilling
The
HolesFilling
components defines how to fill the selected region in an image and mask.
This is an abstract class that can not be used directly. In order to use it, it is necessary to use its inherited classes.
HolesFilling
HolesFilling (modifier:RegionModifier=None, hole_maker:HoleMakerTechnique=None)
Defines the strategy used to make the holes.
Type | Default | Details | |
---|---|---|---|
modifier | RegionModifier | None | The modifier that defines the traditional augments to apply to the selected regions. |
hole_maker | HoleMakerTechnique | None | The strategy used to make the holes. |
The default technique used to make those holes is the HoleMakerRandom
technique.
HolesFilling.make_hole
HolesFilling.make_hole (mask)
Makes the holes in the mask.
Details | |
---|---|
mask | The mask associated with the image where the hole is going to be made. |
The make_hole
function calls the get_hole
function of the HoleMakerTechnique
used.
HolesFilling.fill_hole
HolesFilling.fill_hole (image:numpy.ndarray, mask:numpy.ndarray, xhole:slice, yhole:slice, fill_values:Union[Calla ble[[numpy.ndarray],numpy.ndarray],numpy.ndarray, float], transparence:bool=False)
Fills a specific hole with something.
Type | Default | Details | |
---|---|---|---|
image | ndarray | The image where the hole is going to be made. | |
mask | ndarray | The mask associated with the image where the hole is going to be made. | |
xhole | slice | The slice that defines the x-region where the hole is. | |
yhole | slice | The slice that defines the y-region where the hole is. | |
fill_values | typing.Union[typing.Callable[[numpy.ndarray], numpy.ndarray], numpy.ndarray, float] | The value to fill the hole (a function to apply or a constant). | |
transparence | bool | False | Whether the fill_values must be added to the image in a transparent form. fill_value if fill_value else image for each value in fill_values |
The fill_values
parameter defines what is used to fill the hole. It can be a callable (another function that is applied to the image and to the mask to select something inside them) or a constant value.