网络摄像头 java_java – 网络摄像头支持的图片大小

我正在尝试检索我的网络摄像头支持的可用图片尺寸分辨率;使用OpenCV库.我已经尝试使用类似的

Android问题/答案,但无济于事. (例如

Android camera supported picture sizes).这是我的代码:

import org.opencv.highgui.VideoCapture;

import org.opencv.core.Size;

public class MyCameraCaptureClass {

public static void main(String[] args) {

System.out.println("Hello,OpenCV");

System.out.println("This program will display the webcam's supported sizes");

System.loadLibrary("opencv_java248"); //load .dll for the jar

VideoCapture vidCap0 = new VideoCapture(0);

if (vidCap0.isOpened()) {

System.out.println("Camera found,and it works so far...");

for (Size aSize : vidCap0.getSupportedPreviewSizes()) {

System.out.println("Doesn't print this at all");

System.out.println("Height:" + aSize.height + "Width:" + aSize.width);

}

}

vidCap0.release();

}

}

堆栈跟踪是:

Exception in thread "main" java.lang.Exception: unknown exception

at org.opencv.highgui.VideoCapture.getSupportedPreviewSizes_0(Native Method)

at org.opencv.highgui.VideoCapture.getSupportedPreviewSizes(VideoCapture.java:478)

at webcam.MyCameraCaptureClass.main(MyCameraCaptureClass.java:19)

所有的帮助将得到真诚的赞赏.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值