首页 > 解决方案 > 构造函数 VideoCapture(long) 不可见

问题描述

我无法创建 VideoCapture(0) 构造函数。

public WritableImage capureFrame() {
  WritableImage writableImage = null;

  // Loading the OpenCV core library
  System.loadLibrary( Core.NATIVE_LIBRARY_NAME );

  // Instantiating the VideoCapture class (camera:: 0)
  VideoCapture capture = new VideoCapture(0);

  // Reading the next video frame from the camera
  Mat matrix = new Mat();
  capture.read(matrix);

  // If camera is opened
  if(!capture.isOpened()) {
     System.out.println("camera not detected");
  } else     {

     System.out.println("Camera detected ");

在此处输入图像描述

我是这个 openCV 的新手,请帮助我使用网络摄像头捕捉视频。我使用的是 openCV-4.3.0 版本及其 jars 和 x64 dll 文件。

标签: javaopencv4

解决方案


推荐阅读