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
754a8c1b
Commit
754a8c1b
authored
Jul 28, 2011
by
Andrey Kamaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Java API: added more tests
parent
6b888ada
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
0 deletions
+23
-0
OpenCVTestCase.java
...java/android_test/src/org/opencv/test/OpenCVTestCase.java
+10
-0
SURFTest.java
...android_test/src/org/opencv/test/features2d/SURFTest.java
+0
-0
imgprocTest.java
...android_test/src/org/opencv/test/imgproc/imgprocTest.java
+13
-0
No files found.
modules/java/android_test/src/org/opencv/test/OpenCVTestCase.java
View file @
754a8c1b
...
...
@@ -7,6 +7,7 @@ import org.opencv.core.Mat;
import
org.opencv.core.Point
;
import
org.opencv.core.Scalar
;
import
org.opencv.core.Core
;
import
org.opencv.features2d.KeyPoint
;
import
org.opencv.highgui.Highgui
;
public
class
OpenCVTestCase
extends
TestCase
{
...
...
@@ -170,6 +171,15 @@ public class OpenCVTestCase extends TestCase {
public
static
void
assertMatNotEqual
(
Mat
expected
,
Mat
actual
,
double
eps
){
compareMats
(
expected
,
actual
,
eps
,
false
);
}
public
static
void
assertKeyPointEqual
(
KeyPoint
expected
,
KeyPoint
actual
,
double
eps
){
assertTrue
(
Math
.
hypot
(
expected
.
pt
.
x
-
actual
.
pt
.
x
,
expected
.
pt
.
y
-
actual
.
pt
.
y
)
<
eps
);
assertTrue
(
Math
.
abs
(
expected
.
size
-
actual
.
size
)
<
eps
);
assertTrue
(
Math
.
abs
(
expected
.
angle
-
actual
.
angle
)
<
eps
);
assertTrue
(
Math
.
abs
(
expected
.
response
-
actual
.
response
)
<
eps
);
assertEquals
(
expected
.
octave
,
actual
.
octave
);
assertEquals
(
expected
.
class_id
,
actual
.
class_id
);
}
static
private
void
compareMats
(
Mat
expected
,
Mat
actual
,
boolean
isEqualityMeasured
)
{
if
(
expected
.
type
()
!=
actual
.
type
()
||
expected
.
cols
()
!=
actual
.
cols
()
...
...
modules/java/android_test/src/org/opencv/test/features2d/SURFTest.java
View file @
754a8c1b
This diff is collapsed.
Click to expand it.
modules/java/android_test/src/org/opencv/test/imgproc/imgprocTest.java
View file @
754a8c1b
...
...
@@ -800,6 +800,19 @@ public class imgprocTest extends OpenCVTestCase {
assertMatEqual
(
mask
.
submat
(
1
,
matSize
+
1
,
1
,
matSize
+
1
),
img
);
}
public
void
testFloodFillMatMatPointScalar_WithoutMask
()
{
Mat
img
=
gray0
;
Core
.
circle
(
img
,
new
Point
(
matSize
/
2
,
matSize
/
2
),
3
,
new
Scalar
(
2
));
//TODO: ideally we should pass null instead of "new Mat()"
int
retval
=
Imgproc
.
floodFill
(
img
,
new
Mat
(),
new
Point
(
matSize
/
2
,
matSize
/
2
),
new
Scalar
(
1
));
Core
.
circle
(
img
,
new
Point
(
matSize
/
2
,
matSize
/
2
),
3
,
new
Scalar
(
0
));
assertEquals
(
Core
.
countNonZero
(
img
),
retval
);
}
public
void
testFloodFillMatMatPointScalarRect
()
{
fail
(
"Not yet implemented"
);
...
...
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