i am new to c++ programming..and this forum ...i just hope that i am giving you all the information which will enable you to figure out the problem.
My program uses c++ and image processing toolbox "imagemagick".This program ideally should work on multiple images and gives me the centroids of white/colored dots present in the images. It does this by initially finding out regons that form a dot.It checks for regions whose pixels are white in color. the mask that it uses for doing it is a square window.Another interesting point is when I change either the window size or the threshold. it works for certain combinations.Threshold is the value that determines whether the pixel is white or balck.
QUERY: when i run my program on multiple images, it gives an error dialogue that
DEBUG ASSERTION FALIED
list operator not incrementable
the lines causing the error:
Expand|Select|Wrap|Line Numbers
- for (pointIter = dotList.begin(); pointIter != dotList.end(); pointIter++)
- {
- for (regionIter = regionList.begin(); regionIter != regionList.end(); regionIter++)
- { // Handle left/right
- if (((regionIter->x == (pointIter->x + nWindowSize)) || (regionIter->x == (pointIter->x - nWindowSize)) && (regionIter->y == pointIter->y)))
- { dotList.push_back(*regionIter);
- regionIter = regionList.erase(regionIter);
- }
- if(regionIter==regionList.end())
- {
- break;
- /*Do nothing*/
- }
- // Handle up/down
- else if (((regionIter->y == (pointIter->y + nWindowSize)) || (regionIter->y == (pointIter->y - nWindowSize))) && (regionIter->x == pointIter->x))
- { dotList.push_back(*regionIter);
- regionIter = regionList.erase(regionIter);
- }
- }
- }