Ask Your Question

Revision history [back]

click to hide/show revision 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

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