Hello (I am working with OpenCV 2.4.13 on Windows 8 with Qt5.7 MinGW),
I have a really weird problem with OpenCV. I try to grab video frames in a thread. It works very well all the time in release mode. In order to deploy my program, I copied the .exe in a folder and included all the dependencies with the .exe. I then built an installer with NSIS.
On several computers, the program works all the time. However, on two computers (Win 8 and Win 7),the videocapture sometimes fail. Sometimes I start the program and everything is fine. Other times, I start the program and all the frames are empty. In the latter case, the capture.open(0) returns 1 which is ok, but the frames are empty.
I tried this: When I get 10 empty frames, I release the video capture, reopen the camera and try to grab frame. But it does not work, the frames are always empty.
The point in common with these two computers is that they have AVG. There are more chances for the capture to fail when AVG is on. There is also more chances for the capture to fail when I run the program as an administrator.
I am working with OpenCV 2.4.13 on Windows 8 with Qt5.7 MinGW. Here is an exerpt of my code.
cv::VideoCapture capture;
int test1=capture.open(0); // This returns 1 so it's ok.
while(1){
capture >> frame;
if (!frame.empty()){...} // This does not work, the frame is empty
Thank you so much,
Alex