diff --git a/bob/learn/misc/__init__.py b/bob/learn/misc/__init__.py index bae1acf977d226b33e12046bd6e1c67d10cab0ad..a4e9098b449607bb38f348861b95e9d883f93bf4 100644 --- a/bob/learn/misc/__init__.py +++ b/bob/learn/misc/__init__.py @@ -12,6 +12,22 @@ from ._old_library import * from . import version from .version import module as __version__ + +def ztnorm_same_value(vect_a, vect_b): + """Computes the matrix of boolean D for the ZT-norm, which indicates where + the client ids of the T-Norm models and Z-Norm samples match. + + vect_a An (ordered) list of client_id corresponding to the T-Norm models + vect_b An (ordered) list of client_id corresponding to the Z-Norm impostor samples + """ + import numpy + sameMatrix = numpy.ndarray((len(vect_a), len(vect_b)), 'bool') + for j in range(len(vect_a)): + for i in range(len(vect_b)): + sameMatrix[j, i] = (vect_a[j] == vect_b[i]) + return sameMatrix + + def get_config(): """Returns a string containing the configuration information. """