问题描述
我是opencv的新用户,并按照说明安装它:
我使用安装制作您从源文件自己的库,这工作很好(使用Visual Studio 2013)。我可以运行基本命令,如读取图像,写图像,运行边缘检测,视频处理等。
但现在我试图使用BackgroundSubtractorMOG,我得到的错误BackgroundSubtractorMOG不是cv的成员。最简单的代码如下,我不知道从哪里开始。我在安装中缺少什么?任何想法?
I am new to opencv and followed instructions to install it as described here:http://docs.opencv.org/doc/tutorials/introduction/windows_install/windows_install.html#windows-installationI used the section "Installation by Making Your Own Libraries from the Source Files", which worked well (using Visual Studio 2013). I am able to run basic commands, like read an image, write an image, run edge detection, video processing etc.But now I tried to use BackgroundSubtractorMOG and I get the error that BackgroundSubtractorMOG is not a member of cv. The simplest code is below and I don't know where to start. Am I missing something in my installation? Any ideas?
#include "stdafx.h"
#include<opencv2/opencv.hpp>
int main()
{
cv::BackgroundSubtractorMOG bg;
return 0;
}
推荐答案
with opencv3.0,BackgroundSubtractorMOG已移至
with opencv3.0, BackgroundSubtractorMOG was moved to the opencv_contrib repo
到使用剩余的BackgroundSubtractorMOG2或BackgroundSubtractorKNN,您必须使用:
to use the remaining BackgroundSubtractorMOG2 or BackgroundSubtractorKNN you'd have to use:
Ptr<BackgroundSubtractorMOG2> bgm = createBackgroundSubtractorMOG2(...);
这篇关于cv没有成员BackgroundSubtractorMOG的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!