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
eea43c6a
Commit
eea43c6a
authored
Nov 29, 2010
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added CV_CALIB_RATIONAL_MODEL for better backward compatibility
parent
a937d9d4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
13 deletions
+25
-13
calib3d.tex
doc/calib3d.tex
+0
-0
calib3d.hpp
modules/calib3d/include/opencv2/calib3d/calib3d.hpp
+11
-9
calibration.cpp
modules/calib3d/src/calibration.cpp
+13
-0
stereo_calib.cpp
samples/cpp/stereo_calib.cpp
+1
-4
No files found.
doc/calib3d.tex
View file @
eea43c6a
This diff is collapsed.
Click to expand it.
modules/calib3d/include/opencv2/calib3d/calib3d.hpp
View file @
eea43c6a
...
...
@@ -223,6 +223,7 @@ CVAPI(void) cvDrawChessboardCorners( CvArr* image, CvSize pattern_size,
#define CV_CALIB_FIX_K4 2048
#define CV_CALIB_FIX_K5 4096
#define CV_CALIB_FIX_K6 8192
#define CV_CALIB_RATIONAL_MODEL 16384
/* Finds intrinsic and extrinsic camera parameters
from a few views of known calibration pattern */
...
...
@@ -542,17 +543,18 @@ enum
CALIB_FIX_PRINCIPAL_POINT
=
4
,
CALIB_ZERO_TANGENT_DIST
=
8
,
CALIB_FIX_FOCAL_LENGTH
=
16
,
CALIB_FIX_K1
=
32
,
CALIB_FIX_K2
=
64
,
CALIB_FIX_K3
=
128
,
CALIB_FIX_K4
=
2048
,
CALIB_FIX_K5
=
4096
,
CALIB_FIX_K6
=
8192
,
CALIB_FIX_K1
=
CV_CALIB_FIX_K1
,
CALIB_FIX_K2
=
CV_CALIB_FIX_K2
,
CALIB_FIX_K3
=
CV_CALIB_FIX_K3
,
CALIB_FIX_K4
=
CV_CALIB_FIX_K4
,
CALIB_FIX_K5
=
CV_CALIB_FIX_K5
,
CALIB_FIX_K6
=
CV_CALIB_FIX_K6
,
CALIB_RATIONAL_MODEL
=
CV_CALIB_RATIONAL_MODEL
,
// only for stereo
CALIB_FIX_INTRINSIC
=
256
,
CALIB_SAME_FOCAL_LENGTH
=
512
,
CALIB_FIX_INTRINSIC
=
CV_CALIB_FIX_INTRINSIC
,
CALIB_SAME_FOCAL_LENGTH
=
CV_CALIB_SAME_FOCAL_LENGTH
,
// for stereo rectification
CALIB_ZERO_DISPARITY
=
1024
CALIB_ZERO_DISPARITY
=
CV_CALIB_ZERO_DISPARITY
};
//! finds intrinsic and extrinsic camera parameters from several fews of a known calibration pattern.
...
...
modules/calib3d/src/calibration.cpp
View file @
eea43c6a
...
...
@@ -1596,6 +1596,8 @@ CV_IMPL double cvCalibrateCamera2( const CvMat* objectPoints,
param
[
6
]
=
param
[
7
]
=
0
;
mask
[
6
]
=
mask
[
7
]
=
0
;
}
if
(
!
(
flags
&
CV_CALIB_RATIONAL_MODEL
)
)
flags
|=
CV_CALIB_FIX_K4
+
CV_CALIB_FIX_K5
+
CV_CALIB_FIX_K6
;
if
(
flags
&
CV_CALIB_FIX_K1
)
mask
[
4
]
=
0
;
if
(
flags
&
CV_CALIB_FIX_K2
)
...
...
@@ -1928,6 +1930,8 @@ double cvStereoCalibrate( const CvMat* _objectPoints, const CvMat* _imagePoints1
if
(
recomputeIntrinsics
)
{
uchar
*
imask
=
solver
.
mask
->
data
.
ptr
+
nparams
-
NINTRINSIC
*
2
;
if
(
!
(
flags
&
CV_CALIB_RATIONAL_MODEL
)
)
flags
|=
CV_CALIB_FIX_K4
|
CV_CALIB_FIX_K5
|
CV_CALIB_FIX_K6
;
if
(
flags
&
CV_CALIB_FIX_ASPECT_RATIO
)
imask
[
0
]
=
imask
[
NINTRINSIC
]
=
0
;
if
(
flags
&
CV_CALIB_FIX_FOCAL_LENGTH
)
...
...
@@ -3293,6 +3297,8 @@ double cv::calibrateCamera( const vector<vector<Point3f> >& objectPoints,
int
rtype
=
CV_64F
;
cameraMatrix
=
prepareCameraMatrix
(
cameraMatrix
,
rtype
);
distCoeffs
=
prepareDistCoeffs
(
distCoeffs
,
rtype
);
if
(
!
(
flags
&
CALIB_RATIONAL_MODEL
)
)
distCoeffs
=
distCoeffs
.
rows
==
1
?
distCoeffs
.
colRange
(
0
,
5
)
:
distCoeffs
.
rowRange
(
0
,
5
);
size_t
i
,
nimages
=
objectPoints
.
size
();
CV_Assert
(
nimages
>
0
);
...
...
@@ -3341,6 +3347,13 @@ double cv::stereoCalibrate( const vector<vector<Point3f> >& objectPoints,
cameraMatrix2
=
prepareCameraMatrix
(
cameraMatrix2
,
rtype
);
distCoeffs1
=
prepareDistCoeffs
(
distCoeffs1
,
rtype
);
distCoeffs2
=
prepareDistCoeffs
(
distCoeffs2
,
rtype
);
if
(
!
(
flags
&
CALIB_RATIONAL_MODEL
)
)
{
distCoeffs1
=
distCoeffs1
.
rows
==
1
?
distCoeffs1
.
colRange
(
0
,
5
)
:
distCoeffs1
.
rowRange
(
0
,
5
);
distCoeffs2
=
distCoeffs2
.
rows
==
1
?
distCoeffs2
.
colRange
(
0
,
5
)
:
distCoeffs2
.
rowRange
(
0
,
5
);
}
R
.
create
(
3
,
3
,
rtype
);
T
.
create
(
3
,
1
,
rtype
);
E
.
create
(
3
,
3
,
rtype
);
...
...
samples/cpp/stereo_calib.cpp
View file @
eea43c6a
...
...
@@ -160,8 +160,6 @@ StereoCalib(const vector<string>& imagelist, Size boardSize, bool useCalibrated=
Mat
cameraMatrix
[
2
],
distCoeffs
[
2
];
cameraMatrix
[
0
]
=
Mat
::
eye
(
3
,
3
,
CV_64F
);
cameraMatrix
[
1
]
=
Mat
::
eye
(
3
,
3
,
CV_64F
);
distCoeffs
[
0
]
=
Mat
::
zeros
(
8
,
1
,
CV_64F
);
distCoeffs
[
1
]
=
Mat
::
zeros
(
8
,
1
,
CV_64F
);
Mat
R
,
T
,
E
,
F
;
stereoCalibrate
(
objectPoints
,
imagePoints
[
0
],
imagePoints
[
1
],
...
...
@@ -171,8 +169,7 @@ StereoCalib(const vector<string>& imagelist, Size boardSize, bool useCalibrated=
TermCriteria
(
CV_TERMCRIT_ITER
+
CV_TERMCRIT_EPS
,
100
,
1e-5
),
CV_CALIB_FIX_ASPECT_RATIO
+
CV_CALIB_ZERO_TANGENT_DIST
+
CV_CALIB_SAME_FOCAL_LENGTH
+
CV_CALIB_FIX_K3
+
CV_CALIB_FIX_K4
+
CV_CALIB_FIX_K5
);
CV_CALIB_SAME_FOCAL_LENGTH
);
cout
<<
"done
\n
"
;
// CALIBRATION QUALITY CHECK
...
...
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