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
4c3d1d58
Commit
4c3d1d58
authored
Jul 04, 2013
by
ozantonkal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove ModelCoefficients, remove showShape methods from viz3d
parent
5bb95c41
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
0 additions
and
204 deletions
+0
-204
types.hpp
modules/viz/include/opencv2/viz/types.hpp
+0
-7
viz3d.hpp
modules/viz/include/opencv2/viz/viz3d.hpp
+0
-25
viz3d_impl.hpp
modules/viz/src/q/viz3d_impl.hpp
+0
-47
viz3d.cpp
modules/viz/src/viz3d.cpp
+0
-60
viz3d_impl.cpp
modules/viz/src/viz3d_impl.cpp
+0
-0
viz_main.cpp
modules/viz/src/viz_main.cpp
+0
-65
No files found.
modules/viz/include/opencv2/viz/types.hpp
View file @
4c3d1d58
...
...
@@ -35,13 +35,6 @@ namespace temp_viz
using
cv
::
DataDepth
;
using
cv
::
DataType
;
struct
CV_EXPORTS
ModelCoefficients
{
std
::
vector
<
float
>
values
;
};
class
CV_EXPORTS
Color
:
public
Scalar
{
public
:
...
...
modules/viz/include/opencv2/viz/viz3d.hpp
View file @
4c3d1d58
...
...
@@ -26,43 +26,18 @@ namespace temp_viz
void
setBackgroundColor
(
const
Color
&
color
=
Color
::
black
());
void
addCoordinateSystem
(
double
scale
,
const
Affine3f
&
t
,
const
String
&
id
=
"coordinate"
);
void
showPointCloud
(
const
String
&
id
,
InputArray
cloud
,
InputArray
colors
,
const
Affine3f
&
pose
=
Affine3f
::
Identity
());
void
showPointCloud
(
const
String
&
id
,
InputArray
cloud
,
const
Color
&
color
,
const
Affine3f
&
pose
=
Affine3f
::
Identity
());
bool
addPointCloudNormals
(
const
Mat
&
cloud
,
const
Mat
&
normals
,
int
level
=
100
,
float
scale
=
0.02
f
,
const
String
&
id
=
"cloud"
);
void
showLine
(
const
String
&
id
,
const
Point3f
&
pt1
,
const
Point3f
&
pt2
,
const
Color
&
color
=
Color
::
white
());
void
showPlane
(
const
String
&
id
,
const
Vec4f
&
coeffs
,
const
Color
&
color
=
Color
::
white
());
void
showPlane
(
const
String
&
id
,
const
Vec4f
&
coeffs
,
const
Point3f
&
pt
,
const
Color
&
color
=
Color
::
white
());
void
showCube
(
const
String
&
id
,
const
Point3f
&
pt1
,
const
Point3f
&
pt2
,
const
Color
&
color
=
Color
::
white
());
void
showCylinder
(
const
String
&
id
,
const
Point3f
&
pt_on_axis
,
const
Point3f
&
axis_direction
,
double
radius
,
int
num_sides
,
const
Color
&
color
=
Color
::
white
());
void
showCircle
(
const
String
&
id
,
const
Point3f
&
pt
,
double
radius
,
const
Color
&
color
=
Color
::
white
());
void
showSphere
(
const
String
&
id
,
const
Point3f
&
pt
,
double
radius
,
const
Color
&
color
=
Color
::
white
());
void
showArrow
(
const
String
&
id
,
const
Point3f
&
pt1
,
const
Point3f
&
pt2
,
const
Color
&
color
=
Color
::
white
());
Affine3f
getShapePose
(
const
String
&
id
);
void
setShapePose
(
const
String
&
id
,
const
Affine3f
&
pose
);
bool
addPlane
(
const
ModelCoefficients
&
coefficients
,
const
String
&
id
=
"plane"
);
bool
addPlane
(
const
ModelCoefficients
&
coefficients
,
double
x
,
double
y
,
double
z
,
const
String
&
id
=
"plane"
);
bool
removeCoordinateSystem
(
const
String
&
id
=
"coordinate"
);
bool
addPolygonMesh
(
const
Mesh3d
&
mesh
,
const
String
&
id
=
"polygon"
);
bool
updatePolygonMesh
(
const
Mesh3d
&
mesh
,
const
String
&
id
=
"polygon"
);
bool
addPolylineFromPolygonMesh
(
const
Mesh3d
&
mesh
,
const
String
&
id
=
"polyline"
);
bool
addText
(
const
String
&
text
,
int
xpos
,
int
ypos
,
const
Color
&
color
,
int
fontsize
=
10
,
const
String
&
id
=
""
);
bool
addPolygon
(
const
Mat
&
cloud
,
const
Color
&
color
,
const
String
&
id
=
"polygon"
);
bool
addSphere
(
const
Point3f
&
center
,
double
radius
,
const
Color
&
color
,
const
String
&
id
=
"sphere"
);
void
spin
();
void
spinOnce
(
int
time
=
1
,
bool
force_redraw
=
false
);
...
...
modules/viz/src/q/viz3d_impl.hpp
View file @
4c3d1d58
...
...
@@ -38,41 +38,6 @@ public:
void
spin
();
void
spinOnce
(
int
time
=
1
,
bool
force_redraw
=
false
);
/** \brief Adds 3D axes describing a coordinate system to screen at x, y, z, Roll,Pitch,Yaw
*
* \param[in] scale the scale of the axes (default: 1)
* \param[in] t transformation matrix
*
* RPY Angles
* Rotate the reference frame by the angle roll about axis x
* Rotate the reference frame by the angle pitch about axis y
* Rotate the reference frame by the angle yaw about axis z
*
* Description:
* Sets the orientation of the Prop3D. Orientation is specified as
* X,Y and Z rotations in that order, but they are performed as
* RotateZ, RotateX, and finally RotateY.
*
* All axies use right hand rule. x=red axis, y=green axis, z=blue axis
* z direction is point into the screen.
* z
* \
* \
* \
* -----------> x
* |
* |
* |
* |
* |
* |
* y
*/
void
addCoordinateSystem
(
double
scale
,
const
Affine3f
&
t
,
const
String
&
id
=
"coordinate"
);
/** \brief Removes a previously added 3D axes (coordinate system)
*/
bool
removeCoordinateSystem
(
const
String
&
id
=
"coordinate"
);
bool
removePointCloud
(
const
String
&
id
=
"cloud"
);
inline
bool
removePolygonMesh
(
const
String
&
id
=
"polygon"
)
{
...
...
@@ -138,18 +103,6 @@ public:
interactor_
->
TerminateApp
();
}
void
showLine
(
const
String
&
id
,
const
Point3f
&
pt1
,
const
Point3f
&
pt2
,
const
Color
&
color
);
void
showPlane
(
const
String
&
id
,
const
cv
::
Vec4f
&
coefs
,
const
Color
&
color
);
void
showPlane
(
const
String
&
id
,
const
cv
::
Vec4f
&
coefs
,
const
Point3f
&
pt
,
const
Color
&
color
);
void
showCube
(
const
String
&
id
,
const
Point3f
&
pt1
,
const
Point3f
&
pt2
,
const
Color
&
color
);
void
showCylinder
(
const
String
&
id
,
const
Point3f
&
pt_on_axis
,
const
Point3f
&
axis_direction
,
double
radius
,
int
num_sides
,
const
Color
&
color
);
void
showCircle
(
const
String
&
id
,
const
Point3f
&
pt
,
double
radius
,
const
Color
&
color
);
void
showSphere
(
const
String
&
id
,
const
Point3f
&
pt
,
double
radius
,
const
Color
&
color
);
void
showArrow
(
const
String
&
id
,
const
Point3f
&
pt1
,
const
Point3f
&
pt2
,
const
Color
&
color
);
Affine3f
getShapePose
(
const
String
&
id
);
void
setShapePose
(
const
String
&
id
,
const
Affine3f
&
pose
);
bool
addPolygon
(
const
cv
::
Mat
&
cloud
,
const
Color
&
color
,
const
String
&
id
=
"polygon"
);
bool
addArrow
(
const
Point3f
&
pt1
,
const
Point3f
&
pt2
,
const
Color
&
color
,
bool
display_length
,
const
String
&
id
=
"arrow"
);
bool
addArrow
(
const
Point3f
&
pt1
,
const
Point3f
&
pt2
,
const
Color
&
color_line
,
const
Color
&
color_text
,
const
String
&
id
=
"arrow"
);
...
...
modules/viz/src/viz3d.cpp
View file @
4c3d1d58
...
...
@@ -17,11 +17,6 @@ void temp_viz::Viz3d::setBackgroundColor(const Color& color)
impl_
->
setBackgroundColor
(
color
);
}
void
temp_viz
::
Viz3d
::
addCoordinateSystem
(
double
scale
,
const
Affine3f
&
t
,
const
String
&
id
)
{
impl_
->
addCoordinateSystem
(
scale
,
t
,
id
);
}
void
temp_viz
::
Viz3d
::
showPointCloud
(
const
String
&
id
,
InputArray
cloud
,
InputArray
colors
,
const
Affine3f
&
pose
)
{
impl_
->
showPointCloud
(
id
,
cloud
,
colors
,
pose
);
...
...
@@ -72,61 +67,6 @@ void temp_viz::Viz3d::spinOnce (int time, bool force_redraw)
impl_
->
spinOnce
(
time
,
force_redraw
);
}
void
temp_viz
::
Viz3d
::
showLine
(
const
String
&
id
,
const
Point3f
&
pt1
,
const
Point3f
&
pt2
,
const
Color
&
color
)
{
impl_
->
showLine
(
id
,
pt1
,
pt2
,
color
);
}
void
temp_viz
::
Viz3d
::
showPlane
(
const
String
&
id
,
const
Vec4f
&
coeffs
,
const
Color
&
color
)
{
impl_
->
showPlane
(
id
,
coeffs
,
color
);
}
void
temp_viz
::
Viz3d
::
showPlane
(
const
String
&
id
,
const
Vec4f
&
coeffs
,
const
Point3f
&
pt
,
const
Color
&
color
)
{
impl_
->
showPlane
(
id
,
coeffs
,
pt
,
color
);
}
void
temp_viz
::
Viz3d
::
showCube
(
const
String
&
id
,
const
Point3f
&
pt1
,
const
Point3f
&
pt2
,
const
Color
&
color
)
{
impl_
->
showCube
(
id
,
pt1
,
pt2
,
color
);
}
void
temp_viz
::
Viz3d
::
showCylinder
(
const
String
&
id
,
const
Point3f
&
pt_on_axis
,
const
Point3f
&
axis_direction
,
double
radius
,
int
num_sides
,
const
Color
&
color
)
{
impl_
->
showCylinder
(
id
,
pt_on_axis
,
axis_direction
,
radius
,
num_sides
,
color
);
}
void
temp_viz
::
Viz3d
::
showCircle
(
const
String
&
id
,
const
Point3f
&
pt
,
double
radius
,
const
Color
&
color
)
{
impl_
->
showCircle
(
id
,
pt
,
radius
,
color
);
}
void
temp_viz
::
Viz3d
::
showSphere
(
const
String
&
id
,
const
Point3f
&
pt
,
double
radius
,
const
Color
&
color
)
{
impl_
->
showSphere
(
id
,
pt
,
radius
,
color
);
}
void
temp_viz
::
Viz3d
::
showArrow
(
const
String
&
id
,
const
Point3f
&
pt1
,
const
Point3f
&
pt2
,
const
Color
&
color
)
{
impl_
->
showArrow
(
id
,
pt1
,
pt2
,
color
);
}
cv
::
Affine3f
temp_viz
::
Viz3d
::
getShapePose
(
const
String
&
id
)
{
return
impl_
->
getShapePose
(
id
);
}
void
temp_viz
::
Viz3d
::
setShapePose
(
const
String
&
id
,
const
Affine3f
&
pose
)
{
impl_
->
setShapePose
(
id
,
pose
);
}
bool
temp_viz
::
Viz3d
::
removeCoordinateSystem
(
const
String
&
id
)
{
return
impl_
->
removeCoordinateSystem
(
id
);
}
void
temp_viz
::
Viz3d
::
registerKeyboardCallback
(
void
(
*
callback
)(
const
KeyboardEvent
&
,
void
*
),
void
*
cookie
)
{
impl_
->
registerKeyboardCallback
(
callback
,
cookie
);
...
...
modules/viz/src/viz3d_impl.cpp
View file @
4c3d1d58
This diff is collapsed.
Click to expand it.
modules/viz/src/viz_main.cpp
View file @
4c3d1d58
...
...
@@ -139,71 +139,6 @@ void temp_viz::Viz3d::VizImpl::spinOnce (int time, bool force_redraw)
}
}
/////////////////////////////////////////////////////////////////////////////////////////////
void
temp_viz
::
Viz3d
::
VizImpl
::
addCoordinateSystem
(
double
scale
,
const
cv
::
Affine3f
&
affine
,
const
std
::
string
&
id
)
{
vtkSmartPointer
<
vtkAxes
>
axes
=
vtkSmartPointer
<
vtkAxes
>::
New
();
axes
->
SetOrigin
(
0
,
0
,
0
);
axes
->
SetScaleFactor
(
scale
);
vtkSmartPointer
<
vtkFloatArray
>
axes_colors
=
vtkSmartPointer
<
vtkFloatArray
>::
New
();
axes_colors
->
Allocate
(
6
);
axes_colors
->
InsertNextValue
(
0.0
);
axes_colors
->
InsertNextValue
(
0.0
);
axes_colors
->
InsertNextValue
(
0.5
);
axes_colors
->
InsertNextValue
(
0.5
);
axes_colors
->
InsertNextValue
(
1.0
);
axes_colors
->
InsertNextValue
(
1.0
);
vtkSmartPointer
<
vtkPolyData
>
axes_data
=
axes
->
GetOutput
();
axes_data
->
Update
();
axes_data
->
GetPointData
()
->
SetScalars
(
axes_colors
);
vtkSmartPointer
<
vtkTubeFilter
>
axes_tubes
=
vtkSmartPointer
<
vtkTubeFilter
>::
New
();
axes_tubes
->
SetInput
(
axes_data
);
axes_tubes
->
SetRadius
(
axes
->
GetScaleFactor
()
/
50.0
);
axes_tubes
->
SetNumberOfSides
(
6
);
vtkSmartPointer
<
vtkPolyDataMapper
>
axes_mapper
=
vtkSmartPointer
<
vtkPolyDataMapper
>::
New
();
axes_mapper
->
SetScalarModeToUsePointData
();
axes_mapper
->
SetInput
(
axes_tubes
->
GetOutput
());
vtkSmartPointer
<
vtkLODActor
>
axes_actor
=
vtkSmartPointer
<
vtkLODActor
>::
New
();
axes_actor
->
SetMapper
(
axes_mapper
);
cv
::
Vec3d
t
=
affine
.
translation
();
axes_actor
->
SetPosition
(
t
[
0
],
t
[
1
],
t
[
2
]);
cv
::
Matx33f
m
=
affine
.
rotation
();
cv
::
Vec3f
rvec
;
cv
::
Rodrigues
(
m
,
rvec
);
float
r_angle
=
cv
::
norm
(
rvec
);
rvec
*=
1.
f
/
r_angle
;
axes_actor
->
SetOrientation
(
0
,
0
,
0
);
axes_actor
->
RotateWXYZ
(
r_angle
*
180
/
CV_PI
,
rvec
[
0
],
rvec
[
1
],
rvec
[
2
]);
renderer_
->
AddActor
(
axes_actor
);
(
*
shape_actor_map_
)[
id
]
=
axes_actor
;
}
/////////////////////////////////////////////////////////////////////////////////////////////
bool
temp_viz
::
Viz3d
::
VizImpl
::
removeCoordinateSystem
(
const
std
::
string
&
id
)
{
ShapeActorMap
::
iterator
am_it
=
shape_actor_map_
->
find
(
id
);
if
(
am_it
==
shape_actor_map_
->
end
())
return
false
;
// Remove it from all renderers
if
(
!
removeActorFromRenderer
(
am_it
->
second
))
return
false
;
shape_actor_map_
->
erase
(
am_it
);
return
true
;
}
/////////////////////////////////////////////////////////////////////////////////////////////
bool
temp_viz
::
Viz3d
::
VizImpl
::
removePointCloud
(
const
std
::
string
&
id
)
{
...
...
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