我正在尝试从网络摄像头捕获帧。网络摄像头似乎正在正常打开,但retrieve()
和read()
语句始终返回false
。
Mat frame1 = new Mat();
VideoCapture cap1 = new VideoCapture(0);
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
System.out.println(cap1.isOpened());
System.out.println(cap1.read(frame1));
输出:
True
False