opencv 播放视频 博客分类: 计算机视觉java opencv
程序员文章站
2024-03-16 21:59:58
...
opencv播放视频代码:
package openvc; import org.opencv.core.Core; import org.opencv.core.Mat; import org.opencv.highgui.HighGui; import org.opencv.videoio.VideoCapture; public class ShowVidioMain { public static void main(String[] args) { try { System.loadLibrary(Core.NATIVE_LIBRARY_NAME); VideoCapture vc = new VideoCapture("d:/workspace/dp4jTest/vtest.avi"); HighGui.namedWindow("video"); Mat pic = new Mat(); while (true) { vc.read(pic); if (pic.empty()) { break; } HighGui.imshow("video", pic); HighGui.waitKey(30); } } catch (Exception e) { e.printStackTrace(); } } }