1 | initial version |
First of all I see yoy commented out C-style functionality and combine it with C++ style functionality. When using the old C-style approach, be sure to close pointers to elements in memory, since they lock access to the element in memory for other functions.
If you do not want problems with this, use only C++ style code. Can you display the function you use for reading your image? I am guessing you are not using the imread() C++ approach right?