Ask Your Question

skdskim's profile - activity

2015-10-15 09:18:26 -0600 commented question c++ fitLine function does not work correctly for three input points!

Are there any preconditions in using opencv in MFC GUI programming? Since I use vs2010, the MFC program can not be built with opencv 3.0 and with versions up to 2.4.11, well built with MFC library in both debug and release modes. But, errors like this time sometimes occur especially when using the vector data in standard library and opencv. For example, HoughLinesP function works well within a function body, but when returning from the function, a memory heap corruption error occurs in freeing the vector data automatically.

2015-10-15 06:39:14 -0600 commented question c++ fitLine function does not work correctly for three input points!

Hi, LorenaGdl, I'm sorry, but my program is too big to show here. After reading your reply, firstly, I tried a simple console application in which just three points in a line are input to the fitLine function as Point2f points. The result was correct. Secondly, I ran my program in debug mode, and then find the image coordinates of the 3 nearly collinear points causing said completely incorrect result. I input the three found points in the above test console program and the result is correct at this time. The difference of the two cases is that in my gdi program the fitLine function is called in a for loop (repeated 4 times to detect 4 sides of a rectangular shape). I guess the error is related to a data structure of the vector (std::vector and Vec4f) in the fitLine function.

2015-10-13 13:01:18 -0600 commented question Heap memory corruption bug in C++ HoughLinesP function

Hi, berak, the same code works well in a console program in the same development environment without causing a heap corruption at the end of the program. In MFC gui programming, I used a debug library of opencv 2.4.11 and a static MFC library of VS2010 (/MD) because the dll version of the MFC causes more problems with opencv.

2015-10-13 10:26:08 -0600 asked a question Heap memory corruption bug in C++ HoughLinesP function

In development environment of VS2010, opencv 2.4.11, Windows7-32bit, and an MFC GUI program, the HoughLinesP function always causes a heap memory corruption error in an automatic memory clearing stage of std::vector, even when a std::vector<vec4i> parameter is inputted as an OutputArray parameter of the function like the examples in the documentation. I could cope with this problem with difficulty by using the old cvHoughLines2 function where the output is an old CvSeq data structure. But I think this is unreasonable, and a newer version should address a major function bug of a pretty older version in a software. Could anyone address this problem? The Hough transform is one of much used basic functions in the vision field, as you know.

2015-10-13 09:18:38 -0600 asked a question c++ fitLine function does not work correctly for three input points!

In development environment of VS2010, opencv 2.4.11, and a C++ console program, I found a while ago that the fitLine function did not output a correct result, when just three 2D points are inputted to the function. The three input points were almost collinear, and I used a std::vector<point2f> for the input points, and a Vec4f for an output, however, the fitLine function surprisingly outputted a completely wrong result. I think this is a serious bug, could anyone answer this?