# Path: video_processing/processor_runner.py
# def run_processor_chain(processors_list):
# 
# Path: video_processing/processors/added_object_tracker.py
# MAX_PREVIOUS_CURSOR_POSITIONS = 4
# MAX_PREVIOUS_FRAMES = 4
# MAX_CONNECTED_FRAMES = 5
# def remove_cursor(gray_input, cursor_template, threshold=0):
# def find_enclosing_rectangle(contours):
# def get_cropped_frame_difference(start_frame,
#                                  end_frame,
#                                  cursor_template=None,
#                                  do_erode=True,
#                                  border_pixels=4):
# def get_color(image):
#   def __init__(self, configuration):
#   def open(self, stream_set):
#   def process(self, frame_set):
#   def close(self):
# class AddedObjectTracker(stream_processor.ProcessorBase):
# 
# Path: video_processing/processors/background_image_extractor.py
# class FirstFrameBackgroundImageExtractor(stream_processor.ProcessorBase):
#   def __init__(self, configuration):
#   def open(self, stream_set):
#   def process(self, frame_set):
#   def close(self):
# 
# Path: video_processing/processors/cursor_tracker.py
# class CursorTracker(stream_processor.ProcessorBase):
#   def __init__(self, configuration):
#   def open(self, stream_set):
#   def process(self, frame_set):
#   def close(self):
# 
# Path: video_processing/processors/json_writer.py
# class JSONWriter(stream_processor.ProcessorBase):
#   def __init__(self, configuration):
#   def open(self, stream_set):
#   def process(self, frame_set):
#   def close(self):
# 
# Path: video_processing/processors/opencv_video_decoder.py
# class OpenCVVideoDecoderProcessor(stream_processor.ProcessorBase):
#   def __init__(self, configuration):
#   def open(self, stream_set):
#   def process(self, frame_set):
#   def close(self):
# 
# Path: video_processing/processors/opencv_video_encoder.py
# class OpenCVVideoEncoderProcessor(stream_processor.ProcessorBase):
#   def __init__(self, configuration):
#   def open(self, stream_set):
#   def process(self, frame_set):
#   def close(self):
# 
# Path: video_processing/processors/stroke_tracker.py
# def object_to_binarized_sub_objects(image):
# def thinning_iteration(image, iteration):
# def thin(src):
# def points_list_from_sub_image(binary_sub_image):
# def is_neighbor_text(x, y, image):
# def find_closest_point(node, nodes):
# def find_candidate_pen_locations(cursor_track, stroke_points_list,
#                                  binary_stroke_image):
# def compute_all_edges(data_pts):
# def reconstruct_pen_track_from_stroke_points_and_cursor_track(
#     points_list, cursor_positions):
# def relative_to_bounding_box(points, bounding_box):
# def relative_to_canvas(points, bounding_box):
# def sub_object_to_stroke(binary_stroke_image, bounding_box, cursor_track):
#   def __init__(self, configuration):
#   def open(self, stream_set):
#   def process(self, frame_set):
#   def close(self):
# class StrokeTracker(stream_processor.ProcessorBase):


from absl import app
from absl import flags
from video_processing import processor_runner
from video_processing.processors import added_object_tracker
from video_processing.processors import background_image_extractor
from video_processing.processors import cursor_tracker
from video_processing.processors import json_writer
from video_processing.processors import opencv_video_decoder
from video_processing.processors import opencv_video_encoder
from video_processing.processors import stroke_tracker
"""Pipeline to decode and reencode a video using OpenCV."""


flags.DEFINE_string('input_video_file', '', 'Input file.')
flags.DEFINE_string('output_video_file', '', 'Output file.')
flags.DEFINE_string('cursor_template_file', '', 'Cursor template file.')

flags.DEFINE_string('background_image_file', 'background.png',
                    'Background image file to be written for output.')
flags.DEFINE_string('output_json_file', 'data.json', 'Output json file.')

FLAGS = flags.FLAGS


