Commit 39ec7099 authored by Kirill Kornyakov's avatar Kirill Kornyakov

java tests: split test, minor improvements

parent 1badec0b
......@@ -65,14 +65,14 @@ public class OpenCVTestCase extends TestCase {
dst = new Mat();
assertTrue(dst.empty());
gray0 = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(0.0));
gray1 = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(1.0));
gray2 = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(2.0));
gray3 = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(3.0));
gray9 = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(9.0));
gray127 = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(127.0));
gray128 = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(128.0));
gray255 = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255.0));
gray0 = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(0));
gray1 = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(1));
gray2 = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(2));
gray3 = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(3));
gray9 = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(9));
gray127 = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(127));
gray128 = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(128));
gray255 = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255));
gray_16u_256 = new Mat(matSize, matSize, CvType.CV_16U, new Scalar(256));
gray_16s_1024 = new Mat(matSize, matSize, CvType.CV_16S, new Scalar(1024));
......
......@@ -35,6 +35,8 @@ public class OpenCVTestRunner extends InstrumentationTestRunner {
ExportResourceImage("lena.jpg", R.drawable.lena);
ExportResourceImage("chessboard.jpg", R.drawable.chessboard);
//FIXME: implement export of the cascade
//List<TestCase> testCases = androidTestRunner.getTestCases();
//Collections.shuffle(testCases); //shuffle the tests order
......
......@@ -144,9 +144,9 @@ public class calib3dTest extends OpenCVTestCase {
public void testFilterSpecklesMatDoubleIntDouble() {
gray_16s_1024.copyTo(dst);
Point center = new Point(gray_16s_1024.rows()/2., gray_16s_1024.cols()/2.);
core.circle(dst, center, 1, Scalar.all(4096));
assertMatNotEqual(gray_16s_1024, dst);
calib3d.filterSpeckles(dst, 1024.0, 100, 0.);
assertMatEqual(gray_16s_1024, dst);
......
......@@ -9,7 +9,6 @@ import org.opencv.Rect;
import org.opencv.Scalar;
import org.opencv.core;
import org.opencv.test.OpenCVTestCase;
import org.opencv.test.OpenCVTestRunner;
public class coreTest extends OpenCVTestCase {
......@@ -311,12 +310,12 @@ public class coreTest extends OpenCVTestCase {
Mat out2 = new Mat(1, 4, CvType.CV_32F);
src.put(0, 0, 1, 2, 3, 4);
out.put(0 , 0, 10, -2, 2, -2);
out.put(0, 0, 10, -2, 2, -2);
core.dft(src, dst, core.DFT_REAL_OUTPUT);
assertMatEqual(out, dst);
core.dft(src, dst, core.DFT_INVERSE);
out2.put(0 , 0, 9, -9, 1, 3);
out2.put(0, 0, 9, -9, 1, 3);
assertMatEqual(out2, dst);
}
......@@ -325,7 +324,7 @@ public class coreTest extends OpenCVTestCase {
Mat out = new Mat(1, 4, CvType.CV_32F);
src.put(0, 0, 1, 2, 3, 4);
out.put(0 , 0, 10, -2, 2, -2);
out.put(0, 0, 10, -2, 2, -2);
core.dft(src, dst, core.DFT_REAL_OUTPUT, 1);
assertMatEqual(out, dst);
}
......@@ -1244,14 +1243,11 @@ public class coreTest extends OpenCVTestCase {
}
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);
// }
ArrayList<Mat> cois = new ArrayList<Mat>();
core.split(rgba0, cois);
for(Mat coi : cois) {
assertMatEqual(gray0, coi);
}
}
public void testSqrt() {
......@@ -1314,8 +1310,4 @@ public class coreTest extends OpenCVTestCase {
assertTrue(subdst.total() == core.countNonZero(subdst));
}
public void testVconcat() {
fail("Not yet implemented");
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment