-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstructureFromStereo.cpp
More file actions
38 lines (31 loc) · 831 Bytes
/
structureFromStereo.cpp
File metadata and controls
38 lines (31 loc) · 831 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include <iostream>
#include <vector>
#include <opencv2/opencv.hpp>
#include <opencv2/opencv_modules.hpp>
#include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/videoio.hpp>
#include <opencv2/xfeatures2d.hpp>
#include <opencv2/sfm/fundamental.hpp>
#include <opencv2/sfm/numeric.hpp>
#include <opencv2/sfm/conditioning.hpp>
using namespace cv;
using namespace cv::xfeatures2d;
using namespace std;
int main()
{
Matx<float,3,3> F, K1, K2, E;
K1={1000,0,64,0,1000,64,0,0,1};
K2={1000,0,64,0,1000,64,0,0,1};
F = {1,0,1,3,2,1,0,5,4};
cv::sfm::essentialFromFundamental(F, K1, K2, E);
for(int i=0;i<3;i++){
for(int j=0;j<3;j++){
cout<<E(i,j)<<" ";
}
cout<<endl;
}
return 0;
}