718c41634f
1.项目后端整体迁移至PaddleOCR-NCNN算法,已通过基本的兼容性测试 2.工程改为使用CMake组织,后续为了更好地兼容第三方库,不再提供QMake工程 3.重整权利声明文件,重整代码工程,确保最小化侵权风险 Log: 切换后端至PaddleOCR-NCNN,切换工程为CMake Change-Id: I4d5d2c5d37505a4a24b389b1a4c5d12f17bfa38c
65 lines
1.6 KiB
Java
65 lines
1.6 KiB
Java
package org.opencv.test.videoio;
|
|
|
|
import java.util.List;
|
|
|
|
import org.opencv.core.Size;
|
|
import org.opencv.videoio.Videoio;
|
|
import org.opencv.videoio.VideoCapture;
|
|
|
|
import org.opencv.test.OpenCVTestCase;
|
|
|
|
public class VideoCaptureTest extends OpenCVTestCase {
|
|
|
|
private VideoCapture capture;
|
|
private boolean isOpened;
|
|
private boolean isSucceed;
|
|
|
|
@Override
|
|
protected void setUp() throws Exception {
|
|
super.setUp();
|
|
|
|
capture = null;
|
|
isTestCaseEnabled = false;
|
|
isSucceed = false;
|
|
isOpened = false;
|
|
}
|
|
|
|
public void testGrab() {
|
|
capture = new VideoCapture();
|
|
isSucceed = capture.grab();
|
|
assertFalse(isSucceed);
|
|
}
|
|
|
|
public void testIsOpened() {
|
|
capture = new VideoCapture();
|
|
assertFalse(capture.isOpened());
|
|
}
|
|
|
|
public void testDefaultConstructor() {
|
|
capture = new VideoCapture();
|
|
assertNotNull(capture);
|
|
assertFalse(capture.isOpened());
|
|
}
|
|
|
|
public void testConstructorWithFilename() {
|
|
capture = new VideoCapture("some_file.avi");
|
|
assertNotNull(capture);
|
|
}
|
|
|
|
public void testConstructorWithFilenameAndExplicitlySpecifiedAPI() {
|
|
capture = new VideoCapture("some_file.avi", Videoio.CAP_ANY);
|
|
assertNotNull(capture);
|
|
}
|
|
|
|
public void testConstructorWithIndex() {
|
|
capture = new VideoCapture(0);
|
|
assertNotNull(capture);
|
|
}
|
|
|
|
public void testConstructorWithIndexAndExplicitlySpecifiedAPI() {
|
|
capture = new VideoCapture(0, Videoio.CAP_ANY);
|
|
assertNotNull(capture);
|
|
}
|
|
|
|
}
|