nguyenducnhaty / aforge

Automatically exported from code.google.com/p/aforge
Other
0 stars 0 forks source link

Infinite loop in blob counter #259

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run blob counter on grayscale images
2. some result in infinite loopa in the BuildObjectsMap rotine in the 3. When 
you are equating to the 0th label if the 0th label maps to a label that maps to 
the label you are equating to you get an infinite loo.

What is the expected output? What do you see instead?

What version of the product are you using?
2.2.2

Please provide any additional information below.
I am able to avoid the problem by changing the loop to start from 0 instead of 
1. i.e. change

// reindex loop
for ( int i = 1; i <= labelsCount; i++ )
to
 for ( int i = 0; i <= labelsCount; i++ )

So the 0th label gets reindexed
I was using grayscale but I suspect the color version has the same problem

Original issue reported on code.google.com by kuhars...@gmail.com on 13 Oct 2011 at 6:47

GoogleCodeExporter commented 9 years ago
Would it be possible to attach an image to reproduce the issue?

Original comment by andrew.k...@gmail.com on 13 Oct 2011 at 8:07

GoogleCodeExporter commented 9 years ago
Sorry. I had made a modification to work a problem the way I wanted and I 
neglected to modify one place that needed it and it caused an inconsistency 
that caused the problem. My bad. Your code is fine.
Bob

Original comment by kuhars...@gmail.com on 13 Oct 2011 at 10:22

GoogleCodeExporter commented 9 years ago
OK. If the code code is fine, then closing the issue.

Original comment by andrew.k...@gmail.com on 14 Oct 2011 at 8:45