Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
4672a70c
O
Opencv
项目概览
Greenplum
/
Opencv
大约 1 年 前同步成功
通知
7
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
Opencv
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4672a70c
编写于
9月 25, 2013
作者:
J
Juan Manuel Perez
提交者:
Vadim Pisarevsky
9月 30, 2013
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Replaced dynamic_cas with Ptr::dynamicCast<>, and & with &&
上级
1bf42982
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
22 addition
and
22 deletion
+22
-22
modules/shape/src/aff_trans.cpp
modules/shape/src/aff_trans.cpp
+2
-2
modules/shape/src/emdL1.cpp
modules/shape/src/emdL1.cpp
+1
-1
modules/shape/src/haus_dis.cpp
modules/shape/src/haus_dis.cpp
+3
-3
modules/shape/src/sc_dis.cpp
modules/shape/src/sc_dis.cpp
+14
-14
modules/shape/src/tps_trans.cpp
modules/shape/src/tps_trans.cpp
+2
-2
未找到文件。
modules/shape/src/aff_trans.cpp
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录