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
66e79167
Commit
66e79167
authored
Aug 03, 2011
by
Kirill Kornyakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
java tests: updated testFillConvexPolyMatMatScalarIntInt, testFitEllipse colorWhite added
parent
c57799a8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
23 deletions
+19
-23
OpenCVTestCase.java
...java/android_test/src/org/opencv/test/OpenCVTestCase.java
+2
-0
coreTest.java
.../java/android_test/src/org/opencv/test/core/coreTest.java
+13
-15
imgprocTest.java
...android_test/src/org/opencv/test/imgproc/imgprocTest.java
+4
-8
No files found.
modules/java/android_test/src/org/opencv/test/OpenCVTestCase.java
View file @
66e79167
...
...
@@ -31,6 +31,7 @@ public class OpenCVTestCase extends TestCase {
protected
static
Mat
truth
;
protected
static
Scalar
colorBlack
;
protected
static
Scalar
colorWhite
;
// Naming notation: <channels info>_[depth]_[dimensions]_value
// examples: gray0 - single channel 8U 2d Mat filled with 0
...
...
@@ -87,6 +88,7 @@ public class OpenCVTestCase extends TestCase {
truth
=
null
;
colorBlack
=
new
Scalar
(
0
);
colorWhite
=
new
Scalar
(
255
,
255
,
255
);
gray0
=
new
Mat
(
matSize
,
matSize
,
CvType
.
CV_8U
,
new
Scalar
(
0
));
gray1
=
new
Mat
(
matSize
,
matSize
,
CvType
.
CV_8U
,
new
Scalar
(
1
));
...
...
modules/java/android_test/src/org/opencv/test/core/coreTest.java
View file @
66e79167
...
...
@@ -3,7 +3,6 @@ package org.opencv.test.core;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.opencv.utils.Converters
;
import
org.opencv.core.Core
;
import
org.opencv.core.CvException
;
import
org.opencv.core.CvType
;
...
...
@@ -12,6 +11,7 @@ import org.opencv.core.Point;
import
org.opencv.core.Rect
;
import
org.opencv.core.Scalar
;
import
org.opencv.test.OpenCVTestCase
;
import
org.opencv.utils.Converters
;
public
class
coreTest
extends
OpenCVTestCase
{
...
...
@@ -503,25 +503,26 @@ public class coreTest extends OpenCVTestCase {
}
public
void
testFillConvexPolyMatMatScalarIntInt
()
{
List
<
Point
>
lp
=
new
ArrayList
<
Point
>(
4
);
List
<
Point
>
lp
=
new
ArrayList
<
Point
>();
lp
.
add
(
new
Point
(
1
,
1
));
lp
.
add
(
new
Point
(
5
,
1
));
lp
.
add
(
new
Point
(
5
,
8
));
lp
.
add
(
new
Point
(
1
,
8
));
lp
.
add
(
new
Point
(
1
,
8
));
Mat
points
=
Converters
.
vector_Point_to_Mat
(
lp
);
List
<
Point
>
lp2
=
new
ArrayList
<
Point
>(
4
);
lp2
.
add
(
new
Point
(
2
,
2
));
List
<
Point
>
lp2
=
new
ArrayList
<
Point
>();
lp2
.
add
(
new
Point
(
0
,
0
));
lp2
.
add
(
new
Point
(
10
,
2
));
lp2
.
add
(
new
Point
(
10
,
1
7
));
// TODO: don't know why '16' fails the test
lp2
.
add
(
new
Point
(
2
,
1
7
));
// TODO: don't know why '16' fails the test
lp2
.
add
(
new
Point
(
10
,
1
6
));
lp2
.
add
(
new
Point
(
2
,
1
6
));
Mat
points2
=
Converters
.
vector_Point_to_Mat
(
lp2
);
assertTrue
(
0
==
Core
.
countNonZero
(
gray0
));
Core
.
fillConvexPoly
(
gray0
,
points
,
new
Scalar
(
150
),
4
,
0
);
assertEquals
(
0
,
Core
.
countNonZero
(
gray0
));
Core
.
fillConvexPoly
(
gray0
,
points
,
colorWhite
,
4
/*TODO: lineType*/
,
0
);
assertTrue
(
0
<
Core
.
countNonZero
(
gray0
));
Core
.
fillConvexPoly
(
gray0
,
points2
,
new
Scalar
(
0
),
4
,
1
);
assert
True
(
0
==
Core
.
countNonZero
(
gray0
));
Core
.
fillConvexPoly
(
gray0
,
points2
,
colorBlack
,
4
/*TODO: lineType*/
,
0
);
assert
Equals
(
0
,
Core
.
countNonZero
(
gray0
));
}
public
void
testFillPolyMatListOfMatScalar
()
{
...
...
@@ -1152,14 +1153,11 @@ public class coreTest extends OpenCVTestCase {
public
void
testPerspectiveTransform
()
{
Mat
src
=
new
Mat
(
matSize
,
matSize
,
CvType
.
CV_32FC2
);
Core
.
randu
(
src
,
0
,
256
);
// FIXME: use Mat.diag
Mat
transformMatrix
=
Mat
.
eye
(
3
,
3
,
CvType
.
CV_32F
);
Core
.
perspectiveTransform
(
src
,
dst
,
transformMatrix
);
assertMatEqual
(
src
,
dst
,
EPS
);
}
...
...
modules/java/android_test/src/org/opencv/test/imgproc/imgprocTest.java
View file @
66e79167
...
...
@@ -14,7 +14,6 @@ import org.opencv.core.Size;
import
org.opencv.core.TermCriteria
;
import
org.opencv.imgproc.Imgproc
;
import
org.opencv.test.OpenCVTestCase
;
import
org.opencv.test.OpenCVTestRunner
;
public
class
imgprocTest
extends
OpenCVTestCase
{
...
...
@@ -443,8 +442,8 @@ public class imgprocTest extends OpenCVTestCase {
int
ksize
=
5
;
// TODO: eigen vals and vectors returned = 0 for most src matrices
truth
=
new
Mat
(
imgprocSz
,
imgprocSz
,
CvType
.
CV_32FC
(
6
),
new
Scalar
(
0
));
Imgproc
.
cornerEigenValsAndVecs
(
src
,
dst
,
blockSize
,
ksize
);
truth
=
new
Mat
(
imgprocSz
,
imgprocSz
,
CvType
.
CV_32FC
(
6
),
new
Scalar
(
0
));
assertMatEqual
(
truth
,
dst
,
EPS
);
}
...
...
@@ -767,15 +766,15 @@ public class imgprocTest extends OpenCVTestCase {
}
public
void
testFitEllipse
()
{
Mat
points
=
new
Mat
(
1
,
5
,
CvType
.
CV_32FC2
);
// TODO: use the list of Points
Mat
points
=
new
Mat
(
1
,
5
,
CvType
.
CV_32FC2
);
points
.
put
(
0
,
0
,
0.0
,
0.0
,
-
1.0
,
1.0
,
1.0
,
1.0
,
1.0
,
-
1.0
,
-
1.0
,
-
1.0
);
RotatedRect
rrect
=
new
RotatedRect
();
rrect
=
Imgproc
.
fitEllipse
(
points
);
assertEquals
(
0.0
,
rrect
.
center
.
x
);
assertEquals
(
0.0
,
rrect
.
center
.
y
);
assertEquals
(
2.
0
,
rrect
.
size
.
width
);
assertEquals
(
2.
0
,
rrect
.
size
.
height
);
assertEquals
(
2.
53
,
rrect
.
size
.
width
,
EPS
);
assertEquals
(
2.
53
,
rrect
.
size
.
height
,
EPS
);
}
public
void
testFitLine
()
{
...
...
@@ -1414,8 +1413,6 @@ public class imgprocTest extends OpenCVTestCase {
points
.
add
(
new
Point
(
1
,
0
));
points
.
add
(
new
Point
(
0
,
1
));
OpenCVTestRunner
.
Log
(
points
.
toString
());
Point
actualCenter
=
new
Point
();
float
radius
=
347.0f
;
// FIXME: Unexpected radius is returned i.e 0
Imgproc
.
minEnclosingCircle
(
points
,
actualCenter
,
radius
);
...
...
@@ -1424,7 +1421,6 @@ public class imgprocTest extends OpenCVTestCase {
assertEquals
(
truthCenter
,
actualCenter
);
float
truthRadius
=
1.0f
;
OpenCVTestRunner
.
Log
(
""
+
radius
);
assertEquals
(
truthRadius
,
radius
,
weakEPS
);
}
...
...
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