java tests: split test, minor improvements
This commit is contained in:
		| @@ -65,14 +65,14 @@ public class OpenCVTestCase extends TestCase { | |||||||
|         dst = new Mat(); |         dst = new Mat(); | ||||||
|         assertTrue(dst.empty()); |         assertTrue(dst.empty()); | ||||||
|  |  | ||||||
|         gray0 = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(0.0)); |         gray0 = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(0)); | ||||||
|         gray1 = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(1.0)); |         gray1 = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(1)); | ||||||
|         gray2 = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(2.0)); |         gray2 = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(2)); | ||||||
|         gray3 = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(3.0)); |         gray3 = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(3)); | ||||||
|         gray9 = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(9.0)); |         gray9 = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(9)); | ||||||
|         gray127 = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(127.0)); |         gray127 = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(127)); | ||||||
|         gray128 = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(128.0)); |         gray128 = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(128)); | ||||||
|         gray255 = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255.0)); |         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_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)); |         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("lena.jpg", R.drawable.lena); | ||||||
|     	ExportResourceImage("chessboard.jpg", R.drawable.chessboard); |     	ExportResourceImage("chessboard.jpg", R.drawable.chessboard); | ||||||
|     	 |     	 | ||||||
|  |     	//FIXME: implement export of the cascade | ||||||
|  | 		 | ||||||
|         //List<TestCase> testCases = androidTestRunner.getTestCases(); |         //List<TestCase> testCases = androidTestRunner.getTestCases(); | ||||||
|         //Collections.shuffle(testCases); //shuffle the tests order |         //Collections.shuffle(testCases); //shuffle the tests order | ||||||
|     	 |     	 | ||||||
|   | |||||||
| @@ -144,9 +144,9 @@ public class calib3dTest extends OpenCVTestCase { | |||||||
|  |  | ||||||
| 	public void testFilterSpecklesMatDoubleIntDouble() { | 	public void testFilterSpecklesMatDoubleIntDouble() { | ||||||
| 		gray_16s_1024.copyTo(dst);	     | 		gray_16s_1024.copyTo(dst);	     | ||||||
| 	     |  | ||||||
| 		Point center = new Point(gray_16s_1024.rows()/2., gray_16s_1024.cols()/2.);		 | 		Point center = new Point(gray_16s_1024.rows()/2., gray_16s_1024.cols()/2.);		 | ||||||
| 		core.circle(dst, center, 1, Scalar.all(4096)); | 		core.circle(dst, center, 1, Scalar.all(4096)); | ||||||
|  | 		 | ||||||
| 		assertMatNotEqual(gray_16s_1024, dst); | 		assertMatNotEqual(gray_16s_1024, dst); | ||||||
| 	    calib3d.filterSpeckles(dst, 1024.0, 100, 0.); | 	    calib3d.filterSpeckles(dst, 1024.0, 100, 0.); | ||||||
| 	    assertMatEqual(gray_16s_1024, dst); | 	    assertMatEqual(gray_16s_1024, dst); | ||||||
|   | |||||||
| @@ -9,7 +9,6 @@ import org.opencv.Rect; | |||||||
| import org.opencv.Scalar; | import org.opencv.Scalar; | ||||||
| import org.opencv.core; | import org.opencv.core; | ||||||
| import org.opencv.test.OpenCVTestCase; | import org.opencv.test.OpenCVTestCase; | ||||||
| import org.opencv.test.OpenCVTestRunner; |  | ||||||
|  |  | ||||||
| public class coreTest extends OpenCVTestCase { | public class coreTest extends OpenCVTestCase { | ||||||
| 	 | 	 | ||||||
| @@ -1244,14 +1243,11 @@ public class coreTest extends OpenCVTestCase { | |||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	public void testSplit() { | 	public void testSplit() { | ||||||
| 		fail("Not yet implemented"); | 		ArrayList<Mat> cois = new ArrayList<Mat>(); | ||||||
| 		//FIXME: must work | 		core.split(rgba0, cois); | ||||||
| 		//ArrayList<Mat> cois = new ArrayList<Mat>(); | 		for(Mat coi : cois) { | ||||||
| 		//core.split(rgba0, cois); | 			assertMatEqual(gray0, coi); | ||||||
| //		for(Mat coi : cois) { | 		} | ||||||
| //			OpenCVTestRunner.Log(coi.toString()); |  | ||||||
| //			//assertMatEqual(gray0, coi); |  | ||||||
| //		} |  | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	public void testSqrt() { | 	public void testSqrt() { | ||||||
| @@ -1314,8 +1310,4 @@ public class coreTest extends OpenCVTestCase { | |||||||
| 		assertTrue(subdst.total() == core.countNonZero(subdst)); | 		assertTrue(subdst.total() == core.countNonZero(subdst)); | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	public void testVconcat() { |  | ||||||
| 		fail("Not yet implemented"); |  | ||||||
| 	} |  | ||||||
| 	 |  | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Kirill Kornyakov
					Kirill Kornyakov