Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
9fbd47ff
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,发现更多精彩内容 >>
提交
9fbd47ff
编写于
6月 30, 2011
作者:
K
Kirill Kornyakov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
added several tests for java/core module
上级
5d703abd
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
59 addition
and
7 deletion
+59
-7
modules/java/android_test/src/org/opencv/test/OpenCVTestCase.java
...java/android_test/src/org/opencv/test/OpenCVTestCase.java
+20
-0
modules/java/android_test/src/org/opencv/test/coreTest.java
modules/java/android_test/src/org/opencv/test/coreTest.java
+39
-7
未找到文件。
modules/java/android_test/src/org/opencv/test/OpenCVTestCase.java
浏览文件 @
9fbd47ff
...
...
@@ -18,6 +18,15 @@ public class OpenCVTestCase extends AndroidTestCase {
static
Mat
gray127
;
static
Mat
gray128
;
static
Mat
gray255
;
static
Mat
grayRnd
;
static
Mat
grayRnd_32f
;
static
Mat
gray0_32f
;
static
Mat
gray0_32f_1d
;
static
Mat
gray0_64f
;
static
Mat
gray0_64f_1d
;
static
Mat
dst
;
...
...
@@ -33,6 +42,17 @@ public class OpenCVTestCase extends AndroidTestCase {
gray127
=
new
Mat
(
matSize
,
matSize
,
Mat
.
CvType
.
CV_8UC1
);
gray127
.
setTo
(
127.0
);
gray128
=
new
Mat
(
matSize
,
matSize
,
Mat
.
CvType
.
CV_8UC1
);
gray128
.
setTo
(
128.0
);
gray255
=
new
Mat
(
matSize
,
matSize
,
Mat
.
CvType
.
CV_8UC1
);
gray255
.
setTo
(
256.0
);
Mat
low
=
new
Mat
(
1
,
1
,
Mat
.
CvType
.
CV_16UC1
);
low
.
setTo
(
0
);
Mat
high
=
new
Mat
(
1
,
1
,
Mat
.
CvType
.
CV_16UC1
);
high
.
setTo
(
256
);
grayRnd
=
new
Mat
(
matSize
,
matSize
,
Mat
.
CvType
.
CV_8UC1
);
core
.
randu
(
grayRnd
,
low
,
high
);
grayRnd_32f
=
new
Mat
(
matSize
,
matSize
,
Mat
.
CvType
.
CV_32FC1
);
core
.
randu
(
grayRnd_32f
,
low
,
high
);
gray0_32f
=
new
Mat
(
matSize
,
matSize
,
Mat
.
CvType
.
CV_32FC1
);
gray0_32f
.
setTo
(
0.0
);
gray0_32f_1d
=
new
Mat
(
1
,
matSize
,
Mat
.
CvType
.
CV_32FC1
);
gray0_32f_1d
.
setTo
(
0.0
);
gray0_64f
=
new
Mat
(
matSize
,
matSize
,
Mat
.
CvType
.
CV_64FC1
);
gray0_64f
.
setTo
(
0.0
);
gray0_64f_1d
=
new
Mat
(
1
,
matSize
,
Mat
.
CvType
.
CV_64FC1
);
gray0_64f_1d
.
setTo
(
0.0
);
dst
=
new
Mat
(
0
,
0
,
Mat
.
CvType
.
CV_8UC1
);
assertTrue
(
dst
.
empty
());
...
...
modules/java/android_test/src/org/opencv/test/coreTest.java
浏览文件 @
9fbd47ff
package
org.opencv.test
;
import
org.opencv.Mat
;
import
org.opencv.core
;
public
class
coreTest
extends
OpenCVTestCase
{
...
...
@@ -13,11 +14,32 @@ public class coreTest extends OpenCVTestCase {
}
public
void
testLUTMatMatMat
()
{
fail
(
"Not yet implemented"
);
}
public
void
testMahalanobis
()
{
fail
(
"Not yet implemented"
);
Mat
lut
=
new
Mat
(
1
,
256
,
Mat
.
CvType
.
CV_8UC1
);
lut
.
setTo
(
0
);
core
.
LUT
(
grayRnd
,
lut
,
dst
);
assertMatEqual
(
gray0
,
dst
);
lut
.
setTo
(
255
);
core
.
LUT
(
grayRnd
,
lut
,
dst
);
assertMatEqual
(
gray255
,
dst
);
}
public
void
testMahalanobis
()
{
Mat
covar
=
new
Mat
(
matSize
,
matSize
,
Mat
.
CvType
.
CV_32FC1
);
Mat
mean
=
new
Mat
(
1
,
matSize
,
Mat
.
CvType
.
CV_32FC1
);
core
.
calcCovarMatrix
(
grayRnd_32f
,
covar
,
mean
,
8
|
1
,
Mat
.
CvType
.
CV_32F
);
//FIXME: CV_COVAR_NORMAL
covar
.
inv
();
Mat
line1
=
grayRnd_32f
.
submat
(
0
,
1
,
0
,
grayRnd_32f
.
cols
());
Mat
line2
=
grayRnd_32f
.
submat
(
1
,
2
,
0
,
grayRnd_32f
.
cols
());
double
d
=
0.0
;
d
=
core
.
Mahalanobis
(
line1
,
line1
,
covar
);
assertEquals
(
0.0
,
d
);
d
=
core
.
Mahalanobis
(
line1
,
line2
,
covar
);
assertTrue
(
d
>
0.0
);
}
public
void
testAbsdiff
()
{
...
...
@@ -80,11 +102,21 @@ public class coreTest extends OpenCVTestCase {
}
public
void
testCalcCovarMatrixMatMatMatIntInt
()
{
fail
(
"Not yet implemented"
);
Mat
covar
=
new
Mat
(
matSize
,
matSize
,
Mat
.
CvType
.
CV_32FC1
);
Mat
mean
=
new
Mat
(
1
,
matSize
,
Mat
.
CvType
.
CV_32FC1
);
core
.
calcCovarMatrix
(
gray0_32f
,
covar
,
mean
,
8
|
1
,
Mat
.
CvType
.
CV_32F
);
//FIXME: CV_COVAR_NORMAL
assertMatEqual
(
gray0_32f
,
covar
);
assertMatEqual
(
gray0_32f_1d
,
mean
);
}
public
void
testCalcCovarMatrixMatMatMatInt
()
{
fail
(
"Not yet implemented"
);
Mat
covar
=
new
Mat
(
matSize
,
matSize
,
Mat
.
CvType
.
CV_64FC1
);
Mat
mean
=
new
Mat
(
1
,
matSize
,
Mat
.
CvType
.
CV_64FC1
);
core
.
calcCovarMatrix
(
gray0_32f
,
covar
,
mean
,
8
|
1
);
//FIXME: CV_COVAR_NORMAL
assertMatEqual
(
gray0_64f
,
covar
);
assertMatEqual
(
gray0_64f_1d
,
mean
);
}
public
void
testCartToPolarMatMatMatMatBoolean
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录