Well, if you're just trying to find the confidence value for the 'test face eigenvectors (or values?)' with just 1 and only trained face, then you'd do something like
However, since you're finding nearest neighbour within trained face database, you want the confidence to reflect that your nearest neighbour gives a high confidence value for one of the faces in your trained database, amongst all the trained faces. Thus the confidence now is calculated not against 1 trained face, but with all trained faces, thus
least_squared_distance = DBL_MAX is basically a safe way from saying least_squared_distance = 99999999, since depending on the platform, hardware, or implementation, that might cause buffer overflow. So DBL_MAX is standard library that represents the largest double value.
And this is how it finds the least squared distance
Well, if you're just trying to find the confidence value for the 'test face eigenvectors (or values?)' with just 1 and only trained face, then you'd do something like
However, since you're finding nearest neighbour within trained face database, you want the confidence to reflect that your nearest neighbour gives a high confidence value for one of the faces in your trained database, amongst all the trained faces. Thus the confidence now is calculated not against 1 trained face, but with all trained faces, thus
least_squared_distance = DBL_MAX is basically a safe way from saying least_squared_distance = 99999999, since depending on the platform, hardware, or implementation, that might cause buffer overflow. So DBL_MAX is standard library that represents the largest double value.
And this is how it finds the least squared distance