Ask Your Question

hyperchondriac's profile - activity

2012-11-29 10:33:44 -0600 received badge  Editor (source)
2012-11-29 10:30:18 -0600 asked a question C++ Win32 API appears to be interfering with GaussianBlur

Hi all, relative C++ and OpenCV newbie here. Apologies in advance for the essay that's about to follow!

First of all, my setup: I'm running on Windows 7, with gcc from Cygwin, and source builds of OpenCV and boost in Cygwin too. I'm using the NetBeans IDE.

I've been trying to put together a C++ OpenCV project to analyse a load of pictures in a folder. I am using the boost::filesystem to read in a folder path and iterate over each JPEG, running some OpenCV code on each one. This all works fine and dandy, but then I thought it would be nice if, instead of having to alter the path in the code every time I want to analyse a new folder, I could have a "select folder" dialog. I put together some code based on a couple of Win32 and COM API tutorials and again, that all works fine on its own, pulls out the folder name from the dialog and returns it nicely.

However, the big problem comes when I try to put it all together. The program seems to choke as soon as it gets to GaussianBlur; I get:


Reading in image...Success
Thresholding image...Success

RUN FAILED (exit value 1, total time: 42s)

If I take that one command out it all works fine.

Any ideas on why this is happening? Here are some links to a minimal version of my code:

main - this has got a withGui switch to prove the GaussianBlur works without the GUI bit.
winApp - the routine to run a simple win32 GUI
fileOpen - the routine to open a folder and return the path
analysis - the OpenCV analysis routine

PS, if you have any comments on my coding style, or see any other errors I've not noticed then please tell me :-)

Thanks a lot for your help!