尝试使用OpenCV通过Processing2学习面部识别。此代码是在Jan Vantomme的书中复制的。但是,我使用的是书中列出的OpenCV的更新版本。收到的错误是:构造函数(sketch_ORIGopenCV)未定义。有谁知道OpenCV是不是可以向上兼容,还是导致这个错误的原因是什么?
import gab.opencv.*; //original code in Vantomme's book shows "import hypermedia.video.*;"
// I assume thats updated to gab.opencv.* but should still work.
OpenCV opencv;
void setup()
{
size( 640, 480 );
opencv = new OpenCV( this ); // <-----THIS IS THE ERROR LINE*********
opencv.capture( width, height );
}
void draw()
{
opencv.read();
opencv.flip( OpenCV.flip_HORIZONTAL );
image( opencv.image(), 0, 0 );
}