java tests: split test, minor improvements

This commit is contained in:
Kirill Kornyakov 2011-07-18 16:41:17 +00:00
parent 1badec0b2d
commit 39ec7099e2
4 changed files with 24 additions and 30 deletions

View File

@ -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));

View File

@ -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

View File

@ -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);

View File

@ -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 {
@ -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");
}
}