Documentation of 'org.ddogleg.fitting.modelset.ransac.RansacMulti' Java class
RansacMulti
org.ddogleg.fitting.modelset.ransac

Class RansacMulti<Point>

  • All Implemented Interfaces:
    ModelMatcher<java.lang.Object,Point>, ModelMatcherMulti<Point>


    public class RansacMulti<Point>
    extends java.lang.Object
    implements ModelMatcherMulti<Point>

    Modification of RANSAC that finds the best fit model and model parameters to a set of data. A model is a mathematical description of a specific object type (e.g. circle, square) and model parameters is the description (e.g. radius and center point for a circle). The minimum (or user specified) set of points is drawn from the set of all points. Then for each model parameters are estimated. The model and parameter pair with the largest inliers set is returned.

    To change the default behavior of the class for specific applications the child class can override internal functions. Suggestions are shown below.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class and Description
      static class  RansacMulti.ObjectType<Model,Point>
      Describes a model and RANSAC fit parameters for specific type of object.
    • Constructor Summary

      Constructors 
      Constructor and Description
      RansacMulti(long randSeed, int maxIterations, java.util.List<RansacMulti.ObjectType> objectTypes, java.lang.Class<Point> typePoint)
      Creates a new instance of the ransac algorithm.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      double getFitQuality()
      Returns the metric used to evaluate the quality of fit.
      int getInlierSize() 
      int getInputIndex(int matchIndex)
      For an item in the match set, return the index of the item in the original input set.
      int getIteration() 
      java.util.List<Point> getMatchSet()
      A set of points which match the provided parameters.
      int getMaxIterations() 
      int getMinimumSize()
      This is the minimum number of observations which can be input and produce a valid model.
      int getModelIndex()
      Indicates which model was found to best fit the points.
      java.lang.Object getModelParameters()
      Model for the match set
      boolean process(java.util.List<Point> dataSet)
      Finds a set of points from the provided list that are a good fit for the internal model and computes the fit parameters for the model.
      void setMaxIterations(int maxIterations) 
      void setSampleSize(int sampleSize)
      Override the number of points that are sampled and used to generate models.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RansacMulti

        public RansacMulti(long randSeed,
                           int maxIterations,
                           java.util.List<RansacMulti.ObjectType> objectTypes,
                           java.lang.Class<Point> typePoint)
        Creates a new instance of the ransac algorithm. The number of points sampled will default to the minimum number. To override this default invoke setSampleSize(int).
        Parameters:
        randSeed - The random seed used by the random number generator.
        maxIterations - The maximum number of iterations the RANSAC algorithm will perform.
        objectTypes - Description of the different types of objects it can detect
        typePoint - Class of Point
    • Method Detail

      • process

        public boolean process(java.util.List<Point> dataSet)
        Finds a set of points from the provided list that are a good fit for the internal model and computes the fit parameters for the model.
        Specified by:
        process in interface ModelMatcher<java.lang.Object,Point>
        Parameters:
        dataSet - Set of points (with noise) that are to be fit.
        Returns:
        true if it successfully found a solution or false if not.
      • getMatchSet

        public java.util.List<Point> getMatchSet()
        Description copied from interface: ModelMatcher
        A set of points which match the provided parameters.
        Specified by:
        getMatchSet in interface ModelMatcher<java.lang.Object,Point>
        Returns:
        List of points in the match set.
      • getInputIndex

        public int getInputIndex(int matchIndex)
        Description copied from interface: ModelMatcher
        For an item in the match set, return the index of the item in the original input set.
        Specified by:
        getInputIndex in interface ModelMatcher<java.lang.Object,Point>
        Parameters:
        matchIndex - Index of an element in the match set.
        Returns:
        Index of the same element in the original input list.
      • getFitQuality

        public double getFitQuality()
        Description copied from interface: ModelMatcher
        Returns the metric used to evaluate the quality of fit. Meaning is implementation specific. Larger or smaller values could be preferred depending on implementation..
        Specified by:
        getFitQuality in interface ModelMatcher<java.lang.Object,Point>
        Returns:
        Quality of fit to matched set of points
      • getModelParameters

        public java.lang.Object getModelParameters()
        Description copied from interface: ModelMatcher
        Model for the match set
        Specified by:
        getModelParameters in interface ModelMatcher<java.lang.Object,Point>
        Returns:
        model.
      • getModelIndex

        public int getModelIndex()
        Description copied from interface: ModelMatcherMulti
        Indicates which model was found to best fit the points. The index is implementation specific and is likely to refer to the index inside a list.
        Specified by:
        getModelIndex in interface ModelMatcherMulti<Point>
        Returns:
        Index of selected model.
      • getInlierSize

        public int getInlierSize()
      • getMaxIterations

        public int getMaxIterations()
      • setMaxIterations

        public void setMaxIterations(int maxIterations)
      • getMinimumSize

        public int getMinimumSize()
        Description copied from interface: ModelMatcher
        This is the minimum number of observations which can be input and produce a valid model.
        Specified by:
        getMinimumSize in interface ModelMatcher<java.lang.Object,Point>
        Returns:
        Minimum number of sample points
      • setSampleSize

        public void setSampleSize(int sampleSize)
        Override the number of points that are sampled and used to generate models. If this value is not set it defaults to the minimum number.
        Parameters:
        sampleSize - Number of sample points.
      • getIteration

        public int getIteration()

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.