I'm reading this code about how to extract SIFT features using VLFeat. In particular the descriptor relative to the keypoint key
with direction angles
is saved in f.desc
:
vl_sift_calc_keypoint_descriptor(filt, &f.desc[0], key, angles[q]) ;
BOOST_FOREACH(float &v, f.desc) {
/*
v = round(v * SIFT_RANGE);
if (v > SIFT_RANGE) v = SIFT_RANGE;
*/
v *= 2;
if (v > 1.0) v = 1.0;
}
What I don't understand is the FOREACH
loop: why each descriptor value is doubled? And why the max value is set to 1.0
?