Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
6b789dd2
O
Opencv
项目概览
Greenplum
/
Opencv
10 个月 前同步成功
通知
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,体验更适合开发者的 AI 搜索 >>
提交
6b789dd2
编写于
7月 19, 2011
作者:
K
Kirill Kornyakov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
java tests: adopted for the new package structure
上级
dfdb15be
变更
11
展开全部
隐藏空白更改
内联
并排
Showing
11 changed file
with
278 addition
and
278 deletion
+278
-278
modules/java/android_test/src/org/opencv/test/OpenCVTestCase.java
...java/android_test/src/org/opencv/test/OpenCVTestCase.java
+11
-11
modules/java/android_test/src/org/opencv/test/calib3d/calib3dTest.java
...android_test/src/org/opencv/test/calib3d/calib3dTest.java
+13
-13
modules/java/android_test/src/org/opencv/test/core/MatTest.java
...s/java/android_test/src/org/opencv/test/core/MatTest.java
+3
-3
modules/java/android_test/src/org/opencv/test/core/RotatedRectTest.java
...ndroid_test/src/org/opencv/test/core/RotatedRectTest.java
+4
-4
modules/java/android_test/src/org/opencv/test/core/coreTest.java
.../java/android_test/src/org/opencv/test/core/coreTest.java
+195
-195
modules/java/android_test/src/org/opencv/test/highgui/VideoCaptureTest.java
...id_test/src/org/opencv/test/highgui/VideoCaptureTest.java
+15
-15
modules/java/android_test/src/org/opencv/test/highgui/highguiTest.java
...android_test/src/org/opencv/test/highgui/highguiTest.java
+3
-3
modules/java/android_test/src/org/opencv/test/imgproc/imgprocTest.java
...android_test/src/org/opencv/test/imgproc/imgprocTest.java
+16
-16
modules/java/android_test/src/org/opencv/test/objdetect/CascadeClassifierTest.java
.../src/org/opencv/test/objdetect/CascadeClassifierTest.java
+5
-5
modules/java/android_test/src/org/opencv/test/objdetect/objdetectTest.java
...oid_test/src/org/opencv/test/objdetect/objdetectTest.java
+4
-4
modules/java/android_test/src/org/opencv/test/video/videoTest.java
...ava/android_test/src/org/opencv/test/video/videoTest.java
+9
-9
未找到文件。
modules/java/android_test/src/org/opencv/test/OpenCVTestCase.java
浏览文件 @
6b789dd2
...
...
@@ -2,11 +2,11 @@ package org.opencv.test;
import
junit.framework.TestCase
;
import
org.opencv.CvType
;
import
org.opencv.Mat
;
import
org.opencv.Scalar
;
import
org.opencv.core
;
import
org.opencv.highgui
;
import
org.opencv.
core.
CvType
;
import
org.opencv.
core.
Mat
;
import
org.opencv.
core.
Scalar
;
import
org.opencv.core
.Core
;
import
org.opencv.highgui
.Highgui
;
public
class
OpenCVTestCase
extends
TestCase
{
...
...
@@ -85,7 +85,7 @@ public class OpenCVTestCase extends TestCase {
Mat
low
=
new
Mat
(
1
,
1
,
CvType
.
CV_16UC1
,
new
Scalar
(
0
));
Mat
high
=
new
Mat
(
1
,
1
,
CvType
.
CV_16UC1
,
new
Scalar
(
256
));
grayRnd
=
new
Mat
(
matSize
,
matSize
,
CvType
.
CV_8U
);
c
ore
.
randu
(
grayRnd
,
low
,
high
);
grayRnd
=
new
Mat
(
matSize
,
matSize
,
CvType
.
CV_8U
);
C
ore
.
randu
(
grayRnd
,
low
,
high
);
gray0_32f
=
new
Mat
(
matSize
,
matSize
,
CvType
.
CV_32F
,
new
Scalar
(
0.0
));
gray1_32f
=
new
Mat
(
matSize
,
matSize
,
CvType
.
CV_32F
,
new
Scalar
(
1.0
));
...
...
@@ -93,7 +93,7 @@ public class OpenCVTestCase extends TestCase {
gray9_32f
=
new
Mat
(
matSize
,
matSize
,
CvType
.
CV_32F
,
new
Scalar
(
9.0
));
gray255_32f
=
new
Mat
(
matSize
,
matSize
,
CvType
.
CV_32F
,
new
Scalar
(
255.0
));
grayE_32f
=
new
Mat
(
matSize
,
matSize
,
CvType
.
CV_32F
);
grayE_32f
=
Mat
.
eye
(
matSize
,
matSize
,
CvType
.
CV_32FC1
);
grayRnd_32f
=
new
Mat
(
matSize
,
matSize
,
CvType
.
CV_32F
);
c
ore
.
randu
(
grayRnd_32f
,
low
,
high
);
grayRnd_32f
=
new
Mat
(
matSize
,
matSize
,
CvType
.
CV_32F
);
C
ore
.
randu
(
grayRnd_32f
,
low
,
high
);
gray0_32f_1d
=
new
Mat
(
1
,
matSize
,
CvType
.
CV_32F
,
new
Scalar
(
0.0
));
...
...
@@ -103,8 +103,8 @@ public class OpenCVTestCase extends TestCase {
rgba0
=
new
Mat
(
matSize
,
matSize
,
CvType
.
CV_8UC4
,
Scalar
.
all
(
0
));
rgba128
=
new
Mat
(
matSize
,
matSize
,
CvType
.
CV_8UC4
,
Scalar
.
all
(
128
));
rgbLena
=
h
ighgui
.
imread
(
OpenCVTestRunner
.
LENA_PATH
);
grayChess
=
h
ighgui
.
imread
(
OpenCVTestRunner
.
CHESS_PATH
);
rgbLena
=
H
ighgui
.
imread
(
OpenCVTestRunner
.
LENA_PATH
);
grayChess
=
H
ighgui
.
imread
(
OpenCVTestRunner
.
CHESS_PATH
);
v1
=
new
Mat
(
1
,
3
,
CvType
.
CV_32F
);
v1
.
put
(
0
,
0
,
1.0
,
3.0
,
2.0
);
v2
=
new
Mat
(
1
,
3
,
CvType
.
CV_32F
);
v2
.
put
(
0
,
0
,
2.0
,
1.0
,
3.0
);
...
...
@@ -163,9 +163,9 @@ public class OpenCVTestCase extends TestCase {
static
private
double
CalcPercentageOfDifference
(
Mat
m1
,
Mat
m2
)
{
Mat
cmp
=
new
Mat
(
0
,
0
,
CvType
.
CV_8U
);
core
.
compare
(
m1
,
m2
,
cmp
,
c
ore
.
CMP_EQ
);
Core
.
compare
(
m1
,
m2
,
cmp
,
C
ore
.
CMP_EQ
);
double
difference
=
100.0
*
(
1.0
-
Double
.
valueOf
(
c
ore
.
countNonZero
(
cmp
))
/
Double
.
valueOf
(
cmp
.
rows
()
*
cmp
.
cols
()));
(
1.0
-
Double
.
valueOf
(
C
ore
.
countNonZero
(
cmp
))
/
Double
.
valueOf
(
cmp
.
rows
()
*
cmp
.
cols
()));
return
difference
;
}
...
...
modules/java/android_test/src/org/opencv/test/calib3d/calib3dTest.java
浏览文件 @
6b789dd2
package
org.opencv.test.calib3d
;
import
org.opencv.CvType
;
import
org.opencv.Mat
;
import
org.opencv.Point
;
import
org.opencv.Scalar
;
import
org.opencv.Size
;
import
org.opencv.calib3d
;
import
org.opencv.core
;
import
org.opencv.
core.
CvType
;
import
org.opencv.
core.
Mat
;
import
org.opencv.
core.
Point
;
import
org.opencv.
core.
Scalar
;
import
org.opencv.
core.
Size
;
import
org.opencv.calib3d
.Calib3d
;
import
org.opencv.core
.Core
;
import
org.opencv.test.OpenCVTestCase
;
public
class
calib3dTest
extends
OpenCVTestCase
{
...
...
@@ -27,7 +27,7 @@ public class calib3dTest extends OpenCVTestCase {
Mat
outRvec
=
new
Mat
(
3
,
1
,
CvType
.
CV_32F
);
outRvec
.
put
(
0
,
0
,
1.418641
,
0.88665926
,
0.56020796
);
Mat
outTvec
=
new
Mat
(
3
,
1
,
CvType
.
CV_32F
);
outTvec
.
put
(
0
,
0
,
1.4560841
,
1.0680628
,
0.81598103
);
c
alib3d
.
composeRT
(
rvec1
,
tvec1
,
rvec2
,
tvec2
,
rvec3
,
tvec3
);
C
alib3d
.
composeRT
(
rvec1
,
tvec1
,
rvec2
,
tvec2
,
rvec3
,
tvec3
);
assertMatEqual
(
outRvec
,
rvec3
);
assertMatEqual
(
outTvec
,
tvec3
);
...
...
@@ -145,10 +145,10 @@ public class calib3dTest extends OpenCVTestCase {
public
void
testFilterSpecklesMatDoubleIntDouble
()
{
gray_16s_1024
.
copyTo
(
dst
);
Point
center
=
new
Point
(
gray_16s_1024
.
rows
()/
2
.,
gray_16s_1024
.
cols
()/
2
.);
c
ore
.
circle
(
dst
,
center
,
1
,
Scalar
.
all
(
4096
));
C
ore
.
circle
(
dst
,
center
,
1
,
Scalar
.
all
(
4096
));
assertMatNotEqual
(
gray_16s_1024
,
dst
);
c
alib3d
.
filterSpeckles
(
dst
,
1024.0
,
100
,
0
.);
C
alib3d
.
filterSpeckles
(
dst
,
1024.0
,
100
,
0
.);
assertMatEqual
(
gray_16s_1024
,
dst
);
}
...
...
@@ -158,14 +158,14 @@ public class calib3dTest extends OpenCVTestCase {
public
void
testFindChessboardCornersMatSizeMat
()
{
Size
patternSize
=
new
Size
(
9
,
6
);
c
alib3d
.
findChessboardCorners
(
grayChess
,
patternSize
,
dst
);
C
alib3d
.
findChessboardCorners
(
grayChess
,
patternSize
,
dst
);
assertTrue
(!
dst
.
empty
());
}
public
void
testFindChessboardCornersMatSizeMatInt
()
{
Size
patternSize
=
new
Size
(
9
,
6
);
c
alib3d
.
findChessboardCorners
(
grayChess
,
patternSize
,
dst
,
calib3d
.
CALIB_CB_ADAPTIVE_THRESH
+
calib3d
.
CALIB_CB_NORMALIZE_IMAGE
+
c
alib3d
.
CALIB_CB_FAST_CHECK
);
C
alib3d
.
findChessboardCorners
(
grayChess
,
patternSize
,
dst
,
Calib3d
.
CALIB_CB_ADAPTIVE_THRESH
+
Calib3d
.
CALIB_CB_NORMALIZE_IMAGE
+
C
alib3d
.
CALIB_CB_FAST_CHECK
);
assertTrue
(!
dst
.
empty
());
}
...
...
modules/java/android_test/src/org/opencv/test/core/MatTest.java
浏览文件 @
6b789dd2
package
org.opencv.test.core
;
import
org.opencv.CvType
;
import
org.opencv.Mat
;
import
org.opencv.Scalar
;
import
org.opencv.
core.
CvType
;
import
org.opencv.
core.
Mat
;
import
org.opencv.
core.
Scalar
;
import
org.opencv.test.OpenCVTestCase
;
public
class
MatTest
extends
OpenCVTestCase
{
...
...
modules/java/android_test/src/org/opencv/test/core/RotatedRectTest.java
浏览文件 @
6b789dd2
package
org.opencv.test.core
;
import
org.opencv.Point
;
import
org.opencv.Rect
;
import
org.opencv.RotatedRect
;
import
org.opencv.Size
;
import
org.opencv.
core.
Point
;
import
org.opencv.
core.
Rect
;
import
org.opencv.
core.
RotatedRect
;
import
org.opencv.
core.
Size
;
import
org.opencv.test.OpenCVTestCase
;
public
class
RotatedRectTest
extends
OpenCVTestCase
{
...
...
modules/java/android_test/src/org/opencv/test/core/coreTest.java
浏览文件 @
6b789dd2
此差异已折叠。
点击以展开。
modules/java/android_test/src/org/opencv/test/highgui/VideoCaptureTest.java
浏览文件 @
6b789dd2
package
org.opencv.test.highgui
;
import
org.opencv.highgui
;
import
org.opencv.VideoCapture
;
import
org.opencv.highgui
.Highgui
;
import
org.opencv.
highgui.
VideoCapture
;
import
org.opencv.test.OpenCVTestCase
;
...
...
@@ -26,8 +26,8 @@ public class VideoCaptureTest extends OpenCVTestCase {
}
public
void
testGet
()
{
capture
=
new
VideoCapture
(
h
ighgui
.
CV_CAP_ANDROID
);
double
frameWidth
=
capture
.
get
(
h
ighgui
.
CV_CAP_PROP_FRAME_WIDTH
);
capture
=
new
VideoCapture
(
H
ighgui
.
CV_CAP_ANDROID
);
double
frameWidth
=
capture
.
get
(
H
ighgui
.
CV_CAP_PROP_FRAME_WIDTH
);
capture
.
release
();
assertTrue
(
0
!=
frameWidth
);
}
...
...
@@ -39,7 +39,7 @@ public class VideoCaptureTest extends OpenCVTestCase {
}
public
void
testGrabFromRealCamera
()
{
capture
=
new
VideoCapture
(
h
ighgui
.
CV_CAP_ANDROID
);
capture
=
new
VideoCapture
(
H
ighgui
.
CV_CAP_ANDROID
);
isSucceed
=
capture
.
grab
();
capture
.
release
();
assertTrue
(
isSucceed
);
...
...
@@ -51,7 +51,7 @@ public class VideoCaptureTest extends OpenCVTestCase {
}
public
void
testIsOpenedRealCamera
()
{
capture
=
new
VideoCapture
(
h
ighgui
.
CV_CAP_ANDROID
);
capture
=
new
VideoCapture
(
H
ighgui
.
CV_CAP_ANDROID
);
isOpened
=
capture
.
isOpened
();
capture
.
release
();
assertTrue
(
isOpened
);
...
...
@@ -59,7 +59,7 @@ public class VideoCaptureTest extends OpenCVTestCase {
public
void
testOpenInt
()
{
capture
=
new
VideoCapture
();
capture
.
open
(
h
ighgui
.
CV_CAP_ANDROID
);
capture
.
open
(
H
ighgui
.
CV_CAP_ANDROID
);
isOpened
=
capture
.
isOpened
();
capture
.
release
();
assertTrue
(
isOpened
);
...
...
@@ -70,7 +70,7 @@ public class VideoCaptureTest extends OpenCVTestCase {
}
public
void
testRead
()
{
capture
=
new
VideoCapture
(
h
ighgui
.
CV_CAP_ANDROID
);
capture
=
new
VideoCapture
(
H
ighgui
.
CV_CAP_ANDROID
);
isSucceed
=
capture
.
read
(
dst
);
capture
.
release
();
assertTrue
(
isSucceed
);
...
...
@@ -79,13 +79,13 @@ public class VideoCaptureTest extends OpenCVTestCase {
}
public
void
testRelease
()
{
capture
=
new
VideoCapture
(
h
ighgui
.
CV_CAP_ANDROID
);
capture
=
new
VideoCapture
(
H
ighgui
.
CV_CAP_ANDROID
);
capture
.
release
();
assertFalse
(
capture
.
isOpened
());
}
public
void
testRetrieveMat
()
{
capture
=
new
VideoCapture
(
h
ighgui
.
CV_CAP_ANDROID
);
capture
=
new
VideoCapture
(
H
ighgui
.
CV_CAP_ANDROID
);
capture
.
grab
();
isSucceed
=
capture
.
retrieve
(
dst
);
capture
.
release
();
...
...
@@ -95,7 +95,7 @@ public class VideoCaptureTest extends OpenCVTestCase {
}
public
void
testRetrieveMatInt
()
{
capture
=
new
VideoCapture
(
h
ighgui
.
CV_CAP_ANDROID
);
capture
=
new
VideoCapture
(
H
ighgui
.
CV_CAP_ANDROID
);
capture
.
grab
();
isSucceed
=
capture
.
retrieve
(
dst
,
1
);
capture
.
release
();
...
...
@@ -106,9 +106,9 @@ public class VideoCaptureTest extends OpenCVTestCase {
}
public
void
testSet
()
{
capture
=
new
VideoCapture
(
h
ighgui
.
CV_CAP_ANDROID
);
capture
.
set
(
h
ighgui
.
CV_CAP_PROP_FRAME_WIDTH
,
640.0
);
double
frameWidth
=
capture
.
get
(
h
ighgui
.
CV_CAP_PROP_FRAME_WIDTH
);
capture
=
new
VideoCapture
(
H
ighgui
.
CV_CAP_ANDROID
);
capture
.
set
(
H
ighgui
.
CV_CAP_PROP_FRAME_WIDTH
,
640.0
);
double
frameWidth
=
capture
.
get
(
H
ighgui
.
CV_CAP_PROP_FRAME_WIDTH
);
capture
.
read
(
dst
);
capture
.
release
();
assertEquals
(
640.0
,
frameWidth
);
...
...
@@ -121,7 +121,7 @@ public class VideoCaptureTest extends OpenCVTestCase {
}
public
void
testVideoCaptureInt
()
{
capture
=
new
VideoCapture
(
h
ighgui
.
CV_CAP_ANDROID
);
capture
=
new
VideoCapture
(
H
ighgui
.
CV_CAP_ANDROID
);
assertTrue
(
null
!=
capture
);
isOpened
=
capture
.
isOpened
();
capture
.
release
();
...
...
modules/java/android_test/src/org/opencv/test/highgui/highguiTest.java
浏览文件 @
6b789dd2
package
org.opencv.test.highgui
;
import
org.opencv.highgui
;
import
org.opencv.highgui
.Highgui
;
import
org.opencv.test.OpenCVTestCase
;
import
org.opencv.test.OpenCVTestRunner
;
...
...
@@ -8,7 +8,7 @@ import org.opencv.test.OpenCVTestRunner;
public
class
highguiTest
extends
OpenCVTestCase
{
public
void
testImreadString
()
{
dst
=
h
ighgui
.
imread
(
OpenCVTestRunner
.
LENA_PATH
);
dst
=
H
ighgui
.
imread
(
OpenCVTestRunner
.
LENA_PATH
);
assertTrue
(!
dst
.
empty
());
assertEquals
(
3
,
dst
.
channels
());
assertTrue
(
512
==
dst
.
cols
());
...
...
@@ -16,7 +16,7 @@ public class highguiTest extends OpenCVTestCase {
}
public
void
testImreadStringInt
()
{
dst
=
h
ighgui
.
imread
(
OpenCVTestRunner
.
LENA_PATH
,
0
);
dst
=
H
ighgui
.
imread
(
OpenCVTestRunner
.
LENA_PATH
,
0
);
assertTrue
(!
dst
.
empty
());
assertEquals
(
1
,
dst
.
channels
());
assertTrue
(
512
==
dst
.
cols
());
...
...
modules/java/android_test/src/org/opencv/test/imgproc/imgprocTest.java
浏览文件 @
6b789dd2
...
...
@@ -3,12 +3,12 @@ package org.opencv.test.imgproc;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.opencv.CvType
;
import
org.opencv.Mat
;
import
org.opencv.Scalar
;
import
org.opencv.Size
;
import
org.opencv.core
;
import
org.opencv.imgproc
;
import
org.opencv.
core.
CvType
;
import
org.opencv.
core.
Mat
;
import
org.opencv.
core.
Scalar
;
import
org.opencv.
core.
Size
;
import
org.opencv.core
.Core
;
import
org.opencv.imgproc
.Imgproc
;
import
org.opencv.test.OpenCVTestCase
;
...
...
@@ -21,7 +21,7 @@ public class imgprocTest extends OpenCVTestCase {
//FIXME: this test crashes
//public void test_Can_Call_accumulate() {
// dst = new Mat(gray1.rows(), gray1.cols(), Mat.CvType.CV_32FC1);
//
i
mgproc.accumulate(gray1, dst);
//
I
mgproc.accumulate(gray1, dst);
// assertMatEqual(gray1, dst);
//}
...
...
@@ -80,10 +80,10 @@ public class imgprocTest extends OpenCVTestCase {
public
void
testBlurMatMatSize
()
{
Size
sz
=
new
Size
(
3
,
3
);
i
mgproc
.
blur
(
gray0
,
dst
,
sz
);
I
mgproc
.
blur
(
gray0
,
dst
,
sz
);
assertMatEqual
(
gray0
,
dst
);
i
mgproc
.
blur
(
gray255
,
dst
,
sz
);
I
mgproc
.
blur
(
gray255
,
dst
,
sz
);
assertMatEqual
(
gray255
,
dst
);
}
...
...
@@ -105,7 +105,7 @@ public class imgprocTest extends OpenCVTestCase {
public
void
testBoxFilterMatMatIntSize
()
{
Size
sz
=
new
Size
(
3
,
3
);
i
mgproc
.
boxFilter
(
gray0
,
dst
,
8
,
sz
);
I
mgproc
.
boxFilter
(
gray0
,
dst
,
8
,
sz
);
assertMatEqual
(
gray0
,
dst
);
}
...
...
@@ -133,13 +133,13 @@ public class imgprocTest extends OpenCVTestCase {
ranges
.
add
(
0.0f
);
ranges
.
add
(
256.0f
);
Mat
hist
=
new
Mat
();
i
mgproc
.
calcHist
(
images
,
channels
,
new
Mat
(),
hist
,
histSize
,
ranges
);
c
ore
.
normalize
(
hist
,
hist
);
I
mgproc
.
calcHist
(
images
,
channels
,
new
Mat
(),
hist
,
histSize
,
ranges
);
C
ore
.
normalize
(
hist
,
hist
);
i
mgproc
.
calcBackProject
(
images
,
channels
,
hist
,
dst
,
ranges
,
255
);
I
mgproc
.
calcBackProject
(
images
,
channels
,
hist
,
dst
,
ranges
,
255
);
assertTrue
(
grayChess
.
size
().
equals
(
dst
.
size
()));
assertEquals
(
grayChess
.
depth
(),
dst
.
depth
());
assertTrue
(
0
!=
c
ore
.
countNonZero
(
dst
));
assertTrue
(
0
!=
C
ore
.
countNonZero
(
dst
));
}
public
void
testCalcHistListOfMatListOfIntegerMatMatListOfIntegerListOfFloat
()
{
...
...
@@ -157,7 +157,7 @@ public class imgprocTest extends OpenCVTestCase {
truth
.
put
(
5
,
0
,
100.0
);
Mat
hist
=
new
Mat
();
i
mgproc
.
calcHist
(
images
,
channels
,
new
Mat
(),
hist
,
histSize
,
ranges
);
I
mgproc
.
calcHist
(
images
,
channels
,
new
Mat
(),
hist
,
histSize
,
ranges
);
assertMatEqual
(
truth
,
hist
);
}
...
...
@@ -183,7 +183,7 @@ public class imgprocTest extends OpenCVTestCase {
truth
.
put
(
9
,
5
,
100.0
);
Mat
hist
=
new
Mat
();
i
mgproc
.
calcHist
(
images
,
channels
,
new
Mat
(),
hist
,
histSize
,
ranges
);
I
mgproc
.
calcHist
(
images
,
channels
,
new
Mat
(),
hist
,
histSize
,
ranges
);
assertMatEqual
(
truth
,
hist
);
}
...
...
modules/java/android_test/src/org/opencv/test/objdetect/CascadeClassifierTest.java
浏览文件 @
6b789dd2
...
...
@@ -2,10 +2,10 @@ package org.opencv.test.objdetect;
import
java.util.ArrayList
;
import
org.opencv.Mat
;
import
org.opencv.Rect
;
import
org.opencv.Size
;
import
org.opencv.imgproc
;
import
org.opencv.
core.
Mat
;
import
org.opencv.
core.
Rect
;
import
org.opencv.
core.
Size
;
import
org.opencv.imgproc
.Imgproc
;
import
org.opencv.objdetect.CascadeClassifier
;
import
org.opencv.test.OpenCVTestCase
;
import
org.opencv.test.OpenCVTestRunner
;
...
...
@@ -36,7 +36,7 @@ public class CascadeClassifierTest extends OpenCVTestCase {
ArrayList
<
Rect
>
faces
=
new
ArrayList
<
Rect
>();
Mat
greyLena
=
new
Mat
();
imgproc
.
cvtColor
(
rgbLena
,
greyLena
,
i
mgproc
.
COLOR_RGB2GRAY
);
Imgproc
.
cvtColor
(
rgbLena
,
greyLena
,
I
mgproc
.
COLOR_RGB2GRAY
);
//TODO: doesn't detect with 1.1 scale
cc
.
detectMultiScale
(
greyLena
,
faces
,
1.09
,
2
,
2
/*TODO: CV_HAAR_SCALE_IMAGE*/
,
new
Size
(
30
,
30
));
...
...
modules/java/android_test/src/org/opencv/test/objdetect/objdetectTest.java
浏览文件 @
6b789dd2
...
...
@@ -2,8 +2,8 @@ package org.opencv.test.objdetect;
import
java.util.ArrayList
;
import
org.opencv.Rect
;
import
org.opencv.objdetect
;
import
org.opencv.
core.
Rect
;
import
org.opencv.objdetect
.Objdetect
;
import
org.opencv.test.OpenCVTestCase
;
...
...
@@ -17,7 +17,7 @@ public class objdetectTest extends OpenCVTestCase {
rects
.
add
(
r
);
int
groupThreshold
=
1
;
o
bjdetect
.
groupRectangles
(
rects
,
groupThreshold
);
O
bjdetect
.
groupRectangles
(
rects
,
groupThreshold
);
assertEquals
(
1
,
rects
.
size
());
}
...
...
@@ -33,7 +33,7 @@ public class objdetectTest extends OpenCVTestCase {
int
groupThreshold
=
1
;
double
eps
=
0.2
;
o
bjdetect
.
groupRectangles
(
rects
,
groupThreshold
,
eps
);
O
bjdetect
.
groupRectangles
(
rects
,
groupThreshold
,
eps
);
assertEquals
(
2
,
rects
.
size
());
}
...
...
modules/java/android_test/src/org/opencv/test/video/videoTest.java
浏览文件 @
6b789dd2
package
org.opencv.test.video
;
import
org.opencv.CvType
;
import
org.opencv.Mat
;
import
org.opencv.Size
;
import
org.opencv.core
;
import
org.opencv.video
;
import
org.opencv.
core.
CvType
;
import
org.opencv.
core.
Mat
;
import
org.opencv.
core.
Size
;
import
org.opencv.core
.Core
;
import
org.opencv.video
.Video
;
import
org.opencv.test.OpenCVTestCase
;
...
...
@@ -59,8 +59,8 @@ public class videoTest extends OpenCVTestCase {
Mat
prevPts
=
new
Mat
(
1
,
3
,
CvType
.
CV_32FC2
);
prevPts
.
put
(
0
,
0
,
1.0
,
1.0
,
5.0
,
5.0
,
10.0
,
10.0
);
v
ideo
.
calcOpticalFlowPyrLK
(
subLena1
,
subLena2
,
prevPts
,
nextPts
,
status
,
err
);
assertEquals
(
3
,
c
ore
.
countNonZero
(
status
));
V
ideo
.
calcOpticalFlowPyrLK
(
subLena1
,
subLena2
,
prevPts
,
nextPts
,
status
,
err
);
assertEquals
(
3
,
C
ore
.
countNonZero
(
status
));
}
public
void
testCalcOpticalFlowPyrLKMatMatMatMatMatMatSize
()
{
...
...
@@ -68,8 +68,8 @@ public class videoTest extends OpenCVTestCase {
prevPts
.
put
(
0
,
0
,
1.0
,
1.0
,
5.0
,
5.0
,
10.0
,
10.0
);
Size
sz
=
new
Size
(
5
,
5
);
v
ideo
.
calcOpticalFlowPyrLK
(
subLena1
,
subLena2
,
prevPts
,
nextPts
,
status
,
err
,
sz
);
assertEquals
(
0
,
c
ore
.
countNonZero
(
status
));
V
ideo
.
calcOpticalFlowPyrLK
(
subLena1
,
subLena2
,
prevPts
,
nextPts
,
status
,
err
,
sz
);
assertEquals
(
0
,
C
ore
.
countNonZero
(
status
));
}
public
void
testCalcOpticalFlowPyrLKMatMatMatMatMatMatSizeInt
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录