I am using loweGradientFeature functor to extract features from series of images. After processing some images (10 for example, approximately 5000 features per image) apply method accesses value outside of vector bounds (generic vector). In debug mode assertion is thrown. I am using gcc 4.1.2.
Here is code example:
std::list<lti::location> locs;
findFeatureLocations(grayChannel, locs); // Finds the feature locations
lti::loweGradientFeature m_SIFTextractor;
m_SIFTextractor.generate(grayChannel);
std::list<lti::location>::iterator locIt;
lti::dvector* feature = 0;
// Loop over all feature locations
for (locIt= locs.begin(); locIt!=locs.end(); locIt++)
{
feature = new lti::dvector(); // Creates new feature vector
m_SIFTextractor.apply(*locIt, *feature); // Extracts descriptor and stores it in vector -> HERE THE ASSERTION IS THROWN
a_featureVectors.push_back(feature); // Stores pointer on feature vector in list
}
Note that this only happens after many features calculated.