|
facebook360_dep
Facebook360 Depth Estimation Pipeline
|
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 | |
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
| 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.
| 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.
| 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.
| def foreground_mask.ForegroundMask.reset_params | ( | self | ) |
Sets blur, closing, and threshold to default values.
| 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).
| foreground_mask.ForegroundMask.blur |
| foreground_mask.ForegroundMask.closing |
| foreground_mask.ForegroundMask.image_8bit_bg |
| foreground_mask.ForegroundMask.image_8bit_fg |
| foreground_mask.ForegroundMask.image_float_bg |
| foreground_mask.ForegroundMask.image_float_fg |
| foreground_mask.ForegroundMask.image_unchanged_bg |
| foreground_mask.ForegroundMask.image_unchanged_fg |
| foreground_mask.ForegroundMask.ready |
| foreground_mask.ForegroundMask.thresh |
1.8.15