You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/iris/nodes/matcher/hamming_distance_matcher.py
+9-3Lines changed: 9 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ class HammingDistanceMatcher(Matcher):
18
18
4) If parameters norm_mean and weights are both defined, calculate weighted normalized Hamming distance (WNHD) based on IB_Counts, MB_Counts, norm_mean and weights.
19
19
5) Otherwise, calculate Hamming distance (HD) based on IB_Counts and MB_Counts.
20
20
6) If parameter rotation_shift is > 0, repeat the above steps for additional rotations of the iriscode.
21
-
7) Return the minimium distance from above calculations.
21
+
7) Return the minimum distance from above calculations.
22
22
"""
23
23
24
24
classParameters(Matcher.Parameters):
@@ -29,6 +29,7 @@ class Parameters(Matcher.Parameters):
rotation_shift (Optional[conint(ge=0, strict=True)], optional): Rotation shifts allowed in matching (in columns). Defaults to 15.
49
51
normalise (bool, optional): Flag to normalize HD. Defaults to True.
50
-
norm_mean (Optional[confloat(ge=0, le = 1, strict=True)], optional): Nonmatch distance used for normalized HD. Optional paremeter for normalized HD. Defaults to 0.45.
52
+
norm_mean (Optional[confloat(ge=0, le = 1, strict=True)], optional): Nonmatch distance used for normalized HD. Optional parameter for normalized HD. Defaults to 0.45.
51
53
norm_gradient: float, optional): Gradient for linear approximation of normalization term. Defaults to 0.00005.
52
54
separate_half_matching (bool, optional): Separate the upper and lower halves for matching. Defaults to True.
53
-
weights (Optional[List[np.ndarray]], optional): list of weights table. Optional paremeter for weighted HD. Defaults to None.
55
+
weights_path (Optional[str], optional): Path to the weights table. Optional parameter for weighted HD. Defaults to None.
56
+
weights (Optional[List[np.ndarray]], optional): list of weights table. Optional parameter for weighted HD. Defaults to None.
half_width (Optional[np.ndarray] = None): List of half of code width. Optional paremeter for scoring the upper and lower halves separately. Defaults to None.
61
-
weights (Optional[np.ndarray] = None): List of weights table. Optional paremeter for weighted HD. Defaults to None.
60
+
half_width (Optional[np.ndarray] = None): List of half of code width. Optional parameter for scoring the upper and lower halves separately. Defaults to None.
61
+
weights (Optional[np.ndarray] = None): List of weights table. Optional parameter for weighted HD. Defaults to None.
62
62
63
63
Returns:
64
64
Tuple[int, int]: Total nonmatch iriscode bit count and common maskcode bit count, could be a list for top and bottom iris separately.
template_probe (IrisTemplate): Iris template from probe.
148
148
template_gallery (IrisTemplate): Iris template from gallery.
149
-
rotation_shift (int): Rotation allowed in matching, converted to columns.
149
+
rotation_shift (int): Rotation allowed in matching, converted to columns. Defaults to 15.
150
150
normalise (bool, optional): Flag to normalize HD. Defaults to False.
151
151
norm_mean (float, optional): Nonmatch mean distance for normalized HD. Defaults to 0.45.
152
152
norm_gradient (float): Gradient for linear approximation of normalization term. Defaults to 0.00005.
153
153
separate_half_matching (bool, optional): Separate the upper and lower halves for matching. Defaults to False.
154
-
weights (Optional[List[np.ndarray]], optional): List of weights table. Optional paremeter for weighted HD. Defaults to None.
154
+
weights (Optional[List[np.ndarray]], optional): List of weights table. Optional parameter for weighted HD. Defaults to None.
155
155
156
156
Raises:
157
157
MatcherError: If probe and gallery iris codes are of different sizes or number of columns of iris codes is not even or If weights (when defined) and iris codes are of different sizes.
158
158
159
159
Returns:
160
-
Tuple[float, int]: Miminum Hamming distance and corresonding rotation shift.
160
+
Tuple[float, int]: Minimum Hamming distance and corresponding rotation shift.
0 commit comments