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
7901879e
Commit
7901879e
authored
Mar 29, 2012
by
Ilya Lysenkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a test for the C++ wrapper of cvTriangulatePoints()
parent
37db334f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
8 deletions
+28
-8
test_cameracalibration.cpp
modules/calib3d/test/test_cameracalibration.cpp
+28
-8
No files found.
modules/calib3d/test/test_cameracalibration.cpp
View file @
7901879e
...
...
@@ -1282,6 +1282,9 @@ protected:
virtual
bool
rectifyUncalibrated
(
const
Mat
&
points1
,
const
Mat
&
points2
,
const
Mat
&
F
,
Size
imgSize
,
Mat
&
H1
,
Mat
&
H2
,
double
threshold
=
5
)
=
0
;
virtual
void
triangulate
(
const
Mat
&
P1
,
const
Mat
&
P2
,
const
Mat
&
points1
,
const
Mat
&
points2
,
Mat
&
points4D
)
=
0
;
void
run
(
int
);
};
...
...
@@ -1515,15 +1518,10 @@ void CV_StereoCalibrationTest::run( int )
Mat
ys_2
=
projectedPoints_2
.
row
(
1
);
projectedPoints_1
.
row
(
1
).
copyTo
(
ys_2
);
const
int
dimension
=
4
;
Mat
points4d
(
dimension
,
pointsCount
,
CV_32FC1
);
CvMat
cvPoints4d
=
points4d
;
CvMat
cvP1
=
P1
;
CvMat
cvP2
=
P2
;
CvMat
cvPoints1
=
projectedPoints_1
;
CvMat
cvPoints2
=
projectedPoints_2
;
cvTriangulatePoints
(
&
cvP1
,
&
cvP2
,
&
cvPoints1
,
&
cvPoints2
,
&
cvPoints4d
);
Mat
points4d
;
triangulate
(
P1
,
P2
,
projectedPoints_1
,
projectedPoints_2
,
points4d
);
Mat
homogeneousPoints4d
=
points4d
.
t
();
const
int
dimension
=
4
;
homogeneousPoints4d
=
homogeneousPoints4d
.
reshape
(
dimension
);
Mat
triangulatedPoints
;
convertPointsFromHomogeneous
(
homogeneousPoints4d
,
triangulatedPoints
);
...
...
@@ -1635,6 +1633,9 @@ protected:
virtual
bool
rectifyUncalibrated
(
const
Mat
&
points1
,
const
Mat
&
points2
,
const
Mat
&
F
,
Size
imgSize
,
Mat
&
H1
,
Mat
&
H2
,
double
threshold
=
5
);
virtual
void
triangulate
(
const
Mat
&
P1
,
const
Mat
&
P2
,
const
Mat
&
points1
,
const
Mat
&
points2
,
Mat
&
points4D
);
};
double
CV_StereoCalibrationTest_C
::
calibrateStereoCamera
(
const
vector
<
vector
<
Point3f
>
>&
objectPoints
,
...
...
@@ -1718,6 +1719,15 @@ bool CV_StereoCalibrationTest_C::rectifyUncalibrated( const Mat& points1,
return
cvStereoRectifyUncalibrated
(
&
_pt1
,
&
_pt2
,
pF
,
imgSize
,
&
_H1
,
&
_H2
,
threshold
)
>
0
;
}
void
CV_StereoCalibrationTest_C
::
triangulate
(
const
Mat
&
P1
,
const
Mat
&
P2
,
const
Mat
&
points1
,
const
Mat
&
points2
,
Mat
&
points4D
)
{
CvMat
_P1
=
P1
,
_P2
=
P2
,
_points1
=
points1
,
_points2
=
points2
;
points4D
.
create
(
4
,
points1
.
cols
,
points1
.
type
());
CvMat
_points4D
=
points4D
;
cvTriangulatePoints
(
&
_P1
,
&
_P2
,
&
_points1
,
&
_points2
,
&
_points4D
);
}
//-------------------------------- CV_StereoCalibrationTest_CPP ------------------------------
...
...
@@ -1742,6 +1752,9 @@ protected:
virtual
bool
rectifyUncalibrated
(
const
Mat
&
points1
,
const
Mat
&
points2
,
const
Mat
&
F
,
Size
imgSize
,
Mat
&
H1
,
Mat
&
H2
,
double
threshold
=
5
);
virtual
void
triangulate
(
const
Mat
&
P1
,
const
Mat
&
P2
,
const
Mat
&
points1
,
const
Mat
&
points2
,
Mat
&
points4D
);
};
double
CV_StereoCalibrationTest_CPP
::
calibrateStereoCamera
(
const
vector
<
vector
<
Point3f
>
>&
objectPoints
,
...
...
@@ -1774,6 +1787,13 @@ bool CV_StereoCalibrationTest_CPP::rectifyUncalibrated( const Mat& points1,
return
stereoRectifyUncalibrated
(
points1
,
points2
,
F
,
imgSize
,
H1
,
H2
,
threshold
);
}
void
CV_StereoCalibrationTest_CPP
::
triangulate
(
const
Mat
&
P1
,
const
Mat
&
P2
,
const
Mat
&
points1
,
const
Mat
&
points2
,
Mat
&
points4D
)
{
triangulatePoints
(
P1
,
P2
,
points1
,
points2
,
points4D
);
}
///////////////////////////////////////////////////////////////////////////////////////////////////
TEST
(
Calib3d_CalibrateCamera_C
,
regression
)
{
CV_CameraCalibrationTest_C
test
;
test
.
safe_run
();
}
...
...
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