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
534f9623
Commit
534f9623
authored
Apr 15, 2014
by
Roman Donchenko
Committed by
OpenCV Buildbot
Apr 15, 2014
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2616 from SpecLad:merge-2.4
parents
8176e893
799d2dab
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
63 additions
and
11 deletions
+63
-11
test_cameracalibration.cpp
modules/calib3d/test/test_cameracalibration.cpp
+1
-1
test_arithm.cpp
modules/core/test/test_arithm.cpp
+0
-1
test_nearestneighbors.cpp
modules/features2d/test/test_nearestneighbors.cpp
+0
-2
hog.cpp
modules/objdetect/src/hog.cpp
+0
-1
widget.rst
modules/viz/doc/widget.rst
+20
-0
widgets.hpp
modules/viz/include/opencv2/viz/widgets.hpp
+7
-0
clouds.cpp
modules/viz/src/clouds.cpp
+19
-6
tests_simple.cpp
modules/viz/test/tests_simple.cpp
+16
-0
No files found.
modules/calib3d/test/test_cameracalibration.cpp
View file @
534f9623
...
...
@@ -1608,7 +1608,7 @@ void CV_StereoCalibrationTest::run( int )
Mat
_M1
,
_M2
,
_D1
,
_D2
;
vector
<
Mat
>
_R1
,
_R2
,
_T1
,
_T2
;
calibrateCamera
(
objpt
,
imgpt1
,
imgsize
,
_M1
,
_D1
,
_R1
,
_T1
,
0
);
calibrateCamera
(
objpt
,
imgpt2
,
imgsize
,
_M2
,
_D2
,
_R2
,
_T
1
,
0
);
calibrateCamera
(
objpt
,
imgpt2
,
imgsize
,
_M2
,
_D2
,
_R2
,
_T
2
,
0
);
undistortPoints
(
_imgpt1
,
_imgpt1
,
_M1
,
_D1
,
Mat
(),
_M1
);
undistortPoints
(
_imgpt2
,
_imgpt2
,
_M2
,
_D2
,
Mat
(),
_M2
);
...
...
modules/core/test/test_arithm.cpp
View file @
534f9623
...
...
@@ -1361,7 +1361,6 @@ TEST_P(ElemWiseTest, accuracy)
op
->
op
(
src
,
dst
,
mask
);
double
maxErr
=
op
->
getMaxErr
(
depth
);
vector
<
int
>
pos
;
ASSERT_PRED_FORMAT2
(
cvtest
::
MatComparator
(
maxErr
,
op
->
context
),
dst0
,
dst
)
<<
"
\n
src[0] ~ "
<<
cvtest
::
MatInfo
(
!
src
.
empty
()
?
src
[
0
]
:
Mat
())
<<
"
\n
testCase #"
<<
testIdx
<<
"
\n
"
;
}
...
...
modules/features2d/test/test_nearestneighbors.cpp
View file @
534f9623
...
...
@@ -215,8 +215,6 @@ int CV_KDTreeTest_CPP::findNeighbors( Mat& points, Mat& neighbors )
const
int
emax
=
20
;
Mat
neighbors2
(
neighbors
.
size
(),
CV_32SC1
);
int
j
;
vector
<
float
>
min
(
points
.
cols
,
static_cast
<
float
>
(
minValue
));
vector
<
float
>
max
(
points
.
cols
,
static_cast
<
float
>
(
maxValue
));
for
(
int
pi
=
0
;
pi
<
points
.
rows
;
pi
++
)
{
// 1st way
...
...
modules/objdetect/src/hog.cpp
View file @
534f9623
...
...
@@ -3525,7 +3525,6 @@ void HOGDescriptor::groupRectangles(std::vector<cv::Rect>& rectList, std::vector
std
::
vector
<
cv
::
Rect_
<
double
>
>
rrects
(
nclasses
);
std
::
vector
<
int
>
numInClass
(
nclasses
,
0
);
std
::
vector
<
double
>
foundWeights
(
nclasses
,
DBL_MIN
);
std
::
vector
<
double
>
totalFactorsPerClass
(
nclasses
,
1
);
int
i
,
j
,
nlabels
=
(
int
)
labels
.
size
();
for
(
i
=
0
;
i
<
nlabels
;
i
++
)
...
...
modules/viz/doc/widget.rst
View file @
534f9623
...
...
@@ -898,6 +898,10 @@ This 3D Widget defines a point cloud. ::
WCloud(InputArray cloud, InputArray colors);
//! All points in cloud have the same color
WCloud(InputArray cloud, const Color &color = Color::white());
//! Each point in cloud is mapped to a color in colors, normals are used for shading
WCloud(InputArray cloud, InputArray colors, InputArray normals);
//! All points in cloud have the same color, normals are used for shading
WCloud(InputArray cloud, const Color &color, InputArray normals);
};
viz::WCloud::WCloud
...
...
@@ -918,6 +922,22 @@ Constructs a WCloud.
Points in the cloud belong to mask when they are set to (NaN, NaN, NaN).
.. ocv:function:: WCloud(InputArray cloud, InputArray colors, InputArray normals)
:param cloud: Set of points which can be of type: ``CV_32FC3``, ``CV_32FC4``, ``CV_64FC3``, ``CV_64FC4``.
:param colors: Set of colors. It has to be of the same size with cloud.
:param normals: Normals for each point in cloud. Size and type should match with the cloud parameter.
Points in the cloud belong to mask when they are set to (NaN, NaN, NaN).
.. ocv:function:: WCloud(InputArray cloud, const Color &color, InputArray normals)
:param cloud: Set of points which can be of type: ``CV_32FC3``, ``CV_32FC4``, ``CV_64FC3``, ``CV_64FC4``.
:param color: A single :ocv:class:`Color` for the whole cloud.
:param normals: Normals for each point in cloud. Size and type should match with the cloud parameter.
Points in the cloud belong to mask when they are set to (NaN, NaN, NaN).
.. note:: In case there are four channels in the cloud, fourth channel is ignored.
viz::WCloudCollection
...
...
modules/viz/include/opencv2/viz/widgets.hpp
View file @
534f9623
...
...
@@ -320,8 +320,15 @@ namespace cv
public
:
//! Each point in cloud is mapped to a color in colors
WCloud
(
InputArray
cloud
,
InputArray
colors
);
//! All points in cloud have the same color
WCloud
(
InputArray
cloud
,
const
Color
&
color
=
Color
::
white
());
//! Each point in cloud is mapped to a color in colors, normals are used for shading
WCloud
(
InputArray
cloud
,
InputArray
colors
,
InputArray
normals
);
//! All points in cloud have the same color, normals are used for shading
WCloud
(
InputArray
cloud
,
const
Color
&
color
,
InputArray
normals
);
};
class
CV_EXPORTS
WPaintedCloud
:
public
Widget3D
...
...
modules/viz/src/clouds.cpp
View file @
534f9623
...
...
@@ -49,11 +49,29 @@
/// Point Cloud Widget implementation
cv
::
viz
::
WCloud
::
WCloud
(
InputArray
cloud
,
InputArray
colors
)
{
WCloud
cloud_widget
(
cloud
,
colors
,
cv
::
noArray
());
*
this
=
cloud_widget
;
}
cv
::
viz
::
WCloud
::
WCloud
(
InputArray
cloud
,
const
Color
&
color
)
{
WCloud
cloud_widget
(
cloud
,
Mat
(
cloud
.
size
(),
CV_8UC3
,
color
));
*
this
=
cloud_widget
;
}
cv
::
viz
::
WCloud
::
WCloud
(
InputArray
cloud
,
const
Color
&
color
,
InputArray
normals
)
{
WCloud
cloud_widget
(
cloud
,
Mat
(
cloud
.
size
(),
CV_8UC3
,
color
),
normals
);
*
this
=
cloud_widget
;
}
cv
::
viz
::
WCloud
::
WCloud
(
cv
::
InputArray
cloud
,
cv
::
InputArray
colors
,
cv
::
InputArray
normals
)
{
CV_Assert
(
!
cloud
.
empty
()
&&
!
colors
.
empty
());
vtkSmartPointer
<
vtkCloudMatSource
>
cloud_source
=
vtkSmartPointer
<
vtkCloudMatSource
>::
New
();
cloud_source
->
SetColorCloud
(
cloud
,
color
s
);
cloud_source
->
SetColorCloud
Normals
(
cloud
,
colors
,
normal
s
);
cloud_source
->
Update
();
vtkSmartPointer
<
vtkPolyDataMapper
>
mapper
=
vtkSmartPointer
<
vtkPolyDataMapper
>::
New
();
...
...
@@ -69,12 +87,7 @@ cv::viz::WCloud::WCloud(InputArray cloud, InputArray colors)
actor
->
SetMapper
(
mapper
);
WidgetAccessor
::
setProp
(
*
this
,
actor
);
}
cv
::
viz
::
WCloud
::
WCloud
(
InputArray
cloud
,
const
Color
&
color
)
{
WCloud
cloud_widget
(
cloud
,
Mat
(
cloud
.
size
(),
CV_8UC3
,
color
));
*
this
=
cloud_widget
;
}
...
...
modules/viz/test/tests_simple.cpp
View file @
534f9623
...
...
@@ -248,6 +248,22 @@ TEST(Viz, show_sampled_normals)
viz
.
spin
();
}
TEST
(
Viz
,
show_cloud_shaded_by_normals
)
{
Mesh
mesh
=
Mesh
::
load
(
get_dragon_ply_file_path
());
computeNormals
(
mesh
,
mesh
.
normals
);
Affine3d
pose
=
Affine3d
().
rotate
(
Vec3d
(
0
,
0.8
,
0
));
WCloud
cloud
(
mesh
.
cloud
,
Color
::
white
(),
mesh
.
normals
);
cloud
.
setRenderingProperty
(
SHADING
,
SHADING_GOURAUD
);
Viz3d
viz
(
"show_cloud_shaded_by_normals"
);
viz
.
showWidget
(
"cloud"
,
cloud
,
pose
);
viz
.
showWidget
(
"text2d"
,
WText
(
"Cloud shaded by normals"
,
Point
(
20
,
20
),
20
,
Color
::
green
()));
viz
.
spin
();
}
TEST
(
Viz
,
show_trajectories
)
{
std
::
vector
<
Affine3d
>
path
=
generate_test_trajectory
<
double
>
(),
sub0
,
sub1
,
sub2
,
sub3
,
sub4
,
sub5
;
...
...
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