# RANSAC & SIFT homography

let image x be an original (non warped) image. let I1 be I1' having suffered some projecive transofmation and possibly some noise. We have computed SIFT descriptors for both images.

can you explain how RANSAC (concretely) is used to find the homography that aligns image x and y? more concretely, I understand we give to the RANSAC function the keypoints(I1) and keypoints(I1'). My understanding (from various papers/tutorials i ve read) is that it will take the postions of keypoints in I1 that i note (x,y) and the positions of keypoints I1' (x',y') i.e. RANSAC((x,y),(x',y')) and then take randomly paris of (x',y') (x,y) and then copute the homography by trying to solve for each xi'yi' : [x'i,y'i]=H*[xi,yi] then how to estimate inliers ? I guess by looking at the Euclidean distance bewteen each pairs of points found in the homography....

However I don't really see the 'big picture' ... I don't completey link this process of 'finding homoraphy' and checking inliers etc.

It would be great if someone could summarize that in a clear way?

best regards, O.

P.S. In general, tutorials say that they "find the homography" and then check for inliers - in some way - but they don't explain in a more pragmatic way what really happends.... w.r.t sift descriptors

• What are I1 and I1'? Do you mean x and x'? What resources have you read? SIFT is explained in many resources (Wikipedia, research papers, tutorials, etc.), and I've seen how RANSAC is used explained in several of them. – D.W. Mar 20 '17 at 17:30
• – D.W. Mar 20 '17 at 17:32

In SIFT, we first generate keypoints and the feature vector for each keypoint. Also, if $k$ is a keypoint in image $x$ and $k'$ is a keypoint in image $x'$, the feature vectors give a way to tell whether $k,k'$ are good matches. For each $k$, we look for a good match: a $k'$ from $x'$ that is significantly closer to $k$ than any other keypoint in $x'$. The set of good matches forms a set of possible inliers.
Then, we apply RANSAC. We randomly pick four good matches, compute a homography from these four, and test how good this homography is by checking how many of the good matches are consistent with the homography (if $k,k'$ are a good match, we're hoping that in most cases the homography will map $k$ to something near $k'$). Good matches that are consistent with the homography are called inliers (for this homography), and those that aren't are called outliers (for this homography). We count the number of outliers for this homography. Then, we repeat this 1000 times (picking a set of four good matches anew each time), in each iteration deriving a homography and counting the number of outliers associated with it. We keep the homography with the smallest number of outliers.