IVALab Python Libraries
Collection of code for computer vision and robotics with specific API.
|
Public Member Functions | |
def | __init__ (self, RG_Params params) |
def | display_results (self) |
def | get_final_mask (self) |
def | get_init_mask (self) |
def | process_mask (self, img, mask, mask_rej=None) |
def | process_seeds (self, img, seeds, rejects=[]) |
Public Attributes | |
cache_img | |
cache_map | |
final_mask | |
init_mask | |
neigb | |
reg_avg | |
reg_var | |
seed_list | |
@brief The base class for all the region grower class. The Region Grow algorithm assumes that a target area is a connected area. The algorithm starts from some initial target pixels (seeds), and then attempts to grow out the whole target region based on some criteria This base class codes up the region grow algorithm process for extracting the target region: 1. Initialize from a single pixel or a binary mask, whose pixels will be marked as target pixels and as "seed" (term for the accepted target pixels whose neighbor pixels have not been examined) 2. while (seed list is not empty): 2.1 pop out a seed and check its neighborhood pixels. 2.2 for each neighbor, if it is out of bounadry, or already been marked as accepted or discarded, then pass 2.3 for each neighbor, if it can pass some criteria, then mark as accepted and add to the seed list else mark as discarded and continue
def __init__ | ( | self, | |
RG_Params | params | ||
) |
Reimplemented in MaskGrower, and RegionGrower_ValDiff.
def display_results | ( | self | ) |
def get_final_mask | ( | self | ) |
def get_init_mask | ( | self | ) |
def process_mask | ( | self, | |
img, | |||
mask, | |||
mask_rej = None |
|||
) |
Region grow from an initial mask @param[in] img The image to apply the algorithm @param[in] mask A initial binary mask in numpy. The same shape as the image
def process_seeds | ( | self, | |
img, | |||
seeds, | |||
rejects = [] |
|||
) |
Region grow from a list of initial seeds @param[in] img The image to apply the algorithm @param[in] seeds (N, 2). 2: (row, col). A list of the initial seed coordinates @param[in] rejects (N, 2). 2: (row, col). A list of discarded pixels that the algorithm shouldn't grow to
cache_img |
cache_map |
final_mask |
init_mask |
neigb |
reg_avg |
reg_var |
seed_list |