Find sinusoidal lines through RANSAC

I have a set of points that I need to group using their proximity to the corresponding sinusoidal lines. I tried to determine the lines using the standard Hough transform, but this does not solve the problem (only a few lines were found).

I would like to check if RANSAC will work better to detect various sin curves. Do you have an example for a similar algorithm?

I know that RANSAC is not the best tool for finding multiple lines, so I would do: a) find a function that matches most points; b) repeat the search, counting only the remaining ones.

enter image description here

+5
source share
1 answer

Ransac

Algorithm

Until a higher percentage threshold is reached or N samples are tested.

  • He randomly selects the smallest sample to build or install the model.
  • Other data points are classified as sheets or outliers.
  • Model accepted or rejected

Inputs

  • error tolerance for determining factors and emissions
  • Threshold Higher Percentage
  • Checked maximum number of samples.

Possible improvements

  • Make sure that no combination is checked more than once.
  • If it’s better to choose combinations, use this.
  • After many identifiers are found, use the new set of identifiers for further search.

Source: Fischler and Bolles - Random Sample Consensus: Model Modeling Paradigm with Image Analysis and Automated Mapping Applications

Your expression

Your model is a sine, defined as f (x) = amplitude * sin (period * x) + offset. Installing this model will not be so simple, because it depends on three parameters. I think that this will risk in the long run and the possibility of retraining. A possible solution would be to run the algorithm several times for different periods and maintain a fixed offset and amplitude.

iterationThreshold = 10000; iterationCount = 0 errorthreshold = 0.05; while(numel(inliers(:,1)) > inlierThreshold) samples = extractMinimumSamples(points); [sineX, sineY] = fitSine(samples); inliers = determineInliers(points, SineX, SineY) iterationCount = iterationCount + 1; if(iterationCount => iterationThreshold) break; end end 

See also possible improvements for modifications to this code.

0
source

All Articles