# OpenCV: error C3861: 'finite':identifier not found

I am using opensource code prepared by Julien Pilet et al. under the title "Making Background Subtraction Robust to Sudden Illumination Changes". I didn't change anything, but just run it, then it gives me the following error:

error C3861: 'finite':identifier not found

I checked and this error occurred in the "imstat.h" file in the following lines:

if (!finite(det) || det<1e-5) { sigma_computed=false; n=0; one_over_sq_det= 1; memset(sigma,0,sizeof(sigma)); sigma[0][0]=1; sigma[1][1]=1; sigma[2][2]=1; two_ln_sq_det = 2; } else { one_over_sq_det = 1/sqrtf(det); assert(finite(one_over_sq_det)); two_ln_sq_det = 2*log(sqrtf(det)); sigma_computed=true; n = new_n; }

The "imstat.h" file was included by the code in "emvisi2.h" file. Could someone help me understand this error? Seems like there is something wrong in some kind of class definition, but I couldn't find it. Thank you.

## Answers

finite() is an obsolete BSD library function which you might find in some, but not all, versions of <cmath>.

If you have a C++11 version of <cmath> or a C99 version of <math.h>, then an equivalent isfinite() should be available. This might not be available in older versions of the standard library.

Microsoft also seem to declare an equivalent non-standard _finite() function in <float.h>.