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
ffbb5e95
Commit
ffbb5e95
authored
Aug 31, 2013
by
ozantonkal
Committed by
Ozan Tonkal
Sep 05, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
resetCamera, resetViewpoint in Viz3d
parent
4aa61dee
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
9 deletions
+17
-9
viz3d.hpp
modules/viz/include/opencv2/viz/viz3d.hpp
+3
-0
viz3d.cpp
modules/viz/src/viz3d.cpp
+3
-0
viz3d_impl.cpp
modules/viz/src/viz3d_impl.cpp
+9
-3
viz3d_impl.hpp
modules/viz/src/viz3d_impl.hpp
+2
-6
No files found.
modules/viz/include/opencv2/viz/viz3d.hpp
View file @
ffbb5e95
...
...
@@ -38,6 +38,9 @@ namespace cv
Affine3f
getViewerPose
();
void
setViewerPose
(
const
Affine3f
&
pose
);
void
resetCameraViewpoint
(
const
String
&
id
);
void
resetCamera
();
void
convertToWindowCoordinates
(
const
Point3d
&
pt
,
Point3d
&
window_coord
);
void
converTo3DRay
(
const
Point3d
&
window_coord
,
Point3d
&
origin
,
Vec3d
&
direction
);
...
...
modules/viz/src/viz3d.cpp
View file @
ffbb5e95
...
...
@@ -67,6 +67,9 @@ cv::viz::Camera cv::viz::Viz3d::getCamera() const { return impl_->getCamera(); }
void
cv
::
viz
::
Viz3d
::
setViewerPose
(
const
Affine3f
&
pose
)
{
impl_
->
setViewerPose
(
pose
);
}
cv
::
Affine3f
cv
::
viz
::
Viz3d
::
getViewerPose
()
{
return
impl_
->
getViewerPose
();
}
void
cv
::
viz
::
Viz3d
::
resetCameraViewpoint
(
const
String
&
id
)
{
impl_
->
resetCameraViewpoint
(
id
);
}
void
cv
::
viz
::
Viz3d
::
resetCamera
()
{
impl_
->
resetCamera
();
}
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
);
}
...
...
modules/viz/src/viz3d_impl.cpp
View file @
ffbb5e95
...
...
@@ -421,21 +421,21 @@ void cv::viz::Viz3d::VizImpl::converTo3DRay(const Point3d &window_coord, Point3d
}
/////////////////////////////////////////////////////////////////////////////////////////////
void
cv
::
viz
::
Viz3d
::
VizImpl
::
resetCameraViewpoint
(
const
std
::
s
tring
&
id
)
void
cv
::
viz
::
Viz3d
::
VizImpl
::
resetCameraViewpoint
(
const
S
tring
&
id
)
{
vtkSmartPointer
<
vtkMatrix4x4
>
camera_pose
;
static
WidgetActorMap
::
iterator
it
=
widget_actor_map_
->
find
(
id
);
if
(
it
!=
widget_actor_map_
->
end
())
{
vtkProp3D
*
actor
=
vtkProp3D
::
SafeDownCast
(
it
->
second
);
CV_Assert
(
"Widget is not 3D."
&&
actor
);
camera_pose
=
actor
->
GetUserMatrix
();
}
else
return
;
// Prevent a segfault
if
(
!
camera_pose
)
return
;
if
(
!
camera_pose
)
return
;
vtkSmartPointer
<
vtkCamera
>
cam
=
renderer_
->
GetActiveCamera
();
cam
->
SetPosition
(
camera_pose
->
GetElement
(
0
,
3
),
...
...
@@ -455,6 +455,12 @@ void cv::viz::Viz3d::VizImpl::resetCameraViewpoint (const std::string &id)
renderer_
->
Render
();
}
///////////////////////////////////////////////////////////////////////////////////
void
cv
::
viz
::
Viz3d
::
VizImpl
::
resetCamera
()
{
renderer_
->
ResetCamera
();
}
///////////////////////////////////////////////////////////////////////////////////
void
cv
::
viz
::
Viz3d
::
VizImpl
::
setRepresentationToSurface
()
{
...
...
modules/viz/src/viz3d_impl.hpp
View file @
ffbb5e95
...
...
@@ -50,17 +50,13 @@ public:
void
setRepresentationToPoints
();
void
setRepresentationToWireframe
();
// ////////////////////////////////////////////////////////////////////////////////////
// All camera methods to refactor into set/getViewwerPose, setCamera()
// and 'Camera' class itself with various constructors/fields
void
setCamera
(
const
Camera
&
camera
);
Camera
getCamera
()
const
;
/** \brief Reset the camera direction from {0, 0, 0} to the center_{x, y, z} of a given dataset.
* \param[in] id the point cloud object id (default: cloud) */
void
resetCameraViewpoint
(
const
String
&
id
=
"cloud"
);
void
resetCameraViewpoint
(
const
String
&
id
);
void
resetCamera
();
void
setViewerPose
(
const
Affine3f
&
pose
);
Affine3f
getViewerPose
();
...
...
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