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
5335489d
Commit
5335489d
authored
Aug 07, 2013
by
ozantonkal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
viz getWindowSize, setWindowSize
parent
731a931c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
4 deletions
+12
-4
viz3d.hpp
modules/viz/include/opencv2/viz/viz3d.hpp
+4
-0
types.cpp
modules/viz/src/types.cpp
+1
-1
viz3d.cpp
modules/viz/src/viz3d.cpp
+5
-2
viz3d_impl.cpp
modules/viz/src/viz3d_impl.cpp
+1
-0
viz3d_impl.hpp
modules/viz/src/viz3d_impl.hpp
+1
-1
No files found.
modules/viz/include/opencv2/viz/viz3d.hpp
View file @
5335489d
...
...
@@ -7,6 +7,7 @@
#include <opencv2/core.hpp>
#include <opencv2/viz/types.hpp>
#include <opencv2/viz/widgets.hpp>
#include <boost/concept_check.hpp>
namespace
cv
{
...
...
@@ -46,6 +47,9 @@ namespace cv
void
convertToWindowCoordinates
(
const
Point3d
&
pt
,
Point3d
&
window_coord
);
void
converTo3DRay
(
const
Point3d
&
window_coord
,
Point3d
&
origin
,
Vec3d
&
direction
);
Size
getWindowSize
()
const
;
void
setWindowSize
(
const
Size
&
window_size
);
void
spin
();
void
spinOnce
(
int
time
=
1
,
bool
force_redraw
=
false
);
...
...
modules/viz/src/types.cpp
View file @
5335489d
...
...
@@ -196,7 +196,7 @@ void cv::viz::Camera::setWindowSize(const Size &window_size)
float
aspect_ratio_new
=
static_cast
<
float
>
(
window_size
.
width
)
/
static_cast
<
float
>
(
window_size
.
height
);
if
(
principal_point_
[
0
]
<
0.0
f
)
fov_
[
0
]
=
2.
f
*
atan
(
tan
(
fov_
[
1
]
*
0.5
)
*
aspect_ratio_new
);
// This assumes that the lens is symmetric!
fov_
[
0
]
=
2.
f
*
atan
(
tan
(
fov_
[
1
]
*
0.5
f
)
*
aspect_ratio_new
);
// This assumes that the lens is symmetric!
else
fov_
[
0
]
=
(
atan2
(
principal_point_
[
0
],
focal_
[
0
])
+
atan2
(
window_size
.
width
-
principal_point_
[
0
],
focal_
[
0
]));
// TODO I need to check this
...
...
modules/viz/src/viz3d.cpp
View file @
5335489d
...
...
@@ -52,4 +52,7 @@ void cv::viz::Viz3d::setViewerPose(const Affine3f &pose) { impl_->setViewerPose(
cv
::
Affine3f
cv
::
viz
::
Viz3d
::
getViewerPose
()
{
return
impl_
->
getViewerPose
();
}
void
cv
::
viz
::
Viz3d
::
convertToWindowCoordinates
(
const
Point3d
&
pt
,
Point3d
&
window_coord
)
{
impl_
->
convertToWindowCoordinates
(
pt
,
window_coord
);
}
void
cv
::
viz
::
Viz3d
::
converTo3DRay
(
const
Point3d
&
window_coord
,
Point3d
&
origin
,
Vec3d
&
direction
)
{
impl_
->
converTo3DRay
(
window_coord
,
origin
,
direction
);
}
\ No newline at end of file
void
cv
::
viz
::
Viz3d
::
converTo3DRay
(
const
Point3d
&
window_coord
,
Point3d
&
origin
,
Vec3d
&
direction
)
{
impl_
->
converTo3DRay
(
window_coord
,
origin
,
direction
);
}
cv
::
Size
cv
::
viz
::
Viz3d
::
getWindowSize
()
const
{
return
impl_
->
getWindowSize
();
}
void
cv
::
viz
::
Viz3d
::
setWindowSize
(
const
Size
&
window_size
)
{
impl_
->
setWindowSize
(
window_size
.
width
,
window_size
.
height
);
}
\ No newline at end of file
modules/viz/src/viz3d_impl.cpp
View file @
5335489d
...
...
@@ -963,6 +963,7 @@ void cv::viz::Viz3d::VizImpl::setWindowName (const std::string &name)
void
cv
::
viz
::
Viz3d
::
VizImpl
::
setWindowPosition
(
int
x
,
int
y
)
{
window_
->
SetPosition
(
x
,
y
);
}
void
cv
::
viz
::
Viz3d
::
VizImpl
::
setWindowSize
(
int
xw
,
int
yw
)
{
window_
->
SetSize
(
xw
,
yw
);
}
cv
::
Size
cv
::
viz
::
Viz3d
::
VizImpl
::
getWindowSize
()
const
{
return
Size
(
window_
->
GetSize
()[
0
],
window_
->
GetSize
()[
1
]);
}
bool
cv
::
viz
::
Viz3d
::
VizImpl
::
addPolygonMesh
(
const
Mesh3d
&
/*mesh*/
,
const
Mat
&
/*mask*/
,
const
std
::
string
&
/*id*/
)
{
...
...
modules/viz/src/viz3d_impl.hpp
View file @
5335489d
...
...
@@ -135,10 +135,10 @@ public:
//to implemnt in Viz3d
void
saveScreenshot
(
const
String
&
file
);
void
setWindowPosition
(
int
x
,
int
y
);
Size
getWindowSize
()
const
;
void
setWindowSize
(
int
xw
,
int
yw
);
void
setFullScreen
(
bool
mode
);
void
setWindowName
(
const
String
&
name
);
...
...
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