My goal is to calculate the fundamental Matrix by using the matching keypoints from two images. Now I got the good matching points:
MatOfDMatch matches = new MatOfDMatch();
matcher.match(descriptor1,descriptor2, matches);
List<DMatch> matchesList = matches.toList();
List<DMatch> good_matches = new ArrayList<DMatch>();
org.opencv.core.Point pt1;
org.opencv.core.Point pt2;
//Then I definite good_dist here
//....
for(int i =0;i<matchesList.size(); i++)
{
if(matchesList.get(i).distance<good_dist)
{
good_matches.add(matchesList.get(i));
pt1 = keypoints1.toList().get(matchesList.get(i).queryIdx).pt;
pt2 = keypoints2.toList().get(matchesList.get(i).trainIdx).pt;
}
}
Now I want to pass the pt1 and pt2 to MatOfPoint2f in order to call the function:
Calib3d.findFundamentalMat(pt1, pt2, Calib3d.FM_8POINT);
Does anyone know what should I do? Thanks in advance!