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
89338a38
Commit
89338a38
authored
Apr 06, 2012
by
Ivan Korolev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed some bugs in the ImgprocTest.java module.
parent
6c308dac
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
22 deletions
+20
-22
ImgprocTest.java
...android_test/src/org/opencv/test/imgproc/ImgprocTest.java
+18
-20
Subdiv2DTest.java
...ndroid_test/src/org/opencv/test/imgproc/Subdiv2DTest.java
+2
-2
No files found.
modules/java/android_test/src/org/opencv/test/imgproc/ImgprocTest.java
View file @
89338a38
...
...
@@ -6,8 +6,11 @@ import java.util.List;
import
org.opencv.core.Core
;
import
org.opencv.core.CvType
;
import
org.opencv.core.CvVectorPoint2f
;
import
org.opencv.core.Mat
;
import
org.opencv.core.MatOfFloat
;
import
org.opencv.core.MatOfInt
;
import
org.opencv.core.MatOfPoint
;
import
org.opencv.core.MatOfPoint2f
;
import
org.opencv.core.Point
;
import
org.opencv.core.Rect
;
import
org.opencv.core.RotatedRect
;
...
...
@@ -142,14 +145,9 @@ public class ImgprocTest extends OpenCVTestCase {
}
public
void
testApproxPolyDP
()
{
CvVectorPoint2f
curve
=
new
CvVectorPoint2f
(
5
);
curve
.
add
(
new
Point
(
1
,
3
));
curve
.
add
(
new
Point
(
2
,
4
));
curve
.
add
(
new
Point
(
3
,
5
));
curve
.
add
(
new
Point
(
4
,
4
));
curve
.
add
(
new
Point
(
5
,
3
));
MatOfPoint2f
curve
=
new
MatOfPoint2f
(
new
Point
(
1
,
3
),
new
Point
(
2
,
4
),
new
Point
(
3
,
5
),
new
Point
(
4
,
4
),
new
Point
(
5
,
3
));
List
<
Point
>
approxCurve
=
new
ArrayList
<
Point
>
();
MatOfPoint2f
approxCurve
=
new
MatOfPoint2f
();
Imgproc
.
approxPolyDP
(
curve
,
approxCurve
,
EPS
,
true
);
...
...
@@ -158,11 +156,11 @@ public class ImgprocTest extends OpenCVTestCase {
approxCurveGold
.
add
(
new
Point
(
3
,
5
));
approxCurveGold
.
add
(
new
Point
(
5
,
3
));
assertListPointEquals
(
approxCurve
,
approxCurveGold
,
EPS
);
assertListPointEquals
(
approxCurve
.
toList
()
,
approxCurveGold
,
EPS
);
}
public
void
testArcLength
()
{
List
<
Point
>
curve
=
Arrays
.
asList
(
new
Point
(
1
,
3
),
new
Point
(
2
,
4
),
new
Point
(
3
,
5
),
new
Point
(
4
,
4
),
new
Point
(
5
,
3
));
MatOfPoint2f
curve
=
new
MatOfPoint2f
(
new
Point
(
1
,
3
),
new
Point
(
2
,
4
),
new
Point
(
3
,
5
),
new
Point
(
4
,
4
),
new
Point
(
5
,
3
));
double
arcLength
=
Imgproc
.
arcLength
(
curve
,
false
);
...
...
@@ -213,7 +211,7 @@ public class ImgprocTest extends OpenCVTestCase {
}
public
void
testBoundingRect
()
{
List
<
Point
>
points
=
Arrays
.
asLis
t
(
new
Point
(
0
,
0
),
new
Point
(
0
,
4
),
new
Point
(
4
,
0
),
new
Point
(
4
,
4
));
MatOfPoint
points
=
new
MatOfPoin
t
(
new
Point
(
0
,
0
),
new
Point
(
0
,
4
),
new
Point
(
4
,
0
),
new
Point
(
4
,
4
));
Point
p1
=
new
Point
(
1
,
1
);
Point
p2
=
new
Point
(-
5
,
-
2
);
...
...
@@ -244,9 +242,9 @@ public class ImgprocTest extends OpenCVTestCase {
public
void
testCalcBackProject
()
{
List
<
Mat
>
images
=
Arrays
.
asList
(
grayChess
);
List
<
Integer
>
channels
=
Arrays
.
asList
(
0
);
List
<
Integer
>
histSize
=
Arrays
.
asList
(
10
);
List
<
Float
>
ranges
=
Arrays
.
asList
(
0
f
,
256
f
);
MatOfInt
channels
=
new
MatOfInt
(
1
,
0
);
MatOfInt
histSize
=
new
MatOfInt
(
1
,
10
);
MatOfFloat
ranges
=
new
MatOfFloat
(
1
,
0
f
,
256
f
);
Mat
hist
=
new
Mat
();
Imgproc
.
calcHist
(
images
,
channels
,
new
Mat
(),
hist
,
histSize
,
ranges
);
...
...
@@ -261,9 +259,9 @@ public class ImgprocTest extends OpenCVTestCase {
public
void
testCalcHistListOfMatListOfIntegerMatMatListOfIntegerListOfFloat
()
{
List
<
Mat
>
images
=
Arrays
.
asList
(
gray128
);
List
<
Integer
>
channels
=
Arrays
.
asList
(
0
);
List
<
Integer
>
histSize
=
Arrays
.
asList
(
10
);
List
<
Float
>
ranges
=
Arrays
.
asList
(
0
f
,
256
f
);
MatOfInt
channels
=
new
MatOfInt
(
1
,
0
);
MatOfInt
histSize
=
new
MatOfInt
(
1
,
10
);
MatOfFloat
ranges
=
new
MatOfFloat
(
1
,
0
f
,
256
f
);
Mat
hist
=
new
Mat
();
Imgproc
.
calcHist
(
images
,
channels
,
new
Mat
(),
hist
,
histSize
,
ranges
);
...
...
@@ -278,9 +276,9 @@ public class ImgprocTest extends OpenCVTestCase {
public
void
testCalcHistListOfMatListOfIntegerMatMatListOfIntegerListOfFloat2d
()
{
List
<
Mat
>
images
=
Arrays
.
asList
(
gray255
,
gray128
);
List
<
Integer
>
channels
=
Arrays
.
asList
(
0
,
1
);
List
<
Integer
>
histSize
=
Arrays
.
asList
(
10
,
10
);
List
<
Float
>
ranges
=
Arrays
.
asList
(
0
f
,
256
f
,
0
f
,
256
f
);
MatOfInt
channels
=
new
MatOfInt
(
1
,
0
,
1
);
MatOfInt
histSize
=
new
MatOfInt
(
1
,
10
,
10
);
MatOfFloat
ranges
=
new
MatOfFloat
(
1
,
0
f
,
256
f
,
0
f
,
256
f
);
Mat
hist
=
new
Mat
();
Imgproc
.
calcHist
(
images
,
channels
,
new
Mat
(),
hist
,
histSize
,
ranges
);
...
...
modules/java/android_test/src/org/opencv/test/imgproc/Subdiv2DTest.java
View file @
89338a38
package
org
.
opencv
.
test
.
imgproc
;
import
org.opencv.core.
CvVectorFloat6
;
import
org.opencv.core.
MatOfFloat
;
import
org.opencv.core.Point
;
import
org.opencv.core.Rect
;
import
org.opencv.imgproc.Subdiv2D
;
...
...
@@ -50,7 +50,7 @@ public class Subdiv2DTest extends OpenCVTestCase {
s2d
.
insert
(
new
Point
(
20
,
10
)
);
s2d
.
insert
(
new
Point
(
20
,
20
)
);
s2d
.
insert
(
new
Point
(
10
,
20
)
);
CvVectorFloat6
triangles
=
new
CvVectorFloat6
();
MatOfFloat
triangles
=
new
MatOfFloat
();
s2d
.
getTriangleList
(
triangles
);
assertEquals
(
10
,
triangles
.
rows
());
/*
...
...
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