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
3e41f064
Commit
3e41f064
authored
Jul 13, 2013
by
Anatoly Baksheev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed q subfolder
parent
f480eca6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
52 additions
and
61 deletions
+52
-61
mesh_load.hpp
modules/viz/include/opencv2/viz/mesh_load.hpp
+0
-10
types.hpp
modules/viz/include/opencv2/viz/types.hpp
+4
-1
common.cpp
modules/viz/src/common.cpp
+1
-1
common.h
modules/viz/src/common.h
+0
-0
interactor_style.cpp
modules/viz/src/interactor_style.cpp
+1
-1
interactor_style.h
modules/viz/src/interactor_style.h
+1
-1
mesh_load.cpp
modules/viz/src/mesh_load.cpp
+1
-3
precomp.hpp
modules/viz/src/precomp.hpp
+1
-1
viz3d.cpp
modules/viz/src/viz3d.cpp
+1
-1
viz3d_impl.cpp
modules/viz/src/viz3d_impl.cpp
+0
-0
viz3d_impl.hpp
modules/viz/src/viz3d_impl.hpp
+9
-15
viz_main.cpp
modules/viz/src/viz_main.cpp
+0
-0
viz_types.h
modules/viz/src/viz_types.h
+0
-0
test_viz3d.cpp
modules/viz/test/test_viz3d.cpp
+33
-27
No files found.
modules/viz/include/opencv2/viz/mesh_load.hpp
deleted
100644 → 0
View file @
f480eca6
#pragma once
#include <opencv2/core.hpp>
#include <opencv2/viz/types.hpp>
#include <vector>
namespace
temp_viz
{
CV_EXPORTS
Mesh3d
::
Ptr
mesh_load
(
const
String
&
file
);
}
modules/viz/include/opencv2/viz/types.hpp
View file @
3e41f064
...
...
@@ -67,10 +67,13 @@ namespace temp_viz
class
CV_EXPORTS
Mesh3d
{
public
:
typedef
cv
::
Ptr
<
Mesh3d
>
Ptr
;
typedef
Ptr
<
Mesh3d
>
Ptr
;
Mat
cloud
,
colors
;
std
::
vector
<
Vertices
>
polygons
;
static
Mesh3d
::
Ptr
mesh_load
(
const
String
&
file
);
};
/////////////////////////////////////////////////////////////////////////////
...
...
modules/viz/src/common.cpp
View file @
3e41f064
#include <
q/
common.h>
#include <common.h>
#include <cstdlib>
#include <opencv2/viz/types.hpp>
...
...
modules/viz/src/
q/
common.h
→
modules/viz/src/common.h
View file @
3e41f064
File moved
modules/viz/src/interactor_style.cpp
View file @
3e41f064
#include "precomp.hpp"
#include
<q/interactor_style.h>
#include
"interactor_style.h"
//#include <q/visualization/vtk/vtkVertexBufferObjectMapper.h>
...
...
modules/viz/src/
q/
interactor_style.h
→
modules/viz/src/interactor_style.h
View file @
3e41f064
#pragma once
#include
<q/viz_types.h>
#include
"viz_types.h"
#include <opencv2/viz/events.hpp>
namespace
temp_viz
...
...
modules/viz/src/mesh_load.cpp
View file @
3e41f064
#include <opencv2/viz/mesh_load.hpp>
#include "precomp.hpp"
#include <vtkPLYReader.h>
...
...
@@ -8,7 +6,7 @@
#include <vtkPointData.h>
#include <vtkCellArray.h>
temp_viz
::
Mesh3d
::
Ptr
temp_viz
::
mesh_load
(
const
String
&
file
)
temp_viz
::
Mesh3d
::
Ptr
temp_viz
::
Mesh3d
::
mesh_load
(
const
String
&
file
)
{
Mesh3d
::
Ptr
mesh
=
new
Mesh3d
();
...
...
modules/viz/src/precomp.hpp
View file @
3e41f064
...
...
@@ -152,7 +152,7 @@
#endif
#include
<q/viz3d_impl.hpp>
#include
"viz3d_impl.hpp"
#include <opencv2/core.hpp>
#include <opencv2/viz.hpp>
#include "opencv2/viz/widget_accessor.hpp"
...
...
modules/viz/src/viz3d.cpp
View file @
3e41f064
#include <opencv2/viz/viz3d.hpp>
#include
<q/viz3d_impl.hpp>
#include
"viz3d_impl.hpp"
temp_viz
::
Viz3d
::
Viz3d
(
const
String
&
window_name
)
:
impl_
(
new
VizImpl
(
window_name
))
...
...
modules/viz/src/viz3d_impl.cpp
deleted
100644 → 0
View file @
f480eca6
This diff is collapsed.
Click to expand it.
modules/viz/src/
q/
viz3d_impl.hpp
→
modules/viz/src/viz3d_impl.hpp
View file @
3e41f064
...
...
@@ -2,17 +2,15 @@
#include <opencv2/core.hpp>
#include <opencv2/viz/events.hpp>
#include
<q/interactor_style.h>
#include
<q/viz_types.h>
#include
<q/common.h>
#include
"interactor_style.h"
#include
"viz_types.h"
#include
"common.h"
#include <opencv2/viz/types.hpp>
#include <opencv2/core/affine.hpp>
#include <opencv2/viz/viz3d.hpp>
namespace
temp_viz
{
struct
Viz3d
::
VizImpl
struct
temp_viz
::
Viz3d
::
VizImpl
{
public
:
typedef
cv
::
Ptr
<
VizImpl
>
Ptr
;
...
...
@@ -23,16 +21,7 @@ public:
void
setFullScreen
(
bool
mode
);
void
setWindowName
(
const
String
&
name
);
/** \brief Register a callback function for keyboard input
* \param[in] callback function that will be registered as a callback for a keyboard event
* \param[in] cookie for passing user data to callback
*/
void
registerKeyboardCallback
(
void
(
*
callback
)(
const
KeyboardEvent
&
,
void
*
),
void
*
cookie
=
0
);
/** \brief Register a callback function for mouse events
* \param[in] ccallback function that will be registered as a callback for a mouse event
* \param[in] cookie for passing user data to callback
*/
void
registerMouseCallback
(
void
(
*
callback
)(
const
MouseEvent
&
,
void
*
),
void
*
cookie
=
0
);
void
spin
();
...
...
@@ -289,6 +278,11 @@ private:
void
allocVtkUnstructuredGrid
(
vtkSmartPointer
<
vtkUnstructuredGrid
>
&
polydata
);
};
namespace
temp_viz
{
//void getTransformationMatrix (const Eigen::Vector4f &origin, const Eigen::Quaternionf& orientation, Eigen::Matrix4f &transformation);
//void convertToVtkMatrix (const Eigen::Matrix4f &m, vtkSmartPointer<vtkMatrix4x4> &vtk_matrix);
...
...
modules/viz/src/viz_main.cpp
View file @
3e41f064
This diff is collapsed.
Click to expand it.
modules/viz/src/
q/
viz_types.h
→
modules/viz/src/viz_types.h
View file @
3e41f064
File moved
modules/viz/test/test_viz3d.cpp
View file @
3e41f064
...
...
@@ -48,7 +48,6 @@
#include <string>
#include <opencv2/viz.hpp>
#include <opencv2/viz/mesh_load.hpp>
cv
::
Mat
cvcloud_load
()
{
...
...
@@ -83,45 +82,50 @@ TEST(Viz_viz3d, accuracy)
float
pos_x
=
0.0
f
;
float
pos_y
=
0.0
f
;
float
pos_z
=
0.0
f
;
// temp_viz::Mesh3d::Ptr mesh = temp_viz
::mesh_load("d:/horse.ply");
//
v.addPolygonMesh(*mesh, "pq");
temp_viz
::
Mesh3d
::
Ptr
mesh
=
temp_viz
::
Mesh3d
::
mesh_load
(
"d:/horse.ply"
);
v
.
addPolygonMesh
(
*
mesh
,
"pq"
);
int
col_blue
=
0
;
int
col_green
=
0
;
int
col_red
=
0
;
temp_viz
::
LineWidget
lw
(
cv
::
Point3f
(
0.0
,
0.0
,
0.0
),
cv
::
Point3f
(
4.0
,
4.0
,
4.0
),
temp_viz
::
Color
(
0
,
255
,
0
));
temp_viz
::
PlaneWidget
pw
(
cv
::
Vec4f
(
0.0
,
1.0
,
2.0
,
3.0
),
5.0
);
temp_viz
::
PlaneWidget
pw
(
cv
::
Vec4f
(
0.0
,
1.0
,
2.0
,
3.0
),
5
0
.0
);
temp_viz
::
SphereWidget
sw
(
cv
::
Point3f
(
0
,
0
,
0
),
0.5
);
temp_viz
::
ArrowWidget
aw
(
cv
::
Point3f
(
0
,
0
,
0
),
cv
::
Point3f
(
1
,
1
,
1
),
temp_viz
::
Color
(
255
,
0
,
0
));
temp_viz
::
CircleWidget
cw
(
cv
::
Point3f
(
0
,
0
,
0
),
0.5
,
0.01
,
temp_viz
::
Color
(
0
,
255
,
0
));
temp_viz
::
CylinderWidget
cyw
(
cv
::
Point3f
(
0
,
0
,
0
),
cv
::
Point3f
(
-
1
,
-
1
,
-
1
),
0.5
,
30
,
temp_viz
::
Color
(
0
,
255
,
0
));
temp_viz
::
CubeWidget
cuw
(
cv
::
Point3f
(
-
2
,
-
2
,
-
2
),
cv
::
Point3f
(
-
1
,
-
1
,
-
1
));
temp_viz
::
CoordinateSystemWidget
csw
(
1.0
f
,
cv
::
Affine3f
::
Identity
())
;
temp_viz
::
CoordinateSystemWidget
csw
;
temp_viz
::
TextWidget
tw
(
"TEST"
,
cv
::
Point2i
(
100
,
100
),
20
);
temp_viz
::
CloudWidget
pcw
(
cloud
,
colors
);
temp_viz
::
CloudWidget
pcw2
(
cloud
,
temp_viz
::
Color
(
0
,
255
,
255
));
// v.showWidget("line", lw);
// v.showWidget("plane", pw);
// v.showWidget("sphere", sw);
// v.showWidget("arrow", aw);
// v.showWidget("circle", cw);
// v.showWidget("cylinder", cyw);
// v.showWidget("cube", cuw);
v
.
showWidget
(
"coordinateSystem"
,
csw
);
// v.showWidget("text",tw);
// v.showWidget("pcw",pcw);
// v.showWidget("pcw2",pcw2);
v
.
showWidget
(
"sphere"
,
sw
);
v
.
spin
();
//v.showWidget("arrow", aw);
//v.showWidget("circle", cw);
//v.showWidget("cylinder", cyw);
//v.showWidget("cube", cuw);
//v.showWidget("coordinateSystem", csw);
//v.showWidget("coordinateSystem2", temp_viz::CoordinateSystemWidget(2.0), cv::Affine3f(0, 0, 0, cv::Vec3f(2, 0, 0)));
//v.showWidget("text",tw);
//v.showWidget("pcw",pcw);
//v.showWidget("pcw2",pcw2);
// temp_viz::LineWidget lw2 = lw;
// v.showPointCloud("cld",cloud, colors);
cv
::
Mat
normals
(
cloud
.
size
(),
cloud
.
type
(),
cv
::
Scalar
(
0
,
10
,
0
));
// v.addPointCloudNormals(cloud, normals, 100, 0.02, "n");
temp_viz
::
CloudNormalsWidget
cnw
(
cloud
,
normals
);
// v.showWidget("n", cnw);
//temp_viz::CloudNormalsWidget cnw(cloud, normals);
//v.showWidget("n", cnw);
// lw = v.getWidget("n").cast<temp_viz::LineWidget>();
// pw = v.getWidget("n").cast<temp_viz::PlaneWidget>();
...
...
@@ -135,16 +139,18 @@ TEST(Viz_viz3d, accuracy)
data
[
3
]
=
cv
::
Vec4d
(
3.0
,
4.0
,
1.0
,
1.0
);
points
=
points
.
reshape
(
0
,
2
);
temp_viz
::
PolyLineWidget
plw
(
points
);
//
v.showWidget("polyline",plw);
temp_viz
::
PolyLineWidget
plw
(
points
,
temp_viz
::
Color
::
green
()
);
v
.
showWidget
(
"polyline"
,
plw
);
// lw = v.getWidget("polyline").cast<temp_viz::LineWidget>();
temp_viz
::
GridWidget
gw
(
temp_viz
::
Vec2i
(
10
,
10
),
temp_viz
::
Vec2d
(
0.1
,
0.1
));
v
.
showWidget
(
"grid"
,
gw
);
v
.
spin
();
//temp_viz::GridWidget gw(temp_viz::Vec2i(100,100), temp_viz::Vec2d(1,1));
//v.showWidget("grid", gw);
lw
=
v
.
getWidget
(
"grid"
).
cast
<
temp_viz
::
LineWidget
>
();
temp_viz
::
Text3DWidget
t3w
(
"OpenCV"
,
cv
::
Point3f
(
0.0
,
2.0
,
0.0
),
1.0
,
temp_viz
::
Color
(
255
,
255
,
0
));
v
.
showWidget
(
"txt3d"
,
t3w
);
//
temp_viz::Text3DWidget t3w("OpenCV", cv::Point3f(0.0, 2.0, 0.0), 1.0, temp_viz::Color(255,255,0));
//
v.showWidget("txt3d", t3w);
// float grid_x_angle = 0.0;
while
(
!
v
.
wasStopped
())
...
...
@@ -156,7 +162,7 @@ TEST(Viz_viz3d, accuracy)
lw
.
setColor
(
temp_viz
::
Color
(
col_blue
,
col_green
,
col_red
));
// lw.setLineWidth(pos_x * 10);
plw
.
setColor
(
temp_viz
::
Color
(
col_blue
,
col_green
,
col_red
));
//
plw.setColor(temp_viz::Color(col_blue, col_green, col_red));
sw
.
setPose
(
cloudPosition
);
// pw.setPose(cloudPosition);
...
...
@@ -172,10 +178,10 @@ TEST(Viz_viz3d, accuracy)
// v.setWidgetPose("n",cloudPosition);
// v.setWidgetPose("pcw2", cloudPosition);
cnw
.
setColor
(
temp_viz
::
Color
(
col_blue
,
col_green
,
col_red
));
pcw2
.
setColor
(
temp_viz
::
Color
(
col_blue
,
col_green
,
col_red
));
//
cnw.setColor(temp_viz::Color(col_blue, col_green, col_red));
//
pcw2.setColor(temp_viz::Color(col_blue, col_green, col_red));
gw
.
updatePose
(
temp_viz
::
Affine3f
(
0.0
,
0.1
,
0.0
,
cv
::
Vec3f
(
0.0
,
0.0
,
0.0
)));
//
gw.updatePose(temp_viz::Affine3f(0.0, 0.1, 0.0, cv::Vec3f(0.0,0.0,0.0)));
angle_x
+=
0.1
f
;
angle_y
-=
0.1
f
;
...
...
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