java tests: added test for OFLK, FD, other improvements
This commit is contained in:
parent
16ba62dcd5
commit
51922658b6
@ -19,7 +19,9 @@ public class OpenCVTestCase extends TestCase {
|
||||
//Naming notation: <channels info>_[depth]_[dimensions]_value
|
||||
//examples: gray0 - single channel 8U 2d Mat filled with 0
|
||||
// grayRnd - single channel 8U 2d Mat filled with random numbers
|
||||
// gray0_32f_1d - refactor ;)
|
||||
// gray0_32f_1d - TODO: refactor
|
||||
|
||||
//TODO: create some masks
|
||||
|
||||
protected static Mat gray0;
|
||||
protected static Mat gray1;
|
||||
|
@ -19,12 +19,12 @@ import android.util.Log;
|
||||
|
||||
public class OpenCVTestRunner extends InstrumentationTestRunner {
|
||||
|
||||
public static String LENA_PATH = "/data/data/org.opencv.test/files/lena.jpg";
|
||||
public static String LENA_PATH = "/data/data/org.opencv.test/files/lena.jpg";
|
||||
public static String CHESS_PATH = "/data/data/org.opencv.test/files/chessboard.jpg";
|
||||
public static String LBPCASCADE_FRONTALFACE_PATH = "/mnt/sdcard/lbpcascade_frontalface.xml";
|
||||
private static String TAG = "opencv_test_java";
|
||||
|
||||
|
||||
private AndroidTestRunner androidTestRunner;
|
||||
private static String TAG = "opencv_test_java";
|
||||
|
||||
static public void Log(String message) {
|
||||
Log.e(TAG, message);
|
||||
|
@ -1,11 +1,13 @@
|
||||
package org.opencv.test.core;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.opencv.CvType;
|
||||
import org.opencv.Mat;
|
||||
import org.opencv.Point;
|
||||
import org.opencv.Rect;
|
||||
import org.opencv.Scalar;
|
||||
import org.opencv.core;
|
||||
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
import org.opencv.test.OpenCVTestRunner;
|
||||
|
||||
@ -141,7 +143,6 @@ public class coreTest extends OpenCVTestCase {
|
||||
core.cartToPolar(x, y, dst, dst_angle,false);
|
||||
|
||||
assertMatEqual(magnitude, dst);
|
||||
OpenCVTestRunner.Log(dst_angle.dump());
|
||||
assertMatEqual(angle, dst_angle);
|
||||
}
|
||||
|
||||
@ -173,6 +174,31 @@ public class coreTest extends OpenCVTestCase {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testClipLine() {
|
||||
Rect r = new Rect(10, 10, 10, 10);
|
||||
|
||||
Point pt1 = new Point(5.0, 15.0);
|
||||
Point pt2 = new Point(25.0, 15.0);
|
||||
|
||||
Point pt1Clipped = new Point(10.0, 15.0);
|
||||
Point pt2Clipped = new Point(19.0, 15.0);
|
||||
|
||||
boolean res = core.clipLine(r, pt1, pt2);
|
||||
assertEquals(true, res);
|
||||
assertEquals(pt1Clipped, pt1);
|
||||
assertEquals(pt2Clipped, pt2);
|
||||
|
||||
pt1 = new Point(5.0, 5.0);
|
||||
pt2 = new Point(25.0, 5.0);
|
||||
pt1Clipped = new Point(5.0, 5.0);
|
||||
pt2Clipped = new Point(25.0, 5.0);
|
||||
|
||||
res = core.clipLine(r, pt1, pt2);
|
||||
assertEquals(false, res);
|
||||
assertEquals(pt1Clipped, pt1);
|
||||
assertEquals(pt2Clipped, pt2);
|
||||
}
|
||||
|
||||
public void testCompare() {
|
||||
core.compare(gray0, gray0, dst, core.CMP_EQ);
|
||||
assertMatEqual(dst, gray255);
|
||||
@ -213,7 +239,7 @@ public class coreTest extends OpenCVTestCase {
|
||||
core.convertScaleAbs(gray_16u_256, dst, 1);
|
||||
assertMatEqual(gray255, dst);
|
||||
}
|
||||
|
||||
|
||||
public void testConvertScaleAbsMatMatDoubleDouble() {
|
||||
core.convertScaleAbs(gray_16u_256, dst, 2, 2);
|
||||
assertMatEqual(gray255, dst);
|
||||
@ -329,6 +355,10 @@ public class coreTest extends OpenCVTestCase {
|
||||
assertMatEqual(gray3, dst);
|
||||
}
|
||||
|
||||
public void testEllipse2Poly() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testEllipseMatPointSizeDoubleDoubleDoubleScalar() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
@ -344,6 +374,18 @@ public class coreTest extends OpenCVTestCase {
|
||||
public void testEllipseMatPointSizeDoubleDoubleDoubleScalarIntIntInt() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testEllipseMatRotatedRectScalar() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testEllipseMatRotatedRectScalarInt() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testEllipseMatRotatedRectScalarIntInt() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testExp() {
|
||||
Mat destination = new Mat(matSize, matSize, CvType.CV_32F); destination.setTo(new Scalar(0.0));
|
||||
@ -388,7 +430,7 @@ public class coreTest extends OpenCVTestCase {
|
||||
core.flip(src, dst, 1);
|
||||
assertMatEqual(des_f1, dst);
|
||||
}
|
||||
|
||||
|
||||
public void testGemmMatMatDoubleMatDoubleMat() {
|
||||
Mat m1 = new Mat(2, 2, CvType.CV_32FC1);
|
||||
Mat m2 = new Mat(2, 2, CvType.CV_32FC1);
|
||||
@ -410,7 +452,7 @@ public class coreTest extends OpenCVTestCase {
|
||||
core.gemm(m1, m2, 1.0, dmatrix, 1.0, dst);
|
||||
assertMatEqual(desired, dst);
|
||||
}
|
||||
|
||||
|
||||
public void testGemmMatMatDoubleMatDoubleMatInt() {
|
||||
Mat m1 = new Mat(2, 2, CvType.CV_32FC1);
|
||||
Mat m2 = new Mat(2, 2, CvType.CV_32FC1);
|
||||
@ -443,6 +485,10 @@ public class coreTest extends OpenCVTestCase {
|
||||
assertEquals(15, largeVecSize);
|
||||
}
|
||||
|
||||
public void testGetTextSize() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGetTickFrequency() {
|
||||
double freq = 0.0;
|
||||
freq = core.getTickFrequency();
|
||||
@ -457,7 +503,6 @@ public class coreTest extends OpenCVTestCase {
|
||||
core.hconcat(e, dst);
|
||||
assertMatEqual(eConcat, dst);
|
||||
}
|
||||
|
||||
|
||||
public void testIdctMatMat() {
|
||||
Mat in = new Mat(1, 8, CvType.CV_32F);
|
||||
@ -538,8 +583,6 @@ public class coreTest extends OpenCVTestCase {
|
||||
answer.put(1, 1, 1.0);
|
||||
|
||||
core.invert(src, dst);
|
||||
OpenCVTestRunner.Log(answer.dump());
|
||||
OpenCVTestRunner.Log(dst.dump());
|
||||
assertMatEqual(answer, dst);
|
||||
|
||||
//TODO: needs epsilon comparison
|
||||
@ -567,6 +610,14 @@ public class coreTest extends OpenCVTestCase {
|
||||
double det = core.determinant(src);
|
||||
assertTrue(det > 0.0);
|
||||
}
|
||||
|
||||
public void testKmeansMatIntMatTermCriteriaIntInt() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testKmeansMatIntMatTermCriteriaIntIntMat() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testLineMatPointPointScalar() {
|
||||
int nPoints = Math.min(gray0.cols(), gray0.rows());
|
||||
@ -595,6 +646,7 @@ public class coreTest extends OpenCVTestCase {
|
||||
public void testLineMatPointPointScalarIntInt() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
|
||||
public void testLineMatPointPointScalarIntIntInt() {
|
||||
fail("Not yet implemented");
|
||||
@ -676,6 +728,17 @@ public class coreTest extends OpenCVTestCase {
|
||||
assertMatEqual(dst, dst);
|
||||
}
|
||||
|
||||
public void testMeanMat() {
|
||||
Scalar mean = null;
|
||||
|
||||
mean = core.mean(gray128);
|
||||
assertEquals(new Scalar(128), mean);
|
||||
}
|
||||
|
||||
public void testMeanMatMat() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testMeanStdDevMatMatMat() {
|
||||
Mat mean = new Mat();
|
||||
Mat stddev = new Mat();
|
||||
@ -710,6 +773,10 @@ public class coreTest extends OpenCVTestCase {
|
||||
assertTrue(0 != core.countNonZero(stddev));
|
||||
}
|
||||
|
||||
public void testMerge() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testMin() {
|
||||
core.min(gray0, gray255, dst);
|
||||
assertMatEqual(gray0, dst);
|
||||
@ -731,6 +798,14 @@ public class coreTest extends OpenCVTestCase {
|
||||
assertTrue(mmres.maxLoc.equals(maxLoc));
|
||||
}
|
||||
|
||||
public void testMinMaxLocMat() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testMinMaxLocMatMat() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testMulSpectrumsMatMatMatInt() {
|
||||
Mat src1 = new Mat(1, 4, CvType.CV_32F);
|
||||
Mat src2 = new Mat(1, 4, CvType.CV_32F);
|
||||
@ -912,8 +987,6 @@ public class coreTest extends OpenCVTestCase {
|
||||
res.put(0, 0, 63.434, 56.310, 44.999, 75.963);
|
||||
|
||||
core.phase(x, y, dst, true);
|
||||
OpenCVTestRunner.Log(res.dump());
|
||||
OpenCVTestRunner.Log(dst.dump());
|
||||
}
|
||||
|
||||
public void testPolarToCartMatMatMatMat() {
|
||||
@ -937,10 +1010,6 @@ public class coreTest extends OpenCVTestCase {
|
||||
|
||||
//TODO: needs epsilon comparison
|
||||
core.polarToCart(magnitude, angle, xCoordinate, yCoordinate);
|
||||
OpenCVTestRunner.Log(x.dump());
|
||||
OpenCVTestRunner.Log(xCoordinate.dump());
|
||||
OpenCVTestRunner.Log(y.dump());
|
||||
OpenCVTestRunner.Log(yCoordinate.dump());
|
||||
assertMatEqual(x, xCoordinate);
|
||||
}
|
||||
|
||||
@ -952,7 +1021,23 @@ public class coreTest extends OpenCVTestCase {
|
||||
core.pow(gray3, 2.0, dst);
|
||||
assertMatEqual(gray9, dst);
|
||||
}
|
||||
|
||||
|
||||
public void testPutTextMatStringPointIntDoubleScalar() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testPutTextMatStringPointIntDoubleScalarInt() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testPutTextMatStringPointIntDoubleScalarIntInt() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testPutTextMatStringPointIntDoubleScalarIntIntBoolean() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testRandn() {
|
||||
Mat low = new Mat(1, 1, CvType.CV_16UC1, new Scalar(0));
|
||||
Mat high = new Mat(1, 1, CvType.CV_16UC1, new Scalar(256));
|
||||
@ -980,7 +1065,7 @@ public class coreTest extends OpenCVTestCase {
|
||||
core.rectangle(gray0, center, origin, color);
|
||||
assertTrue(0 != core.countNonZero(gray0));
|
||||
}
|
||||
|
||||
|
||||
public void testRectangleMatPointPointScalarInt() {
|
||||
Point center = new Point(gray0.cols(), gray0.rows());
|
||||
Point origin = new Point(0,0);
|
||||
@ -1113,10 +1198,7 @@ public class coreTest extends OpenCVTestCase {
|
||||
coeffs.put(0, 0, -6, 11, -6, 1);
|
||||
|
||||
Mat answer = new Mat(3, 1, CvType.CV_32FC2);
|
||||
//FIXME: doesn't work answer.put(0, 0, 1, 0, 2, 0, 3, 0);
|
||||
answer.put(0, 0, 1, 0);
|
||||
answer.put(1, 0, 2, 0);
|
||||
answer.put(2, 0, 3, 0);
|
||||
answer.put(0, 0, 1, 0, 2, 0, 3, 0);
|
||||
|
||||
core.solvePoly(coeffs, roots);
|
||||
assertMatEqual(answer, roots);
|
||||
@ -1129,10 +1211,7 @@ public class coreTest extends OpenCVTestCase {
|
||||
coeffs.put(0, 0, -6, 11, -6, 1);
|
||||
|
||||
Mat answer = new Mat(3, 1, CvType.CV_32FC2);
|
||||
//FIXME: doesn't work answer.put(0, 0, 1, 0, 2, 0, 3, 0);
|
||||
answer.put(0, 0, 1, 0);
|
||||
answer.put(1, 0, -1, 2);
|
||||
answer.put(2, 0, -2, 12);
|
||||
answer.put(0, 0, 1, 0, -1, 2, -2, 12);
|
||||
|
||||
core.solvePoly(coeffs, roots, 1);
|
||||
assertMatEqual(answer, roots);
|
||||
@ -1164,6 +1243,17 @@ public class coreTest extends OpenCVTestCase {
|
||||
assertMatEqual(answer, b);
|
||||
}
|
||||
|
||||
public void testSplit() {
|
||||
fail("Not yet implemented");
|
||||
//FIXME: must work
|
||||
//ArrayList<Mat> cois = new ArrayList<Mat>();
|
||||
//core.split(rgba0, cois);
|
||||
// for(Mat coi : cois) {
|
||||
// OpenCVTestRunner.Log(coi.toString());
|
||||
// //assertMatEqual(gray0, coi);
|
||||
// }
|
||||
}
|
||||
|
||||
public void testSqrt() {
|
||||
core.sqrt(gray9_32f, dst);
|
||||
assertMatEqual(gray3_32f, dst);
|
||||
@ -1198,6 +1288,14 @@ public class coreTest extends OpenCVTestCase {
|
||||
assertMatEqual(gray1_32f, dst);
|
||||
}
|
||||
|
||||
public void testSumElems() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testTrace() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testTransform() {
|
||||
Mat src = new Mat(2, 2, CvType.CV_32F, new Scalar(55));
|
||||
Mat m = Mat.eye(2, 2, CvType.CV_32FC1);
|
||||
|
@ -0,0 +1,105 @@
|
||||
package org.opencv.test.objdetect;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.opencv.Mat;
|
||||
import org.opencv.Rect;
|
||||
import org.opencv.Size;
|
||||
import org.opencv.imgproc;
|
||||
import org.opencv.objdetect.CascadeClassifier;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
import org.opencv.test.OpenCVTestRunner;
|
||||
|
||||
public class CascadeClassifierTest extends OpenCVTestCase {
|
||||
|
||||
private CascadeClassifier cc;
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
|
||||
cc = null;
|
||||
}
|
||||
|
||||
public void testCascadeClassifier() {
|
||||
cc = new CascadeClassifier();
|
||||
assertTrue(null != cc);
|
||||
}
|
||||
|
||||
public void testCascadeClassifierString() {
|
||||
cc = new CascadeClassifier(OpenCVTestRunner.LBPCASCADE_FRONTALFACE_PATH);
|
||||
assertTrue(null != cc);
|
||||
}
|
||||
|
||||
public void testDetectMultiScaleMatListOfRect() {
|
||||
CascadeClassifier cc = new CascadeClassifier(OpenCVTestRunner.LBPCASCADE_FRONTALFACE_PATH);
|
||||
ArrayList<Rect> faces = new ArrayList<Rect>();
|
||||
|
||||
Mat greyLena = new Mat();
|
||||
imgproc.cvtColor(rgbLena, greyLena, imgproc.CV_RGB2GRAY);
|
||||
|
||||
//TODO: doesn't detect with 1.1 scale
|
||||
cc.detectMultiScale(greyLena, faces, 1.09, 2, 2 /*TODO: CV_HAAR_SCALE_IMAGE*/, new Size(30, 30));
|
||||
assertEquals(1, faces.size());
|
||||
}
|
||||
|
||||
public void testDetectMultiScaleMatListOfRectDouble() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDetectMultiScaleMatListOfRectDoubleInt() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDetectMultiScaleMatListOfRectDoubleIntInt() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDetectMultiScaleMatListOfRectDoubleIntIntSize() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDetectMultiScaleMatListOfRectDoubleIntIntSizeSize() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDetectMultiScaleMatListOfRectListOfIntegerListOfDouble() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDetectMultiScaleMatListOfRectListOfIntegerListOfDoubleDouble() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDetectMultiScaleMatListOfRectListOfIntegerListOfDoubleDoubleInt() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDetectMultiScaleMatListOfRectListOfIntegerListOfDoubleDoubleIntInt() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDetectMultiScaleMatListOfRectListOfIntegerListOfDoubleDoubleIntIntSize() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDetectMultiScaleMatListOfRectListOfIntegerListOfDoubleDoubleIntIntSizeSize() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testDetectMultiScaleMatListOfRectListOfIntegerListOfDoubleDoubleIntIntSizeSizeBoolean() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testEmpty() {
|
||||
cc = new CascadeClassifier();
|
||||
assertTrue(cc.empty());
|
||||
}
|
||||
|
||||
public void testLoad() {
|
||||
cc = new CascadeClassifier();
|
||||
cc.load(OpenCVTestRunner.LBPCASCADE_FRONTALFACE_PATH);
|
||||
assertTrue(!cc.empty());
|
||||
}
|
||||
|
||||
}
|
@ -2,39 +2,47 @@ package org.opencv.test.objdetect;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.opencv.Mat;
|
||||
import org.opencv.objdetect;
|
||||
import org.opencv.highgui;
|
||||
import org.opencv.core;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
import org.opencv.test.OpenCVTestRunner;
|
||||
import org.opencv.Rect;
|
||||
import org.opencv.Size;
|
||||
import org.opencv.Scalar;
|
||||
import org.opencv.objdetect;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
|
||||
public class objdetectTest extends OpenCVTestCase {
|
||||
public void testCascadeClassifierFaceDetector() {
|
||||
objdetect.CascadeClassifier cc=new objdetect.CascadeClassifier("/mnt/sdcard/lbpcascade_frontalface.xml");
|
||||
///objdetect.CascadeClassifier cc=new objdetect.CascadeClassifier("/mnt/sdcard/haarcascade_frontalface_alt2.xml");
|
||||
ArrayList<Rect> faces=new ArrayList<Rect>();
|
||||
|
||||
|
||||
Mat shot002=highgui.imread("/mnt/sdcard/shot0002.png");
|
||||
OpenCVTestRunner.Log("after imread shot002");
|
||||
|
||||
cc.detectMultiScale(shot002, faces, 1.1, 2, 2 /*TODO: CV_HAAR_SCALE_IMAGE*/, new Size(10,10));
|
||||
OpenCVTestRunner.Log("faces.size="+faces.size());
|
||||
|
||||
Scalar color=new Scalar(0,255,0);
|
||||
for(int i=0; i < faces.size(); i++) {
|
||||
OpenCVTestRunner.Log("face["+i+"]="+faces.get(i).toString());
|
||||
core.rectangle(shot002, faces.get(i).tl(), faces.get(i).br(), color);
|
||||
}
|
||||
OpenCVTestRunner.Log("before writing image");
|
||||
boolean reswrite=highgui.imwrite("/mnt/sdcard/lbpcascade_frontalface_res.jpg", shot002);
|
||||
OpenCVTestRunner.Log("after writing image, res="+reswrite);
|
||||
|
||||
}
|
||||
|
||||
public void testGroupRectanglesListOfRectInt() {
|
||||
Rect r = new Rect(10, 10, 20, 20);
|
||||
ArrayList<Rect> rects = new ArrayList<Rect>();
|
||||
|
||||
for (int i = 0; i < 10; i++)
|
||||
rects.add(r);
|
||||
|
||||
int groupThreshold = 1;
|
||||
objdetect.groupRectangles(rects, groupThreshold);
|
||||
assertEquals(1, rects.size());
|
||||
}
|
||||
|
||||
public void testGroupRectanglesListOfRectIntDouble() {
|
||||
Rect r1 = new Rect(10, 10, 20, 20);
|
||||
Rect r2 = new Rect(10, 10, 25, 25);
|
||||
ArrayList<Rect> rects = new ArrayList<Rect>();
|
||||
|
||||
for (int i = 0; i < 10; i++)
|
||||
rects.add(r1);
|
||||
for (int i = 0; i < 10; i++)
|
||||
rects.add(r2);
|
||||
|
||||
int groupThreshold = 1;
|
||||
double eps = 0.2;
|
||||
objdetect.groupRectangles(rects, groupThreshold, eps);
|
||||
assertEquals(2, rects.size());
|
||||
}
|
||||
|
||||
public void testGroupRectanglesListOfRectListOfIntegerInt() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testGroupRectanglesListOfRectListOfIntegerIntDouble() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,9 +1,43 @@
|
||||
package org.opencv.test.video;
|
||||
|
||||
import org.opencv.CvType;
|
||||
import org.opencv.Mat;
|
||||
import org.opencv.Size;
|
||||
import org.opencv.core;
|
||||
import org.opencv.video;
|
||||
import org.opencv.test.OpenCVTestCase;
|
||||
|
||||
|
||||
public class videoTest extends OpenCVTestCase {
|
||||
|
||||
private int shift1;
|
||||
private int shift2;
|
||||
private int w;
|
||||
private int h;
|
||||
|
||||
private Mat subLena1 = null;
|
||||
private Mat subLena2 = null;
|
||||
|
||||
private Mat nextPts = null;
|
||||
private Mat status = null;
|
||||
private Mat err = null;
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
|
||||
shift1 = 10;
|
||||
shift2 = 17;
|
||||
w = rgbLena.cols() / 2;
|
||||
h = rgbLena.rows() / 2;
|
||||
|
||||
subLena1 = rgbLena.submat(shift1, h + shift1, shift1, w + shift1);
|
||||
subLena2 = rgbLena.submat(shift2, h + shift2, shift2, w + shift2);
|
||||
|
||||
nextPts = new Mat();
|
||||
status = new Mat();
|
||||
err = new Mat();
|
||||
}
|
||||
|
||||
public void testCalcGlobalOrientation() {
|
||||
fail("Not yet implemented");
|
||||
@ -21,10 +55,55 @@ public class videoTest extends OpenCVTestCase {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testCalcOpticalFlowPyrLKMatMatMatMatMatMat() {
|
||||
Mat prevPts = new Mat(1, 3, CvType.CV_32FC2);
|
||||
prevPts.put(0, 0, 1.0, 1.0, 5.0, 5.0, 10.0, 10.0);
|
||||
|
||||
video.calcOpticalFlowPyrLK(subLena1, subLena2, prevPts, nextPts, status, err);
|
||||
assertEquals(3, core.countNonZero(status));
|
||||
}
|
||||
|
||||
public void testCalcOpticalFlowPyrLKMatMatMatMatMatMatSize() {
|
||||
Mat prevPts = new Mat(1, 3, CvType.CV_32FC2);
|
||||
prevPts.put(0, 0, 1.0, 1.0, 5.0, 5.0, 10.0, 10.0);
|
||||
|
||||
Size sz = new Size(5, 5);
|
||||
video.calcOpticalFlowPyrLK(subLena1, subLena2, prevPts, nextPts, status, err, sz);
|
||||
assertEquals(0, core.countNonZero(status));
|
||||
}
|
||||
|
||||
public void testCalcOpticalFlowPyrLKMatMatMatMatMatMatSizeInt() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testCalcOpticalFlowPyrLKMatMatMatMatMatMatSizeIntTermCriteria() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testCalcOpticalFlowPyrLKMatMatMatMatMatMatSizeIntTermCriteriaDouble() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testCalcOpticalFlowPyrLKMatMatMatMatMatMatSizeIntTermCriteriaDoubleInt() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testCamShift() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testEstimateRigidTransform() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testMeanShift() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testSegmentMotion() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
||||
public void testUpdateMotionHistory() {
|
||||
fail("Not yet implemented");
|
||||
}
|
||||
|
@ -6,6 +6,34 @@ try:
|
||||
except:
|
||||
from StringIO import StringIO
|
||||
|
||||
class_ignore_list = (
|
||||
#core
|
||||
"FileNode",
|
||||
"FileStorage",
|
||||
#highgui
|
||||
"VideoWriter",
|
||||
"VideoCapture",
|
||||
)
|
||||
|
||||
func_ignore_list = (
|
||||
#core
|
||||
"checkHardwareSupport",
|
||||
"setUseOptimized",
|
||||
"useOptimized",
|
||||
"vconcat",
|
||||
#highgui
|
||||
"namedWindow",
|
||||
"destroyWindow",
|
||||
"destroyAllWindows",
|
||||
"startWindowThread",
|
||||
"setWindowProperty",
|
||||
"getWindowProperty",
|
||||
"getTrackbarPos",
|
||||
"setTrackbarPos",
|
||||
"imshow",
|
||||
"waitKey",
|
||||
)
|
||||
|
||||
const_ignore_list = (
|
||||
"CV_CAP_OPENNI",
|
||||
"CV_CAP_PROP_OPENNI_",
|
||||
@ -73,23 +101,6 @@ const_ignore_list = (
|
||||
"CV_CAP_PROP_PVAPI_MULTICASTIP",
|
||||
)
|
||||
|
||||
func_ignore_list = (
|
||||
"namedWindow",
|
||||
"destroyWindow",
|
||||
"destroyAllWindows",
|
||||
"startWindowThread",
|
||||
"setWindowProperty",
|
||||
"getWindowProperty",
|
||||
"getTrackbarPos",
|
||||
"setTrackbarPos",
|
||||
"imshow",
|
||||
"waitKey",
|
||||
)
|
||||
|
||||
class_ignore_list = (
|
||||
"VideoWriter",
|
||||
"VideoCapture",
|
||||
)
|
||||
|
||||
# c_type : { java/jni correspondence }
|
||||
type_dict = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user