Questions tagged [ransac]

RANSAC is an abbreviation for "RANdom SAmple Consensus". It is an iterative method to estimate parameters of a mathematical model from a set of observed data which contains outliers. It is a non-deterministic algorithm in the sense that it produces a reasonable result only with a certain probability, with this probability increasing as more iterations are allowed.

The input to the RANSAC algorithm is a set of observed data values, a parameterized model which can explain or be fitted to the observations, and some confidence parameters.

RANSAC achieves its goal by iteratively selecting a random subset of the original data. These data are hypothetical inliers and this hypothesis is then tested as follows: A model is fitted to the hypothetical inliers, i.e. all free parameters of the model are reconstructed from the inliers.

All other data are then tested against the fitted model and, if a point fits well to the estimated model, also considered as a hypothetical inlier. The estimated model is reasonably good if sufficiently many points have been classified as hypothetical inliers.

The model is reestimated from all hypothetical inliers, because it has only been estimated from the initial set of hypothetical inliers.

Finally, the model is evaluated by estimating the error of the inliers relative to the model.

This procedure is repeated a fixed number of times, each time producing either a model which is rejected because too few points are classified as inliers or a refined model together with a corresponding error measure. In the latter case, we keep the refined model if its error is lower than the last saved model.

Source: Wikipedia

167 questions
3
votes
1 answer

prosac algorithm implementation detail, meaning and importance

I understand that Prosac algorithm is a modified version of Ransac algorithm that it samples according to the quality of data points. However, I cannot understand the details of the algorithm implementation. Specifically, I cannot understand the two…
Ronald Ku
  • 319
  • 2
  • 14
3
votes
0 answers

OpenCV Python - How to implement RANSAC to detect straight lines?

I'm trying to detect lines on an image which contains a road. Using gaussian smoothing and Canny edge detection, I reached a wall while trying to implement RANSAC. I basically don't know a single step as to how to go about it. Can I get a rough idea…
zyrkor
  • 73
  • 2
  • 5
3
votes
2 answers

Can RANSAC be improved to remove outliers?

I am using SIFT feature detector and descriptor. I am matching the points between two images. I am using findHomography() function of OpenCV with the RANSAC method. When I read about the RANSAC algorithm, it is said that adjusting a threshold…
3
votes
1 answer

Robustly estimate Polynomial geometric transformation with scikit-image and RANSAC

I would like to robustly estimate a polynomial geometric transform with scikit-image skimage.transform and skimage.measure.ransac The ransack documentation gives a very nice example of how to do exactly that but with a Similarity Transform. Here is…
HBouy
  • 245
  • 3
  • 14
3
votes
2 answers

What's the best way to fit a set of points in an image one or more good lines using RANSAC using OpenCV?

What's the best way to fit a set of points in an image one or more good lines using RANSAC using OpenCV? Is RANSAC is the most efficient way to fit a line?
DualSim
  • 279
  • 2
  • 4
  • 7
2
votes
1 answer

Divide a 2D depth image into non-overlapping rectangular areas of similar values

I am trying to segment a 2D depth image into non-overlapping rectangular areas of similar values as shown in the example: In this example, the depth image is segmented into four rectangles: 4by3by6 yellow, 2by4by15 green, 4by2by8 orange, and…
2
votes
1 answer

RANSACRegressor changing base_estimator properties after construction

Based on the accepted answer of this question, I am trying to implement a polynomial regressor using RANSAC to fit a polynomial of order 5. Let the data to adjust be x = [0.02965717 0.10966089 0.17002236 0.19015372 0.27044443 0.33011883 0.40844298…
AlanWik
  • 326
  • 1
  • 10
2
votes
1 answer

PCL RANSAC model fitting: How can I initialise the model parameters?

I'm reading the PCL tutorial on plane segmentation, because I want to find 3D circles in a very large and dense point cloud I have. I know already the approximate values for center, radius and orientation of the circle, but I have found no way so…
oarfish
  • 4,116
  • 4
  • 37
  • 66
2
votes
1 answer

Which inliers is the RANSAC Algorithm using in cv2.FindHomography to find the homography matrix?

1) How is the RANSAC algorithm in OpenCV choosing an inlier over an outlier? I am presuming it calculates some total least square matching between the matched keypoints. 2) I am fully aware that apart from the H matrix, the cv2.FindHomography also…
Charles B
  • 95
  • 3
  • 14
2
votes
1 answer

How to include custom constraints/rankings on a RANSAC plane estimator?

I'm trying to segment a plane from a point cloud using the Point Cloud library and I have some prior information about the plane model (i.e, the normal should be similar to the z axis and the height (d) should be around 0). Is there a way I can…
gilad
  • 426
  • 1
  • 5
  • 15
2
votes
0 answers

Robust epipolar geometry estimation with scikit-image's ransac

I'm having trouble achieving robust performance with skimage.measure.ransac when estimating fundamental matrix for a pair of images. I'm seeing highly varying results with different random seeds when compared to OpenCV's findFundamentalMatrix. I'm…
msladecek
  • 21
  • 1
  • 5
2
votes
1 answer

Affine transformation and RANSAC: How to compute the number of inliers?

I have 2 images and I am using SIFT to find the matching features. I chose the best matches by thresholding. After doing this, I am trying to use RANSAC to efficiently determine the affine transformation matrix between the two pictures. From my…
OHHH
  • 1,011
  • 3
  • 16
  • 34
2
votes
0 answers

With findHomography, how to improve the quality of a match and avoid duplicates?

I use OpenCV for object recognition. Once I have the list of keypoints for the scene image and the template image, I use the findHomography function with RANSAC. There can be several identical objects in one scene, so I run the function against the…
KooDooMoo
  • 143
  • 5
2
votes
1 answer

Calculation of corner points for the localization of robot in 3D data

After segmenting out subset of a pointcloud that fitted using pcl::SACMODEL_LINE RANSAC line segmentation module. In the next step center point of extracted point cloud is computed using pcl::compute3DCentroid(point_cloud, centroid); Which gives…
2
votes
2 answers

SACSegmentation detecting odd plane model

I'm trying to fit a plane model to a point cloud (with a plane-like structure). The problem I'm encountering is that the fitted plane is just a small slice of the cloud, even if the distance threshold is set to a relatively large value. Here are…
brad
  • 930
  • 9
  • 22
1 2
3
11 12