ELSE runs even after IF runs!
Hey Guys & Gals! I have an odd problem with OpenCV.
I am trying to implement a calibration program based on calibration example of opencv but with more features. The problem is, when in class "Settings" the program reaches the following line in Debug mode, it runs perfectly:
Mat nextImage()
{
Mat result;
if( inputCapture.isOpened() )
{
Mat view0;
inputCapture >> view0;
view0.copyTo(result);
}
else if( atImageList < (int)imageList.size() )
result = imread(imageList[atImageList++], CV_LOAD_IMAGE_COLOR);
return result;
}
Assuming I am taking images from my WebCam, when I am trying to trace the code in Release mode, after IF validates (isOpened()==true) and filling the Result with view0, OpenCV runs the ELSE part too!!!, and thus destoying the result and creating an empty view!. As far as I know if IF validates, ELSE shouldn't validate! :)) but I've no idea why this happens! Remember that my code runs perfectly in Debug mode!
OpenCV:2.4.6 / Visual Studio 2012 / Windows 7 SP1 64bit / Active Configuration: 64bit
First of all, small remark. We suggest not to use hashtags for the tags in the future. They generate a lot of double tags, rendering the search and filter options useless. Keep this in mind at your next post, adjusted it for you now. Like @Michael Burdinov said, keep in mind that in visual studio you need seperate settings for debug/release. Also, make sure that you have your resources at a fixed path for starters, then work on relative paths if that works.
Sorry, I just added what the editor suggested, nothing from myself. I'll consider this in future. Thanks for noting.
Like I said, it is just a small remark. We are in contact with the forum administrator to actually remove the hashtags, meaning tons of topics will loose their tags in the process. Making people using the correct ones for now, will keep it more clear.