'Single iteration of the application\'s main loop.'

def main_loop(self):

    frame = self.cameras[self.selected_cam].get_frame()
    (self.h, self.w, _c) = frame.shape
    self.processor.frame_in = frame
    self.processor.run(self.selected_cam)
    output_frame = self.processor.frame_out
    imshow('Processed', output_frame)
    if self.bpm_plot:
        self.make_bpm_plot()
    if self.send_serial:
        self.serial.write((str(self.processor.bpm) + '\r\n'))
    if self.send_udp:
        self.sock.sendto(str(self.processor.bpm), self.udp)
    self.key_handler()
