def get_multi_handler(width, height, left_index, right_index): """ Returns a handler for multiple streams """ left_feed = CameraFeed(left_index, width, height) right_feed = CameraFeed(right_index, width, height) return MultiFeedHandler([left_feed, right_feed])
def example_two_feed_stitch(): """ Shows two stitched feeds handled by feed handler. """ feed1 = CameraFeed(0, 400) feed2 = CameraFeed(1, 400) handler = MultiFeedHandler([feed1, feed2]) handler.stitch_feeds()
def test_frame_get_resized_next(): """ Checks to make sure resizing within get_next method is working. """ passed = True feed = CameraFeed(0) try: feed.get_next(True, False) except AttributeError: # This means there was an error in the resize method of get__next() passed = False assert passed is True
def test_frame_resize(): """ Checks to make sure resize of a frame is working correcly. """ passed = True feed = CameraFeed(0) frame = feed.get_next(False, False) try: imutils.resize(frame, 400) except AttributeError: # This means there was an error in the resize method of get_next() passed = False assert passed is True
def example_single_feed_stitch(): """ Shows "stitched" single feed handled by feed handler. """ feed = CameraFeed(0) handler = MultiFeedHandler([feed]) handler.stitch_feeds()
def stitch_single(): """ Responsible for handling stitch of one camera. """ config = get_configuration("config/profiles/singlecamerastitch.yml") camera_feed = CameraFeed(config['camera-index'], config['width'], config['height']) handler = MultiFeedHandler([camera_feed]) handler.stitch_feeds(config['should-stream'], config['output-path'], config['width'], config['height'], config['rtmp_url'])
def correct_single_camera(feed_index=0): """ Function to show corrected distortion for a camera feed. """ camera_feed = CameraFeed(feed_index) camera_feed.show()
def get_single_handler(width, height, index): """ Returns a handler for single stream """ return MultiFeedHandler([CameraFeed(index, width, height)])