Quantcast
Channel: OpenCV Q&A Forum - Latest question feed
Viewing all articles
Browse latest Browse all 19555

OpenCV VideoCapture does not work as pointer or member variable

$
0
0
I have a very strange hevaviour with opencv3.0.0 c++ in visual studio 2010 on windows7. I simply want to open a video file to grab/extract frames from it. When i create a local variable in my cpp, everything works fine: VideoCapture inputVideo; bool loadOk = inputVideo.open(filename); //loadOk is true When i do a pointer in my cpp, the open process does not work. VideoCapture * inputVideo = new VideoCapture(); bool loadOk = inputVideo->open(filename); //loadOk is false When i create a member variable in my header file, it is also not working Header: VideoCapture m_inputVideo; CPP: bool loadOk = m_inputVideo.open(filename); //loadOk is false Header: VideoCapture * m_inputVideo; CPP: m_inputVideo = new VideoCapture(); bool loadOk = m_inputVideo->open(filename); //loadOk is false Can you help me get rid of this problem? I really need to declare the videocapture as member variable so i can acess it throughout my whole program. greetings, Julian

Viewing all articles
Browse latest Browse all 19555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>