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
5ed4e1b8
Commit
5ed4e1b8
authored
Apr 25, 2016
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6459 from eliao:Fix6457
parents
df6eb101
f87b175a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
stereo_calib.cpp
samples/cpp/stereo_calib.cpp
+5
-5
No files found.
samples/cpp/stereo_calib.cpp
View file @
5ed4e1b8
...
...
@@ -50,13 +50,13 @@ static int print_help()
" matrix separately) stereo.
\n
"
" Calibrate the cameras and display the
\n
"
" rectified results along with the computed disparity images.
\n
"
<<
endl
;
cout
<<
"Usage:
\n
./stereo_calib -w=<board_width default=9> -h=<board_height default=6> <image list XML/YML file default=../data/stereo_calib.xml>
\n
"
<<
endl
;
cout
<<
"Usage:
\n
./stereo_calib -w=<board_width default=9> -h=<board_height default=6>
-s=<square_size default=1.0>
<image list XML/YML file default=../data/stereo_calib.xml>
\n
"
<<
endl
;
return
0
;
}
static
void
StereoCalib
(
const
vector
<
string
>&
imagelist
,
Size
boardSize
,
bool
displayCorners
=
false
,
bool
useCalibrated
=
true
,
bool
showRectified
=
true
)
StereoCalib
(
const
vector
<
string
>&
imagelist
,
Size
boardSize
,
float
squareSize
,
bool
displayCorners
=
false
,
bool
useCalibrated
=
true
,
bool
showRectified
=
true
)
{
if
(
imagelist
.
size
()
%
2
!=
0
)
{
...
...
@@ -65,7 +65,6 @@ StereoCalib(const vector<string>& imagelist, Size boardSize,bool displayCorners
}
const
int
maxScale
=
2
;
const
float
squareSize
=
1.
f
;
// Set this to your actual square size
// ARRAY AND VECTOR STORAGE:
vector
<
vector
<
Point2f
>
>
imagePoints
[
2
];
...
...
@@ -348,13 +347,14 @@ int main(int argc, char** argv)
Size
boardSize
;
string
imagelistfn
;
bool
showRectified
;
cv
::
CommandLineParser
parser
(
argc
,
argv
,
"{w|9|}{h|6|}{nr||}{help||}{@input|../data/stereo_calib.xml|}"
);
cv
::
CommandLineParser
parser
(
argc
,
argv
,
"{w|9|}{h|6|}{
s|1.0|}{
nr||}{help||}{@input|../data/stereo_calib.xml|}"
);
if
(
parser
.
has
(
"help"
))
return
print_help
();
showRectified
=
!
parser
.
has
(
"nr"
);
imagelistfn
=
parser
.
get
<
string
>
(
"@input"
);
boardSize
.
width
=
parser
.
get
<
int
>
(
"w"
);
boardSize
.
height
=
parser
.
get
<
int
>
(
"h"
);
float
squareSize
=
parser
.
get
<
float
>
(
"s"
);
if
(
!
parser
.
check
())
{
parser
.
printErrors
();
...
...
@@ -368,6 +368,6 @@ int main(int argc, char** argv)
return
print_help
();
}
StereoCalib
(
imagelist
,
boardSize
,
false
,
true
,
showRectified
);
StereoCalib
(
imagelist
,
boardSize
,
squareSize
,
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