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
4672a70c
Commit
4672a70c
authored
Sep 25, 2013
by
Juan Manuel Perez
Committed by
Vadim Pisarevsky
Sep 30, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replaced dynamic_cas with Ptr::dynamicCast<>, and & with &&
parent
1bf42982
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
22 deletions
+22
-22
aff_trans.cpp
modules/shape/src/aff_trans.cpp
+2
-2
emdL1.cpp
modules/shape/src/emdL1.cpp
+1
-1
haus_dis.cpp
modules/shape/src/haus_dis.cpp
+3
-3
sc_dis.cpp
modules/shape/src/sc_dis.cpp
+14
-14
tps_trans.cpp
modules/shape/src/tps_trans.cpp
+2
-2
No files found.
modules/shape/src/aff_trans.cpp
View file @
4672a70c
...
...
@@ -186,7 +186,7 @@ void AffineTransformerImpl::estimateTransformation(InputArray _pts1, InputArray
{
Mat
pts1
=
_pts1
.
getMat
();
Mat
pts2
=
_pts2
.
getMat
();
CV_Assert
((
pts1
.
channels
()
==
2
)
&
(
pts1
.
cols
>
0
)
&
(
pts2
.
channels
()
==
2
)
&
(
pts2
.
cols
>
0
));
CV_Assert
((
pts1
.
channels
()
==
2
)
&
&
(
pts1
.
cols
>
0
)
&&
(
pts2
.
channels
()
==
2
)
&
&
(
pts2
.
cols
>
0
));
CV_Assert
(
_matches
.
size
()
>
1
);
if
(
pts1
.
type
()
!=
CV_32F
)
...
...
@@ -230,7 +230,7 @@ void AffineTransformerImpl::estimateTransformation(InputArray _pts1, InputArray
float
AffineTransformerImpl
::
applyTransformation
(
InputArray
inPts
,
OutputArray
outPts
)
{
Mat
pts1
=
inPts
.
getMat
();
CV_Assert
((
pts1
.
channels
()
==
2
)
&
(
pts1
.
cols
>
0
));
CV_Assert
((
pts1
.
channels
()
==
2
)
&
&
(
pts1
.
cols
>
0
));
//Apply transformation in the complete set of points
Mat
fAffine
;
...
...
modules/shape/src/emdL1.cpp
View file @
4672a70c
...
...
@@ -60,7 +60,7 @@
float
EmdL1
::
getEMDL1
(
cv
::
Mat
&
sig1
,
cv
::
Mat
&
sig2
)
{
// Initialization
CV_Assert
((
sig1
.
rows
==
sig2
.
rows
)
&
(
sig1
.
cols
==
sig2
.
cols
)
&
(
!
sig1
.
empty
())
&
(
!
sig2
.
empty
()));
CV_Assert
((
sig1
.
rows
==
sig2
.
rows
)
&
&
(
sig1
.
cols
==
sig2
.
cols
)
&&
(
!
sig1
.
empty
())
&
&
(
!
sig2
.
empty
()));
if
(
!
initBaseTrees
(
sig1
.
rows
,
1
))
return
-
1
;
...
...
modules/shape/src/haus_dis.cpp
View file @
4672a70c
...
...
@@ -71,7 +71,7 @@ public:
virtual
void
setRankProportion
(
float
_rankProportion
)
{
CV_Assert
((
_rankProportion
>
0
)
&
(
_rankProportion
<=
1
));
CV_Assert
((
_rankProportion
>
0
)
&
&
(
_rankProportion
<=
1
));
rankProportion
=
_rankProportion
;
}
virtual
float
getRankProportion
()
const
{
return
rankProportion
;}
...
...
@@ -135,8 +135,8 @@ float HausdorffDistanceExtractorImpl::computeDistance(InputArray contour1, Input
set1
.
convertTo
(
set1
,
CV_32F
);
if
(
set2
.
type
()
!=
CV_32F
)
set2
.
convertTo
(
set2
,
CV_32F
);
CV_Assert
((
set1
.
channels
()
==
2
)
&
(
set1
.
cols
>
0
));
CV_Assert
((
set2
.
channels
()
==
2
)
&
(
set2
.
cols
>
0
));
CV_Assert
((
set1
.
channels
()
==
2
)
&
&
(
set1
.
cols
>
0
));
CV_Assert
((
set2
.
channels
()
==
2
)
&
&
(
set2
.
cols
>
0
));
return
std
::
max
(
_apply
(
set1
,
set2
,
distanceFlag
,
rankProportion
),
_apply
(
set2
,
set1
,
distanceFlag
,
rankProportion
)
);
}
...
...
modules/shape/src/sc_dis.cpp
View file @
4672a70c
...
...
@@ -45,7 +45,7 @@
* Belongie et al., 2002 by Juan Manuel Perez for GSoC 2013.
*/
#include "precomp.hpp"
//#include "opencv2/highgui
.hpp"
#include "opencv2/core
.hpp"
/*
* ShapeContextDescriptor class
*/
...
...
@@ -181,7 +181,7 @@ protected:
{
if
(
queryInliers
.
size
()
>
0
)
{
mask
.
at
<
char
>
(
i
,
j
)
=
char
(
queryInliers
[
j
]
&
queryInliers
[
i
]);
mask
.
at
<
char
>
(
i
,
j
)
=
char
(
queryInliers
[
j
]
&
&
queryInliers
[
i
]);
}
else
{
...
...
@@ -641,14 +641,14 @@ public:
virtual
void
setImages
(
InputArray
_image1
,
InputArray
_image2
)
{
Mat
image1_
=
_image1
.
getMat
(),
image2_
=
_image2
.
getMat
();
CV_Assert
((
image1_
.
depth
()
==
0
)
&
(
image2_
.
depth
()
==
0
));
CV_Assert
((
image1_
.
depth
()
==
0
)
&
&
(
image2_
.
depth
()
==
0
));
image1
=
image1_
;
image2
=
image2_
;
}
virtual
void
getImages
(
OutputArray
_image1
,
OutputArray
_image2
)
const
{
CV_Assert
((
!
image1
.
empty
())
&
(
!
image2
.
empty
()));
CV_Assert
((
!
image1
.
empty
())
&
&
(
!
image2
.
empty
()));
_image1
.
create
(
image1
.
size
(),
image1
.
type
());
_image2
.
create
(
image2
.
size
(),
image2
.
type
());
_image1
.
getMat
()
=
image1
;
...
...
@@ -726,11 +726,11 @@ float ShapeContextDistanceExtractorImpl::computeDistance(InputArray contour1, In
else
sset1
.
copyTo
(
set2
);
CV_Assert
((
set1
.
channels
()
==
2
)
&
(
set1
.
cols
>
0
));
CV_Assert
((
set2
.
channels
()
==
2
)
&
(
set2
.
cols
>
0
));
CV_Assert
((
set1
.
channels
()
==
2
)
&
&
(
set1
.
cols
>
0
));
CV_Assert
((
set2
.
channels
()
==
2
)
&
&
(
set2
.
cols
>
0
));
if
(
imageAppearanceWeight
!=
0
)
{
CV_Assert
((
!
image1
.
empty
())
&
(
!
image2
.
empty
()));
CV_Assert
((
!
image1
.
empty
())
&
&
(
!
image2
.
empty
()));
}
// Initializing Extractor, Descriptor structures and Matcher //
...
...
@@ -747,9 +747,9 @@ float ShapeContextDistanceExtractorImpl::computeDistance(InputArray contour1, In
// Initializing some variables //
std
::
vector
<
int
>
inliers1
,
inliers2
;
bool
isTPS
=
false
;
if
(
dynamic_cast
<
ThinPlateSplineShapeTransformer
*>
(
&*
transformer
)
)
isTPS
=
true
;
Ptr
<
ThinPlateSplineShapeTransformer
>
transDown
=
transformer
.
dynamicCast
<
ThinPlateSplineShapeTransformer
>
();
Mat
warpedImage
;
for
(
int
ii
=
0
;
ii
<
iterations
;
ii
++
)
{
...
...
@@ -766,8 +766,8 @@ float ShapeContextDistanceExtractorImpl::computeDistance(InputArray contour1, In
matcher
.
matchDescriptors
(
set1SCD
,
set2SCD
,
matches
,
comparer
,
inliers1
,
inliers2
);
// apply TPS transform //
if
(
isTPS
)
dynamic_cast
<
ThinPlateSplineShapeTransformer
*>
(
&*
transformer
)
->
setRegularizationParameter
(
beta
);
if
(
!
transDown
.
empty
()
)
transDown
->
setRegularizationParameter
(
beta
);
transformer
->
estimateTransformation
(
set1
,
set2
,
matches
);
bEnergy
+=
transformer
->
applyTransformation
(
set1
,
set1
);
...
...
@@ -777,7 +777,7 @@ float ShapeContextDistanceExtractorImpl::computeDistance(InputArray contour1, In
// Have to accumulate the transformation along all the iterations
if
(
ii
==
0
)
{
if
(
isTPS
)
if
(
!
transDown
.
empty
()
)
{
image2
.
copyTo
(
warpedImage
);
}
...
...
@@ -794,7 +794,7 @@ float ShapeContextDistanceExtractorImpl::computeDistance(InputArray contour1, In
if
(
imageAppearanceWeight
!=
0
)
{
// compute appearance cost
if
(
isTPS
)
if
(
!
transDown
.
empty
()
)
{
resize
(
warpedImage
,
warpedImage
,
image1
.
size
());
Mat
temp
=
(
warpedImage
-
image1
);
...
...
modules/shape/src/tps_trans.cpp
View file @
4672a70c
...
...
@@ -169,7 +169,7 @@ float ThinPlateSplineShapeTransformerImpl::applyTransformation(InputArray inPts,
{
CV_Assert
(
tpsComputed
);
Mat
pts1
=
inPts
.
getMat
();
CV_Assert
((
pts1
.
channels
()
==
2
)
&
(
pts1
.
cols
>
0
));
CV_Assert
((
pts1
.
channels
()
==
2
)
&
&
(
pts1
.
cols
>
0
));
//Apply transformation in the complete set of points
// Ensambling output //
...
...
@@ -192,7 +192,7 @@ void ThinPlateSplineShapeTransformerImpl::estimateTransformation(InputArray _pts
{
Mat
pts1
=
_pts1
.
getMat
();
Mat
pts2
=
_pts2
.
getMat
();
CV_Assert
((
pts1
.
channels
()
==
2
)
&
(
pts1
.
cols
>
0
)
&
(
pts2
.
channels
()
==
2
)
&
(
pts2
.
cols
>
0
));
CV_Assert
((
pts1
.
channels
()
==
2
)
&
&
(
pts1
.
cols
>
0
)
&&
(
pts2
.
channels
()
==
2
)
&
&
(
pts2
.
cols
>
0
));
CV_Assert
(
_matches
.
size
()
>
1
);
if
(
pts1
.
type
()
!=
CV_32F
)
...
...
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