1

OpenCV ライブラリの処理に問題があります。

http://ubaa.net/shared/processing/opencv/index.html

私は可能な限り最も基本的なサンプルコードを実行しています:

import hypermedia.video.*;

OpenCV opencv;

void setup ()
{
    opencv = new OpenCV( this );
    opencv.capture( width, height );
}

void draw ()
{
    opencv.read();
    background( opencv.image() );
}

But every time, I get the console message:

SGIdle failed in icvGrabFrame_QT_Cam with error -1

and get no video input. My webcam turns on, but the program hangs.

I have seen others online with this problem, however I have not found a single source. I have a feeling it has something to do with QuickTime's video capture, but I'm not sure.

System info:

  • Recent MacBook Pro with built-in iSight camera
  • OS X 10.7.3 (Lion)
  • QuickTime 10.1
  • OpenCV 1.1
  • Processing 1.5.1

Does anyone know what is going on? It's difficult to get to the actual project when the most basic functionality of the library doesn't work...

4

2 に答える 2

2

ビデオ ライブラリを使用して回避策を実行し、ビデオ フレームを openCV レイヤーにコピーします: http://habu.phpfogapp.com/?p=3

于 2012-10-17T16:34:12.050 に答える
0

標準ライブラリを使用して画像をキャプチャする回避策の例を次に示します

// OpenCV cannot capture anymore since a iTunes or QuickTime update.
// It returns this error:
// SGIdle failed in icvGrabFrame_QT_Cam with error -1
// This example shows how to use standard video library to capture then
// pass the image to OpenCV.
//
// Pierre Rossel
// 25.2.2013


import hypermedia.video.*;
import processing.video.*;

OpenCV opencv;
Capture video;
int captureW = 640;
int captureH = 480;

void setup ()
{
  size(captureW, captureH);

  opencv = new OpenCV( this );
  opencv.allocate(captureW, captureH);
  opencv.threshold(255); // Clears allocated image

  video = new Capture(this, captureW, captureH);
  video.start();
}

void draw ()
{
  if (video.available()) {
    video.read();
    opencv.copy(video);
  }

  background( opencv.image() );
}
于 2013-02-25T09:23:09.950 に答える