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
43628ab8
Commit
43628ab8
authored
Aug 03, 2011
by
Kirill Kornyakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
java: bugfix in RotatedRect, one test fixed
parent
69588dfa
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
39 deletions
+38
-39
OpenCVTestCase.java
...java/android_test/src/org/opencv/test/OpenCVTestCase.java
+8
-8
calib3dTest.java
...android_test/src/org/opencv/test/calib3d/calib3dTest.java
+1
-2
RotatedRectTest.java
...ndroid_test/src/org/opencv/test/core/RotatedRectTest.java
+6
-6
imgprocTest.java
...android_test/src/org/opencv/test/imgproc/imgprocTest.java
+18
-18
core+RotatedRect.java
modules/java/src/java/core+RotatedRect.java
+5
-5
No files found.
modules/java/android_test/src/org/opencv/test/OpenCVTestCase.java
View file @
43628ab8
...
...
@@ -38,6 +38,7 @@ public class OpenCVTestCase extends TestCase {
// TODO: OpenCVTestCase refactorings
// - rename matrices
// - create methods gray0() and create src1 explicitly
// - create some masks
// - use truth member everywhere
...
...
@@ -82,8 +83,7 @@ public class OpenCVTestCase extends TestCase {
dst
=
new
Mat
();
assertTrue
(
dst
.
empty
());
truth
=
new
Mat
();
assertTrue
(
truth
.
empty
());
truth
=
null
;
colorBlack
=
new
Scalar
(
0
);
...
...
@@ -96,11 +96,11 @@ public class OpenCVTestCase extends TestCase {
gray128
=
new
Mat
(
matSize
,
matSize
,
CvType
.
CV_8U
,
new
Scalar
(
128
));
gray255
=
new
Mat
(
matSize
,
matSize
,
CvType
.
CV_8U
,
new
Scalar
(
255
));
gray_16u_256
=
new
Mat
(
matSize
,
matSize
,
CvType
.
CV_16U
,
new
Scalar
(
256
));
gray_16s_1024
=
new
Mat
(
matSize
,
matSize
,
CvType
.
CV_16S
,
new
Scalar
(
1024
));
grayRnd
=
new
Mat
(
matSize
,
matSize
,
CvType
.
CV_8U
);
Core
.
randu
(
grayRnd
,
0
,
256
);
gray_16u_256
=
new
Mat
(
matSize
,
matSize
,
CvType
.
CV_16U
,
new
Scalar
(
256
));
gray_16s_1024
=
new
Mat
(
matSize
,
matSize
,
CvType
.
CV_16S
,
new
Scalar
(
1024
));
gray0_32f
=
new
Mat
(
matSize
,
matSize
,
CvType
.
CV_32F
,
new
Scalar
(
0.0
));
gray1_32f
=
new
Mat
(
matSize
,
matSize
,
CvType
.
CV_32F
,
new
Scalar
(
1.0
));
...
...
@@ -112,9 +112,9 @@ public class OpenCVTestCase extends TestCase {
grayRnd_32f
=
new
Mat
(
matSize
,
matSize
,
CvType
.
CV_32F
);
Core
.
randu
(
grayRnd_32f
,
0
,
256
);
gray0_32f_1d
=
new
Mat
(
1
,
matSize
,
CvType
.
CV_32F
,
new
Scalar
(
0.0
));
gray0_64f
=
new
Mat
(
matSize
,
matSize
,
CvType
.
CV_64F
,
new
Scalar
(
0.0
));
gray0_32f_1d
=
new
Mat
(
1
,
matSize
,
CvType
.
CV_32F
,
new
Scalar
(
0.0
));
gray0_64f_1d
=
new
Mat
(
1
,
matSize
,
CvType
.
CV_64F
,
new
Scalar
(
0.0
));
rgba0
=
new
Mat
(
matSize
,
matSize
,
CvType
.
CV_8UC4
,
Scalar
.
all
(
0
));
...
...
@@ -224,7 +224,7 @@ public class OpenCVTestCase extends TestCase {
assertEquals
(
expected
.
width
,
actual
.
width
);
assertEquals
(
expected
.
height
,
actual
.
height
);
}
public
static
void
assertMatEqual
(
Mat
m1
,
Mat
m2
)
{
compareMats
(
m1
,
m2
,
true
);
}
...
...
modules/java/android_test/src/org/opencv/test/calib3d/calib3dTest.java
View file @
43628ab8
...
...
@@ -245,8 +245,7 @@ public class calib3dTest extends OpenCVTestCase {
List
<
Point
>
pts1
=
new
ArrayList
<
Point
>();
List
<
Point
>
pts2
=
new
ArrayList
<
Point
>();
int
minFundamentalMatPoints
=
9
;
// FIXME: probably should be 8 (see
// ticket #1262)
int
minFundamentalMatPoints
=
9
;
// FIXME: probably should be 8 (see ticket #1262)
for
(
int
i
=
0
;
i
<
minFundamentalMatPoints
;
i
++)
{
double
x
=
Math
.
random
()
*
100
-
50
;
double
y
=
Math
.
random
()
*
100
-
50
;
...
...
modules/java/android_test/src/org/opencv/test/core/RotatedRectTest.java
View file @
43628ab8
...
...
@@ -141,15 +141,15 @@ public class RotatedRectTest extends OpenCVTestCase {
}
public
void
testRotatedRectDoubleArray
()
{
double
[]
vals
=
{
1
,
2
,
3
,
4
,
5
};
double
[]
vals
=
{
1
.5
,
2.6
,
3.7
,
4.2
,
5.1
};
RotatedRect
rr
=
new
RotatedRect
(
vals
);
assertNotNull
(
rr
);
assertEquals
(
1
.,
rr
.
center
.
x
);
assertEquals
(
2
.,
rr
.
center
.
y
);
assertEquals
(
3
.,
rr
.
size
.
width
);
assertEquals
(
4
.,
rr
.
size
.
height
);
assertEquals
(
5
.,
rr
.
angle
);
assertEquals
(
1.
5
,
rr
.
center
.
x
);
assertEquals
(
2.
6
,
rr
.
center
.
y
);
assertEquals
(
3.
7
,
rr
.
size
.
width
);
assertEquals
(
4.
2
,
rr
.
size
.
height
);
assertEquals
(
5.
1
,
rr
.
angle
);
}
public
void
testRotatedRectPointSizeDouble
()
{
...
...
modules/java/android_test/src/org/opencv/test/imgproc/imgprocTest.java
View file @
43628ab8
...
...
@@ -524,22 +524,22 @@ public class imgprocTest extends OpenCVTestCase {
}
public
void
testCornerSubPix
()
{
Mat
img
=
new
Mat
(
matSize
,
matSize
,
CvType
.
CV_8U
,
new
Scalar
(
128
));
Point
truthPosition
=
new
Point
(
img
.
cols
()/
2
,
img
.
rows
()/
2
);
Rect
r
=
new
Rect
(
new
Point
(
0
,
0
),
truthPosition
);
Core
.
rectangle
(
img
,
r
.
tl
(),
r
.
br
(),
new
Scalar
(
0
),
-
1
/*TODO: CV_FILLED
*/
);
List
<
Point
>
corners
=
new
ArrayList
<
Point
>();
corners
.
add
(
new
Point
(
truthPosition
.
x
+
1
,
truthPosition
.
y
+
1
));
Size
winSize
=
new
Size
(
2
,
2
);
Size
zeroZone
=
new
Size
(-
1
,
-
1
);
TermCriteria
criteria
=
new
TermCriteria
(
2
/*TODO: CV_TERMCRIT_EPS
*/
,
0
,
0.01
);
Imgproc
.
cornerSubPix
(
img
,
corners
,
winSize
,
zeroZone
,
criteria
);
assertPointEquals
(
truthPosition
,
corners
.
get
(
0
),
weakEPS
);
Mat
img
=
new
Mat
(
matSize
,
matSize
,
CvType
.
CV_8U
,
new
Scalar
(
128
));
Point
truthPosition
=
new
Point
(
img
.
cols
()
/
2
,
img
.
rows
()
/
2
);
Rect
r
=
new
Rect
(
new
Point
(
0
,
0
),
truthPosition
);
Core
.
rectangle
(
img
,
r
.
tl
(),
r
.
br
(),
new
Scalar
(
0
),
-
1
/* TODO: CV_FILLED
*/
);
List
<
Point
>
corners
=
new
ArrayList
<
Point
>();
corners
.
add
(
new
Point
(
truthPosition
.
x
+
1
,
truthPosition
.
y
+
1
));
Size
winSize
=
new
Size
(
2
,
2
);
Size
zeroZone
=
new
Size
(-
1
,
-
1
);
TermCriteria
criteria
=
new
TermCriteria
(
2
/* TODO: CV_TERMCRIT_EPS
*/
,
0
,
0.01
);
Imgproc
.
cornerSubPix
(
img
,
corners
,
winSize
,
zeroZone
,
criteria
);
assertPointEquals
(
truthPosition
,
corners
.
get
(
0
),
weakEPS
);
}
public
void
testCvtColorMatMatInt
()
{
...
...
@@ -1157,11 +1157,11 @@ public class imgprocTest extends OpenCVTestCase {
cameraMatrix
.
put
(
1
,
0
,
0
,
1
,
2
);
cameraMatrix
.
put
(
2
,
0
,
0
,
0
,
1
);
distCoeffs
.
put
(
0
,
0
,
1.0
,
3.0
,
2.0
,
4
);
truth
=
new
Mat
(
3
,
3
,
CvType
.
CV_32F
);
truth
.
put
(
0
,
0
,
0
,
0
,
0
);
truth
.
put
(
1
,
0
,
0
,
0
,
0
);
truth
.
put
(
2
,
0
,
0
,
3
,
0
);
distCoeffs
.
put
(
0
,
0
,
1.0
,
3.0
,
2.0
,
4
);
// TODO: No documentation for this function
// Imgproc.initWideAngleProjMap(cameraMatrix, distCoeffs, imageSize,
// 5.0, m1type, truthput1, truthput2);
...
...
modules/java/src/java/core+RotatedRect.java
View file @
43628ab8
...
...
@@ -26,11 +26,11 @@ public class RotatedRect {
public
void
set
(
double
[]
vals
)
{
if
(
vals
!=
null
)
{
center
.
x
=
vals
.
length
>
0
?
(
int
)
vals
[
0
]
:
0
;
center
.
x
=
vals
.
length
>
1
?
(
int
)
vals
[
1
]
:
0
;
size
.
width
=
vals
.
length
>
2
?
(
int
)
vals
[
2
]
:
0
;
size
.
height
=
vals
.
length
>
3
?
(
int
)
vals
[
3
]
:
0
;
angle
=
vals
.
length
>
4
?
(
int
)
vals
[
4
]
:
0
;
center
.
x
=
vals
.
length
>
0
?
(
double
)
vals
[
0
]
:
0
;
center
.
y
=
vals
.
length
>
1
?
(
double
)
vals
[
1
]
:
0
;
size
.
width
=
vals
.
length
>
2
?
(
double
)
vals
[
2
]
:
0
;
size
.
height
=
vals
.
length
>
3
?
(
double
)
vals
[
3
]
:
0
;
angle
=
vals
.
length
>
4
?
(
double
)
vals
[
4
]
:
0
;
}
else
{
center
.
x
=
0
;
center
.
x
=
0
;
...
...
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