开发者

EXC_BAD_ACCESS on a struct assignment -- no idea why this happens

开发者 https://www.devze.com 2023-03-18 23:03 出处:网络
My program crashes on the line params.hessianThreshold = threshold; CvSURFParams cvSURFParams(double threshold, int extended)

My program crashes on the line

params.hessianThreshold = threshold;

CvSURFParams cvSURFParams(double threshold, int extended)
{
    CvSURFParams params;
    params.hessianThreshold = threshold;
    params.extended = extended;
    params.upright = 0;
    params.nOctaves = 4;
    par开发者_如何转开发ams.nOctaveLayers = 2;
    return params;
}

I have no idea why it would crash on a static assignment ... any ideas?


If that code is in the header, it should be static inline CvSURFParams cvSURFParams(double threshold, int extended) (Add a static inline to it). If it's not in the header, put it in the header.

0

精彩评论

暂无评论...
验证码 换一张
取 消