Example #1
0
    sys.stdout.flush()
    difference_image = camera.fetch(camera.DIFFERENCE)
    camera_frame = camera.fetch(camera.IMAGE)
    detector.update(camera_frame, difference_image)
    detector_data = detector.data()
    detector_dump = detector.dump()

    abs_difference_image = camera.fetch(camera.ABS_DIFFERENCE)
    imshow('Debug', abs_difference_image)

    # If we have a detector...
    if detector.detection():
        # ...cycle through the effects...
        for effect in effect_list:
            effect.push(detector_data)
            # ...checking if the conditions for one is true...
            if effect.condition():
                imageprinter.save(camera_frame)
                plotprinter.save(detector_dump[0], detector_dump[1],
                                 detector_data[0], detector_data[1])
                log.update(detector_data, cow.condition())
                # ...showing that effect...
                effect.show()
                break  #...and that's it for now!

    # Update viewport... maybe not needed...
    key = waitKey(10)

# Kill camera thread
camera.deactivate()
Example #2
0
    sys.stdout.flush()
    difference_image = camera.fetch(camera.DIFFERENCE)
    camera_frame = camera.fetch(camera.IMAGE)
    detector.update(camera_frame,difference_image)
    detector_data = detector.data()
    detector_dump = detector.dump()
    
    abs_difference_image = camera.fetch(camera.ABS_DIFFERENCE)
    imshow('Debug',abs_difference_image)

    # If we have a detector...
    if detector.detection():
        # ...cycle through the effects...
        for effect in effect_list:
            effect.push(detector_data)
            # ...checking if the conditions for one is true...
            if effect.condition():
                imageprinter.save(camera_frame)
                plotprinter.save(detector_dump[0],detector_dump[1],detector_data[0],detector_data[1])
                log.update(detector_data,cow.condition())
                # ...showing that effect...
                effect.show()
                break #...and that's it for now!

    # Update viewport... maybe not needed...
    key = waitKey(10)

# Kill camera thread
camera.deactivate()

Example #3
0
#! /usr/bin/env python
###############################################################################
##
## cow_test.py -- part of the bypasser program
##
## Copyright (c) 2014 Riccardo Sven Risuleo
##
## This software may be modified and distributed under the terms
## of the MIT license.  See the LICENSE file for details.
##
###############################################################################

import cv2
from behaviours.cow import Cow

cv2.namedWindow('test')
cv2.waitKey(20)

moo = Cow('test')
moo.push((0, 0))
print(moo.condition())  # Returns true 5% of the time XD
moo.show()
Example #4
0
#! /usr/bin/env python
###############################################################################
##
## cow_test.py -- part of the bypasser program
##
## Copyright (c) 2014 Riccardo Sven Risuleo 
##
## This software may be modified and distributed under the terms
## of the MIT license.  See the LICENSE file for details.
##
###############################################################################

import cv2
from behaviours.cow import Cow

cv2.namedWindow('test')
cv2.waitKey(20)

moo = Cow('test')
moo.push((0,0))
print(moo.condition()) # Returns true 5% of the time XD
moo.show()