Qt - Opencv background subtraction issue
-
Hi there! I'm using Qt5.8 with Visual Studio 2017. The below piece of OpenCV code works well in VS, but when I run it using Qt Creator, it doesn't seem to work.
cv::Mat frame, output;
Ptr<BackgroundSubtractor> bgS = createBackgroundSubtractorMOG2();
.
.
cvtColor(frame, output, CV_BGR2GRAY);
bgS->apply(frame, output);The background subtractor doesn't seem to work (but no error is thrown) and output is showing blank (plain gray color) whereas this is working fine in VS. Anyone encountered this issue before?
Thanks in advance.
-
Hi
If you mean "run in creator" that you compile it via creator with same vs compiler or
is it other compiler in Creator ? ( like mingw)In the project folder, there is a run environment settings.
You might need to add a path to the opencv dlls for it to find them.Else it will work the same as Creator is just an editor.
-
@yjt8 if your problem is gone, please don't forget to mark your post as solved! Thanks.