#视频处理
// 打开摄像头或者视频文件
VideoCapture capture = new VideoCapture();
//capture.open(0);
capture.open("D:/vcprojects/images/768x576.avi");
if(!capture.isOpened()) {
System.out.println("could not load video data...");
return;
}
int frame_width = (int)capture.get(3);
int frame_height = (int)capture.get(4);
Mat frame = new Mat();
while(true) {
boolean have = capture.read(frame);
Core.flip(frame, frame, 1);// Win上摄像头
if(!have) break;
if(!frame.empty()) {
...
}
try {
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
}