Class SelectNeighborsAroundView

java.lang.Object
boofcv.alg.structure.SelectNeighborsAroundView
All Implemented Interfaces:
VerbosePrint

public class SelectNeighborsAroundView
extends Object
implements VerbosePrint
Selects a subset of views from a SceneWorkingGraph as the first step before performing local bundle adjustment. The goal is to select the subset of views which would contribute the most to the target view's state estimate. To keep computational limits in check the user needs to specifies a maximum number of views. Every connection between views is assigned a score. The goal is to find the subset of views which maximizes the minimum score across all connections between views. This is approximated using the greedy algorithm below: Summary:
  1. Set of views will be the target's neighbors and their neighbors
  2. Create a list of all edges and their scores that connect these
  3. Repeat the loop below until only N views remain
    1. Select the edge with the lowest score
    2. Pick one of the views it is connected to be prune based on their connections
    3. Remove the view and all the edges connected to it
Care is taken so that not all the direct neighbors are removed by setting a minimum number that must remain at the end. If all neighbors are removed then there is the possibility that all the remaining nodes will not see the same features as the target.

WARNING: There is a known flaw where a multiple disconnected graphs can be created in a poorly connected graph

  • Field Details

    • maxViews

      public int maxViews
      Moving number of views in the constructed working graph.
    • worstOfTop

      public int worstOfTop
      When a view is scored for removal the N-worstOfTop connection is used for the score.
    • minNeighbors

      public int minNeighbors
      There should be at least this number of direct neighbors in the final list
    • localWorking

      protected final SceneWorkingGraph localWorking
      Copy of the local scene which can be independently optimized
  • Constructor Details

    • SelectNeighborsAroundView

      public SelectNeighborsAroundView()
  • Method Details

    • process

      public void process​(SceneWorkingGraph.View target, SceneWorkingGraph working)
      Computes a local graph with the view as a seed. Local graph can be accessed by calling #getLocalWorking()
      Parameters:
      target - (Input) The view in 'working' that a local graph is to be built around
      working - (Input) A graph of the entire scene that a sub graph is to be made from
    • setVerbose

      public void setVerbose​(@Nullable @Nullable PrintStream out, @Nullable @Nullable Set<String> configuration)
      Specified by:
      setVerbose in interface VerbosePrint