예제 #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
예제 #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
예제 #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()
예제 #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()