Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
bab4f4f5
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,发现更多精彩内容 >>
提交
bab4f4f5
编写于
8月 31, 2018
作者:
V
Vadim Pisarevsky
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #12348 from take1014:subdiv_getTriangleList_5788
上级
a08c6e49
e1ee744e
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
57 addition
and
2 deletion
+57
-2
modules/imgproc/misc/java/test/Subdiv2DTest.java
modules/imgproc/misc/java/test/Subdiv2DTest.java
+1
-1
modules/imgproc/src/subdivision2d.cpp
modules/imgproc/src/subdivision2d.cpp
+3
-1
modules/imgproc/test/test_subdivision2d.cpp
modules/imgproc/test/test_subdivision2d.cpp
+53
-0
未找到文件。
modules/imgproc/misc/java/test/Subdiv2DTest.java
浏览文件 @
bab4f4f5
...
...
@@ -52,7 +52,7 @@ public class Subdiv2DTest extends OpenCVTestCase {
s2d
.
insert
(
new
Point
(
10
,
20
)
);
MatOfFloat6
triangles
=
new
MatOfFloat6
();
s2d
.
getTriangleList
(
triangles
);
assertEquals
(
10
,
triangles
.
rows
());
assertEquals
(
2
,
triangles
.
rows
());
/*
int cnt = triangles.rows();
float buff[] = new float[cnt*6];
...
...
modules/imgproc/src/subdivision2d.cpp
浏览文件 @
bab4f4f5
...
...
@@ -758,6 +758,7 @@ void Subdiv2D::getTriangleList(std::vector<Vec6f>& triangleList) const
triangleList
.
clear
();
int
i
,
total
=
(
int
)(
qedges
.
size
()
*
4
);
std
::
vector
<
bool
>
edgemask
(
total
,
false
);
Rect2f
rect
(
topLeft
.
x
,
topLeft
.
y
,
bottomRight
.
x
,
bottomRight
.
y
);
for
(
i
=
4
;
i
<
total
;
i
+=
2
)
{
...
...
@@ -773,7 +774,8 @@ void Subdiv2D::getTriangleList(std::vector<Vec6f>& triangleList) const
edge
=
getEdge
(
edge
,
NEXT_AROUND_LEFT
);
edgeOrg
(
edge
,
&
c
);
edgemask
[
edge
]
=
true
;
triangleList
.
push_back
(
Vec6f
(
a
.
x
,
a
.
y
,
b
.
x
,
b
.
y
,
c
.
x
,
c
.
y
));
if
(
rect
.
contains
(
a
)
&&
rect
.
contains
(
b
)
&&
rect
.
contains
(
c
)
)
triangleList
.
push_back
(
Vec6f
(
a
.
x
,
a
.
y
,
b
.
x
,
b
.
y
,
c
.
x
,
c
.
y
));
}
}
...
...
modules/imgproc/test/test_subdivision2d.cpp
0 → 100644
浏览文件 @
bab4f4f5
/*M///////////////////////////////////////////////////////////////////////////////////////
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
//M*/
#include "test_precomp.hpp"
namespace
opencv_test
{
namespace
{
TEST
(
Imgproc_Subdiv2D_getTriangleList
,
regression_5788
)
{
const
float
points
[
65
][
2
]
=
{
{
390
,
802
},
{
397
,
883
},
{
414
,
963
},
{
439
,
1042
},
{
472
,
1113
},
{
521
,
1181
},
{
591
,
1238
},
{
678
,
1284
},
{
771
,
1292
},
{
853
,
1281
},
{
921
,
1243
},
{
982
,
1191
},
{
1030
,
1121
},
{
1059
,
1038
},
{
1072
,
945
},
{
1081
,
849
},
{
1082
,
749
},
{
459
,
734
},
{
502
,
704
},
{
554
,
696
},
{
609
,
698
},
{
660
,
707
},
{
818
,
688
},
{
874
,
661
},
{
929
,
646
},
{
982
,
653
},
{
1026
,
682
},
{
740
,
771
},
{
748
,
834
},
{
756
,
897
},
{
762
,
960
},
{
700
,
998
},
{
733
,
1006
},
{
766
,
1011
},
{
797
,
999
},
{
825
,
987
},
{
528
,
796
},
{
566
,
766
},
{
617
,
763
},
{
659
,
794
},
{
619
,
808
},
{
569
,
812
},
{
834
,
777
},
{
870
,
735
},
{
918
,
729
},
{
958
,
750
},
{
929
,
773
},
{
882
,
780
},
{
652
,
1102
},
{
701
,
1079
},
{
743
,
1063
},
{
774
,
1068
},
{
807
,
1057
},
{
852
,
1065
},
{
896
,
1077
},
{
860
,
1117
},
{
820
,
1135
},
{
783
,
1141
},
{
751
,
1140
},
{
706
,
1130
},
{
675
,
1102
},
{
743
,
1094
},
{
774
,
1094
},
{
809
,
1088
},
{
878
,
1082
}
};
std
::
vector
<
cv
::
Point2f
>
pts
;
cv
::
Rect
rect
(
0
,
0
,
1500
,
2000
);
cv
::
Subdiv2D
subdiv
(
rect
);
for
(
int
i
=
0
;
i
<
65
;
i
++
)
{
cv
::
Point2f
pt
(
points
[
i
][
0
],
points
[
i
][
1
]);
pts
.
push_back
(
pt
);
}
subdiv
.
insert
(
pts
);
std
::
vector
<
cv
::
Vec6f
>
triangles
;
subdiv
.
getTriangleList
(
triangles
);
int
trig_cnt
=
0
;
for
(
std
::
vector
<
cv
::
Vec6f
>::
const_iterator
it
=
triangles
.
begin
();
it
!=
triangles
.
end
();
it
++
,
trig_cnt
++
)
{
EXPECT_TRUE
(
(
0
<=
triangles
.
at
(
trig_cnt
).
val
[
0
]
&&
triangles
.
at
(
trig_cnt
).
val
[
0
]
<
1500
)
&&
(
0
<=
triangles
.
at
(
trig_cnt
).
val
[
1
]
&&
triangles
.
at
(
trig_cnt
).
val
[
1
]
<
2000
)
&&
(
0
<=
triangles
.
at
(
trig_cnt
).
val
[
2
]
&&
triangles
.
at
(
trig_cnt
).
val
[
2
]
<
1500
)
&&
(
0
<=
triangles
.
at
(
trig_cnt
).
val
[
3
]
&&
triangles
.
at
(
trig_cnt
).
val
[
3
]
<
2000
)
&&
(
0
<=
triangles
.
at
(
trig_cnt
).
val
[
4
]
&&
triangles
.
at
(
trig_cnt
).
val
[
4
]
<
1500
)
&&
(
0
<=
triangles
.
at
(
trig_cnt
).
val
[
5
]
&&
triangles
.
at
(
trig_cnt
).
val
[
5
]
<
2000
)
);
}
EXPECT_EQ
(
trig_cnt
,
105
);
}
}};
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录