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
b5ddaae4
Commit
b5ddaae4
authored
Dec 10, 2015
by
Pavel Rojtberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
calib3d: add CALIB_USE_LU to use LU decomposition in solver
parent
4c251bd2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
5 deletions
+13
-5
calib3d.hpp
modules/calib3d/include/opencv2/calib3d.hpp
+2
-1
calibration.cpp
modules/calib3d/src/calibration.cpp
+11
-4
No files found.
modules/calib3d/include/opencv2/calib3d.hpp
View file @
b5ddaae4
...
...
@@ -225,7 +225,8 @@ enum { CALIB_USE_INTRINSIC_GUESS = 0x00001,
CALIB_FIX_INTRINSIC
=
0x00100
,
CALIB_SAME_FOCAL_LENGTH
=
0x00200
,
// for stereo rectification
CALIB_ZERO_DISPARITY
=
0x00400
CALIB_ZERO_DISPARITY
=
0x00400
,
CALIB_USE_LU
=
(
1
<<
17
),
//!< use LU instead of SVD decomposition for solving. much faster but potentially less precise
};
//! the algorithm for finding fundamental matrix
...
...
modules/calib3d/src/calibration.cpp
View file @
b5ddaae4
...
...
@@ -1232,7 +1232,6 @@ CV_IMPL double cvCalibrateCamera2( const CvMat* objectPoints,
CvMat
*
rvecs
,
CvMat
*
tvecs
,
int
flags
,
CvTermCriteria
termCrit
)
{
const
int
NINTRINSIC
=
16
;
CvLevMarq
solver
;
double
reprojErr
=
0
;
Matx33d
A
;
...
...
@@ -1388,7 +1387,11 @@ CV_IMPL double cvCalibrateCamera2( const CvMat* objectPoints,
cvInitIntrinsicParams2D
(
&
_matM
,
&
m
,
npoints
,
imageSize
,
&
matA
,
aspectRatio
);
}
solver
.
init
(
nparams
,
0
,
termCrit
);
CvLevMarq
solver
(
nparams
,
0
,
termCrit
);
if
(
flags
&
CALIB_USE_LU
)
{
solver
.
solveMethod
=
DECOMP_LU
;
}
{
double
*
param
=
solver
.
param
->
data
.
db
;
...
...
@@ -1635,7 +1638,6 @@ double cvStereoCalibrate( const CvMat* _objectPoints, const CvMat* _imagePoints1
{
const
int
NINTRINSIC
=
16
;
Ptr
<
CvMat
>
npoints
,
err
,
J_LR
,
Je
,
Ji
,
imagePoints
[
2
],
objectPoints
,
RT0
;
CvLevMarq
solver
;
double
reprojErr
=
0
;
double
A
[
2
][
9
],
dk
[
2
][
12
]
=
{{
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
},{
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
}},
rlr
[
9
];
...
...
@@ -1737,7 +1739,12 @@ double cvStereoCalibrate( const CvMat* _objectPoints, const CvMat* _imagePoints1
// storage for initial [om(R){i}|t{i}] (in order to compute the median for each component)
RT0
.
reset
(
cvCreateMat
(
6
,
nimages
,
CV_64F
));
solver
.
init
(
nparams
,
0
,
termCrit
);
CvLevMarq
solver
(
nparams
,
0
,
termCrit
);
if
(
flags
&
CALIB_USE_LU
)
{
solver
.
solveMethod
=
DECOMP_LU
;
}
if
(
recomputeIntrinsics
)
{
uchar
*
imask
=
solver
.
mask
->
data
.
ptr
+
nparams
-
NINTRINSIC
*
2
;
...
...
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