Skip to content

Wrong palm print comprasion computation #36

@IoNaNO

Description

@IoNaNO

while (lhs_md_cur_ptr < lhs_md_end_ptr) {
uint8_t distance = *(uint8_t*)lhs_md_cur_ptr ^ *(uint8_t*)rhs_md_cur_ptr;
if (distance == 0x00) { // same d, s.
acc += 2;
} else if (distance < 0x10) { // same d, diff s.
acc += 0;
}

Based on the matching stage's math definition
$$M\left(X,Y\right)=\frac{1}{2N^2}\sum_{i=1}^{N}\sum_{j=1}^{N}\left[\left(C_X\left(i,j\right)==C_Y\left(i,j\right)\right)+\left(C_X\left(i,j\right)==C_Y\left(i,j\right)\right)\cap\lnot\left(Cs_X\left(i,j\right)\oplus C s_Y\left(i,j\right)\right)\right]$$

When the variable $d$ is the same but the variable $s$ is different, the acc variable should be increased by 1.

In addition, if the variable $d$ is the same but the variable $s$ is different, the distance should yield a specific value of 0x10. It is not recommended to use a comparison expression for this simple operation; instead, an equality expression should be used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions