Esempio n. 1
0
class MotionTriggerCondition(TriggerCondition):
    '''
    classdocs
    '''
    
    def __init__(self):
        '''
        Constructor
        '''       
        super(MotionTriggerCondition, self).__init__()
        self.__motionDetector = MotionDetector()

        # Get first image
        self.__image1 = self.__motionDetector.captureTestImage()
        self.__image2 = None
        
        # Reset last capture time
        lastCapture = time.time()
    
    def isTriggered(self):
        triggered = False
        
        # Get comparison image
        self.__image2 = self.__motionDetector.captureTestImage()
        triggered = self.__motionDetector.recognizeMotion(self.__image1, self.__image2)
        # Swap comparison buffers
        self.__image1 = self.__image2
        
        return triggered
Esempio n. 2
0
class MotionTriggerCondition(TriggerCondition):
    '''
    classdocs
    '''
    def __init__(self):
        '''
        Constructor
        '''
        super(MotionTriggerCondition, self).__init__()
        self.__motionDetector = MotionDetector()

        # Get first image
        self.__image1 = self.__motionDetector.captureTestImage()
        self.__image2 = None

        # Reset last capture time
        lastCapture = time.time()

    def isTriggered(self):
        triggered = False

        # Get comparison image
        self.__image2 = self.__motionDetector.captureTestImage()
        triggered = self.__motionDetector.recognizeMotion(
            self.__image1, self.__image2)
        # Swap comparison buffers
        self.__image1 = self.__image2

        return triggered
Esempio n. 3
0
    def __init__(self):
        '''
        Constructor
        '''
        super(MotionTriggerCondition, self).__init__()
        self.__motionDetector = MotionDetector()

        # Get first image
        self.__image1 = self.__motionDetector.captureTestImage()
        self.__image2 = None

        # Reset last capture time
        lastCapture = time.time()
Esempio n. 4
0
    def __init__(self):
        '''
        Constructor
        '''       
        super(MotionTriggerCondition, self).__init__()
        self.__motionDetector = MotionDetector()

        # Get first image
        self.__image1 = self.__motionDetector.captureTestImage()
        self.__image2 = None
        
        # Reset last capture time
        lastCapture = time.time()