예제 #1
0
    def __init__(self, controller, stgs = {}):
        """
        IDM's init function.
        
        Arguments:
        - self: The main object pointer.
        - controller: mousetrap main class pointer. This is passed by MouseTrap's controller (mousetrap.py) when loaded.
        - stgs: Possible settings loaded from the user's settings file. If there aren't settings the IDM will use the a_settings dict.
        """
        
        # This will init the Camera class. 
        # This class is used to handle the camera device.
        Camera.init()

        # Controller instance
        self.ctr          = controller
        
        # Capture instance
        # The capture is the object containing the image 
        # and all the possible methods to modify it.
        self.cap          = None
        
        # IDM's Settings dict
        self.stgs         = stgs

        # Prepares the IDM using the settings.
        self.prepare_config()
예제 #2
0
파일: forehead.py 프로젝트: fnv/mousetrap
    def __init__(self, controller, stgs = {}):
        Camera.init()

        self.img          = None
        self.ctr          = controller
        self.cap          = None
        self.stgs         = stgs

        ##############################
        #  MOTION RELATED VARIABLES  #
        ##############################

        #self.step         = self.settings.getint( "mouse", "stepSpeed" )
        self.forehead     = None
        self.foreheadLast = None
        self.foreheadOrig = None
        self.foreheadDiff = None
        self.stopMove     = None
        self.startMove    = None

        ##############################
        #       ACTION POINTS        #
        ##############################
        self.mpPointer       = None

        ##############################
        #  CLICK RELATED VARIABLES   #
        ##############################

        self.isMoving       = False

        self.prepare_config()
예제 #3
0
파일: colors.py 프로젝트: fnv/mousetrap
    def __init__(self, controller, stgs = {}):
        """
        IDM's init function.
        
        Arguments:
        - self: The main object pointer.
        - controller: mousetrap main class pointer. This is passed by MouseTrap's controller (mousetrap.py) when loaded.
        - stgs: Possible settings loaded from the user's settings file. If there aren't settings the IDM will use the a_settings dict.
        """
        
        # This will init the Camera class. 
        # This class is used to handle the camera device.
        Camera.init()

        # Controller instance
        self.ctr          = controller
        
        # Capture instance
        # The capture is the object containing the image 
        # and all the possible methods to modify it.
        self.cap          = None
        
        # IDM's Settings dict
        self.stgs         = stgs

        # Prepares the IDM using the settings.
        self.prepare_config()
        image = None
        self.hsv = None
        self.hue = None
        self.mask = None
        self.backproject = None
        self.histimg = None
        self.hist = None

        self.backproject_mode = 0
        self.select_object = 0
        self.track_object = 0
        self.show_hist = 1
        self.origin = None
        self.selection = None
        self.track_window = None
        self.track_box = None
        self.track_comp = None
        self.hdims = 16

       # initial settings for value, saturation, and hue
        self.vmin = c_int(10)
        self.vmax = c_int(256)
        self.smin = c_int(80)
        self.smax = c_int(256)
        self.hmin = c_int(0)
        self.hmax = c_int(180) #this may have to be 180 and not 256, for whatever reason
        self.h2min = c_int(170)
        self.h2max = c_int(175)
예제 #4
0
파일: camshift.py 프로젝트: fnv/mousetrap
 def __init__(self):
     
     # By Flavio's design, the modules themselves initialize the camera
     Camera.init()