parent
5649f35757
commit
72cc69e431
14 changed files with 262 additions and 48 deletions
@ -0,0 +1,59 @@ |
||||
package org.opencv.test.core; |
||||
|
||||
import org.opencv.core.FileStorage; |
||||
import org.opencv.test.OpenCVTestCase; |
||||
|
||||
public class FileStorageTest extends OpenCVTestCase { |
||||
|
||||
private FileStorage fs; |
||||
|
||||
@Override |
||||
protected void setUp() throws Exception { |
||||
super.setUp(); |
||||
|
||||
fs = null; |
||||
} |
||||
|
||||
public void test_1() { |
||||
super.test_1("CORE.FileStorage"); |
||||
} |
||||
|
||||
public void testFileStorage() { |
||||
fs = new FileStorage(); |
||||
assertTrue(null != fs); |
||||
} |
||||
|
||||
public void testFileStorageLong() { |
||||
fail("Not yet implemented"); |
||||
} |
||||
|
||||
public void testFileStorageStringInt() { |
||||
fs = new FileStorage("test.yml", FileStorage.WRITE); |
||||
assertTrue(null != fs); |
||||
} |
||||
|
||||
public void testFileStorageStringIntString() { |
||||
fail("Not yet implemented"); |
||||
} |
||||
|
||||
public void testIsOpened() { |
||||
fs = new FileStorage(); |
||||
assertFalse(fs.isOpened()); |
||||
|
||||
fs = new FileStorage("test.yml", FileStorage.WRITE); |
||||
assertTrue(fs.isOpened()); |
||||
} |
||||
|
||||
public void testOpenStringInt() { |
||||
fail("Not yet implemented"); |
||||
} |
||||
|
||||
public void testOpenStringIntString() { |
||||
fail("Not yet implemented"); |
||||
} |
||||
|
||||
public void testRelease() { |
||||
fail("Not yet implemented"); |
||||
} |
||||
|
||||
} |
@ -1,8 +1,9 @@ |
||||
package org.opencv.test; |
||||
package org.opencv.test.core; |
||||
|
||||
import org.opencv.CvType; |
||||
import org.opencv.Mat; |
||||
import org.opencv.Scalar; |
||||
import org.opencv.test.OpenCVTestCase; |
||||
|
||||
public class MatTest extends OpenCVTestCase { |
||||
|
@ -0,0 +1,8 @@ |
||||
package org.opencv.test.features2d; |
||||
|
||||
import org.opencv.test.OpenCVTestCase; |
||||
|
||||
|
||||
public class features2dTest extends OpenCVTestCase { |
||||
|
||||
} |
@ -1,6 +0,0 @@ |
||||
package org.opencv.test; |
||||
|
||||
|
||||
public class features2dTest extends OpenCVTestCase { |
||||
|
||||
} |
@ -0,0 +1,136 @@ |
||||
package org.opencv.test.highgui; |
||||
|
||||
import org.opencv.highgui; |
||||
import org.opencv.highgui.VideoCapture; |
||||
|
||||
import org.opencv.test.OpenCVTestCase; |
||||
import org.opencv.test.OpenCVTestRunner; |
||||
|
||||
|
||||
public class VideoCaptureTest extends OpenCVTestCase { |
||||
|
||||
private VideoCapture capture; |
||||
private boolean isSucceed; |
||||
private boolean isOpened; |
||||
|
||||
@Override |
||||
protected void setUp() throws Exception { |
||||
super.setUp(); |
||||
|
||||
capture = null; |
||||
isSucceed = false; |
||||
isOpened = false; |
||||
} |
||||
|
||||
public void test_1() { |
||||
super.test_1("HIGHGUI.VideoCapture"); |
||||
} |
||||
|
||||
public void testGet() { |
||||
capture = new VideoCapture(highgui.CV_CAP_ANDROID); |
||||
double frameWidth = capture.get(highgui.CV_CAP_PROP_FRAME_WIDTH); |
||||
capture.release(); |
||||
assertTrue(0 != frameWidth); |
||||
} |
||||
|
||||
public void testGrab() { |
||||
capture = new VideoCapture(); |
||||
isSucceed = capture.grab(); |
||||
assertFalse(isSucceed); |
||||
} |
||||
|
||||
public void testGrabFromRealCamera() { |
||||
capture = new VideoCapture(highgui.CV_CAP_ANDROID); |
||||
isSucceed = capture.grab(); |
||||
capture.release(); |
||||
assertTrue(isSucceed); |
||||
} |
||||
|
||||
public void testIsOpened() { |
||||
capture = new VideoCapture(); |
||||
assertFalse(capture.isOpened()); |
||||
} |
||||
|
||||
public void testIsOpenedRealCamera() { |
||||
capture = new VideoCapture(highgui.CV_CAP_ANDROID); |
||||
isOpened = capture.isOpened(); |
||||
capture.release(); |
||||
assertTrue(isOpened); |
||||
} |
||||
|
||||
public void testOpenInt() { |
||||
capture = new VideoCapture(); |
||||
capture.open(highgui.CV_CAP_ANDROID); |
||||
isOpened = capture.isOpened(); |
||||
capture.release(); |
||||
assertTrue(isOpened); |
||||
} |
||||
|
||||
public void testOpenString() { |
||||
fail("Not yet implemented"); |
||||
} |
||||
|
||||
public void testRead() { |
||||
capture = new VideoCapture(highgui.CV_CAP_ANDROID); |
||||
isSucceed = capture.read(dst); |
||||
capture.release(); |
||||
assertTrue(isSucceed); |
||||
assertFalse(dst.empty()); |
||||
assertEquals(3, dst.channels()); |
||||
} |
||||
|
||||
public void testRelease() { |
||||
capture = new VideoCapture(highgui.CV_CAP_ANDROID); |
||||
capture.release(); |
||||
assertFalse(capture.isOpened()); |
||||
} |
||||
|
||||
public void testRetrieveMat() { |
||||
capture = new VideoCapture(highgui.CV_CAP_ANDROID); |
||||
capture.grab(); |
||||
isSucceed = capture.retrieve(dst); |
||||
capture.release(); |
||||
assertTrue(isSucceed); |
||||
assertFalse(dst.empty()); |
||||
assertEquals(3, dst.channels()); |
||||
} |
||||
|
||||
public void testRetrieveMatInt() { |
||||
capture = new VideoCapture(highgui.CV_CAP_ANDROID); |
||||
capture.grab(); |
||||
isSucceed = capture.retrieve(dst, 1); |
||||
capture.release(); |
||||
assertTrue(isSucceed); |
||||
assertFalse(dst.empty()); |
||||
OpenCVTestRunner.Log(dst.toString()); |
||||
assertEquals(1, dst.channels()); |
||||
} |
||||
|
||||
public void testSet() { |
||||
capture = new VideoCapture(highgui.CV_CAP_ANDROID); |
||||
capture.set(highgui.CV_CAP_PROP_FRAME_WIDTH, 640.0); |
||||
double frameWidth = capture.get(highgui.CV_CAP_PROP_FRAME_WIDTH); |
||||
capture.read(dst); |
||||
capture.release(); |
||||
assertEquals(640.0, frameWidth); |
||||
assertEquals(640, dst.cols()); |
||||
} |
||||
|
||||
public void testVideoCapture() { |
||||
capture = new VideoCapture(); |
||||
assertTrue(null != capture); |
||||
} |
||||
|
||||
public void testVideoCaptureInt() { |
||||
capture = new VideoCapture(highgui.CV_CAP_ANDROID); |
||||
assertTrue(null != capture); |
||||
isOpened = capture.isOpened(); |
||||
capture.release(); |
||||
assertTrue(isOpened); |
||||
} |
||||
|
||||
public void testVideoCaptureString() { |
||||
fail("Not yet implemented"); |
||||
} |
||||
|
||||
} |
@ -1,6 +1,8 @@ |
||||
package org.opencv.test; |
||||
package org.opencv.test.highgui; |
||||
|
||||
import org.opencv.highgui; |
||||
import org.opencv.test.OpenCVTestCase; |
||||
import org.opencv.test.OpenCVTestRunner; |
||||
|
||||
|
||||
public class highguiTest extends OpenCVTestCase { |
@ -1,7 +1,8 @@ |
||||
package org.opencv.test; |
||||
package org.opencv.test.imgproc; |
||||
|
||||
import org.opencv.Size; |
||||
import org.opencv.imgproc; |
||||
import org.opencv.test.OpenCVTestCase; |
||||
|
||||
|
||||
public class imgprocTest extends OpenCVTestCase { |
@ -0,0 +1,8 @@ |
||||
package org.opencv.test.objdetect; |
||||
|
||||
import org.opencv.test.OpenCVTestCase; |
||||
|
||||
|
||||
public class objdetectTest extends OpenCVTestCase { |
||||
|
||||
} |
@ -1,6 +0,0 @@ |
||||
package org.opencv.test; |
||||
|
||||
|
||||
public class objdetectTest extends OpenCVTestCase { |
||||
|
||||
} |
@ -1,4 +1,6 @@ |
||||
package org.opencv.test; |
||||
package org.opencv.test.video; |
||||
|
||||
import org.opencv.test.OpenCVTestCase; |
||||
|
||||
|
||||
public class videoTest extends OpenCVTestCase { |
Loading…
Reference in new issue