相关疑难解决方法(0)

OpenCV:如何从以太网相机捕获帧

我之前编写过USB网络摄像头,其唯一目的是从摄像头获取实时帧并在窗口中显示.我为此目的使用了cvCaptureFromCAM,它适用于USB Camera(见下面的代码).

我想知道如何从千兆以太网相机中捕获帧?我想我需要使用一些API从一些默认IP地址捕获帧.有人能指出我正确的方向吗?

我将在Intel i3处理器上的Windows 7上使用C++和OpenCV.

#include "cv.h"
#include "highgui.h"
#include <stdio.h>

// A Simple Camera Capture Framework 
int main() {
    CvCapture* capture = cvCaptureFromCAM( CV_CAP_ANY );
    if ( !capture ) {
        fprintf( stderr, "ERROR: capture is NULL \n" );
        getchar();
        return -1;
    }

    // Create a window in which the captured images will be presented
    cvNamedWindow( "mywindow", CV_WINDOW_AUTOSIZE );

    // Show the image captured from the camera in the window and repeat
    while ( 1 ) {
        // Get …
Run Code Online (Sandbox Code Playgroud)

c++ opencv ethernet ip-camera

8
推荐指数
2
解决办法
2万
查看次数

标签 统计

c++ ×1

ethernet ×1

ip-camera ×1

opencv ×1