Esempio n. 1
0
/* Based on write_minutiae_XYTQ and bz_load */
static void minutiae_to_xyt(struct fp_minutiae *minutiae, int bwidth,
	int bheight, unsigned char *buf)
{
	int i;
	struct fp_minutia *minutia;
	struct minutiae_struct c[MAX_FILE_MINUTIAE];
	struct xyt_struct *xyt = (struct xyt_struct *) buf;

	/* FIXME: only considers first 150 minutiae (MAX_FILE_MINUTIAE) */
	/* nist does weird stuff with 150 vs 1000 limits */
	int nmin = min(minutiae->num, MAX_FILE_MINUTIAE);

	for (i = 0; i < nmin; i++){
		minutia = minutiae->list[i];

		lfs2nist_minutia_XYT(&c[i].col[0], &c[i].col[1], &c[i].col[2],
				minutia, bwidth, bheight);
		c[i].col[3] = sround(minutia->reliability * 100.0);

		if (c[i].col[2] > 180)
			c[i].col[2] -= 360;
	}

	qsort((void *) &c, (size_t) nmin, sizeof(struct minutiae_struct),
			sort_x_y);

	for (i = 0; i < nmin; i++) {
		xyt->xcol[i]     = c[i].col[0];
		xyt->ycol[i]     = c[i].col[1];
		xyt->thetacol[i] = c[i].col[2];
	}
	xyt->nrows = nmin;
}
Esempio n. 2
0
/*************************************************************************
**************************************************************************
#cat:   lfs2nist_format - Takes a minutiae data structure and converts
#cat:                     the XYT minutiae attributes in LFS native
#cat:                     representation to NIST internal representation
   Input:
      iminutiae - minutiae data structure
      iw        - width (in pixels) of the grayscale image
      ih        - height (in pixels) of the grayscale image
   Output:
      iminutiae - overwrite each minutia element in the minutiae data 
                  sturcture convernt to nist internal minutiae format
**************************************************************************/
void lfs2nist_format(MINUTIAE *iminutiae, int iw, int ih)                     
{
   int i, ox, oy, ot, oq;
   MINUTIA *minutia;

   for (i = 0; i < iminutiae->num; i++)
   {
      minutia = iminutiae->list[i];
      lfs2nist_minutia_XYT(&ox, &oy, &ot, minutia, iw, ih);
      oq = sround(minutia->reliability * 100.0);
      minutia->x = ox;
      minutia->y = oy;
      minutia->direction = ot;
      minutia->reliability = (double)oq;
   }
}