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
7fd7bbc9
Commit
7fd7bbc9
authored
Sep 12, 2013
by
look4pritam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
The prism distortion coefficients are added for the stereo calibration.
parent
4fe8e377
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
3 deletions
+18
-3
calibration.cpp
modules/calib3d/src/calibration.cpp
+18
-3
No files found.
modules/calib3d/src/calibration.cpp
View file @
7fd7bbc9
...
@@ -1638,12 +1638,12 @@ double cvStereoCalibrate( const CvMat* _objectPoints, const CvMat* _imagePoints1
...
@@ -1638,12 +1638,12 @@ double cvStereoCalibrate( const CvMat* _objectPoints, const CvMat* _imagePoints1
CvTermCriteria
termCrit
,
CvTermCriteria
termCrit
,
int
flags
)
int
flags
)
{
{
const
int
NINTRINSIC
=
1
2
;
const
int
NINTRINSIC
=
1
6
;
Ptr
<
CvMat
>
npoints
,
err
,
J_LR
,
Je
,
Ji
,
imagePoints
[
2
],
objectPoints
,
RT0
;
Ptr
<
CvMat
>
npoints
,
err
,
J_LR
,
Je
,
Ji
,
imagePoints
[
2
],
objectPoints
,
RT0
;
CvLevMarq
solver
;
CvLevMarq
solver
;
double
reprojErr
=
0
;
double
reprojErr
=
0
;
double
A
[
2
][
9
],
dk
[
2
][
8
]
=
{{
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
},{
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
}},
rlr
[
9
];
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
];
CvMat
K
[
2
],
Dist
[
2
],
om_LR
,
T_LR
;
CvMat
K
[
2
],
Dist
[
2
],
om_LR
,
T_LR
;
CvMat
R_LR
=
cvMat
(
3
,
3
,
CV_64F
,
rlr
);
CvMat
R_LR
=
cvMat
(
3
,
3
,
CV_64F
,
rlr
);
int
i
,
k
,
p
,
ni
=
0
,
ofs
,
nimages
,
pointsTotal
,
maxPoints
=
0
;
int
i
,
k
,
p
,
ni
=
0
,
ofs
,
nimages
,
pointsTotal
,
maxPoints
=
0
;
...
@@ -1689,7 +1689,7 @@ double cvStereoCalibrate( const CvMat* _objectPoints, const CvMat* _imagePoints1
...
@@ -1689,7 +1689,7 @@ double cvStereoCalibrate( const CvMat* _objectPoints, const CvMat* _imagePoints1
(
_imagePoints1
->
rows
==
1
&&
_imagePoints1
->
cols
==
pointsTotal
&&
cn
==
2
))
);
(
_imagePoints1
->
rows
==
1
&&
_imagePoints1
->
cols
==
pointsTotal
&&
cn
==
2
))
);
K
[
k
]
=
cvMat
(
3
,
3
,
CV_64F
,
A
[
k
]);
K
[
k
]
=
cvMat
(
3
,
3
,
CV_64F
,
A
[
k
]);
Dist
[
k
]
=
cvMat
(
1
,
8
,
CV_64F
,
dk
[
k
]);
Dist
[
k
]
=
cvMat
(
1
,
12
,
CV_64F
,
dk
[
k
]);
imagePoints
[
k
].
reset
(
cvCreateMat
(
points
->
rows
,
points
->
cols
,
CV_64FC
(
CV_MAT_CN
(
points
->
type
))));
imagePoints
[
k
].
reset
(
cvCreateMat
(
points
->
rows
,
points
->
cols
,
CV_64FC
(
CV_MAT_CN
(
points
->
type
))));
cvConvert
(
points
,
imagePoints
[
k
]
);
cvConvert
(
points
,
imagePoints
[
k
]
);
...
@@ -1768,6 +1768,13 @@ double cvStereoCalibrate( const CvMat* _objectPoints, const CvMat* _imagePoints1
...
@@ -1768,6 +1768,13 @@ double cvStereoCalibrate( const CvMat* _objectPoints, const CvMat* _imagePoints1
imask
[
10
]
=
imask
[
NINTRINSIC
+
10
]
=
0
;
imask
[
10
]
=
imask
[
NINTRINSIC
+
10
]
=
0
;
if
(
flags
&
CV_CALIB_FIX_K6
)
if
(
flags
&
CV_CALIB_FIX_K6
)
imask
[
11
]
=
imask
[
NINTRINSIC
+
11
]
=
0
;
imask
[
11
]
=
imask
[
NINTRINSIC
+
11
]
=
0
;
if
(
flags
&
CV_CALIB_FIX_S1_S2_S3_S4
)
{
imask
[
12
]
=
imask
[
NINTRINSIC
+
12
]
=
0
;
imask
[
13
]
=
imask
[
NINTRINSIC
+
13
]
=
0
;
imask
[
14
]
=
imask
[
NINTRINSIC
+
14
]
=
0
;
imask
[
15
]
=
imask
[
NINTRINSIC
+
15
]
=
0
;
}
}
}
/*
/*
...
@@ -1842,6 +1849,10 @@ double cvStereoCalibrate( const CvMat* _objectPoints, const CvMat* _imagePoints1
...
@@ -1842,6 +1849,10 @@ double cvStereoCalibrate( const CvMat* _objectPoints, const CvMat* _imagePoints1
iparam
[
4
]
=
dk
[
k
][
0
];
iparam
[
5
]
=
dk
[
k
][
1
];
iparam
[
6
]
=
dk
[
k
][
2
];
iparam
[
4
]
=
dk
[
k
][
0
];
iparam
[
5
]
=
dk
[
k
][
1
];
iparam
[
6
]
=
dk
[
k
][
2
];
iparam
[
7
]
=
dk
[
k
][
3
];
iparam
[
8
]
=
dk
[
k
][
4
];
iparam
[
9
]
=
dk
[
k
][
5
];
iparam
[
7
]
=
dk
[
k
][
3
];
iparam
[
8
]
=
dk
[
k
][
4
];
iparam
[
9
]
=
dk
[
k
][
5
];
iparam
[
10
]
=
dk
[
k
][
6
];
iparam
[
11
]
=
dk
[
k
][
7
];
iparam
[
10
]
=
dk
[
k
][
6
];
iparam
[
11
]
=
dk
[
k
][
7
];
iparam
[
12
]
=
dk
[
k
][
8
];
iparam
[
13
]
=
dk
[
k
][
9
];
iparam
[
14
]
=
dk
[
k
][
10
];
iparam
[
15
]
=
dk
[
k
][
11
];
}
}
om_LR
=
cvMat
(
3
,
1
,
CV_64F
,
solver
.
param
->
data
.
db
);
om_LR
=
cvMat
(
3
,
1
,
CV_64F
,
solver
.
param
->
data
.
db
);
...
@@ -1908,6 +1919,10 @@ double cvStereoCalibrate( const CvMat* _objectPoints, const CvMat* _imagePoints1
...
@@ -1908,6 +1919,10 @@ double cvStereoCalibrate( const CvMat* _objectPoints, const CvMat* _imagePoints1
dk
[
k
][
5
]
=
iparam
[
k
*
NINTRINSIC
+
9
];
dk
[
k
][
5
]
=
iparam
[
k
*
NINTRINSIC
+
9
];
dk
[
k
][
6
]
=
iparam
[
k
*
NINTRINSIC
+
10
];
dk
[
k
][
6
]
=
iparam
[
k
*
NINTRINSIC
+
10
];
dk
[
k
][
7
]
=
iparam
[
k
*
NINTRINSIC
+
11
];
dk
[
k
][
7
]
=
iparam
[
k
*
NINTRINSIC
+
11
];
dk
[
k
][
8
]
=
iparam
[
k
*
NINTRINSIC
+
12
];
dk
[
k
][
9
]
=
iparam
[
k
*
NINTRINSIC
+
13
];
dk
[
k
][
10
]
=
iparam
[
k
*
NINTRINSIC
+
14
];
dk
[
k
][
11
]
=
iparam
[
k
*
NINTRINSIC
+
15
];
}
}
}
}
...
...
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