vector subscript out of range [closed]
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();
}
lookup.resize(255); // should be 256 (2^8)
(also, careful, the 59 bins assumption there is only valid for exactly 8 neighbours)
thanks that's right it work now