◆ __init__()
def __init__ |
( |
|
self, |
|
|
* |
args |
|
) |
| |
◆ apply()
def apply |
( |
|
self, |
|
|
|
mask, |
|
|
|
cache = False |
|
) |
| |
Execute the mask processing sequence.
Args:
mask (np.ndarray. (H, W)): The mask to process
cache (bool, optional): Cache the results in the process or not. Defaults to False.
Returns:
maskOut: The processed mask
◆ closing()
def closing |
( |
|
mask, |
|
|
|
kernel |
|
) |
| |
|
static |
Morphological closing operation(dilate then erode)
This operation can fill the small holes in the mask
Args:
mask (np.ndarray. (H, W)): The input mask
kernel (np.ndarray. (Hk, Wk)): The kernel for morphological closing
Returns:
maskClosing [np.ndarray. (H, W)]: The mask after Closing operation
◆ dilate()
def dilate |
( |
|
mask, |
|
|
|
kernel |
|
) |
| |
|
static |
Morphological dilation operation
Args:
mask (np.ndarray. (H, W)): The input mask
kernel (np.ndarray. (Hk, Wk)): The kernel for morphological dilation
Returns:
maskDilate [np.ndarray. (H, W)]: The mask after dilation
◆ erode()
def erode |
( |
|
mask, |
|
|
|
kernel |
|
) |
| |
|
static |
Morphological erosion operation
Args:
mask (np.ndarray. (H, W)): The input mask
kernel (np.ndarray. (Hk, Wk)): The kernel for morphological erosion
Returns:
maskErode (np.ndarray. (H, W)): The mask after erosion
◆ get_cache_results()
def get_cache_results |
( |
|
self | ) |
|
Get the cached results
Returns:
cache_results[list]: A list of cached results in the processing order
◆ getLargestCC()
Return the largest connected component of a binary mask
If the mask has no connected components (all zero), will be directly returned
@param[in] mask The input binary mask
@param[out] largestCC The binary mask of the largest connected component
The shape is the same as the input mask
◆ opening()
def opening |
( |
|
mask, |
|
|
|
kernel |
|
) |
| |
|
static |
Morphological opening operation(erode then dilate)
This operation can remove small blobs in the mask
Args:
mask (np.ndarray. (H, W)): The input mask
kernel (np.ndarray. (Hk, Wk)): The kernel for morphological opening
Returns:
maskOpening [np.ndarray. (H, W)]: The mask after Opening operation
◆ cache
◆ numfuncs
The documentation for this class was generated from the following file:
- /home/pvela/python/improcessor/improcessor/mask.py