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
e1ad6b27
Commit
e1ad6b27
authored
Jul 02, 2011
by
itsyplen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
several java tests added
parent
afad87b5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
3 deletions
+16
-3
OpenCVTestCase.java
...java/android_test/src/org/opencv/test/OpenCVTestCase.java
+4
-0
coreTest.java
modules/java/android_test/src/org/opencv/test/coreTest.java
+12
-3
No files found.
modules/java/android_test/src/org/opencv/test/OpenCVTestCase.java
View file @
e1ad6b27
...
...
@@ -19,6 +19,8 @@ public class OpenCVTestCase extends AndroidTestCase {
static
Mat
gray128
;
static
Mat
gray255
;
static
Mat
gray255_32f
;
static
Mat
grayRnd
;
static
Mat
grayRnd_32f
;
...
...
@@ -49,6 +51,8 @@ public class OpenCVTestCase extends AndroidTestCase {
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
);
gray255_32f
=
new
Mat
(
matSize
,
matSize
,
Mat
.
CvType
.
CV_32FC1
);
gray255_32f
.
setTo
(
255.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
);
...
...
modules/java/android_test/src/org/opencv/test/coreTest.java
View file @
e1ad6b27
...
...
@@ -63,11 +63,14 @@ public class coreTest extends OpenCVTestCase {
}
public
void
testAddWeightedMatDoubleMatDoubleDoubleMatInt
()
{
fail
(
"Not yet implemented"
);
Mat
dst
=
new
Mat
();
core
.
addWeighted
(
gray1
,
126.0
,
gray127
,
1.0
,
2.0
,
dst
,
gray255_32f
.
depth
());
assertTrue
(
gray255_32f
.
depth
()
==
dst
.
depth
());
}
public
void
testAddWeightedMatDoubleMatDoubleDoubleMat
()
{
fail
(
"Not yet implemented"
);
core
.
addWeighted
(
gray1
,
126.0
,
gray127
,
1.0
,
2.0
,
dst_gray
);
assertMatEqual
(
gray255
,
dst_gray
);
}
public
void
testBitwise_andMatMatMatMat
()
{
...
...
@@ -164,6 +167,11 @@ public class coreTest extends OpenCVTestCase {
core
.
compare
(
gray0
,
gray1
,
cmp
,
core
.
CMP_EQ
);
assertMatEqual
(
cmp
,
gray0
);
core
.
compare
(
gray0
,
grayRnd
,
cmp
,
core
.
CMP_EQ
);
double
nBlackPixels
=
core
.
countNonZero
(
cmp
);
double
nNonBlackpixels
=
core
.
countNonZero
(
grayRnd
);
assertTrue
((
nBlackPixels
+
nNonBlackpixels
)
==
grayRnd
.
rows
()*
grayRnd
.
cols
());
}
public
void
testCompleteSymmMatBoolean
()
{
...
...
@@ -419,7 +427,8 @@ public class coreTest extends OpenCVTestCase {
}
public
void
testMulTransposedMatMatBooleanMat
()
{
fail
(
"Not yet implemented"
);
core
.
mulTransposed
(
grayRnd_32f
,
dst_gray_32f
,
true
,
grayRnd_32f
);
assertMatEqual
(
gray0_32f
,
dst_gray_32f
);
}
public
void
testMulTransposedMatMatBoolean
()
{
...
...
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