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
43097c6a
Commit
43097c6a
authored
Jul 04, 2011
by
Kirill Kornyakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lena added
parent
1649c8f6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
58 additions
and
53 deletions
+58
-53
lena.jpg
modules/java/android_test/res/drawable/lena.jpg
+0
-0
OpenCVTestCase.java
...java/android_test/src/org/opencv/test/OpenCVTestCase.java
+14
-13
coreTest.java
modules/java/android_test/src/org/opencv/test/coreTest.java
+28
-28
highguiTest.java
...es/java/android_test/src/org/opencv/test/highguiTest.java
+10
-6
imgprocTest.java
...es/java/android_test/src/org/opencv/test/imgprocTest.java
+6
-6
No files found.
modules/java/android_test/res/drawable/lena.jpg
0 → 100644
View file @
43097c6a
89.7 KB
modules/java/android_test/src/org/opencv/test/OpenCVTestCase.java
View file @
43097c6a
...
...
@@ -4,6 +4,7 @@ import java.io.FileOutputStream;
import
org.opencv.Mat
;
import
org.opencv.core
;
import
org.opencv.highgui
;
import
android.content.Context
;
import
android.graphics.Bitmap
;
...
...
@@ -18,6 +19,11 @@ public class OpenCVTestCase extends AndroidTestCase {
static
String
LENA
=
"/data/data/org.opencv.test/files/lena.jpg"
;
static
int
matSize
=
10
;
//Naming notation: channels_[type]_[dimension]_value
//examples: gray0 - single channel 8U 2d Mat filled with 0
// grayRnd - single channel 8U 2d Mat filled with random numbers
// gray0_32f_1d - refactor ;)
static
Mat
gray0
;
static
Mat
gray1
;
...
...
@@ -41,20 +47,15 @@ public class OpenCVTestCase extends AndroidTestCase {
static
Mat
gray0_64f_1d
;
static
Mat
rgba0
;
static
Mat
rgba128
;
static
Mat
rgba128
;
static
Mat
rgbLena
;
static
Mat
dst_gray
;
static
Mat
dst_gray_32f
;
static
Mat
dst
;
@Override
protected
void
setUp
()
throws
Exception
{
// Log.e(TAG, "setUp");
super
.
setUp
();
//Naming notation: channels_[type]_[dimension]_value
//examples: gray0 - single channel 8U 2d Mat filled with 0
// grayRnd - single channel 8U 2d Mat filled with random numbers
// gray0_32f_1d - refactor ;)
gray0
=
new
Mat
(
matSize
,
matSize
,
Mat
.
CvType
.
CV_8UC1
);
gray0
.
setTo
(
0.0
);
gray1
=
new
Mat
(
matSize
,
matSize
,
Mat
.
CvType
.
CV_8UC1
);
gray1
.
setTo
(
1.0
);
...
...
@@ -92,11 +93,11 @@ public class OpenCVTestCase extends AndroidTestCase {
catch
(
Exception
e
)
{
Log
.
e
(
TAG
,
"Tried to write lena.jpg, but: "
+
e
.
toString
());
}
rgbLena
=
highgui
.
imread
(
LENA
);
dst_gray
=
new
Mat
();
assertTrue
(
dst_gray
.
empty
());
dst_gray_32f
=
new
Mat
();
assertTrue
(
dst_gray_32f
.
empty
());
dst
=
new
Mat
();
assertTrue
(
dst
.
empty
());
}
public
static
void
assertMatEqual
(
Mat
m1
,
Mat
m2
)
{
...
...
modules/java/android_test/src/org/opencv/test/coreTest.java
View file @
43097c6a
...
...
@@ -19,12 +19,12 @@ public class coreTest extends OpenCVTestCase {
Mat
lut
=
new
Mat
(
1
,
256
,
Mat
.
CvType
.
CV_8UC1
);
lut
.
setTo
(
0
);
core
.
LUT
(
grayRnd
,
lut
,
dst
_gray
);
assertMatEqual
(
gray0
,
dst
_gray
);
core
.
LUT
(
grayRnd
,
lut
,
dst
);
assertMatEqual
(
gray0
,
dst
);
lut
.
setTo
(
255
);
core
.
LUT
(
grayRnd
,
lut
,
dst
_gray
);
assertMatEqual
(
gray255
,
dst
_gray
);
core
.
LUT
(
grayRnd
,
lut
,
dst
);
assertMatEqual
(
gray255
,
dst
);
}
public
void
testMahalanobis
()
{
...
...
@@ -45,8 +45,8 @@ public class coreTest extends OpenCVTestCase {
}
public
void
testAbsdiff
()
{
core
.
absdiff
(
gray128
,
gray255
,
dst
_gray
);
assertMatEqual
(
gray127
,
dst
_gray
);
core
.
absdiff
(
gray128
,
gray255
,
dst
);
assertMatEqual
(
gray127
,
dst
);
}
public
void
testAddMatMatMatMatInt
()
{
...
...
@@ -58,8 +58,8 @@ public class coreTest extends OpenCVTestCase {
}
public
void
testAddMatMatMat
()
{
core
.
add
(
gray128
,
gray128
,
dst
_gray
);
assertMatEqual
(
gray255
,
dst
_gray
);
core
.
add
(
gray128
,
gray128
,
dst
);
assertMatEqual
(
gray255
,
dst
);
}
public
void
testAddWeightedMatDoubleMatDoubleDoubleMatInt
()
{
...
...
@@ -69,8 +69,8 @@ public class coreTest extends OpenCVTestCase {
}
public
void
testAddWeightedMatDoubleMatDoubleDoubleMat
()
{
core
.
addWeighted
(
gray1
,
126.0
,
gray127
,
1.0
,
2.0
,
dst
_gray
);
assertMatEqual
(
gray255
,
dst
_gray
);
core
.
addWeighted
(
gray1
,
126.0
,
gray127
,
1.0
,
2.0
,
dst
);
assertMatEqual
(
gray255
,
dst
);
}
public
void
testBitwise_andMatMatMatMat
()
{
...
...
@@ -78,8 +78,8 @@ public class coreTest extends OpenCVTestCase {
}
public
void
testBitwise_andMatMatMat
()
{
core
.
bitwise_and
(
gray3
,
gray2
,
dst
_gray
);
assertMatEqual
(
gray2
,
dst
_gray
);
core
.
bitwise_and
(
gray3
,
gray2
,
dst
);
assertMatEqual
(
gray2
,
dst
);
}
public
void
testBitwise_notMatMatMat
()
{
...
...
@@ -177,14 +177,14 @@ public class coreTest extends OpenCVTestCase {
public
void
testCompleteSymmMatBoolean
()
{
core
.
completeSymm
(
grayRnd_32f
,
true
);
core
.
transpose
(
grayRnd_32f
,
dst
_gray_32f
);
assertMatEqual
(
grayRnd_32f
,
dst
_gray_32f
);
core
.
transpose
(
grayRnd_32f
,
dst
);
assertMatEqual
(
grayRnd_32f
,
dst
);
}
public
void
testCompleteSymmMat
()
{
core
.
completeSymm
(
grayRnd_32f
);
core
.
transpose
(
grayRnd_32f
,
dst
_gray_32f
);
assertMatEqual
(
grayRnd_32f
,
dst
_gray_32f
);
core
.
transpose
(
grayRnd_32f
,
dst
);
assertMatEqual
(
grayRnd_32f
,
dst
);
}
public
void
testConvertScaleAbsMatMatDoubleDouble
()
{
...
...
@@ -215,15 +215,15 @@ public class coreTest extends OpenCVTestCase {
}
public
void
testDctMatMat
()
{
core
.
dct
(
gray0_32f_1d
,
dst
_gray
);
assertMatEqual
(
gray0_32f_1d
,
dst
_gray
);
core
.
dct
(
gray0_32f_1d
,
dst
);
assertMatEqual
(
gray0_32f_1d
,
dst
);
Mat
in
=
new
Mat
(
1
,
4
,
Mat
.
CvType
.
CV_32FC1
);
in
.
put
(
0
,
0
,
135.22211
,
50.811096
,
102.27016
,
207.6682
);
Mat
out
=
new
Mat
(
1
,
4
,
Mat
.
CvType
.
CV_32FC1
);
out
.
put
(
0
,
0
,
247.98576
,
-
61.252407
,
94.904533
,
14.013477
);
core
.
dct
(
in
,
dst
_gray
);
assertMatEqual
(
out
,
dst
_gray
);
core
.
dct
(
in
,
dst
);
assertMatEqual
(
out
,
dst
);
}
public
void
testDeterminant
()
{
...
...
@@ -283,8 +283,8 @@ public class coreTest extends OpenCVTestCase {
}
public
void
testExtractChannel
()
{
core
.
extractChannel
(
rgba128
,
dst
_gray
,
0
);
assertMatEqual
(
gray128
,
dst
_gray
);
core
.
extractChannel
(
rgba128
,
dst
,
0
);
assertMatEqual
(
gray128
,
dst
);
}
public
void
testFastAtan2
()
{
...
...
@@ -317,9 +317,9 @@ public class coreTest extends OpenCVTestCase {
Mat
eConcat
=
new
Mat
(
1
,
9
,
Mat
.
CvType
.
CV_8UC1
);
e
.
put
(
0
,
0
,
0
,
0
,
1
,
0
,
1
,
0
,
0
,
0
,
1
);
eConcat
.
put
(
0
,
0
,
0
,
0
,
1
,
0
,
1
,
0
,
0
,
0
,
1
);
core
.
hconcat
(
e
,
dst
_gray
);
core
.
hconcat
(
e
,
dst
);
assertMatEqual
(
eConcat
,
dst
_gray
);
assertMatEqual
(
eConcat
,
dst
);
}
public
void
testIdctMatMatInt
()
{
...
...
@@ -428,13 +428,13 @@ public class coreTest extends OpenCVTestCase {
}
public
void
testMulTransposedMatMatBooleanMat
()
{
core
.
mulTransposed
(
grayRnd_32f
,
dst
_gray_32f
,
true
,
grayRnd_32f
);
assertMatEqual
(
gray0_32f
,
dst
_gray_32f
);
core
.
mulTransposed
(
grayRnd_32f
,
dst
,
true
,
grayRnd_32f
);
assertMatEqual
(
gray0_32f
,
dst
);
}
public
void
testMulTransposedMatMatBoolean
()
{
core
.
mulTransposed
(
grayE_32f
,
dst
_gray_32f
,
true
);
assertMatEqual
(
grayE_32f
,
dst
_gray_32f
);
core
.
mulTransposed
(
grayE_32f
,
dst
,
true
);
assertMatEqual
(
grayE_32f
,
dst
);
}
public
void
testMultiplyMatMatMatDoubleInt
()
{
...
...
modules/java/android_test/src/org/opencv/test/highguiTest.java
View file @
43097c6a
...
...
@@ -40,15 +40,19 @@ public class highguiTest extends OpenCVTestCase {
}
public
void
testImreadStringInt
()
{
dst_gray
=
highgui
.
imread
(
LENA
,
0
);
assertTrue
(!
dst_gray
.
empty
());
assertEquals
(
1
,
dst_gray
.
channels
());
dst
=
highgui
.
imread
(
LENA
,
0
);
assertTrue
(!
dst
.
empty
());
assertEquals
(
1
,
dst
.
channels
());
assertTrue
(
512
==
dst
.
cols
());
assertTrue
(
512
==
dst
.
rows
());
}
public
void
testImreadString
()
{
dst_gray
=
highgui
.
imread
(
LENA
);
assertTrue
(!
dst_gray
.
empty
());
assertEquals
(
3
,
dst_gray
.
channels
());
dst
=
highgui
.
imread
(
LENA
);
assertTrue
(!
dst
.
empty
());
assertEquals
(
3
,
dst
.
channels
());
assertTrue
(
512
==
dst
.
cols
());
assertTrue
(
512
==
dst
.
rows
());
}
public
void
testImshow
()
{
...
...
modules/java/android_test/src/org/opencv/test/imgprocTest.java
View file @
43097c6a
...
...
@@ -200,11 +200,11 @@ public class imgprocTest extends OpenCVTestCase {
public
void
testBlurMatMatSize
()
{
Size
sz
=
new
Size
(
3
,
3
);
imgproc
.
blur
(
gray0
,
dst
_gray
,
sz
);
assertMatEqual
(
gray0
,
dst
_gray
);
imgproc
.
blur
(
gray0
,
dst
,
sz
);
assertMatEqual
(
gray0
,
dst
);
imgproc
.
blur
(
gray255
,
dst
_gray
,
sz
);
assertMatEqual
(
gray255
,
dst
_gray
);
imgproc
.
blur
(
gray255
,
dst
,
sz
);
assertMatEqual
(
gray255
,
dst
);
}
public
void
testBorderInterpolate
()
{
...
...
@@ -225,8 +225,8 @@ public class imgprocTest extends OpenCVTestCase {
public
void
testBoxFilterMatMatIntSize
()
{
Size
sz
=
new
Size
(
3
,
3
);
imgproc
.
boxFilter
(
gray0
,
dst
_gray
,
8
,
sz
);
assertMatEqual
(
gray0
,
dst
_gray
);
imgproc
.
boxFilter
(
gray0
,
dst
,
8
,
sz
);
assertMatEqual
(
gray0
,
dst
);
}
public
void
testCompareHist
()
{
...
...
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