// Copyright 2019 The MediaPipe Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto2";

package mediapipe.autoflip;

import "mediapipe/framework/calculator.proto";

message ShotBoundaryCalculatorOptions {
  extend mediapipe.CalculatorOptions {
    optional ShotBoundaryCalculatorOptions ext = 281194049;
  }
  // Parameters to shot detection algorithm. All the constraints (the fields
  // named with 'min_') need to be satisfied for a frame to be a shot boundary.
  //
  // Minimum motion to be considered as a shot boundary frame.
  optional double min_motion = 1 [default = 0.2];
  // Minimum number of shot duration (in seconds).
  optional double min_shot_span = 2 [default = 2];
  // A window for computing shot measure (see the definition in min_shot_measure
  // field).
  optional int32 window_size = 3 [default = 7];
  // Minimum shot measure to be considered as a shot boundary frame.
  // Must also satisfy the min_motion_with_shot_measure constraint.
  // The shot measure is defined as the ratio of the motion of the
  // current frame to the maximum motion of the frames in the window (defined
  // as window_size).
  optional double min_shot_measure = 4 [default = 10];
  // Minimum motion to be considered as a shot boundary frame.
  // Must also satisfy the min_shot_measure constraint.
  optional double min_motion_with_shot_measure = 5 [default = 0.05];
  // Only send results if the shot value is true.
  optional bool output_only_on_change = 6 [default = true];
  // Perform histogram equalization before computing keypoints/features.
  optional bool equalize_histogram = 7 [default = false];
}
