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
b99c5db1
Commit
b99c5db1
authored
Jul 29, 2011
by
Andrey Pavlenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Java API: tests for polylines() and goodFeaturesToTrack(), fix of GFTT corners arg type
parent
418bc6db
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
84 additions
and
13 deletions
+84
-13
coreTest.java
.../java/android_test/src/org/opencv/test/core/coreTest.java
+43
-3
imgprocTest.java
...android_test/src/org/opencv/test/imgproc/imgprocTest.java
+40
-10
gen_java.py
modules/java/gen_java.py
+1
-0
No files found.
modules/java/android_test/src/org/opencv/test/core/coreTest.java
View file @
b99c5db1
...
...
@@ -1243,15 +1243,55 @@ public class coreTest extends OpenCVTestCase {
}
public
void
testPolylinesMatListOfMatBooleanScalar
()
{
fail
(
"Not yet implemented"
);
Mat
img
=
gray0
;
List
<
Point
>
pts
=
new
ArrayList
<
Point
>();
pts
.
add
(
new
Point
(
1
,
1
));
pts
.
add
(
new
Point
(
7
,
1
));
pts
.
add
(
new
Point
(
7
,
6
));
pts
.
add
(
new
Point
(
1
,
6
));
List
<
Mat
>
mats
=
new
ArrayList
<
Mat
>();
mats
.
add
(
Converters
.
vector_Point_to_Mat
(
pts
)
);
assertEquals
(
0
,
Core
.
countNonZero
(
img
));
Core
.
polylines
(
img
,
mats
,
true
,
new
Scalar
(
100
));
assertEquals
(
22
,
Core
.
countNonZero
(
img
));
Core
.
polylines
(
img
,
mats
,
false
,
new
Scalar
(
0
));
assertEquals
(
4
,
Core
.
countNonZero
(
img
));
}
public
void
testPolylinesMatListOfMatBooleanScalarInt
()
{
fail
(
"Not yet implemented"
);
Mat
img
=
gray0
;
List
<
Point
>
pts
=
new
ArrayList
<
Point
>();
pts
.
add
(
new
Point
(
1
,
1
));
pts
.
add
(
new
Point
(
7
,
1
));
pts
.
add
(
new
Point
(
7
,
6
));
pts
.
add
(
new
Point
(
1
,
6
));
List
<
Mat
>
mats
=
new
ArrayList
<
Mat
>();
mats
.
add
(
Converters
.
vector_Point_to_Mat
(
pts
)
);
assertEquals
(
0
,
Core
.
countNonZero
(
img
));
Core
.
polylines
(
img
,
mats
,
true
,
new
Scalar
(
100
),
2
);
assertEquals
(
62
,
Core
.
countNonZero
(
img
));
}
public
void
testPolylinesMatListOfMatBooleanScalarIntInt
()
{
fail
(
"Not yet implemented"
);
Mat
img
=
gray0
;
List
<
Point
>
pts
=
new
ArrayList
<
Point
>();
List
<
Point
>
pts2
=
new
ArrayList
<
Point
>();
pts
.
add
(
new
Point
(
1
,
1
));
pts2
.
add
(
new
Point
(
2
,
2
));
pts
.
add
(
new
Point
(
7
,
1
));
pts2
.
add
(
new
Point
(
14
,
2
));
pts
.
add
(
new
Point
(
7
,
6
));
pts2
.
add
(
new
Point
(
14
,
12
));
pts
.
add
(
new
Point
(
1
,
6
));
pts2
.
add
(
new
Point
(
2
,
12
));
List
<
Mat
>
mats
=
new
ArrayList
<
Mat
>();
List
<
Mat
>
mats2
=
new
ArrayList
<
Mat
>();
mats
.
add
(
Converters
.
vector_Point_to_Mat
(
pts
)
);
mats2
.
add
(
Converters
.
vector_Point_to_Mat
(
pts2
)
);
assertTrue
(
0
==
Core
.
countNonZero
(
img
));
Core
.
polylines
(
img
,
mats
,
true
,
new
Scalar
(
100
),
2
,
8
,
0
);
assertFalse
(
0
==
Core
.
countNonZero
(
img
));
Core
.
polylines
(
img
,
mats2
,
true
,
new
Scalar
(
0
),
2
,
8
,
1
);
assertTrue
(
0
==
Core
.
countNonZero
(
img
));
}
public
void
testPolylinesMatListOfMatBooleanScalarIntIntInt
()
{
...
...
modules/java/android_test/src/org/opencv/test/imgproc/imgprocTest.java
View file @
b99c5db1
...
...
@@ -14,6 +14,7 @@ import org.opencv.core.Size;
import
org.opencv.imgproc.Imgproc
;
import
org.opencv.test.OpenCVTestCase
;
public
class
imgprocTest
extends
OpenCVTestCase
{
private
Mat
gray_64f_2
;
...
...
@@ -1000,29 +1001,58 @@ public class imgprocTest extends OpenCVTestCase {
}
public
void
testGoodFeaturesToTrackMatMatIntDoubleDouble
()
{
Mat
src
=
new
Mat
(
matSize
,
matSize
,
CvType
.
CV_32FC1
,
new
Scalar
(
2.0
))
;
Mat
corners
=
new
Mat
(
1
,
4
,
CvType
.
CV_32FC2
);
corners
.
put
(
0
,
0
,
1.0
,
1.0
,
6.0
,
1.0
,
6.0
,
1.0
,
6.0
,
6.0
);
Mat
src
=
gray0
;
Core
.
rectangle
(
src
,
new
Point
(
2
,
2
),
new
Point
(
8
,
8
),
new
Scalar
(
100
),
-
1
);
List
<
Point
>
lp
=
new
ArrayList
<
Point
>(
);
Imgproc
.
goodFeaturesToTrack
(
src
,
dst
,
100
,
0.01
,
5.0
);
// TODO : How do we test this?
fail
(
"Not yet implemented"
);
Imgproc
.
goodFeaturesToTrack
(
src
,
lp
,
100
,
0.01
,
3
);
assertEquals
(
4
,
lp
.
size
()
);
}
public
void
testGoodFeaturesToTrackMatMatIntDoubleDoubleMat
()
{
fail
(
"Not yet implemented"
);
Mat
src
=
gray128
;
Point
tl
=
new
Point
(
2
,
2
);
Point
br
=
new
Point
(
8
,
8
);
Scalar
color
=
new
Scalar
(
100
);
Core
.
rectangle
(
src
,
tl
,
br
,
color
,
-
1
);
Mat
mask
=
gray0
;
Core
.
circle
(
mask
,
tl
,
3
,
color
,
-
1
);
List
<
Point
>
lp
=
new
ArrayList
<
Point
>();
Imgproc
.
goodFeaturesToTrack
(
src
,
lp
,
100
,
0.01
,
3
,
mask
);
assertEquals
(
1
,
lp
.
size
());
}
public
void
testGoodFeaturesToTrackMatMatIntDoubleDoubleMatInt
()
{
fail
(
"Not yet implemented"
);
Mat
src
=
gray0
;
Core
.
rectangle
(
src
,
new
Point
(
2
,
2
),
new
Point
(
8
,
8
),
new
Scalar
(
100
),
-
1
);
List
<
Point
>
lp
=
new
ArrayList
<
Point
>();
Imgproc
.
goodFeaturesToTrack
(
src
,
lp
,
100
,
0.01
,
3
,
gray1
,
4
);
assertEquals
(
4
,
lp
.
size
());
}
public
void
testGoodFeaturesToTrackMatMatIntDoubleDoubleMatIntBoolean
()
{
fail
(
"Not yet implemented"
);
Mat
src
=
gray0
;
Core
.
rectangle
(
src
,
new
Point
(
2
,
2
),
new
Point
(
8
,
8
),
new
Scalar
(
100
),
-
1
);
List
<
Point
>
lp
=
new
ArrayList
<
Point
>();
Imgproc
.
goodFeaturesToTrack
(
src
,
lp
,
100
,
0.01
,
3
,
gray1
,
4
,
true
);
assertEquals
(
4
,
lp
.
size
());
}
public
void
testGoodFeaturesToTrackMatMatIntDoubleDoubleMatIntBooleanDouble
()
{
fail
(
"Not yet implemented"
);
Mat
src
=
gray0
;
Core
.
rectangle
(
src
,
new
Point
(
2
,
2
),
new
Point
(
8
,
8
),
new
Scalar
(
100
),
-
1
);
List
<
Point
>
lp
=
new
ArrayList
<
Point
>();
Imgproc
.
goodFeaturesToTrack
(
src
,
lp
,
100
,
0.01
,
3
,
gray1
,
4
,
true
,
0
);
assertEquals
(
4
,
lp
.
size
());
}
public
void
testGrabCutMatMatRectMatMatInt
()
{
...
...
modules/java/gen_java.py
View file @
b99c5db1
...
...
@@ -457,6 +457,7 @@ func_arg_fix = {
'randu'
:
{
'low'
:
'Scalar'
,
'high'
:
'Scalar'
,
},
'randn'
:
{
'mean'
:
'Scalar'
,
'stddev'
:
'Scalar'
,
},
'inRange'
:
{
'lowerb'
:
'Scalar'
,
'upperb'
:
'Scalar'
,
},
'goodFeaturesToTrack'
:
{
'corners'
:
'vector_Point'
},
},
# '', i.e. empty class
}
# func_arg_fix
...
...
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