IVALab Python Libraries
Collection of code for computer vision and robotics with specific API.
Public Member Functions | Public Attributes | List of all members
RegionGrower_base Class Reference
Inheritance diagram for RegionGrower_base:
Inheritance graph
[legend]

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
 

Detailed Description

@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

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
RG_Params  params 
)

Reimplemented in MaskGrower, and RegionGrower_ValDiff.

Member Function Documentation

◆ display_results()

def display_results (   self)

◆ get_final_mask()

def get_final_mask (   self)

◆ get_init_mask()

def get_init_mask (   self)

◆ process_mask()

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

◆ process_seeds()

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

Member Data Documentation

◆ cache_img

cache_img

◆ cache_map

cache_map

◆ final_mask

final_mask

◆ init_mask

init_mask

◆ neigb

neigb

◆ reg_avg

reg_avg

◆ reg_var

reg_var

◆ seed_list

seed_list

The documentation for this class was generated from the following file: