Update Samples

This commit is contained in:
Suleyman TURKMEN
2019-07-28 12:09:17 +03:00
committed by sturkmen72
parent 9ef5373776
commit f73395122c
72 changed files with 251 additions and 271 deletions
@@ -52,8 +52,8 @@ void computeC2MC1(const Mat &R1, const Mat &tvec1, const Mat &R2, const Mat &tve
void decomposeHomography(const string &img1Path, const string &img2Path, const Size &patternSize,
const float squareSize, const string &intrinsicsPath)
{
Mat img1 = imread(img1Path);
Mat img2 = imread(img2Path);
Mat img1 = imread( samples::findFile( img1Path) );
Mat img2 = imread( samples::findFile( img2Path) );
vector<Point2f> corners1, corners2;
bool found1 = findChessboardCorners(img1, patternSize, corners1);
@@ -69,7 +69,7 @@ void decomposeHomography(const string &img1Path, const string &img2Path, const S
vector<Point3f> objectPoints;
calcChessboardCorners(patternSize, squareSize, objectPoints);
FileStorage fs(intrinsicsPath, FileStorage::READ);
FileStorage fs( samples::findFile( intrinsicsPath ), FileStorage::READ);
Mat cameraMatrix, distCoeffs;
fs["camera_matrix"] >> cameraMatrix;
fs["distortion_coefficients"] >> distCoeffs;
@@ -154,9 +154,9 @@ void decomposeHomography(const string &img1Path, const string &img2Path, const S
const char* params
= "{ help h | | print usage }"
"{ image1 | ../data/left02.jpg | path to the source chessboard image }"
"{ image2 | ../data/left01.jpg | path to the desired chessboard image }"
"{ intrinsics | ../data/left_intrinsics.yml | path to camera intrinsics }"
"{ image1 | left02.jpg | path to the source chessboard image }"
"{ image2 | left01.jpg | path to the desired chessboard image }"
"{ intrinsics | left_intrinsics.yml | path to camera intrinsics }"
"{ width bw | 9 | chessboard width }"
"{ height bh | 6 | chessboard height }"
"{ square_size | 0.025 | chessboard square size }";
@@ -65,8 +65,8 @@ void computeC2MC1(const Mat &R1, const Mat &tvec1, const Mat &R2, const Mat &tve
void homographyFromCameraDisplacement(const string &img1Path, const string &img2Path, const Size &patternSize,
const float squareSize, const string &intrinsicsPath)
{
Mat img1 = imread(img1Path);
Mat img2 = imread(img2Path);
Mat img1 = imread( samples::findFile( img1Path ) );
Mat img2 = imread( samples::findFile( img2Path ) );
//! [compute-poses]
vector<Point2f> corners1, corners2;
@@ -82,7 +82,7 @@ void homographyFromCameraDisplacement(const string &img1Path, const string &img2
vector<Point3f> objectPoints;
calcChessboardCorners(patternSize, squareSize, objectPoints);
FileStorage fs(intrinsicsPath, FileStorage::READ);
FileStorage fs( samples::findFile( intrinsicsPath ), FileStorage::READ);
Mat cameraMatrix, distCoeffs;
fs["camera_matrix"] >> cameraMatrix;
fs["distortion_coefficients"] >> distCoeffs;
@@ -170,9 +170,9 @@ void homographyFromCameraDisplacement(const string &img1Path, const string &img2
const char* params
= "{ help h | | print usage }"
"{ image1 | ../data/left02.jpg | path to the source chessboard image }"
"{ image2 | ../data/left01.jpg | path to the desired chessboard image }"
"{ intrinsics | ../data/left_intrinsics.yml | path to camera intrinsics }"
"{ image1 | left02.jpg | path to the source chessboard image }"
"{ image2 | left01.jpg | path to the desired chessboard image }"
"{ intrinsics | left_intrinsics.yml | path to camera intrinsics }"
"{ width bw | 9 | chessboard width }"
"{ height bh | 6 | chessboard height }"
"{ square_size | 0.025 | chessboard square size }";
@@ -10,8 +10,8 @@ namespace
{
void basicPanoramaStitching(const string &img1Path, const string &img2Path)
{
Mat img1 = imread(img1Path);
Mat img2 = imread(img2Path);
Mat img1 = imread( samples::findFile( img1Path ) );
Mat img2 = imread( samples::findFile( img2Path ) );
//! [camera-pose-from-Blender-at-location-1]
Mat c1Mo = (Mat_<double>(4,4) << 0.9659258723258972, 0.2588190734386444, 0.0, 1.5529145002365112,
@@ -67,9 +67,9 @@ void basicPanoramaStitching(const string &img1Path, const string &img2Path)
}
const char* params
= "{ help h | | print usage }"
"{ image1 | ../data/Blender_Suzanne1.jpg | path to the first Blender image }"
"{ image2 | ../data/Blender_Suzanne2.jpg | path to the second Blender image }";
= "{ help h | | print usage }"
"{ image1 | Blender_Suzanne1.jpg | path to the first Blender image }"
"{ image2 | Blender_Suzanne2.jpg | path to the second Blender image }";
}
int main(int argc, char *argv[])
@@ -19,8 +19,8 @@ Scalar randomColor( RNG& rng )
void perspectiveCorrection(const string &img1Path, const string &img2Path, const Size &patternSize, RNG &rng)
{
Mat img1 = imread(img1Path);
Mat img2 = imread(img2Path);
Mat img1 = imread( samples::findFile(img1Path) );
Mat img2 = imread( samples::findFile(img2Path) );
//! [find-corners]
vector<Point2f> corners1, corners2;
@@ -68,8 +68,8 @@ void perspectiveCorrection(const string &img1Path, const string &img2Path, const
const char* params
= "{ help h | | print usage }"
"{ image1 | ../data/left02.jpg | path to the source chessboard image }"
"{ image2 | ../data/left01.jpg | path to the desired chessboard image }"
"{ image1 | left02.jpg | path to the source chessboard image }"
"{ image2 | left01.jpg | path to the desired chessboard image }"
"{ width bw | 9 | chessboard width }"
"{ height bh | 6 | chessboard height }";
}
@@ -42,7 +42,7 @@ void calcChessboardCorners(Size boardSize, float squareSize, vector<Point3f>& co
void poseEstimationFromCoplanarPoints(const string &imgPath, const string &intrinsicsPath, const Size &patternSize,
const float squareSize)
{
Mat img = imread(imgPath);
Mat img = imread( samples::findFile( imgPath) );
Mat img_corners = img.clone(), img_pose = img.clone();
//! [find-chessboard-corners]
@@ -69,7 +69,7 @@ void poseEstimationFromCoplanarPoints(const string &imgPath, const string &intri
//! [compute-object-points]
//! [load-intrinsics]
FileStorage fs(intrinsicsPath, FileStorage::READ);
FileStorage fs( samples::findFile( intrinsicsPath ), FileStorage::READ);
Mat cameraMatrix, distCoeffs;
fs["camera_matrix"] >> cameraMatrix;
fs["distortion_coefficients"] >> distCoeffs;
@@ -126,8 +126,8 @@ void poseEstimationFromCoplanarPoints(const string &imgPath, const string &intri
const char* params
= "{ help h | | print usage }"
"{ image | ../data/left04.jpg | path to a chessboard image }"
"{ intrinsics | ../data/left_intrinsics.yml | path to camera intrinsics }"
"{ image | left04.jpg | path to a chessboard image }"
"{ intrinsics | left_intrinsics.yml | path to camera intrinsics }"
"{ width bw | 9 | chessboard width }"
"{ height bh | 6 | chessboard height }"
"{ square_size | 0.025 | chessboard square size }";