'**SUMMARY**
This method returns the fundamental matrix F such that (P_2).T F P_1 = 0
**PARAMETERS**
* *thresh* - The feature quality metric. This can be any value between about 300 and 500. Higher
values should return fewer, but higher quality features.
* *minDist* - The value below which the feature correspondence is considered a match. This
is the distance between two feature vectors. Good values are between 0.05 and 0.3
**RETURNS**
Return None if it fails.
* *F* -  Fundamental matrix as ndarray.
* *matched_pts1* - the matched points (x, y) in img1
* *matched_pts2* - the matched points (x, y) in img2
**EXAMPLE**
>>> img1 = Image("sampleimages/stereo_view1.png")
>>> img2 = Image("sampleimages/stereo_view2.png")
>>> stereoImg = StereoImage(img1,img2)
>>> F,pts1,pts2 = stereoImg.findFundamentalMat()
**NOTE**
If you deal with the fundamental matrix F directly, be aware of (P_2).T F P_1 = 0
where P_2 and P_1 consist of (y, x, 1)'

def findFundamentalMat(self, thresh=500.0, minDist=0.15):

    (kpts1, desc1) = self.ImageLeft._getRawKeypoints(thresh)
    (kpts2, desc2) = self.ImageRight._getRawKeypoints(thresh)
    if ((desc1 == None) or (desc2 == None)):
        logger.warning("We    didn't    get    any    descriptors.    Image    might    be    too    uniform    or    blurry.")
        return None
    num_pts1 = desc1.shape[0]
    num_pts2 = desc2.shape[0]
    magic_ratio = 1.0
    if (num_pts1 > num_pts2):
        magic_ratio = (float(num_pts1) / float(num_pts2))
    (idx, dist) = Image()._getFLANNMatches(desc1, desc2)
    p = dist.squeeze()
    result = ((p * magic_ratio) < minDist)
    try:
        import cv2
    except:
        logger.warning("Can't    use    fundamental    matrix    without    OpenCV    >=    2.3.0")
        return None
    pts1 = np.array([kpt.pt for kpt in kpts1])
    pts2 = np.array([kpt.pt for kpt in kpts2])
    matched_pts1 = pts1[idx[result]].squeeze()
    matched_pts2 = pts2[result]
    (F, mask) = cv2.findFundamentalMat(matched_pts1, matched_pts2, method=cv.CV_FM_LMEDS)
    inlier_ind = mask.nonzero()[0]
    matched_pts1 = matched_pts1[inlier_ind, :]
    matched_pts2 = matched_pts2[inlier_ind, :]
    matched_pts1 = matched_pts1[:, ::(-1.0)]
    matched_pts2 = matched_pts2[:, ::(-1.0)]
    return (F, matched_pts1, matched_pts2)
