Ask Your Question

Revision history [back]

Exception when constructing BRISK in debug mode but not in release

Hi,

I'm running the following simple code:

int main( int argc, const char** argv )
{
    // Creating the BRISK descriptor
    int Threshl=60;
    int Octaves=4; // (pyramid layer) from which the keypoint has been extracted
    float PatternScales=1.0f;
    std::vector<float> rList;
    std::vector<int> nList;

    // this is the standard pattern found to be suitable also
    rList.resize(5);
    nList.resize(5);
    const double f = 0.85 * PatternScales;

    rList[0] = (float)(f * 0.);
    rList[1] = (float)(f * 2.9);
    rList[2] = (float)(f * 4.9);
    rList[3] = (float)(f * 7.4);
    rList[4] = (float)(f * 10.8);

    nList[0] = 1;
    nList[1] = 10;
    nList[2] = 14;
    nList[3] = 15;
    nList[4] = 20;

    cv::BRISK  BRISKD(rList,nList,1000,(float)(8.2 * PatternScales));//initialize algoritm

It works fine in release mode, but in debug mode I get an exception

Unhandled exception at at 0x000007FF9EA9811C in BriskBoosting1.exe: Microsoft C++ exception: std::length_error at memory location 0x000000A211DA9D70.

How can the code work in release but not in debug? Can someone please shed some light on this problem?

If that makes any difference, I'm using visual studio 2012 and running on windows (x64).

Thanks in advance!

click to hide/show revision 2
retagged

updated 2013-10-09 03:02:06 -0600

berak gravatar image

Exception when constructing BRISK in debug mode but not in release

Hi,

I'm running the following simple code:

int main( int argc, const char** argv )
{
    // Creating the BRISK descriptor
    int Threshl=60;
    int Octaves=4; // (pyramid layer) from which the keypoint has been extracted
    float PatternScales=1.0f;
    std::vector<float> rList;
    std::vector<int> nList;

    // this is the standard pattern found to be suitable also
    rList.resize(5);
    nList.resize(5);
    const double f = 0.85 * PatternScales;

    rList[0] = (float)(f * 0.);
    rList[1] = (float)(f * 2.9);
    rList[2] = (float)(f * 4.9);
    rList[3] = (float)(f * 7.4);
    rList[4] = (float)(f * 10.8);

    nList[0] = 1;
    nList[1] = 10;
    nList[2] = 14;
    nList[3] = 15;
    nList[4] = 20;

    cv::BRISK  BRISKD(rList,nList,1000,(float)(8.2 * PatternScales));//initialize algoritm

It works fine in release mode, but in debug mode I get an exception

Unhandled exception at at 0x000007FF9EA9811C in BriskBoosting1.exe: Microsoft C++ exception: std::length_error at memory location 0x000000A211DA9D70.

How can the code work in release but not in debug? Can someone please shed some light on this problem?

If that makes any difference, I'm using visual studio 2012 and running on windows (x64).

Thanks in advance!