Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
c2caea48
Commit
c2caea48
authored
Oct 01, 2015
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5409 from kauevestena:patch-1
parents
34e4e66b
1bd18836
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
stereo_calib.cpp
samples/cpp/stereo_calib.cpp
+6
-6
No files found.
samples/cpp/stereo_calib.cpp
View file @
c2caea48
...
...
@@ -56,7 +56,7 @@ static int print_help()
static
void
StereoCalib
(
const
vector
<
string
>&
imagelist
,
Size
boardSize
,
bool
useCalibrated
=
true
,
bool
showRectified
=
true
)
StereoCalib
(
const
vector
<
string
>&
imagelist
,
Size
boardSize
,
bool
displayCorners
=
false
,
bool
useCalibrated
=
true
,
bool
showRectified
=
true
)
{
if
(
imagelist
.
size
()
%
2
!=
0
)
{
...
...
@@ -64,7 +64,6 @@ StereoCalib(const vector<string>& imagelist, Size boardSize, bool useCalibrated=
return
;
}
bool
displayCorners
=
false
;
//true;
const
int
maxScale
=
2
;
const
float
squareSize
=
1.
f
;
// Set this to your actual square size
// ARRAY AND VECTOR STORAGE:
...
...
@@ -165,8 +164,8 @@ StereoCalib(const vector<string>& imagelist, Size boardSize, bool useCalibrated=
cout
<<
"Running stereo calibration ...
\n
"
;
Mat
cameraMatrix
[
2
],
distCoeffs
[
2
];
cameraMatrix
[
0
]
=
Mat
::
eye
(
3
,
3
,
CV_64F
);
cameraMatrix
[
1
]
=
Mat
::
eye
(
3
,
3
,
CV_64F
);
cameraMatrix
[
0
]
=
initCameraMatrix2D
(
objectPoints
,
imagePoints
[
0
],
imageSize
,
0
);
cameraMatrix
[
1
]
=
initCameraMatrix2D
(
objectPoints
,
imagePoints
[
1
],
imageSize
,
0
);
Mat
R
,
T
,
E
,
F
;
double
rms
=
stereoCalibrate
(
objectPoints
,
imagePoints
[
0
],
imagePoints
[
1
],
...
...
@@ -175,6 +174,7 @@ StereoCalib(const vector<string>& imagelist, Size boardSize, bool useCalibrated=
imageSize
,
R
,
T
,
E
,
F
,
CALIB_FIX_ASPECT_RATIO
+
CALIB_ZERO_TANGENT_DIST
+
CALIB_USE_INTRINSIC_GUESS
+
CALIB_SAME_FOCAL_LENGTH
+
CALIB_RATIONAL_MODEL
+
CALIB_FIX_K3
+
CALIB_FIX_K4
+
CALIB_FIX_K5
,
...
...
@@ -209,7 +209,7 @@ StereoCalib(const vector<string>& imagelist, Size boardSize, bool useCalibrated=
}
npoints
+=
npt
;
}
cout
<<
"average
reprojection
err = "
<<
err
/
npoints
<<
endl
;
cout
<<
"average
epipolar
err = "
<<
err
/
npoints
<<
endl
;
// save intrinsic parameters
FileStorage
fs
(
"../data/intrinsics.yml"
,
FileStorage
::
WRITE
);
...
...
@@ -399,6 +399,6 @@ int main(int argc, char** argv)
return
print_help
();
}
StereoCalib
(
imagelist
,
boardSize
,
true
,
showRectified
);
StereoCalib
(
imagelist
,
boardSize
,
false
,
true
,
showRectified
);
return
0
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment