Implementation of RANSAC algorithm in python 3. The code in ransac_main.py uses random data everytime it is run.
This random data is stored in data_x and data_y. (line 58) The main algorithm uses the properties of triangles to figure out the inliers and outliers.
At the beginning of the file (upto line 16) the various parameters can be changed.
Parameter description:
- DEBUG_MODE (line 5)
- data_size (line 8)
- x_size (line 9)
- y_size (line 10)
- threshold_factor li (line 13)
- threshold (line 14)
- optimized_distance (line 15)
- angle_threshold (line 16)
can be toggled to print results and actions at various points of the code.
is the number of samples. The more samples you take, the more time will the code take to run.
is the range for x-cordinate, starting from zero.
is the range for y-cordinate, starting from zero.
defines the threshold for determinig inliers
since the threshold depends on the size of graph. I have used a simple formula to relate them.
is used so that points that are too close together are not used since this was giving bad results.
is used to filter out points too far away from the model line.