# Revision history [back]

five-point.cpp is the file that provides functions to calculate the Essential matrix (a special case of the Fundamental matrix) using the five point algorithm. The findEssentialMat function is similar to findFundamentalMat, the difference is that you require the intrinsic parameters of your camera (calculated from calibration). You need to provide the following:

1. p1: points of the image 1 (vector<point2f> or Mat)
2. p2: points of the image 2 (vector<point2f> or Mat)
3. focal: focal distance (double), it is the element (0,0) of your intrinsic parameters matrix.
4. pp: principal point (Point2d), this vector must have the elements (0,2) and (1,2) of the intrinsic parameters matrix.
5. method: in this case it could be RANSAC or LMeDS (similar to findFundamentalMat)
6. probability of success: usually 0.99
7. error: this value is the threshold used in RANSAC to determine if a match is considered an outlier or an inlier
8. output: a matrix that contains ones and zeros, indicates which correspondences are outliers using a zero and inliers using a one.

Example:

     Mat essential = findEssentialMat(p1,p2,focal,pp,RANSAC,0.99,1,output);