// 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;

// Next tag: 17
message MotionSaliencyOptions {
  // Standard normalized bounds and weights used to initialize salient points.
  // See region_flow.proto for details.
  optional float bound_left = 1 [default = 0.3];
  optional float bound_bottom = 2 [default = 0.3];
  optional float bound_right = 15 [default = 0.3];
  optional float bound_top = 16 [default = 0.3];

  optional float saliency_weight = 3 [default = 20];

  // If set, scales saliency_weight by flow magnitude.
  optional bool scale_weight_by_flow_magnitude = 8 [default = false];

  // Minimum number of features within a region to be considered salient.
  // Only applicable for functions accepting RegionFlowFrames.
  optional int32 min_features = 4 [default = 5];

  // If set, only considers regions flagged as forground.
  optional bool use_only_foreground_regions = 9 [default = false];

  // Specifies roughly number of foreground features mapped to one mode,
  // for mode to be considered salient.
  optional float min_irls_mode_weight = 10 [default = 10];

  // Only returns the top N irls modes.
  optional int32 num_top_irls_modes = 11 [default = 3];

  // Mode finding is performed with a fraction radius of 10% of frame
  // diameter by default.
  optional float mode_band_width = 12 [default = 0.10];

  // We filter salient points along the temporal dimension only, keeping those
  // that have sufficient support (in form of neighboring salient points). For
  // every salient point in frame n, all points in frames
  // [n - filtering_frame_radius, n + filtering_frame_radius] are tested,
  // whether they support the current test point.
  optional int32 selection_frame_radius = 5 [default = 5];

  // Fractional distance to be considered a supporting salient point for a test
  // point.
  optional float selection_support_distance = 6 [default = 0.2];

  // Minimum number of supporting salient points that need to be present in
  // order for a point to be considered an inlier.
  optional int32 selection_minimum_support = 7 [default = 4];

  // Sigma in space (normalized domain).
  optional float filtering_sigma_space = 13 [default = 0.05];

  // Sigma in time (in frames).
  optional float filtering_sigma_time = 14 [default = 5];
}
