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
f445f762
Commit
f445f762
authored
Aug 03, 2013
by
ozantonkal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
initial setCamera implementation
parent
4953786d
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
1 deletion
+17
-1
viz3d.hpp
modules/viz/include/opencv2/viz/viz3d.hpp
+1
-0
types.cpp
modules/viz/src/types.cpp
+1
-1
viz3d.cpp
modules/viz/src/viz3d.cpp
+1
-0
viz3d_impl.cpp
modules/viz/src/viz3d_impl.cpp
+12
-0
viz3d_impl.hpp
modules/viz/src/viz3d_impl.hpp
+2
-0
No files found.
modules/viz/include/opencv2/viz/viz3d.hpp
View file @
f445f762
...
...
@@ -39,6 +39,7 @@ namespace cv
void
updateWidgetPose
(
const
String
&
id
,
const
Affine3f
&
pose
);
Affine3f
getWidgetPose
(
const
String
&
id
)
const
;
void
setCamera
(
const
Camera2
&
camera
);
Affine3f
getViewerPose
();
void
setViewerPose
(
const
Affine3f
&
pose
);
...
...
modules/viz/src/types.cpp
View file @
f445f762
...
...
@@ -167,7 +167,7 @@ cv::viz::Camera2::Camera2(const Vec2f &fov, const Size &window_size)
setClip
(
Vec2d
(
0.01
,
1000.01
));
// Default clipping
window_size_
=
window_size
;
fov_
=
fov
;
principal_point_
=
Vec2f
(
-
1.0
f
,
-
1.0
f
);
//
S
ymmetric lens
principal_point_
=
Vec2f
(
-
1.0
f
,
-
1.0
f
);
//
Default s
ymmetric lens
focal_
=
Vec2f
(
-
1.0
f
,
-
1.0
f
);
}
...
...
modules/viz/src/viz3d.cpp
View file @
f445f762
...
...
@@ -46,5 +46,6 @@ void cv::viz::Viz3d::setWidgetPose(const String &id, const Affine3f &pose) { imp
void
cv
::
viz
::
Viz3d
::
updateWidgetPose
(
const
String
&
id
,
const
Affine3f
&
pose
)
{
impl_
->
updateWidgetPose
(
id
,
pose
);
}
cv
::
Affine3f
cv
::
viz
::
Viz3d
::
getWidgetPose
(
const
String
&
id
)
const
{
return
impl_
->
getWidgetPose
(
id
);
}
void
cv
::
viz
::
Viz3d
::
setCamera
(
const
Camera2
&
camera
)
{
impl_
->
setCamera
(
camera
);
}
void
cv
::
viz
::
Viz3d
::
setViewerPose
(
const
Affine3f
&
pose
)
{
impl_
->
setViewerPose
(
pose
);
}
cv
::
Affine3f
cv
::
viz
::
Viz3d
::
getViewerPose
()
{
return
impl_
->
getViewerPose
();
}
modules/viz/src/viz3d_impl.cpp
View file @
f445f762
...
...
@@ -591,6 +591,18 @@ void cv::viz::Viz3d::VizImpl::getCameras (cv::viz::Camera& camera)
camera
.
window_pos
=
cv
::
Vec2d
::
all
(
0
);
}
/////////////////////////////////////////////////////////////////////////////////////////////
void
cv
::
viz
::
Viz3d
::
VizImpl
::
setCamera
(
const
Camera2
&
camera
)
{
vtkCamera
&
active_camera
=
*
renderer_
->
GetActiveCamera
();
// Set the intrinsic parameters of the camera
active_camera
.
SetUseHorizontalViewAngle
(
0
);
// Horizontal view angle is set based on the window size
active_camera
.
SetViewAngle
(
camera
.
getFov
()[
1
]
*
180.0
f
/
CV_PI
);
active_camera
.
SetClippingRange
(
camera
.
getClip
()[
0
],
camera
.
getClip
()[
1
]);
window_
->
SetSize
(
static_cast
<
int
>
(
camera
.
getWindowSize
().
width
),
static_cast
<
int
>
(
camera
.
getWindowSize
().
height
));
}
/////////////////////////////////////////////////////////////////////////////////////////////
void
cv
::
viz
::
Viz3d
::
VizImpl
::
setViewerPose
(
const
Affine3f
&
pose
)
{
...
...
modules/viz/src/viz3d_impl.hpp
View file @
f445f762
...
...
@@ -110,6 +110,8 @@ public:
// All camera methods to refactor into set/getViewwerPose, setCamera()
// and 'Camera' class itself with various constructors/fields
void
setCamera
(
const
Camera2
&
camera
);
void
initCameraParameters
();
/** \brief Initialize camera parameters with some default values. */
bool
cameraParamsSet
()
const
;
/** \brief Checks whether the camera parameters were manually loaded from file.*/
void
updateCamera
();
/** \brief Update camera parameters and render. */
...
...
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