//Camera creation :
Camera cam(WEBCAM, 0);//camera from webcam 0
Camera cam1(AVI_FLUX,"video1.avi");//camera from video
Camera cam2(PICT_FLUX,"prefixe",".png",0,100);//camera from images (prefixe0.png -> prefixe100.png)
cam2.setInternalParameters(Mat::eye(3,3,CV_64F));//set the internal parameters of cam2...
//If we want to do some steps with particular methods, we can then doing it like that:
//Example: use SURF points detections and BruteForceMatching
SURFDetect algoDetect(params);//See documentation for params details
cam.setDetectAlgo(algoDetect);//Now when points are needed for a FoV from cam, SURF method will be used.
BFMatcher
cam.setMatchAlgo(matchsAlgo);//Now if we need matching, brute force will be used.
vector<vector<Point3f>> objectPoints=???;//3D points of the calibration pattern in its coordinate system...
cam1.calibrateCamera(objectPoints)//Compute intra and extern parameters using images cam1 have (using cv::calibrateCamera)...
cv::Mat K=cam3.getInternalParameters(CV_PROJECTIVE,CV_FM_RANSAC);//get the internal coefs of cam3... The parameter CV_PROJECTIVE says that if internal coefs are not computed then try to estimate the coefs using cv::cvFindFundamentalMat and cv::decomposeprojectionmatrix (We can find projection matrices using decomposition of F)
//Of course, this estimation can be upgraded to perspective or metric recontruction if wanted using different parameters... Details not yet found.
cv::Mat img=cam3.getImage(0);//get the first image of cam3...
pcl::PointCloud<pcl::PointXYZ> world=cam3.getAllObjects();//get all objects found with cam3...
FieldOfView p1=cam1.getFoV(3);//Get the 3rd field of view from cam1
FieldOfView pNew("pictX.jpg");//Create a new FoV. This will create a new empty camera
pNew.setCam(cam1);//set cam1 as the camera of pNew (equal to p1.getCam())
FieldOfView p2=cam.getCurrentFoV();//Get the current FoV (for video or picture sequences, increment the frame)
cam1.compute3DObjects();
cam2.compute3DObjects();
//Now merge the two objects:
Camera::merge({cam1,cam2});//the parameter will be a vector of Camera. Each camera inside the vector will be updated!
//If we want to show all objects of cam1 as viewed by the first FoV:
cam1.showObjects("myWindow",cam1.getFoV(0));
//Or using particular position (position is a 3*3 matrix):
cam1.showObjects("myWindow",position);
//Or with an animation reproducing the camera motion:
PointDeVue::showObjet(world,cam);