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
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
26 deletions
+25
-26
OpenCVTestCase.java
...java/android_test/src/org/opencv/test/OpenCVTestCase.java
+7
-7
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
+6
-6
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 {
...
@@ -38,6 +38,7 @@ public class OpenCVTestCase extends TestCase {
// TODO: OpenCVTestCase refactorings
// TODO: OpenCVTestCase refactorings
// - rename matrices
// - rename matrices
// - create methods gray0() and create src1 explicitly
// - create some masks
// - create some masks
// - use truth member everywhere
// - use truth member everywhere
...
@@ -82,8 +83,7 @@ public class OpenCVTestCase extends TestCase {
...
@@ -82,8 +83,7 @@ public class OpenCVTestCase extends TestCase {
dst
=
new
Mat
();
dst
=
new
Mat
();
assertTrue
(
dst
.
empty
());
assertTrue
(
dst
.
empty
());
truth
=
new
Mat
();
truth
=
null
;
assertTrue
(
truth
.
empty
());
colorBlack
=
new
Scalar
(
0
);
colorBlack
=
new
Scalar
(
0
);
...
@@ -96,12 +96,12 @@ public class OpenCVTestCase extends TestCase {
...
@@ -96,12 +96,12 @@ public class OpenCVTestCase extends TestCase {
gray128
=
new
Mat
(
matSize
,
matSize
,
CvType
.
CV_8U
,
new
Scalar
(
128
));
gray128
=
new
Mat
(
matSize
,
matSize
,
CvType
.
CV_8U
,
new
Scalar
(
128
));
gray255
=
new
Mat
(
matSize
,
matSize
,
CvType
.
CV_8U
,
new
Scalar
(
255
));
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
);
grayRnd
=
new
Mat
(
matSize
,
matSize
,
CvType
.
CV_8U
);
Core
.
randu
(
grayRnd
,
0
,
256
);
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
));
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
));
gray1_32f
=
new
Mat
(
matSize
,
matSize
,
CvType
.
CV_32F
,
new
Scalar
(
1.0
));
gray3_32f
=
new
Mat
(
matSize
,
matSize
,
CvType
.
CV_32F
,
new
Scalar
(
3.0
));
gray3_32f
=
new
Mat
(
matSize
,
matSize
,
CvType
.
CV_32F
,
new
Scalar
(
3.0
));
...
@@ -112,9 +112,9 @@ public class OpenCVTestCase extends TestCase {
...
@@ -112,9 +112,9 @@ public class OpenCVTestCase extends TestCase {
grayRnd_32f
=
new
Mat
(
matSize
,
matSize
,
CvType
.
CV_32F
);
grayRnd_32f
=
new
Mat
(
matSize
,
matSize
,
CvType
.
CV_32F
);
Core
.
randu
(
grayRnd_32f
,
0
,
256
);
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_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
));
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
));
rgba0
=
new
Mat
(
matSize
,
matSize
,
CvType
.
CV_8UC4
,
Scalar
.
all
(
0
));
...
...
modules/java/android_test/src/org/opencv/test/calib3d/calib3dTest.java
View file @
43628ab8
...
@@ -245,8 +245,7 @@ public class calib3dTest extends OpenCVTestCase {
...
@@ -245,8 +245,7 @@ public class calib3dTest extends OpenCVTestCase {
List
<
Point
>
pts1
=
new
ArrayList
<
Point
>();
List
<
Point
>
pts1
=
new
ArrayList
<
Point
>();
List
<
Point
>
pts2
=
new
ArrayList
<
Point
>();
List
<
Point
>
pts2
=
new
ArrayList
<
Point
>();
int
minFundamentalMatPoints
=
9
;
// FIXME: probably should be 8 (see
int
minFundamentalMatPoints
=
9
;
// FIXME: probably should be 8 (see ticket #1262)
// ticket #1262)
for
(
int
i
=
0
;
i
<
minFundamentalMatPoints
;
i
++)
{
for
(
int
i
=
0
;
i
<
minFundamentalMatPoints
;
i
++)
{
double
x
=
Math
.
random
()
*
100
-
50
;
double
x
=
Math
.
random
()
*
100
-
50
;
double
y
=
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 {
...
@@ -141,15 +141,15 @@ public class RotatedRectTest extends OpenCVTestCase {
}
}
public
void
testRotatedRectDoubleArray
()
{
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
);
RotatedRect
rr
=
new
RotatedRect
(
vals
);
assertNotNull
(
rr
);
assertNotNull
(
rr
);
assertEquals
(
1
.,
rr
.
center
.
x
);
assertEquals
(
1.
5
,
rr
.
center
.
x
);
assertEquals
(
2
.,
rr
.
center
.
y
);
assertEquals
(
2.
6
,
rr
.
center
.
y
);
assertEquals
(
3
.,
rr
.
size
.
width
);
assertEquals
(
3.
7
,
rr
.
size
.
width
);
assertEquals
(
4
.,
rr
.
size
.
height
);
assertEquals
(
4.
2
,
rr
.
size
.
height
);
assertEquals
(
5
.,
rr
.
angle
);
assertEquals
(
5.
1
,
rr
.
angle
);
}
}
public
void
testRotatedRectPointSizeDouble
()
{
public
void
testRotatedRectPointSizeDouble
()
{
...
...
modules/java/android_test/src/org/opencv/test/imgproc/imgprocTest.java
View file @
43628ab8
...
@@ -526,17 +526,17 @@ public class imgprocTest extends OpenCVTestCase {
...
@@ -526,17 +526,17 @@ public class imgprocTest extends OpenCVTestCase {
public
void
testCornerSubPix
()
{
public
void
testCornerSubPix
()
{
Mat
img
=
new
Mat
(
matSize
,
matSize
,
CvType
.
CV_8U
,
new
Scalar
(
128
));
Mat
img
=
new
Mat
(
matSize
,
matSize
,
CvType
.
CV_8U
,
new
Scalar
(
128
));
Point
truthPosition
=
new
Point
(
img
.
cols
()/
2
,
img
.
rows
()/
2
);
Point
truthPosition
=
new
Point
(
img
.
cols
()
/
2
,
img
.
rows
()
/
2
);
Rect
r
=
new
Rect
(
new
Point
(
0
,
0
),
truthPosition
);
Rect
r
=
new
Rect
(
new
Point
(
0
,
0
),
truthPosition
);
Core
.
rectangle
(
img
,
r
.
tl
(),
r
.
br
(),
new
Scalar
(
0
),
-
1
/*TODO: CV_FILLED
*/
);
Core
.
rectangle
(
img
,
r
.
tl
(),
r
.
br
(),
new
Scalar
(
0
),
-
1
/* TODO: CV_FILLED
*/
);
List
<
Point
>
corners
=
new
ArrayList
<
Point
>();
List
<
Point
>
corners
=
new
ArrayList
<
Point
>();
corners
.
add
(
new
Point
(
truthPosition
.
x
+
1
,
truthPosition
.
y
+
1
));
corners
.
add
(
new
Point
(
truthPosition
.
x
+
1
,
truthPosition
.
y
+
1
));
Size
winSize
=
new
Size
(
2
,
2
);
Size
winSize
=
new
Size
(
2
,
2
);
Size
zeroZone
=
new
Size
(-
1
,
-
1
);
Size
zeroZone
=
new
Size
(-
1
,
-
1
);
TermCriteria
criteria
=
new
TermCriteria
(
2
/*TODO: CV_TERMCRIT_EPS
*/
,
0
,
0.01
);
TermCriteria
criteria
=
new
TermCriteria
(
2
/* TODO: CV_TERMCRIT_EPS
*/
,
0
,
0.01
);
Imgproc
.
cornerSubPix
(
img
,
corners
,
winSize
,
zeroZone
,
criteria
);
Imgproc
.
cornerSubPix
(
img
,
corners
,
winSize
,
zeroZone
,
criteria
);
assertPointEquals
(
truthPosition
,
corners
.
get
(
0
),
weakEPS
);
assertPointEquals
(
truthPosition
,
corners
.
get
(
0
),
weakEPS
);
...
@@ -1157,11 +1157,11 @@ public class imgprocTest extends OpenCVTestCase {
...
@@ -1157,11 +1157,11 @@ public class imgprocTest extends OpenCVTestCase {
cameraMatrix
.
put
(
1
,
0
,
0
,
1
,
2
);
cameraMatrix
.
put
(
1
,
0
,
0
,
1
,
2
);
cameraMatrix
.
put
(
2
,
0
,
0
,
0
,
1
);
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
(
0
,
0
,
0
,
0
,
0
);
truth
.
put
(
1
,
0
,
0
,
0
,
0
);
truth
.
put
(
1
,
0
,
0
,
0
,
0
);
truth
.
put
(
2
,
0
,
0
,
3
,
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
// TODO: No documentation for this function
// Imgproc.initWideAngleProjMap(cameraMatrix, distCoeffs, imageSize,
// Imgproc.initWideAngleProjMap(cameraMatrix, distCoeffs, imageSize,
// 5.0, m1type, truthput1, truthput2);
// 5.0, m1type, truthput1, truthput2);
...
...
modules/java/src/java/core+RotatedRect.java
View file @
43628ab8
...
@@ -26,11 +26,11 @@ public class RotatedRect {
...
@@ -26,11 +26,11 @@ public class RotatedRect {
public
void
set
(
double
[]
vals
)
{
public
void
set
(
double
[]
vals
)
{
if
(
vals
!=
null
)
{
if
(
vals
!=
null
)
{
center
.
x
=
vals
.
length
>
0
?
(
int
)
vals
[
0
]
:
0
;
center
.
x
=
vals
.
length
>
0
?
(
double
)
vals
[
0
]
:
0
;
center
.
x
=
vals
.
length
>
1
?
(
int
)
vals
[
1
]
:
0
;
center
.
y
=
vals
.
length
>
1
?
(
double
)
vals
[
1
]
:
0
;
size
.
width
=
vals
.
length
>
2
?
(
int
)
vals
[
2
]
:
0
;
size
.
width
=
vals
.
length
>
2
?
(
double
)
vals
[
2
]
:
0
;
size
.
height
=
vals
.
length
>
3
?
(
int
)
vals
[
3
]
:
0
;
size
.
height
=
vals
.
length
>
3
?
(
double
)
vals
[
3
]
:
0
;
angle
=
vals
.
length
>
4
?
(
int
)
vals
[
4
]
:
0
;
angle
=
vals
.
length
>
4
?
(
double
)
vals
[
4
]
:
0
;
}
else
{
}
else
{
center
.
x
=
0
;
center
.
x
=
0
;
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