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
5c0c8107
Commit
5c0c8107
authored
Apr 04, 2012
by
Andrey Pavlenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Java API: fixing Objdetect tests
parent
5fefac7f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
23 deletions
+19
-23
Subdiv2DTest.java
...ndroid_test/src/org/opencv/test/imgproc/Subdiv2DTest.java
+2
-2
CascadeClassifierTest.java
.../src/org/opencv/test/objdetect/CascadeClassifierTest.java
+3
-5
ObjdetectTest.java
...oid_test/src/org/opencv/test/objdetect/ObjdetectTest.java
+14
-16
No files found.
modules/java/android_test/src/org/opencv/test/imgproc/Subdiv2DTest.java
View file @
5c0c8107
package
org
.
opencv
.
test
.
imgproc
;
package
org
.
opencv
.
test
.
imgproc
;
import
org.opencv.core.
Mat
;
import
org.opencv.core.
CvVectorFloat6
;
import
org.opencv.core.Point
;
import
org.opencv.core.Point
;
import
org.opencv.core.Rect
;
import
org.opencv.core.Rect
;
import
org.opencv.imgproc.Subdiv2D
;
import
org.opencv.imgproc.Subdiv2D
;
...
@@ -50,7 +50,7 @@ public class Subdiv2DTest extends OpenCVTestCase {
...
@@ -50,7 +50,7 @@ public class Subdiv2DTest extends OpenCVTestCase {
s2d
.
insert
(
new
Point
(
20
,
10
)
);
s2d
.
insert
(
new
Point
(
20
,
10
)
);
s2d
.
insert
(
new
Point
(
20
,
20
)
);
s2d
.
insert
(
new
Point
(
20
,
20
)
);
s2d
.
insert
(
new
Point
(
10
,
20
)
);
s2d
.
insert
(
new
Point
(
10
,
20
)
);
Mat
triangles
=
new
Mat
();
CvVectorFloat6
triangles
=
new
CvVectorFloat6
();
s2d
.
getTriangleList
(
triangles
);
s2d
.
getTriangleList
(
triangles
);
assertEquals
(
10
,
triangles
.
rows
());
assertEquals
(
10
,
triangles
.
rows
());
/*
/*
...
...
modules/java/android_test/src/org/opencv/test/objdetect/CascadeClassifierTest.java
View file @
5c0c8107
package
org
.
opencv
.
test
.
objdetect
;
package
org
.
opencv
.
test
.
objdetect
;
import
java.util.ArrayList
;
import
org.opencv.core.CvVectorRect
;
import
org.opencv.core.Mat
;
import
org.opencv.core.Mat
;
import
org.opencv.core.Rect
;
import
org.opencv.core.Size
;
import
org.opencv.core.Size
;
import
org.opencv.imgproc.Imgproc
;
import
org.opencv.imgproc.Imgproc
;
import
org.opencv.objdetect.CascadeClassifier
;
import
org.opencv.objdetect.CascadeClassifier
;
...
@@ -34,14 +32,14 @@ public class CascadeClassifierTest extends OpenCVTestCase {
...
@@ -34,14 +32,14 @@ public class CascadeClassifierTest extends OpenCVTestCase {
public
void
testDetectMultiScaleMatListOfRect
()
{
public
void
testDetectMultiScaleMatListOfRect
()
{
CascadeClassifier
cc
=
new
CascadeClassifier
(
OpenCVTestRunner
.
LBPCASCADE_FRONTALFACE_PATH
);
CascadeClassifier
cc
=
new
CascadeClassifier
(
OpenCVTestRunner
.
LBPCASCADE_FRONTALFACE_PATH
);
ArrayList
<
Rect
>
faces
=
new
ArrayList
<
Rect
>
();
CvVectorRect
faces
=
new
CvVectorRect
();
Mat
greyLena
=
new
Mat
();
Mat
greyLena
=
new
Mat
();
Imgproc
.
cvtColor
(
rgbLena
,
greyLena
,
Imgproc
.
COLOR_RGB2GRAY
);
Imgproc
.
cvtColor
(
rgbLena
,
greyLena
,
Imgproc
.
COLOR_RGB2GRAY
);
// TODO: doesn't detect with 1.1 scale
// TODO: doesn't detect with 1.1 scale
cc
.
detectMultiScale
(
greyLena
,
faces
,
1.09
,
3
,
Objdetect
.
CASCADE_SCALE_IMAGE
,
new
Size
(
30
,
30
),
new
Size
());
cc
.
detectMultiScale
(
greyLena
,
faces
,
1.09
,
3
,
Objdetect
.
CASCADE_SCALE_IMAGE
,
new
Size
(
30
,
30
),
new
Size
());
assertEquals
(
1
,
faces
.
size
());
assertEquals
(
1
,
faces
.
total
());
}
}
public
void
testDetectMultiScaleMatListOfRectDouble
()
{
public
void
testDetectMultiScaleMatListOfRectDouble
()
{
...
...
modules/java/android_test/src/org/opencv/test/objdetect/ObjdetectTest.java
View file @
5c0c8107
package
org
.
opencv
.
test
.
objdetect
;
package
org
.
opencv
.
test
.
objdetect
;
import
java.util.ArrayList
;
import
org.opencv.core.CvVectorRect
;
import
org.opencv.core.Rect
;
import
org.opencv.objdetect.Objdetect
;
import
org.opencv.objdetect.Objdetect
;
import
org.opencv.test.OpenCVTestCase
;
import
org.opencv.test.OpenCVTestCase
;
...
@@ -10,27 +8,27 @@ public class ObjdetectTest extends OpenCVTestCase {
...
@@ -10,27 +8,27 @@ public class ObjdetectTest extends OpenCVTestCase {
public
void
testGroupRectanglesListOfRectListOfIntegerInt
()
{
public
void
testGroupRectanglesListOfRectListOfIntegerInt
()
{
fail
(
"Not yet implemented"
);
fail
(
"Not yet implemented"
);
Rect
r
=
new
Rect
(
10
,
10
,
20
,
20
)
;
final
int
NUM
=
10
;
ArrayList
<
Rect
>
rects
=
new
ArrayList
<
Rect
>(
);
CvVectorRect
rects
=
new
CvVectorRect
(
NUM
);
for
(
int
i
=
0
;
i
<
10
;
i
++)
for
(
int
i
=
0
;
i
<
NUM
;
i
++)
rects
.
add
(
r
);
rects
.
put
(
i
,
0
,
10
,
10
,
20
,
20
);
int
groupThreshold
=
1
;
int
groupThreshold
=
1
;
Objdetect
.
groupRectangles
(
rects
,
null
,
groupThreshold
);
//TODO: second parameter should not be null
Objdetect
.
groupRectangles
(
rects
,
null
,
groupThreshold
);
//TODO: second parameter should not be null
assertEquals
(
1
,
rects
.
size
());
assertEquals
(
1
,
rects
.
total
());
}
}
public
void
testGroupRectanglesListOfRectListOfIntegerIntDouble
()
{
public
void
testGroupRectanglesListOfRectListOfIntegerIntDouble
()
{
fail
(
"Not yet implemented"
);
fail
(
"Not yet implemented"
);
Rect
r1
=
new
Rect
(
10
,
10
,
20
,
20
)
;
final
int
NUM
=
10
;
Rect
r2
=
new
Rect
(
10
,
10
,
25
,
25
);
CvVectorRect
rects
=
new
CvVectorRect
(
NUM
);
ArrayList
<
Rect
>
rects
=
new
ArrayList
<
Rect
>();
for
(
int
i
=
0
;
i
<
NUM
;
i
++)
for
(
int
i
=
0
;
i
<
10
;
i
++)
rects
.
put
(
i
,
0
,
10
,
10
,
20
,
20
);
rects
.
add
(
r1
);
for
(
int
i
=
0
;
i
<
10
;
i
++)
for
(
int
i
=
0
;
i
<
NUM
;
i
++)
rects
.
add
(
r2
);
rects
.
put
(
i
,
0
,
10
,
10
,
25
,
25
);
int
groupThreshold
=
1
;
int
groupThreshold
=
1
;
double
eps
=
0.2
;
double
eps
=
0.2
;
...
...
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