Something funky in the drawing functions? 2.4.8 VS2012
I am wondering if other folks are experiencing something funky in the drawing functions in 2.4.8 using VS2012 c++/cli.
Previously, in 2.4.6, I was using the line function in spots with no problems. Then, I switched to 2.4.8, and the exact same line function started crashing for no apparent reason. I never figured it out.
Now, I am trying to use drawcontours and, depending on the line width, the code crashes.
The following line works.
for(unsigned int i = 0; i < ContoursList.size(); i++ )
{
drawContours( AnalysisFrame, ContoursList , i, color, CV_FILLED, 8);
}
However, if I replace CV_FILLED with an integer like 1 or 2 (for a line width), it crashes. Thus,
drawContours( AnalysisFrame, ContoursList , i, color, 2, 8);
crashes.
Anyone else experiencing these problems with the drawing functions?
Thanks for any help.
Actually, using an integer for line width seems to work perfectly here ... sure you haven't made a typo somewhere? What is the error generated in debugging mode?
Actually, why are you using an unsigned integer to loop through the contours? You would prefer a signed integer right there...
for the "unsigned" issue, I was getting a warning that I was comparing a signed with an unsigned in the for loop because ContoursList.size() returns an unsigned number. It was not an error but I changed it to get rid of the warning since that shouldn't matter. In any event, switching between signed and unsigned here has no efftect.
With more tracking, I can see that it appears to be the same error as I previously posted on the line function because drawcontours calls "thickline" in drawing.cpp. When you run this, you crash getting an error saying "Run Time Check Failure #2 - Stack around the variable 'center' was corrupted." which appears to be on the last line of thickline in drawing.cpp. Previously, I moved the line function to the first line of my code and still got this error.
Then please explain to me why 2.4.8 is working on my system here :)?
Is it possible that it is the same error as was reported for ellipse? http://answers.opencv.org/question/28328/ellipse-bug-found/ That seems like it was found in 2.4.6.