Path: blob/master/modules/video/misc/java/test/VideoTest.java
16363 views
package org.opencv.test.video;12import org.opencv.core.Core;3import org.opencv.core.Mat;4import org.opencv.core.MatOfByte;5import org.opencv.core.MatOfFloat;6import org.opencv.core.MatOfPoint2f;7import org.opencv.core.Point;8import org.opencv.core.Size;9import org.opencv.test.OpenCVTestCase;10import org.opencv.video.Video;1112public class VideoTest extends OpenCVTestCase {1314private MatOfFloat err = null;15private int h;16private MatOfPoint2f nextPts = null;17private MatOfPoint2f prevPts = null;1819private int shift1;20private int shift2;2122private MatOfByte status = null;23private Mat subLena1 = null;24private Mat subLena2 = null;25private int w;2627@Override28protected void setUp() throws Exception {29super.setUp();3031shift1 = 10;32shift2 = 17;33w = (int)(rgbLena.cols() / 2);34h = (int)(rgbLena.rows() / 2);3536subLena1 = rgbLena.submat(shift1, h + shift1, shift1, w + shift1);37subLena2 = rgbLena.submat(shift2, h + shift2, shift2, w + shift2);3839prevPts = new MatOfPoint2f(new Point(11d, 8d), new Point(5d, 5d), new Point(10d, 10d));4041nextPts = new MatOfPoint2f();42status = new MatOfByte();43err = new MatOfFloat();44}4546public void testCalcGlobalOrientation() {47fail("Not yet implemented");48}4950public void testCalcMotionGradientMatMatMatDoubleDouble() {51fail("Not yet implemented");52}5354public void testCalcMotionGradientMatMatMatDoubleDoubleInt() {55fail("Not yet implemented");56}5758public void testCalcOpticalFlowFarneback() {59fail("Not yet implemented");60}6162public void testCalcOpticalFlowPyrLKMatMatListOfPointListOfPointListOfByteListOfFloat() {63Video.calcOpticalFlowPyrLK(subLena1, subLena2, prevPts, nextPts, status, err);64assertEquals(3, Core.countNonZero(status));65}6667public void testCalcOpticalFlowPyrLKMatMatListOfPointListOfPointListOfByteListOfFloatSize() {68Size sz = new Size(3, 3);69Video.calcOpticalFlowPyrLK(subLena1, subLena2, prevPts, nextPts, status, err, sz, 3);70assertEquals(0, Core.countNonZero(status));71}727374public void testCalcOpticalFlowPyrLKMatMatListOfPointListOfPointListOfByteListOfFloatSizeIntTermCriteriaDoubleIntDouble() {75fail("Not yet implemented");76}7778public void testCamShift() {79fail("Not yet implemented");80}8182public void testEstimateRigidTransform() {83fail("Not yet implemented");84}8586public void testMeanShift() {87fail("Not yet implemented");88}8990public void testSegmentMotion() {91fail("Not yet implemented");92}9394public void testUpdateMotionHistory() {95fail("Not yet implemented");96}9798}99100101