def pipeline(input_video_file, output_video_file, cursor_template_file,
             background_image_file, output_json_file):
  return [

# Path: video_processing/processor_runner.py
# def run_processor_chain(processors_list):
# 
# Path: video_processing/processors/added_object_tracker.py
# MAX_PREVIOUS_CURSOR_POSITIONS = 4
# MAX_PREVIOUS_FRAMES = 4
# MAX_CONNECTED_FRAMES = 5
# def remove_cursor(gray_input, cursor_template, threshold=0):
# def find_enclosing_rectangle(contours):
# def get_cropped_frame_difference(start_frame,
#                                  end_frame,
#                                  cursor_template=None,
#                                  do_erode=True,
#                                  border_pixels=4):
# def get_color(image):
#   def __init__(self, configuration):
#   def open(self, stream_set):
#   def process(self, frame_set):
#   def close(self):
# class AddedObjectTracker(stream_processor.ProcessorBase):
# 
# Path: video_processing/processors/background_image_extractor.py
# class FirstFrameBackgroundImageExtractor(stream_processor.ProcessorBase):
#   def __init__(self, configuration):
#   def open(self, stream_set):
#   def process(self, frame_set):
#   def close(self):
# 
# Path: video_processing/processors/cursor_tracker.py
# class CursorTracker(stream_processor.ProcessorBase):
#   def __init__(self, configuration):
#   def open(self, stream_set):
#   def process(self, frame_set):
#   def close(self):
# 
# Path: video_processing/processors/json_writer.py
# class JSONWriter(stream_processor.ProcessorBase):
#   def __init__(self, configuration):
#   def open(self, stream_set):
#   def process(self, frame_set):
#   def close(self):
# 
# Path: video_processing/processors/opencv_video_decoder.py
# class OpenCVVideoDecoderProcessor(stream_processor.ProcessorBase):
#   def __init__(self, configuration):
#   def open(self, stream_set):
#   def process(self, frame_set):
#   def close(self):
# 
# Path: video_processing/processors/opencv_video_encoder.py
# class OpenCVVideoEncoderProcessor(stream_processor.ProcessorBase):
#   def __init__(self, configuration):
#   def open(self, stream_set):
#   def process(self, frame_set):
#   def close(self):
# 
# Path: video_processing/processors/stroke_tracker.py
# def object_to_binarized_sub_objects(image):
# def thinning_iteration(image, iteration):
# def thin(src):
# def points_list_from_sub_image(binary_sub_image):
# def is_neighbor_text(x, y, image):
# def find_closest_point(node, nodes):
# def find_candidate_pen_locations(cursor_track, stroke_points_list,
#                                  binary_stroke_image):
# def compute_all_edges(data_pts):
# def reconstruct_pen_track_from_stroke_points_and_cursor_track(
#     points_list, cursor_positions):
# def relative_to_bounding_box(points, bounding_box):
# def relative_to_canvas(points, bounding_box):
# def sub_object_to_stroke(binary_stroke_image, bounding_box, cursor_track):
#   def __init__(self, configuration):
#   def open(self, stream_set):
#   def process(self, frame_set):
#   def close(self):
# class StrokeTracker(stream_processor.ProcessorBase):


# Path: video_processing/pipelines/vectorization_v1.py
from absl import app
from absl import flags
from video_processing import processor_runner
from video_processing.processors import added_object_tracker
from video_processing.processors import background_image_extractor
from video_processing.processors import cursor_tracker
from video_processing.processors import json_writer
from video_processing.processors import opencv_video_decoder
from video_processing.processors import opencv_video_encoder
from video_processing.processors import stroke_tracker

"""Pipeline to decode and reencode a video using OpenCV."""


flags.DEFINE_string('input_video_file', '', 'Input file.')
flags.DEFINE_string('output_video_file', '', 'Output file.')
flags.DEFINE_string('cursor_template_file', '', 'Cursor template file.')

flags.DEFINE_string('background_image_file', 'background.png',
                    'Background image file to be written for output.')
flags.DEFINE_string('output_json_file', 'data.json', 'Output json file.')

FLAGS = flags.FLAGS


def pipeline(input_video_file, output_video_file, cursor_template_file,
             background_image_file, output_json_file):
  return [

      opencv_video_decoder.OpenCVVideoDecoderProcessor(