VideoTest.java 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. package org.opencv.test.video;
  2. import org.opencv.core.Core;
  3. import org.opencv.core.Mat;
  4. import org.opencv.core.MatOfByte;
  5. import org.opencv.core.MatOfFloat;
  6. import org.opencv.core.MatOfPoint2f;
  7. import org.opencv.core.Point;
  8. import org.opencv.core.Size;
  9. import org.opencv.test.OpenCVTestCase;
  10. import org.opencv.video.Video;
  11. public class VideoTest extends OpenCVTestCase {
  12. private MatOfFloat err = null;
  13. private int h;
  14. private MatOfPoint2f nextPts = null;
  15. private MatOfPoint2f prevPts = null;
  16. private int shift1;
  17. private int shift2;
  18. private MatOfByte status = null;
  19. private Mat subLena1 = null;
  20. private Mat subLena2 = null;
  21. private int w;
  22. @Override
  23. protected void setUp() throws Exception {
  24. super.setUp();
  25. shift1 = 10;
  26. shift2 = 17;
  27. w = (int)(rgbLena.cols() / 2);
  28. h = (int)(rgbLena.rows() / 2);
  29. subLena1 = rgbLena.submat(shift1, h + shift1, shift1, w + shift1);
  30. subLena2 = rgbLena.submat(shift2, h + shift2, shift2, w + shift2);
  31. prevPts = new MatOfPoint2f(new Point(11d, 8d), new Point(5d, 5d), new Point(10d, 10d));
  32. nextPts = new MatOfPoint2f();
  33. status = new MatOfByte();
  34. err = new MatOfFloat();
  35. }
  36. public void testCalcGlobalOrientation() {
  37. fail("Not yet implemented");
  38. }
  39. public void testCalcMotionGradientMatMatMatDoubleDouble() {
  40. fail("Not yet implemented");
  41. }
  42. public void testCalcMotionGradientMatMatMatDoubleDoubleInt() {
  43. fail("Not yet implemented");
  44. }
  45. public void testCalcOpticalFlowFarneback() {
  46. fail("Not yet implemented");
  47. }
  48. public void testCalcOpticalFlowPyrLKMatMatListOfPointListOfPointListOfByteListOfFloat() {
  49. Video.calcOpticalFlowPyrLK(subLena1, subLena2, prevPts, nextPts, status, err);
  50. assertEquals(3, Core.countNonZero(status));
  51. }
  52. public void testCalcOpticalFlowPyrLKMatMatListOfPointListOfPointListOfByteListOfFloatSize() {
  53. Size sz = new Size(3, 3);
  54. Video.calcOpticalFlowPyrLK(subLena1, subLena2, prevPts, nextPts, status, err, sz, 3);
  55. assertEquals(0, Core.countNonZero(status));
  56. }
  57. public void testCalcOpticalFlowPyrLKMatMatListOfPointListOfPointListOfByteListOfFloatSizeIntTermCriteriaDoubleIntDouble() {
  58. fail("Not yet implemented");
  59. }
  60. public void testCamShift() {
  61. fail("Not yet implemented");
  62. }
  63. public void testEstimateRigidTransform() {
  64. fail("Not yet implemented");
  65. }
  66. public void testMeanShift() {
  67. fail("Not yet implemented");
  68. }
  69. public void testSegmentMotion() {
  70. fail("Not yet implemented");
  71. }
  72. public void testUpdateMotionHistory() {
  73. fail("Not yet implemented");
  74. }
  75. }