473,396 Members | 1,852 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

list iterator not incremntable in c++: debug assertion

Hi guyz,

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
  1. for (pointIter = dotList.begin(); pointIter != dotList.end(); pointIter++)
  2. for (regionIter = regionList.begin(); regionIter != regionList.end(); regionIter++)
  3. { // Handle left/right
  4. if (((regionIter->x == (pointIter->x + nWindowSize)) || (regionIter->x == (pointIter->x - nWindowSize)) && (regionIter->y == pointIter->y))) 
  5. { dotList.push_back(*regionIter);
  6. regionIter = regionList.erase(regionIter);
  7. }
  8.  
  9. if(regionIter==regionList.end())
  10. {
  11. break;
  12. /*Do nothing*/
  13. }
  14. // Handle up/down
  15. else if (((regionIter->y == (pointIter->y + nWindowSize)) || (regionIter->y == (pointIter->y - nWindowSize))) && (regionIter->x == pointIter->x)) 
  16. { dotList.push_back(*regionIter);
  17. regionIter = regionList.erase(regionIter);
  18. }
  19.  
  20. }
  21. }
Oct 2 '07 #1
1 2358
Savage
1,764 Expert 1GB
Hi guyz,

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
  1. for (pointIter = dotList.begin(); pointIter != dotList.end(); pointIter++)
  2.   for (regionIter = regionList.begin(); regionIter != regionList.end(); regionIter++)
  3.   {  
  4.        // Handle left/right
  5.       if (((regionIter->x == (pointIter->x + nWindowSize)) || (regionIter->x ==   
  6.                     (pointIter->x - nWindowSize)) && (regionIter->y == pointIter->y))) 
  7.       {
  8.             dotList.push_back(*regionIter);
  9.             regionIter = regionList.erase(regionIter);
  10.      }
  11.  
  12.      if(regionIter==regionList.end())
  13.     {
  14.            break;
  15.           /*Do nothing*/
  16.     }
  17.     // Handle up/down
  18.      else if (((regionIter->y == (pointIter->y + nWindowSize)) || (regionIter->y ==                      
  19.                      (pointIter->y - nWindowSize))) && (regionIter->x == pointIter->x)) 
  20.      {
  21.            dotList.push_back(*regionIter);
  22.            regionIter = regionList.erase(regionIter);
  23.     }
  24.  
  25.   }
  26. }
Have you tried with preincrementation?

Savage
Oct 2 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

12
by: Brett L. Moore | last post by:
Hi, I have had trouble determining whether the STL list.size() operation is O(1) or O(n). I know the list is a doubly-linked list, so if the size() operation begins at the head, then counts to...
1
by: Eyal | last post by:
Hi, We have an issue with Debug Assertion showing in Release builds in Managed C++! I have created a small managed C++ project that looks like this: #include "stdafx.h" #using <mscorlib.dll>...
8
by: freckred76 | last post by:
Hi, I think this might be a VC++ problem. I am using Microsoft Visual Studio 2005 Full Version (8.0). I have a simple for loop that iterates over a list using the standard iterator. The...
4
by: Johan Pettersson | last post by:
Hi, I'm trying to "port" a project from VC++ 2003 to VC++ 2005 (Express Edition). This project contains the following code on several places (It is not exactly this code but a generalization of...
4
by: Mullai | last post by:
Hi , My program gives an error message like this Debug Assertion Failed! program:................ File: wincore.cpp Line: 958 Please can anyone help me out in this issue. I have to solve...
12
by: xgngli | last post by:
Suppose we have a vector: vector<intvec(10); We can declare a iterator this way: vector<int>::iterator vecItor; and then dereference it like this: for (vecItor = vec.begin(); vecItor !=...
27
by: Jason Doucette | last post by:
I'm getting an assertion fire from a list iterator being checked against NULL. This did not occur in VC++ 2003 (v7.1). Are there changes that have been made to the STL between these versions that...
11
by: beginner | last post by:
Hi, Does anyone know how to put an assertion in list comprehension? I have the following list comprehension, but I want to use an assertion to check the contents of rec_stdl. I ended up using...
1
by: ashishbhatt12 | last post by:
Hi All, I am using list class in my project(MFC Application). I have made list like ..... typedef std::list rectlist; // Here list is of type RECT in one header file. And during my project...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.