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
e58b0b35
Commit
e58b0b35
authored
Jun 07, 2013
by
ozantonkal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed cv keywords and redundant lines from showPointCloud
parent
59acccfa
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
15 deletions
+15
-15
types.hpp
modules/viz/include/opencv2/viz/types.hpp
+3
-0
viz3d.hpp
modules/viz/include/opencv2/viz/viz3d.hpp
+1
-1
viz3d_impl.hpp
modules/viz/src/q/viz3d_impl.hpp
+1
-1
viz3d.cpp
modules/viz/src/viz3d.cpp
+1
-1
viz3d_impl.cpp
modules/viz/src/viz3d_impl.cpp
+9
-12
No files found.
modules/viz/include/opencv2/viz/types.hpp
View file @
e58b0b35
...
...
@@ -16,14 +16,17 @@ namespace temp_viz
typedef
cv
::
Vec4d
Vec4d
;
typedef
cv
::
Vec2d
Vec2d
;
typedef
cv
::
Vec2i
Vec2i
;
typedef
cv
::
Vec3b
Vec3b
;
typedef
cv
::
Matx33d
Matx33d
;
typedef
cv
::
Affine3f
Affine3f
;
typedef
cv
::
Affine3d
Affine3d
;
typedef
cv
::
Point3f
Point3f
;
typedef
cv
::
Point3d
Point3d
;
typedef
cv
::
Matx44d
Matx44d
;
typedef
cv
::
Matx44f
Matx44f
;
typedef
cv
::
Size
Size
;
typedef
cv
::
Point
Point
;
typedef
cv
::
InputArray
InputArray
;
...
...
modules/viz/include/opencv2/viz/viz3d.hpp
View file @
e58b0b35
...
...
@@ -27,7 +27,7 @@ namespace temp_viz
void
addCoordinateSystem
(
double
scale
,
const
Affine3f
&
t
,
const
String
&
id
=
"coordinate"
);
void
showPointCloud
(
const
std
::
string
&
id
,
cv
::
InputArray
cloud
,
cv
::
InputArray
colors
,
const
cv
::
Affine3f
&
pose
=
cv
::
Affine3f
::
Identity
());
void
showPointCloud
(
const
String
&
id
,
InputArray
cloud
,
InputArray
colors
,
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"
);
...
...
modules/viz/src/q/viz3d_impl.hpp
View file @
e58b0b35
...
...
@@ -103,7 +103,7 @@ public:
* \param[in] colors color input in the same order of the points or single uniform color
* \param[in] pose transform to be applied on the point cloud
*/
void
showPointCloud
(
const
std
::
string
&
id
,
cv
::
InputArray
cloud
,
cv
::
InputArray
colors
,
const
cv
::
Affine3f
&
pose
=
cv
::
Affine3f
::
Identity
());
void
showPointCloud
(
const
String
&
id
,
InputArray
cloud
,
InputArray
colors
,
const
Affine3f
&
pose
=
Affine3f
::
Identity
());
bool
addPolygonMesh
(
const
Mesh3d
&
mesh
,
const
cv
::
Mat
&
mask
,
const
std
::
string
&
id
=
"polygon"
);
bool
updatePolygonMesh
(
const
Mesh3d
&
mesh
,
const
cv
::
Mat
&
mask
,
const
std
::
string
&
id
=
"polygon"
);
...
...
modules/viz/src/viz3d.cpp
View file @
e58b0b35
...
...
@@ -23,7 +23,7 @@ void temp_viz::Viz3d::addCoordinateSystem(double scale, const Affine3f& t, const
impl_
->
addCoordinateSystem
(
scale
,
t
,
id
);
}
void
temp_viz
::
Viz3d
::
showPointCloud
(
const
std
::
string
&
id
,
cv
::
InputArray
cloud
,
cv
::
InputArray
colors
,
const
cv
::
Affine3f
&
pose
)
void
temp_viz
::
Viz3d
::
showPointCloud
(
const
String
&
id
,
InputArray
cloud
,
InputArray
colors
,
const
Affine3f
&
pose
)
{
impl_
->
showPointCloud
(
id
,
cloud
,
colors
,
pose
);
}
...
...
modules/viz/src/viz3d_impl.cpp
View file @
e58b0b35
...
...
@@ -28,10 +28,10 @@ void temp_viz::Viz3d::VizImpl::setPosition (int x, int y) { window_->SetPosition
void
temp_viz
::
Viz3d
::
VizImpl
::
setSize
(
int
xw
,
int
yw
)
{
window_
->
SetSize
(
xw
,
yw
);
}
void
temp_viz
::
Viz3d
::
VizImpl
::
showPointCloud
(
const
std
::
string
&
id
,
cv
::
InputArray
cloud
,
cv
::
InputArray
colors
,
const
cv
::
Affine3f
&
pose
)
void
temp_viz
::
Viz3d
::
VizImpl
::
showPointCloud
(
const
String
&
id
,
InputArray
cloud
,
InputArray
colors
,
const
Affine3f
&
pose
)
{
cv
::
Mat
cloudMat
=
cloud
.
getMat
();
cv
::
Mat
colorsMat
=
colors
.
getMat
();
Mat
cloudMat
=
cloud
.
getMat
();
Mat
colorsMat
=
colors
.
getMat
();
CV_Assert
(
cloudMat
.
type
()
==
CV_32FC3
&&
colorsMat
.
type
()
==
CV_8UC3
&&
cloudMat
.
size
()
==
colorsMat
.
size
());
vtkSmartPointer
<
vtkPolyData
>
polydata
;
...
...
@@ -84,13 +84,13 @@ void temp_viz::Viz3d::VizImpl::showPointCloud(const std::string& id, cv::InputAr
// If a point is NaN, ignore it
for
(
int
y
=
0
;
y
<
cloudMat
.
rows
;
++
y
)
{
const
cv
::
Point3f
*
crow
=
cloudMat
.
ptr
<
cv
::
Point3f
>
(
y
);
const
Point3f
*
crow
=
cloudMat
.
ptr
<
Point3f
>
(
y
);
for
(
int
x
=
0
;
x
<
cloudMat
.
cols
;
++
x
)
if
(
cvIsNaN
(
crow
[
x
].
x
)
!=
1
&&
cvIsNaN
(
crow
[
x
].
y
)
!=
1
&&
cvIsNaN
(
crow
[
x
].
z
)
!=
1
)
{
// Points are transformed based on pose parameter
cv
::
Point3f
transformed_point
=
pose
*
crow
[
x
];
memcpy
(
&
data
[
j
++
*
3
],
&
transformed_point
,
sizeof
(
cv
::
Point3f
));
Point3f
transformed_point
=
pose
*
crow
[
x
];
memcpy
(
&
data
[
j
++
*
3
],
&
transformed_point
,
sizeof
(
Point3f
));
}
}
nr_points
=
j
;
...
...
@@ -118,11 +118,11 @@ void temp_viz::Viz3d::VizImpl::showPointCloud(const std::string& id, cv::InputAr
j
=
0
;
for
(
int
y
=
0
;
y
<
colorsMat
.
rows
;
++
y
)
{
const
cv
::
Vec3b
*
crow
=
colorsMat
.
ptr
<
cv
::
Vec3b
>
(
y
);
const
cv
::
Point3f
*
cloud_row
=
cloudMat
.
ptr
<
cv
::
Point3f
>
(
y
);
const
Vec3b
*
crow
=
colorsMat
.
ptr
<
Vec3b
>
(
y
);
const
Point3f
*
cloud_row
=
cloudMat
.
ptr
<
Point3f
>
(
y
);
for
(
int
x
=
0
;
x
<
colorsMat
.
cols
;
++
x
)
if
(
cvIsNaN
(
cloud_row
[
x
].
x
)
!=
1
&&
cvIsNaN
(
cloud_row
[
x
].
y
)
!=
1
&&
cvIsNaN
(
cloud_row
[
x
].
z
)
!=
1
)
memcpy
(
&
colors_data
[
j
++
*
3
],
&
crow
[
x
],
sizeof
(
cv
::
Vec3b
));
memcpy
(
&
colors_data
[
j
++
*
3
],
&
crow
[
x
],
sizeof
(
Vec3b
));
}
reinterpret_cast
<
vtkUnsignedCharArray
*>
(
&
(
*
scalars
))
->
SetArray
(
colors_data
,
3
*
nr_points
,
0
);
...
...
@@ -152,9 +152,6 @@ void temp_viz::Viz3d::VizImpl::showPointCloud(const std::string& id, cv::InputAr
// Save the viewpoint transformation matrix to the global actor map
vtkSmartPointer
<
vtkMatrix4x4
>
transformation
=
vtkSmartPointer
<
vtkMatrix4x4
>::
New
();
convertToVtkMatrix
(
sensor_origin
,
sensor_orientation
,
transformation
);
// convertToVtkMatrix (pose.matrix, transformation);
std
::
cout
<<
transformation
->
GetElement
(
0
,
3
)
<<
endl
;
(
*
cloud_actor_map_
)[
id
].
viewpoint_transformation_
=
transformation
;
}
...
...
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