Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

While I have no idea what the problem was with

Yold = inContour[0].y;

by compiling it with the debug flag, it went away and it stayed away when I set the release flag.

Having said that, the line

sortedContour[0].x = inContour[0].x;

did not work because sortedContour had not been sized. Adding the lines:

int sz2=inContour.size();

sortedContour.resize(sz2);

corrected that fault and the code compiled.

click to hide/show revision 2
reduced ambiguity of a description

While I have no idea what the problem was with

Yold = inContour[0].y;

by compiling it with the debug flag, it went away and it stayed away when I set the release flag.

Having said that, the line

sortedContour[0].x = inContour[0].x;

did not work caused a segment fault because sortedContour had not been sized. I will allow that the Yout line was always OK and I was misinterpreting the condition. That would make more sense than a self healing program.

Adding the lines:

int sz2=inContour.size();

sortedContour.resize(sz2);

corrected that the latter segment fault and the code compiled.executed properly.