Merge pull request #1495 from StevenPuttemans:bugfix_3282
This commit is contained in:
commit
42c4f91ef4
@ -543,6 +543,8 @@ static void calcSIFTDescriptor( const Mat& img, Point2f ptf, float ori, float sc
|
|||||||
float exp_scale = -1.f/(d * d * 0.5f);
|
float exp_scale = -1.f/(d * d * 0.5f);
|
||||||
float hist_width = SIFT_DESCR_SCL_FCTR * scl;
|
float hist_width = SIFT_DESCR_SCL_FCTR * scl;
|
||||||
int radius = cvRound(hist_width * 1.4142135623730951f * (d + 1) * 0.5f);
|
int radius = cvRound(hist_width * 1.4142135623730951f * (d + 1) * 0.5f);
|
||||||
|
// Clip the radius to the diagonal of the image to avoid autobuffer too large exception
|
||||||
|
radius = std::min(radius, (int) sqrt((double) img.cols*img.cols + img.rows*img.rows));
|
||||||
cos_t /= hist_width;
|
cos_t /= hist_width;
|
||||||
sin_t /= hist_width;
|
sin_t /= hist_width;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user