Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

vector subscript out of range

i have acode for check the lbp code for pgm image if it is uniform code or not but when i run the code i have this vector out of range error: debug assertion failed vector out of range this is my code:

  void LBPFeatures::initUniform( int check)
   {

lookup.resize(255);
int index=0;

for(int i=0;i<=255;i++)
{
    bool status=checkUniform(check);
    if(status==true)
    {
        lookup[i]=index;
        index++;
    }
    else
    {
        lookup[i]=59;
    }
}
spatialhist Hist;
 Hist.initHistogram();

}
click to hide/show revision 2
retagged

updated 2014-05-28 14:18:46 -0600

berak gravatar image

vector subscript out of range

i have acode for check the lbp code for pgm image if it is uniform code or not but when i run the code i have this vector out of range error: debug assertion failed vector out of range this is my code:

  void LBPFeatures::initUniform( int check)
   {

lookup.resize(255);
int index=0;

for(int i=0;i<=255;i++)
{
    bool status=checkUniform(check);
    if(status==true)
    {
        lookup[i]=index;
        index++;
    }
    else
    {
        lookup[i]=59;
    }
}
spatialhist Hist;
 Hist.initHistogram();

}