Updated by Kirill Kornyakov over 12 years ago
Currently, SIFT currently, sift triggers a floating point exception (_EM_INVALID) in sift.cpp:376 @adjustLocalExtrema@ adjustLocalExtrema (2.4.2 & master) current trunk) if the Hesse matrix has a very small determinant. Our
our Hesse matrix is:
<pre>
dxx = 0.000000000
dxy = 6.12745134e-005
dyy = 0.00220588245
dxs = 2.04248372e-005
dys = 0.00208333344
dss = 0.00114379090
</pre>
The the issue seems to be related with casting the @cvRound@ cvRound value which is xr = -77489432.0 (if the value is not casted no exception is thrown). In in our case @cvRound@ cvRound uses this define:
@#elif #elif defined _MSC_VER && defined _M_IX86 (hence we use visual studio and compile x86 code)@ code)
Since since these values get rejected anyway in line 379, one could fix that issue by writing this statement:
<pre>
if( xi+layer < 1 || xi+layer > nOctaveLayers ||
c+xc < SIFT_IMG_BORDER || c+xc >= img.cols - SIFT_IMG_BORDER ||
r+xr < SIFT_IMG_BORDER || r+xr >= img.rows - SIFT_IMG_BORDER )
return false;
</pre>
in line 374 -> checking for a valid border & layer condition before rounding & casting the values
cheers stefan
our Hesse matrix is:
<pre>
dxx = 0.000000000
dxy = 6.12745134e-005
dyy = 0.00220588245
dxs = 2.04248372e-005
dys = 0.00208333344
dss = 0.00114379090
</pre>
The the issue seems to be related with casting the @cvRound@ cvRound value which is xr = -77489432.0 (if the value is not casted no exception is thrown). In in our case @cvRound@ cvRound uses this define:
@#elif #elif defined _MSC_VER && defined _M_IX86 (hence we use visual studio and compile x86 code)@ code)
Since since these values get rejected anyway in line 379, one could fix that issue by writing this statement:
<pre>
if( xi+layer < 1 || xi+layer > nOctaveLayers ||
c+xc < SIFT_IMG_BORDER || c+xc >= img.cols - SIFT_IMG_BORDER ||
r+xr < SIFT_IMG_BORDER || r+xr >= img.rows - SIFT_IMG_BORDER )
return false;
</pre>
in line 374 -> checking for a valid border & layer condition before rounding & casting the values
cheers stefan