[Solved] Background MOG Substractor unreferenced - OpenCV 3.1.0
Hi ,
I am here because i do not come up to use a MOG background substractor with OpendCV 3.1.0
I don't know if it is an include probleme or anything else.
I followed this official tutorial :http://docs.opencv.org/3.1.0/d1/dc5/tutorial_background_subtraction.html#gsc.tab=0
But when i try to create a MOG background substractor like this:
Ptr<BackgroundSubtractor> pMOG; //MOG Background subtractor
Ptr<BackgroundSubtractor> pMOG2; //MOG2 Background subtractor
...
//create Background Subtractor objects
pMOG = createBackgroundSubtractorMOG(); //MOG approach
pMOG2 = createBackgroundSubtractorMOG2(); //MOG2 approach
i get the error: cv has no member named "createBackgroundSubtractorMOG"
Can someone help me?
Edit: I write my own code, i can use the MOG2 but i can't find the simple MOG background substractor.
Solution: Thanks to berak: MOG was moved to opencv_contrib
Importing Contrib to OpenCV: Thanks to the Readme.md in github, i saw that the best way to improt contrib is to rebuild openCV using special option on CMake.
As a temporrary solution i copied the files in an external folder and i included them in my project.
As berak pointed out, the background substractor is in a new namespace, cv::bgsegm::createBackgroundSubtractorMOG(..)
did you try to compile bg_sub.cpp or write a code yourself
I write my own code, i can use the MOG2 but i can't find the simple MOG background substractor
MOG was moved to opencv_contrib
Thanks you berak . Then i have new question, How can i add this to my current project? just copy the .cpp and . hpp i need into my current opencv? or do i have to rebuild opencv? or just add in my .pro file a way to the include folder of the opencv_Contrib
@ClementD, please take a look at the readme there, it's called "readme" for a reason ...
"I keep this subject open if i have question on the importing of opencv contrib" -- yes, sure.
also note, that it's in a new namespace, cv::bgsegm::createBackgroundSubtractorMOG(..)