I have a set of points that I need to group using their vicinity to the respective sinusoidal lines. I tried to determine the lines using a standard Hough transform, but that doesn't solve the problem (only a few lines are detected).
I'd like to test if RANSAC would work better to detect the various sin curves. Do you have an example for a similar algorithm?
I know that RANSAC is not the best tool to find multiple lines, so what I would do is a) find the function fitting most points; b) iterate the search, considering only the remaining ones.
RANSAC
The algorithm
Until an inlier percentage threshold is reached or N sample combinations are tested.
Inputs:
Possible improvements
Source: Fischler and Bolles - Random Sample Consensus: A Paradigm for Model Fitting with Applications to Image Analysis and Automated Cartography
Your aplication
Your model is a sine defined as f(x) = amplitude * sin(period * x) + bias. Fitting this model will not be as easy as it is dependent on three parameters. I think that it will risk in long runs and a possibility of overfitting. A possible solution might be to run the algorithm multiple times for different periods and keep the bias and amplitude fixed.
See also the possible improvements for modifications to this code