如何检查连接到PC的相机(计算机) [英] How to check camera conected to pc (computer)
本文介绍了如何检查连接到PC的相机(计算机)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
//我想从摄像机捕获图像.我要检查相机是否已连接
// I want to captute image from camera. I want to check camera has connected
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using OpenCVDotNet;
namespace WindowsApplication6
{
public partial class Form1 : Form
{
private CVCapture capture;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
capture = new CVCapture(0); // when debug i see signal light camera
}
private void timer1_Tick(object sender, EventArgs e)
{
using (CVImage nextFrame = capture.QueryFrame())
{
selectPictureBox1.Image = nextFrame.ToBitmap();// this line error. Because of nextFrame set null . may be camera not connected?
}
}
private void button1_Click(object sender, EventArgs e)
{
timer1.Enabled = !(timer1.Enabled);
}
}
}
如何解决这个问题?
How to fix this problem? Thanks!
推荐答案
关注该链接. :)
http://support.microsoft.com/kb/283658 [
follow thw link. :)
http://support.microsoft.com/kb/283658[^]
mark as answer if solves your problem.
这篇关于如何检查连接到PC的相机(计算机)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文