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
ca6beb9c
Commit
ca6beb9c
authored
8 years ago
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
calib3d: fix InputArray -> CvMat
parent
be7d060e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
84 deletions
+53
-84
calibinit.cpp
modules/calib3d/src/calibinit.cpp
+1
-1
calibration.cpp
modules/calib3d/src/calibration.cpp
+50
-82
test_cameracalibration.cpp
modules/calib3d/test/test_cameracalibration.cpp
+2
-1
No files found.
modules/calib3d/src/calibinit.cpp
View file @
ca6beb9c
...
...
@@ -2085,7 +2085,7 @@ void cv::drawChessboardCorners( InputOutputArray _image, Size patternSize,
Mat
corners
=
_corners
.
getMat
();
if
(
corners
.
empty
()
)
return
;
Mat
image
=
_image
.
getMat
();
CvMat
c_image
=
_image
.
getMat
()
;
Mat
image
=
_image
.
getMat
();
CvMat
c_image
=
image
;
int
nelems
=
corners
.
checkVector
(
2
,
CV_32F
,
true
);
CV_Assert
(
nelems
>=
0
);
cvDrawChessboardCorners
(
&
c_image
,
patternSize
,
corners
.
ptr
<
CvPoint2D32f
>
(),
...
...
This diff is collapsed.
Click to expand it.
modules/calib3d/src/calibration.cpp
View file @
ca6beb9c
...
...
@@ -3234,54 +3234,20 @@ void cv::composeRT( InputArray _rvec1, InputArray _tvec1,
c_tvec2
=
tvec2
,
c_rvec3
=
rvec3
,
c_tvec3
=
tvec3
;
CvMat
c_dr3dr1
,
c_dr3dt1
,
c_dr3dr2
,
c_dr3dt2
,
c_dt3dr1
,
c_dt3dt1
,
c_dt3dr2
,
c_dt3dt2
;
CvMat
*
p_dr3dr1
=
0
,
*
p_dr3dt1
=
0
,
*
p_dr3dr2
=
0
,
*
p_dr3dt2
=
0
,
*
p_dt3dr1
=
0
,
*
p_dt3dt1
=
0
,
*
p_dt3dr2
=
0
,
*
p_dt3dt2
=
0
;
if
(
_dr3dr1
.
needed
()
)
{
_dr3dr1
.
create
(
3
,
3
,
rtype
);
p_dr3dr1
=
&
(
c_dr3dr1
=
_dr3dr1
.
getMat
());
}
if
(
_dr3dt1
.
needed
()
)
{
_dr3dt1
.
create
(
3
,
3
,
rtype
);
p_dr3dt1
=
&
(
c_dr3dt1
=
_dr3dt1
.
getMat
());
}
if
(
_dr3dr2
.
needed
()
)
{
_dr3dr2
.
create
(
3
,
3
,
rtype
);
p_dr3dr2
=
&
(
c_dr3dr2
=
_dr3dr2
.
getMat
());
}
if
(
_dr3dt2
.
needed
()
)
{
_dr3dt2
.
create
(
3
,
3
,
rtype
);
p_dr3dt2
=
&
(
c_dr3dt2
=
_dr3dt2
.
getMat
());
}
if
(
_dt3dr1
.
needed
()
)
{
_dt3dr1
.
create
(
3
,
3
,
rtype
);
p_dt3dr1
=
&
(
c_dt3dr1
=
_dt3dr1
.
getMat
());
}
if
(
_dt3dt1
.
needed
()
)
{
_dt3dt1
.
create
(
3
,
3
,
rtype
);
p_dt3dt1
=
&
(
c_dt3dt1
=
_dt3dt1
.
getMat
());
}
if
(
_dt3dr2
.
needed
()
)
{
_dt3dr2
.
create
(
3
,
3
,
rtype
);
p_dt3dr2
=
&
(
c_dt3dr2
=
_dt3dr2
.
getMat
());
#define CV_COMPOSE_RT_PARAM(name) \
Mat name; \
if (_ ## name.needed())\
{ \
_ ## name.create(3, 3, rtype); \
name = _ ## name.getMat(); \
p_ ## name = &(c_ ## name = name); \
}
if
(
_dt3dt2
.
needed
()
)
{
_dt3dt2
.
create
(
3
,
3
,
rtype
);
p_dt3dt2
=
&
(
c_dt3dt2
=
_dt3dt2
.
getMat
()
);
}
CV_COMPOSE_RT_PARAM
(
dr3dr1
);
CV_COMPOSE_RT_PARAM
(
dr3dt1
);
CV_COMPOSE_RT_PARAM
(
dr3dr2
);
CV_COMPOSE_RT_PARAM
(
dr3dt2
);
CV_COMPOSE_RT_PARAM
(
dt3dr1
);
CV_COMPOSE_RT_PARAM
(
dt3dt1
);
CV_COMPOSE_RT_PARAM
(
dt3dr2
);
CV_COMPOSE_RT_PARAM
(
dt3dt2
);
#undef CV_COMPOSE_RT_PARAM
cvComposeRT
(
&
c_rvec1
,
&
c_tvec1
,
&
c_rvec2
,
&
c_tvec2
,
&
c_rvec3
,
&
c_tvec3
,
p_dr3dr1
,
p_dr3dt1
,
p_dr3dr2
,
p_dr3dt2
,
...
...
@@ -3306,7 +3272,8 @@ void cv::projectPoints( InputArray _opoints,
CvMat
*
pdpdrot
=
0
,
*
pdpdt
=
0
,
*
pdpdf
=
0
,
*
pdpdc
=
0
,
*
pdpddist
=
0
;
_ipoints
.
create
(
npoints
,
1
,
CV_MAKETYPE
(
depth
,
2
),
-
1
,
true
);
CvMat
c_imagePoints
=
_ipoints
.
getMat
();
Mat
imagePoints
=
_ipoints
.
getMat
();
CvMat
c_imagePoints
(
imagePoints
);
CvMat
c_objectPoints
=
opoints
;
Mat
cameraMatrix
=
_cameraMatrix
.
getMat
();
...
...
@@ -3674,24 +3641,25 @@ cv::Vec3d cv::RQDecomp3x3( InputArray _Mmat,
Mat
M
=
_Mmat
.
getMat
();
_Rmat
.
create
(
3
,
3
,
M
.
type
());
_Qmat
.
create
(
3
,
3
,
M
.
type
());
Mat
Rmat
=
_Rmat
.
getMat
();
Mat
Qmat
=
_Qmat
.
getMat
();
Vec3d
eulerAngles
;
CvMat
matM
=
M
,
matR
=
_Rmat
.
getMat
(),
matQ
=
_Qmat
.
getMat
(),
Qx
,
Qy
,
Qz
,
*
pQx
=
0
,
*
pQy
=
0
,
*
pQz
=
0
;
if
(
_Qx
.
needed
()
)
{
_Qx
.
create
(
3
,
3
,
M
.
type
());
pQx
=
&
(
Qx
=
_Qx
.
getMat
());
}
if
(
_Qy
.
needed
()
)
{
_Qy
.
create
(
3
,
3
,
M
.
type
());
pQy
=
&
(
Qy
=
_Qy
.
getMat
());
}
if
(
_Qz
.
needed
()
)
{
_Qz
.
create
(
3
,
3
,
M
.
type
());
pQz
=
&
(
Qz
=
_Qz
.
getMat
());
}
CvMat
matM
=
M
,
matR
=
Rmat
,
matQ
=
Qmat
;
#define CV_RQDecomp3x3_PARAM(name) \
Mat name; \
CvMat c_ ## name, *p ## name = NULL; \
if( _ ## name.needed() ) \
{ \
_ ## name.create(3, 3, M.type()); \
name = _ ## name.getMat(); \
c_ ## name = name; p ## name = &c_ ## name; \
}
CV_RQDecomp3x3_PARAM
(
Qx
);
CV_RQDecomp3x3_PARAM
(
Qy
);
CV_RQDecomp3x3_PARAM
(
Qz
);
#undef CV_RQDecomp3x3_PARAM
cvRQDecomp3x3
(
&
matM
,
&
matR
,
&
matQ
,
pQx
,
pQy
,
pQz
,
(
CvPoint3D64f
*
)
&
eulerAngles
[
0
]);
return
eulerAngles
;
}
...
...
@@ -3709,28 +3677,28 @@ void cv::decomposeProjectionMatrix( InputArray _projMatrix, OutputArray _cameraM
_cameraMatrix
.
create
(
3
,
3
,
type
);
_rotMatrix
.
create
(
3
,
3
,
type
);
_transVect
.
create
(
4
,
1
,
type
);
CvMat
c_projMatrix
=
projMatrix
,
c_
cameraMatrix
=
_cameraMatrix
.
getMat
();
CvMat
c_rotMatrix
=
_rotMatrix
.
getMat
(),
c_transVect
=
_transVect
.
getMat
();
CvMat
c_rotMatrixX
,
*
p_rotMatrixX
=
0
;
CvMat
c_
rotMatrixY
,
*
p_rotMatrixY
=
0
;
CvMat
c_rotMatrix
Z
,
*
p_rotMatrixZ
=
0
;
Mat
cameraMatrix
=
_cameraMatrix
.
getMat
();
Mat
rotMatrix
=
_rotMatrix
.
getMat
();
Mat
transVect
=
_transVect
.
getMat
()
;
CvMat
c_
projMatrix
=
projMatrix
,
c_cameraMatrix
=
cameraMatrix
;
CvMat
c_rotMatrix
=
rotMatrix
,
c_transVect
=
transVect
;
CvPoint3D64f
*
p_eulerAngles
=
0
;
if
(
_rotMatrixX
.
needed
()
)
{
_rotMatrixX
.
create
(
3
,
3
,
type
);
p_rotMatrixX
=
&
(
c_rotMatrixX
=
_rotMatrixX
.
getMat
());
}
if
(
_rotMatrixY
.
needed
()
)
{
_rotMatrixY
.
create
(
3
,
3
,
type
);
p_rotMatrixY
=
&
(
c_rotMatrixY
=
_rotMatrixY
.
getMat
());
}
if
(
_rotMatrixZ
.
needed
()
)
{
_rotMatrixZ
.
create
(
3
,
3
,
type
);
p_rotMatrixZ
=
&
(
c_rotMatrixZ
=
_rotMatrixZ
.
getMat
());
#define CV_decomposeProjectionMatrix_PARAM(name) \
Mat name; \
CvMat c_ ## name, *p_ ## name = NULL; \
if( _ ## name.needed() ) \
{ \
_ ## name.create(3, 3, type); \
name = _ ## name.getMat(); \
c_ ## name = name; p_ ## name = &c_ ## name; \
}
CV_decomposeProjectionMatrix_PARAM
(
rotMatrixX
);
CV_decomposeProjectionMatrix_PARAM
(
rotMatrixY
);
CV_decomposeProjectionMatrix_PARAM
(
rotMatrixZ
);
#undef CV_decomposeProjectionMatrix_PARAM
if
(
_eulerAngles
.
needed
()
)
{
_eulerAngles
.
create
(
3
,
1
,
CV_64F
,
-
1
,
true
);
...
...
This diff is collapsed.
Click to expand it.
modules/calib3d/test/test_cameracalibration.cpp
View file @
ca6beb9c
...
...
@@ -1306,7 +1306,8 @@ void CV_ProjectPointsTest_C::project( const Mat& opoints, const Mat& rvec, const
dpdf
.
create
(
npoints
*
2
,
2
,
CV_64F
);
dpdc
.
create
(
npoints
*
2
,
2
,
CV_64F
);
dpddist
.
create
(
npoints
*
2
,
distCoeffs
.
rows
+
distCoeffs
.
cols
-
1
,
CV_64F
);
CvMat
_objectPoints
=
opoints
,
_imagePoints
=
Mat
(
ipoints
);
Mat
imagePoints
(
ipoints
);
CvMat
_objectPoints
=
opoints
,
_imagePoints
=
imagePoints
;
CvMat
_rvec
=
rvec
,
_tvec
=
tvec
,
_cameraMatrix
=
cameraMatrix
,
_distCoeffs
=
distCoeffs
;
CvMat
_dpdrot
=
dpdrot
,
_dpdt
=
dpdt
,
_dpdf
=
dpdf
,
_dpdc
=
dpdc
,
_dpddist
=
dpddist
;
...
...
This diff is collapsed.
Click to expand it.
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