1 | initial version |
here is some code that will solve the question
bool goodMatch(int distance, float percent, int descriptornum)
{
int descriptorbits = 256 * descriptornum;
int result = descriptorbits - (descriptorbits * percent);
if (distance <= result)
return true;
return false;
}
distance - the value returned in dists percent - float value of percent (i.e. 90% = 0.9) descriptornum - the number of descriptors
2 | No.2 Revision |
here is some code that will solve the question
bool goodMatch(int distance, float percent, int descriptornum)
{
int descriptorbits = 256 * descriptornum;
int result = descriptorbits - (descriptorbits * percent);
if return (distance <= result)
return true;
return false;
result);
}
distance - the value returned in dists percent - float value of percent (i.e. 90% = 0.9) descriptornum - the number of descriptors