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
aa2594c0
Commit
aa2594c0
authored
Jul 25, 2013
by
ozantonkal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix aspect_ratio computation from fovs, add casting for camerapositionwidget, trajectorywidget
parent
769512db
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
widgets.hpp
modules/viz/include/opencv2/viz/widgets.hpp
+2
-0
shape_widgets.cpp
modules/viz/src/shape_widgets.cpp
+16
-2
No files found.
modules/viz/include/opencv2/viz/widgets.hpp
View file @
aa2594c0
...
@@ -231,6 +231,8 @@ namespace cv
...
@@ -231,6 +231,8 @@ namespace cv
template
<>
CV_EXPORTS
TextWidget
Widget
::
cast
<
TextWidget
>
();
template
<>
CV_EXPORTS
TextWidget
Widget
::
cast
<
TextWidget
>
();
template
<>
CV_EXPORTS
ImageOverlayWidget
Widget
::
cast
<
ImageOverlayWidget
>
();
template
<>
CV_EXPORTS
ImageOverlayWidget
Widget
::
cast
<
ImageOverlayWidget
>
();
template
<>
CV_EXPORTS
Image3DWidget
Widget
::
cast
<
Image3DWidget
>
();
template
<>
CV_EXPORTS
Image3DWidget
Widget
::
cast
<
Image3DWidget
>
();
template
<>
CV_EXPORTS
CameraPositionWidget
Widget
::
cast
<
CameraPositionWidget
>
();
template
<>
CV_EXPORTS
TrajectoryWidget
Widget
::
cast
<
TrajectoryWidget
>
();
template
<>
CV_EXPORTS
CloudWidget
Widget
::
cast
<
CloudWidget
>
();
template
<>
CV_EXPORTS
CloudWidget
Widget
::
cast
<
CloudWidget
>
();
template
<>
CV_EXPORTS
CloudNormalsWidget
Widget
::
cast
<
CloudNormalsWidget
>
();
template
<>
CV_EXPORTS
CloudNormalsWidget
Widget
::
cast
<
CloudNormalsWidget
>
();
template
<>
CV_EXPORTS
MeshWidget
Widget
::
cast
<
MeshWidget
>
();
template
<>
CV_EXPORTS
MeshWidget
Widget
::
cast
<
MeshWidget
>
();
...
...
modules/viz/src/shape_widgets.cpp
View file @
aa2594c0
...
@@ -1003,9 +1003,10 @@ cv::viz::CameraPositionWidget::CameraPositionWidget(const Vec2f &fov, double sca
...
@@ -1003,9 +1003,10 @@ cv::viz::CameraPositionWidget::CameraPositionWidget(const Vec2f &fov, double sca
camera
->
SetFocalPoint
(
0.0
,
0.0
,
1.0
);
camera
->
SetFocalPoint
(
0.0
,
0.0
,
1.0
);
camera
->
SetClippingRange
(
0.01
,
scale
);
camera
->
SetClippingRange
(
0.01
,
scale
);
double
aspect_ratio
=
tan
(
fov
[
0
]
*
0.5
)
/
tan
(
fov
[
1
]
*
0.5
);
double
planesArray
[
24
];
double
planesArray
[
24
];
// Default aspect ratio = 1.0? fovx/fovy?
camera
->
GetFrustumPlanes
(
aspect_ratio
,
planesArray
);
camera
->
GetFrustumPlanes
(
1.0
,
planesArray
);
vtkSmartPointer
<
vtkPlanes
>
planes
=
vtkSmartPointer
<
vtkPlanes
>::
New
();
vtkSmartPointer
<
vtkPlanes
>
planes
=
vtkSmartPointer
<
vtkPlanes
>::
New
();
planes
->
SetFrustumPlanes
(
planesArray
);
planes
->
SetFrustumPlanes
(
planesArray
);
...
@@ -1122,6 +1123,12 @@ cv::viz::CameraPositionWidget::CameraPositionWidget(const Matx33f &K, const Mat
...
@@ -1122,6 +1123,12 @@ cv::viz::CameraPositionWidget::CameraPositionWidget(const Matx33f &K, const Mat
WidgetAccessor
::
setProp
(
*
this
,
actor
);
WidgetAccessor
::
setProp
(
*
this
,
actor
);
}
}
template
<>
cv
::
viz
::
CameraPositionWidget
cv
::
viz
::
Widget
::
cast
<
cv
::
viz
::
CameraPositionWidget
>
()
{
Widget3D
widget
=
this
->
cast
<
Widget3D
>
();
return
static_cast
<
CameraPositionWidget
&>
(
widget
);
}
///////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////
/// trajectory widget implementation
/// trajectory widget implementation
...
@@ -1279,3 +1286,9 @@ cv::viz::TrajectoryWidget::TrajectoryWidget(const std::vector<Affine3f> &path, c
...
@@ -1279,3 +1286,9 @@ cv::viz::TrajectoryWidget::TrajectoryWidget(const std::vector<Affine3f> &path, c
WidgetAccessor
::
setProp
(
*
this
,
actor
);
WidgetAccessor
::
setProp
(
*
this
,
actor
);
setColor
(
color
);
setColor
(
color
);
}
}
template
<>
cv
::
viz
::
TrajectoryWidget
cv
::
viz
::
Widget
::
cast
<
cv
::
viz
::
TrajectoryWidget
>
()
{
Widget3D
widget
=
this
->
cast
<
Widget3D
>
();
return
static_cast
<
TrajectoryWidget
&>
(
widget
);
}
\ No newline at end of file
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