本文介绍了EmguCV无法读取相机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在带有EmguCV 3.1的普通Windows窗体应用程序中,我具有以下代码

I have the the following code in a normal windows form application with EmguCV 3.1

    public Form1()
    {
        InitializeComponent();
        _capture = new Capture("http://root:pass@192.168.1.27:80/axis-cgi/mjpg/video.cgi");
        _capture.ImageGrabbed += ProcessFrame;
    }

    private void Form1_Load(object sender, EventArgs e)
    {
        _capture.Start();
    }

    private void ProcessFrame(object sender, EventArgs e)
    {
        Mat image = new Mat();
        _capture.Retrieve(image);
        imageBox1.BackgroundImage = image.Bitmap;

    }

我已经在可以正常工作的浏览器中测试了上面的链接,我也已经使用iSpy对其进行了测试,但也可以在其中使用,但从未使用EmguCV ProcessFrame

I have tested the above link in a browser it worked, I have also tested this using iSpy it also works there but using EmguCV ProcessFrame is never reached

我也尝试使用Luxand连接到相机,并且效果很好,但是Luxand不是免费的,所以我必须使用EmguCV进行人脸检测&.识别

I have also tried to connect to the camera using Luxand and it worked well but Luxand is not free so I have to use EmguCV to do face detection & recognition

推荐答案

查看此发布,请尝试在您网址的.cgi之后添加?x.mjpeg.

Looking at this post, try adding ?x.mjpeg after .cgi in your url.

这篇关于EmguCV无法读取相机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-17 01:43