Ejemplo n.º 1
0
    def get_minutiae_paired_all(self, format=None, **options):
        """
            Return only the paired minutiae for all fingers, similair to the get_minutiae_all() function
        """
        if ifany([4, 14], self.get_ntype()):
            if format == None:
                format = self.minutiaeformat

            ret = []

            for idc in xrange(1, 11):
                try:
                    ret.append(self.get_minutiae_paired(format=format,
                                                        idc=idc))
                except idcNotFound:
                    ret.append([])

            return ret

        elif 13 in self.get_ntype():
            ret = [[]] * 10
            ret[0] = self.get_minutiae(format=format)
            return ret

        else:
            raise notImplemented
Ejemplo n.º 2
0
    def load_auto(self, p):
        """
            Function to detect and load automatically the 'p' value passed in
            parameter. The argument 'p' can be a string (URI to the file to
            load) or a NIST object (a copy will be done in the current object).
            
            :param p: Input data to parse to NIST object.
            :type p: NIST or str
        """
        if isinstance(p, (str, unicode)):
            if ifany([FS, GS, RS, US], p):
                self.load(p)

            else:
                self.read(p)

        elif isinstance(p, (NIST, dict)):
            if isinstance(p, NIST):
                p = p.data

            for ntype, tmp in p.iteritems():
                ntype = int(ntype)
                self.add_ntype(ntype)

                for idc, tmp2 in tmp.iteritems():
                    idc = int(idc)
                    self.add_idc(ntype, idc)

                    for tagid, value in tmp2.iteritems():
                        tagid = int(tagid)

                        self.set_field((ntype, tagid), value, idc)
Ejemplo n.º 3
0
    def get_minutiae(self, format=None, idc=-1, **options):
        """
            Overload of the NISTf.get_minutiae() function to extract the
            information from the JAR stored in the 9.184 field. The minutiae
            coordinates are converted in the correct format (mm in this case),
            and stored in an AnnoationList object. All functions based on this
            function should work normaly.
            
            .. see:: :func:`NIST.fingerprint.NISTf.get_minutiae()`
        """
        if ifany(options.keys(),
                 ["field", "asfield"]) or self.get_field("9.184") == None:
            return super(NIST_Morpho, self).get_minutiae(format=format,
                                                         idc=idc)

        else:
            if isinstance(format, int):
                idc, format = format, self.minutiaeformat

            return self.process_imageenh(idc)['minutiae'].get(format)