Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Tetragramm
GitHub Repository: Tetragramm/opencv
Path: blob/master/modules/video/misc/java/test/VideoTest.java
16363 views
1
package org.opencv.test.video;
2
3
import org.opencv.core.Core;
4
import org.opencv.core.Mat;
5
import org.opencv.core.MatOfByte;
6
import org.opencv.core.MatOfFloat;
7
import org.opencv.core.MatOfPoint2f;
8
import org.opencv.core.Point;
9
import org.opencv.core.Size;
10
import org.opencv.test.OpenCVTestCase;
11
import org.opencv.video.Video;
12
13
public class VideoTest extends OpenCVTestCase {
14
15
private MatOfFloat err = null;
16
private int h;
17
private MatOfPoint2f nextPts = null;
18
private MatOfPoint2f prevPts = null;
19
20
private int shift1;
21
private int shift2;
22
23
private MatOfByte status = null;
24
private Mat subLena1 = null;
25
private Mat subLena2 = null;
26
private int w;
27
28
@Override
29
protected void setUp() throws Exception {
30
super.setUp();
31
32
shift1 = 10;
33
shift2 = 17;
34
w = (int)(rgbLena.cols() / 2);
35
h = (int)(rgbLena.rows() / 2);
36
37
subLena1 = rgbLena.submat(shift1, h + shift1, shift1, w + shift1);
38
subLena2 = rgbLena.submat(shift2, h + shift2, shift2, w + shift2);
39
40
prevPts = new MatOfPoint2f(new Point(11d, 8d), new Point(5d, 5d), new Point(10d, 10d));
41
42
nextPts = new MatOfPoint2f();
43
status = new MatOfByte();
44
err = new MatOfFloat();
45
}
46
47
public void testCalcGlobalOrientation() {
48
fail("Not yet implemented");
49
}
50
51
public void testCalcMotionGradientMatMatMatDoubleDouble() {
52
fail("Not yet implemented");
53
}
54
55
public void testCalcMotionGradientMatMatMatDoubleDoubleInt() {
56
fail("Not yet implemented");
57
}
58
59
public void testCalcOpticalFlowFarneback() {
60
fail("Not yet implemented");
61
}
62
63
public void testCalcOpticalFlowPyrLKMatMatListOfPointListOfPointListOfByteListOfFloat() {
64
Video.calcOpticalFlowPyrLK(subLena1, subLena2, prevPts, nextPts, status, err);
65
assertEquals(3, Core.countNonZero(status));
66
}
67
68
public void testCalcOpticalFlowPyrLKMatMatListOfPointListOfPointListOfByteListOfFloatSize() {
69
Size sz = new Size(3, 3);
70
Video.calcOpticalFlowPyrLK(subLena1, subLena2, prevPts, nextPts, status, err, sz, 3);
71
assertEquals(0, Core.countNonZero(status));
72
}
73
74
75
public void testCalcOpticalFlowPyrLKMatMatListOfPointListOfPointListOfByteListOfFloatSizeIntTermCriteriaDoubleIntDouble() {
76
fail("Not yet implemented");
77
}
78
79
public void testCamShift() {
80
fail("Not yet implemented");
81
}
82
83
public void testEstimateRigidTransform() {
84
fail("Not yet implemented");
85
}
86
87
public void testMeanShift() {
88
fail("Not yet implemented");
89
}
90
91
public void testSegmentMotion() {
92
fail("Not yet implemented");
93
}
94
95
public void testUpdateMotionHistory() {
96
fail("Not yet implemented");
97
}
98
99
}
100
101