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
462d5167
Commit
462d5167
authored
Jan 09, 2014
by
Anatoly Baksheev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added test for camera positions, slightly refactored the widgets
parent
8309d19f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
0 deletions
+27
-0
shapes.cpp
modules/viz/src/shapes.cpp
+0
-0
tests_simple.cpp
modules/viz/test/tests_simple.cpp
+27
-0
No files found.
modules/viz/src/shapes.cpp
View file @
462d5167
This diff is collapsed.
Click to expand it.
modules/viz/test/tests_simple.cpp
View file @
462d5167
...
@@ -199,6 +199,33 @@ TEST(Viz, DISABLED_show_trajectory_reposition)
...
@@ -199,6 +199,33 @@ TEST(Viz, DISABLED_show_trajectory_reposition)
}
}
TEST
(
Viz
,
show_camera_positions
)
{
Mat
lena
=
imread
(
Path
::
combine
(
cvtest
::
TS
::
ptr
()
->
get_data_path
(),
"lena.png"
));
Mat
chs
[
3
];
split
(
lena
,
chs
);
Mat
gray
=
0.114
*
chs
[
0
]
+
0.58
*
chs
[
1
]
+
0.3
*
chs
[
2
];
Matx33d
K
(
1024.0
,
0.0
,
320.0
,
0.0
,
1024.0
,
240.0
,
0.0
,
0.0
,
1.0
);
Affine3d
poses
[
2
];
for
(
int
i
=
0
;
i
<
2
;
++
i
)
{
Vec3d
pose
=
5
*
Vec3d
(
sin
(
3.14
+
2.7
+
i
*
60
*
CV_PI
/
180
),
0.4
-
i
*
0.3
,
cos
(
3.14
+
2.7
+
i
*
60
*
CV_PI
/
180
));
poses
[
i
]
=
makeCameraPose
(
pose
,
Vec3d
(
0.0
,
0.0
,
0.0
),
Vec3d
(
0.0
,
-
0.1
,
0.0
));
}
Viz3d
viz
(
"show_camera_positions"
);
viz
.
showWidget
(
"sphe"
,
WSphere
(
Point3d
(
0
,
0
,
0
),
1.0
));
viz
.
showWidget
(
"coos"
,
WCoordinateSystem
(
1.5
));
viz
.
showWidget
(
"pos1"
,
WCameraPosition
(
0.75
),
poses
[
0
]);
viz
.
showWidget
(
"pos2"
,
WCameraPosition
(
Vec2d
(
0.78
,
0.78
),
lena
,
2.2
,
Color
::
green
()),
poses
[
0
]);
viz
.
showWidget
(
"pos3"
,
WCameraPosition
(
0.75
),
poses
[
1
]);
viz
.
showWidget
(
"pos4"
,
WCameraPosition
(
K
,
gray
,
3
,
Color
::
indigo
()),
poses
[
1
]);
viz
.
spin
();
}
TEST
(
Viz
,
DISABLED_spin_twice_____________________________TODO_UI_BUG
)
TEST
(
Viz
,
DISABLED_spin_twice_____________________________TODO_UI_BUG
)
{
{
Mesh
mesh
=
Mesh
::
load
(
get_dragon_ply_file_path
());
Mesh
mesh
=
Mesh
::
load
(
get_dragon_ply_file_path
());
...
...
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