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
5fefac7f
Commit
5fefac7f
authored
Apr 04, 2012
by
Andrey Pavlenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Java API: fixing Highgui and Video tests
parent
cd8dfd6c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
24 deletions
+18
-24
HighguiTest.java
...android_test/src/org/opencv/test/highgui/HighguiTest.java
+5
-7
VideoTest.java
...ava/android_test/src/org/opencv/test/video/VideoTest.java
+13
-17
No files found.
modules/java/android_test/src/org/opencv/test/highgui/HighguiTest.java
View file @
5fefac7f
package
org
.
opencv
.
test
.
highgui
;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.opencv.core.CvVectorByte
;
import
org.opencv.highgui.Highgui
;
import
org.opencv.test.OpenCVTestCase
;
import
org.opencv.test.OpenCVTestRunner
;
...
...
@@ -14,10 +12,10 @@ public class HighguiTest extends OpenCVTestCase {
}
public
void
testImencodeStringMatListOfByte
()
{
List
<
Byte
>
buf
=
new
ArrayList
<
Byte
>
();
assertEquals
(
0
,
buf
.
size
());
assertTrue
(
Highgui
.
imencode
(
".jpg"
,
gray127
,
buf
)
);
assertFalse
(
0
==
buf
.
size
());
CvVectorByte
buff
=
new
CvVectorByte
();
assertEquals
(
0
,
buf
f
.
size
());
assertTrue
(
Highgui
.
imencode
(
".jpg"
,
gray127
,
buf
f
)
);
assertFalse
(
0
==
buf
f
.
total
());
}
public
void
testImencodeStringMatListOfByteListOfInteger
()
{
...
...
modules/java/android_test/src/org/opencv/test/video/VideoTest.java
View file @
5fefac7f
package
org
.
opencv
.
test
.
video
;
import
org.opencv.core.Core
;
import
org.opencv.core.CvVectorByte
;
import
org.opencv.core.CvVectorFloat
;
import
org.opencv.core.CvVectorPoint2f
;
import
org.opencv.core.Mat
;
import
org.opencv.core.Point
;
import
org.opencv.core.Size
;
import
org.opencv.test.OpenCVTestCase
;
import
org.opencv.utils.Converters
;
import
org.opencv.video.Video
;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
VideoTest
extends
OpenCVTestCase
{
private
List
<
Float
>
err
=
null
;
private
CvVectorFloat
err
=
null
;
private
int
h
;
private
List
<
Point
>
nextPts
=
null
;
List
<
Point
>
prevPts
=
null
;
private
CvVectorPoint2f
nextPts
=
null
;
private
CvVectorPoint2f
prevPts
=
null
;
private
int
shift1
;
private
int
shift2
;
private
List
<
Byte
>
status
=
null
;
private
CvVectorByte
status
=
null
;
private
Mat
subLena1
=
null
;
private
Mat
subLena2
=
null
;
private
int
w
;
...
...
@@ -38,14 +37,11 @@ public class VideoTest extends OpenCVTestCase {
subLena1
=
rgbLena
.
submat
(
shift1
,
h
+
shift1
,
shift1
,
w
+
shift1
);
subLena2
=
rgbLena
.
submat
(
shift2
,
h
+
shift2
,
shift2
,
w
+
shift2
);
prevPts
=
new
ArrayList
<
Point
>();
prevPts
.
add
(
new
Point
(
11.0
,
8.0
));
prevPts
.
add
(
new
Point
(
5.0
,
5.0
));
prevPts
.
add
(
new
Point
(
10.0
,
10.0
));
prevPts
=
new
CvVectorPoint2f
(
new
Point
(
11
d
,
8
d
),
new
Point
(
5
d
,
5
d
),
new
Point
(
10
d
,
10
d
));
nextPts
=
new
ArrayList
<
Point
>
();
status
=
new
ArrayList
<
Byte
>
();
err
=
new
ArrayList
<
Float
>
();
nextPts
=
new
CvVectorPoint2f
();
status
=
new
CvVectorByte
();
err
=
new
CvVectorFloat
();
}
public
void
testCalcGlobalOrientation
()
{
...
...
@@ -66,13 +62,13 @@ public class VideoTest extends OpenCVTestCase {
public
void
testCalcOpticalFlowPyrLKMatMatListOfPointListOfPointListOfByteListOfFloat
()
{
Video
.
calcOpticalFlowPyrLK
(
subLena1
,
subLena2
,
prevPts
,
nextPts
,
status
,
err
);
assertEquals
(
3
,
Core
.
countNonZero
(
Converters
.
vector_uchar_to_Mat
(
status
)
));
assertEquals
(
3
,
Core
.
countNonZero
(
status
));
}
public
void
testCalcOpticalFlowPyrLKMatMatListOfPointListOfPointListOfByteListOfFloatSize
()
{
Size
sz
=
new
Size
(
3
,
3
);
Video
.
calcOpticalFlowPyrLK
(
subLena1
,
subLena2
,
prevPts
,
nextPts
,
status
,
err
,
sz
,
3
);
assertEquals
(
0
,
Core
.
countNonZero
(
Converters
.
vector_uchar_to_Mat
(
status
)
));
assertEquals
(
0
,
Core
.
countNonZero
(
status
));
}
...
...
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