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()
#! /usr/bin/env python ############################################################################### ## ## datalogger_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. ## ############################################################################### from utilities.datalogger import Datalogger log = Datalogger('log.txt') log.update((1, 2, 3, 4), True) # iscow! log.update((5, 6, 7, 8), False) # iscow!
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()
#! /usr/bin/env python ############################################################################### ## ## datalogger_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. ## ############################################################################### from utilities.datalogger import Datalogger log = Datalogger('log.txt') log.update((1,2,3,4),True) # iscow! log.update((5,6,7,8),False) # iscow!