1
package org.opencv.test.video;
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;
13
public class VideoTest extends OpenCVTestCase {
15
private MatOfFloat err = null;
17
private MatOfPoint2f nextPts = null;
18
private MatOfPoint2f prevPts = null;
23
private MatOfByte status = null;
24
private Mat subLena1 = null;
25
private Mat subLena2 = null;
29
protected void setUp() throws Exception {
34
w = (int)(rgbLena.cols() / 2);
35
h = (int)(rgbLena.rows() / 2);
37
subLena1 = rgbLena.submat(shift1, h + shift1, shift1, w + shift1);
38
subLena2 = rgbLena.submat(shift2, h + shift2, shift2, w + shift2);
40
prevPts = new MatOfPoint2f(new Point(11d, 8d), new Point(5d, 5d), new Point(10d, 10d));
42
nextPts = new MatOfPoint2f();
43
status = new MatOfByte();
44
err = new MatOfFloat();
47
public void testCalcGlobalOrientation() {
48
fail("Not yet implemented");
51
public void testCalcMotionGradientMatMatMatDoubleDouble() {
52
fail("Not yet implemented");
55
public void testCalcMotionGradientMatMatMatDoubleDoubleInt() {
56
fail("Not yet implemented");
59
public void testCalcOpticalFlowFarneback() {
60
fail("Not yet implemented");
63
public void testCalcOpticalFlowPyrLKMatMatListOfPointListOfPointListOfByteListOfFloat() {
64
Video.calcOpticalFlowPyrLK(subLena1, subLena2, prevPts, nextPts, status, err);
65
assertEquals(3, Core.countNonZero(status));
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));
75
public void testCalcOpticalFlowPyrLKMatMatListOfPointListOfPointListOfByteListOfFloatSizeIntTermCriteriaDoubleIntDouble() {
76
fail("Not yet implemented");
79
public void testCamShift() {
80
fail("Not yet implemented");
83
public void testEstimateRigidTransform() {
84
fail("Not yet implemented");
87
public void testMeanShift() {
88
fail("Not yet implemented");
91
public void testSegmentMotion() {
92
fail("Not yet implemented");
95
public void testUpdateMotionHistory() {
96
fail("Not yet implemented");