facebook360_dep
Facebook360 Depth Estimation Pipeline
Public Member Functions | Public Attributes | List of all members
foreground_mask.ForegroundMask Class Reference

Public Member Functions

def __init__ (self, parent=None)
 
def reset_params (self)
 
def set_images (self, filename_bg, filename_fg, res=2048)
 
def generate_fg_mask (self, image_bg, image_fg, blur, closing, thresh)
 
def apply_thresholds (self, blur=-1, closing=-1, thresh=-1)
 

Public Attributes

 image_float_fg
 
 image_float_bg
 
 image_8bit_fg
 
 image_8bit_bg
 
 image_unchanged_fg
 
 image_unchanged_bg
 
 blur
 
 closing
 
 thresh
 
 ready
 

Detailed Description

Back-end for the interactive element to visualize foreground mask thresholds.

Attributes:
    blur (int): Gaussian blur radius.
    closing (int): Closure (for sealing holes).
    image_8bit_bg (np.array[uint8]): Thresholded background image (loaded as 8-bit).
    image_8bit_fg (np.array[uint8]): Thresholded foreground image (loaded as 8-bit).
    image_float_bg (np.array[float]): Thresholded background image (loaded as floats).
    image_float_fg (np.array[float]): Thresholded foreground image (loaded as floats).
    image_unchanged_bg (np.array[_]): Thresholded background image (loaded unchanged from disk).
    image_unchanged_fg (np.array[_]): Thresholded foreground image (loaded unchanged from disk).
    ready (bool): Whether or not the element is ready to display.
    thresh (int): Threshold applied to segment foreground and background

Constructor & Destructor Documentation

◆ __init__()

def foreground_mask.ForegroundMask.__init__ (   self,
  parent = None 
)
Initializes the back-end for foreground mask thresholds visualization with default
parameters and no images.

Args:
    parent (App(QDialog), optional): Object corresponding to the parent UI element.

Member Function Documentation

◆ apply_thresholds()

def foreground_mask.ForegroundMask.apply_thresholds (   self,
  blur = -1,
  closing = -1,
  thresh = -1 
)
Displays colored visualization of the foreground masking.

Args:
    blur (int, optional): Gaussian blur radius.
    closing (int, optional): Closure (for sealing holes).
    thresh (int, optional): Threshold applied to segment foreground and background

Returns:
    np.array[uint8, uint8, uint8]: Colored image where green represents the foreground.

◆ generate_fg_mask()

def foreground_mask.ForegroundMask.generate_fg_mask (   self,
  image_bg,
  image_fg,
  blur,
  closing,
  thresh 
)
Creates a segmented (0, 255) image of the background vs. foreground.

Args:
    image_bg (np.array[_]): Image of the background frame.
    image_fg (np.array[_]): Image of the foreground frame.
    blur (int): Gaussian blur radius.
    closing (int): Closure (for sealing holes).
    thresh (int): Threshold applied to segment foreground and background

Returns:
    np.array[uint8]: Segmented image with 0 marking the background and 255 the foreground.

◆ reset_params()

def foreground_mask.ForegroundMask.reset_params (   self)
Sets blur, closing, and threshold to default values.

◆ set_images()

def foreground_mask.ForegroundMask.set_images (   self,
  filename_bg,
  filename_fg,
  res = 2048 
)
Updates the foreground and background images per images on disk.

Args:
    filename_bg (str): Path to the background image.
    filename_fg (str): Path to the foreground image.
    res (int, optional): Resolution of both images (assumed to be the same).

Member Data Documentation

◆ blur

foreground_mask.ForegroundMask.blur

◆ closing

foreground_mask.ForegroundMask.closing

◆ image_8bit_bg

foreground_mask.ForegroundMask.image_8bit_bg

◆ image_8bit_fg

foreground_mask.ForegroundMask.image_8bit_fg

◆ image_float_bg

foreground_mask.ForegroundMask.image_float_bg

◆ image_float_fg

foreground_mask.ForegroundMask.image_float_fg

◆ image_unchanged_bg

foreground_mask.ForegroundMask.image_unchanged_bg

◆ image_unchanged_fg

foreground_mask.ForegroundMask.image_unchanged_fg

◆ ready

foreground_mask.ForegroundMask.ready

◆ thresh

foreground_mask.ForegroundMask.thresh

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