Ejemplo n.º 1
0
    def __init__(self,
                 name=None,
                 params={},
                 color='white',
                 bEqualizeHist=False):
        self.name = name
        self.bEqualizeHist = bEqualizeHist

        self.bValidMask = False

        self.color = color
        self.bgra = ui.bgra_dict[color]
        self.bgra_dim = tuple(0.5 * np.array(ui.bgra_dict[color]))
        self.bgra_state = ui.bgra_dict[color]  #ui.bgra_dict['red']
        self.pixelmax = 255.0

        self.shape = (np.inf, np.inf)
        self.ptHinge_i = np.array([0, 0])
        self.roi = None

        self.mask = Struct()
        self.mask.img = None
        self.mask.sum = 1.0
        self.mask.xMin = None
        self.mask.yMin = None
        self.mask.xMax = None
        self.mask.yMax = None

        self.dt = np.inf

        self.params = {}
        self.handles = {
            'hinge':
            ui.Handle(np.array([0, 0]), self.bgra, name='hinge'),
            'angle_hi':
            ui.Handle(np.array([0, 0]), self.bgra, name='angle_hi'),
            'angle_lo':
            ui.Handle(np.array([0, 0]), self.bgra, name='angle_lo'),
            'radius_inner':
            ui.Handle(np.array([0, 0]), self.bgra, name='radius_inner')
        }

        self.lockBackground = threading.Lock()

        # Region of interest images.
        self.imgFullBackground = None
        self.imgRoiBackground = None
        self.imgRoi = None  # Untouched roi image.
        self.imgRoiFg = None  # Background subtracted.
        self.imgRoiFgMasked = None
        self.imgFinal = None  # The image to use for tracking.
        self.imgHeadroom = None

        # Extra windows.
        self.windowBG = ImageWindow(False, self.name + 'BG')
        self.windowFG = ImageWindow(False, self.name + 'FG')
        self.windowMask = ImageWindow(gbShowMasks, self.name + 'Mask')
Ejemplo n.º 2
0
    def __init__(self,
                 name=None,
                 params={},
                 color='white',
                 bEqualizeHist=False):
        self.name = name
        self.bEqualizeHist = bEqualizeHist

        self.bValidMask = False

        self.bgra = ui.bgra_dict[color]
        self.bgra_dim = tuple(0.5 * np.array(ui.bgra_dict[color]))
        self.bgra_state = ui.bgra_dict[color]  #ui.bgra_dict['red']
        self.pixelmax = 255.0

        self.shape = (np.inf, np.inf)
        self.ptCenter_i = np.array([0, 0])
        self.roi = None

        self.mask = Struct()
        self.mask.img = None
        self.mask.sum = 1.0

        self.dt = np.inf

        self.params = {}
        self.handles = {
            'center': ui.Handle(np.array([0, 0]), self.bgra, name='center'),
            'radius1': ui.Handle(np.array([0, 0]), self.bgra, name='radius1'),
            'radius2': ui.Handle(np.array([0, 0]), self.bgra, name='radius2')
        }

        # Region of interest images.
        self.imgFullBackground = None
        self.imgRoiBackground = None
        self.imgRoi = None  # Untouched roi image.
        self.imgRoiFg = None  # Background subtracted.
        self.imgRoiFgMasked = None

        # Extra windows.
        self.windowBG = ImageWindow(False, self.name + 'BG')
        self.windowFG = ImageWindow(False, self.name + 'FG')
        self.windowMask = ImageWindow(gbShowMasks, self.name + 'Mask')
Ejemplo n.º 3
0
    def __init__(self,
                 name=None,
                 params={},
                 color='white',
                 bEqualizeHist=False):
        self.name = name
        self.bEqualizeHist = bEqualizeHist
        self.color = color
        self.bgra = ui.bgra_dict[color]
        self.bgra_dim = tuple(0.5 * np.array(ui.bgra_dict[color]))
        self.bgra_state = ui.bgra_dict[color]
        self.pixelmax = 255.0
        self.iCount = 0
        self.bValidMask = False

        self.params = {}
        self.pt1_i = np.array([0, 0])
        self.pt2_i = np.array([0, 0])
        self.handles = {
            'pt1': ui.Handle(self.pt1_i, self.bgra, name='pt1'),
            'pt2': ui.Handle(self.pt2_i, self.bgra, name='pt2'),
        }