123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157 |
- /*******************************************************************************
- License:
- This software and/or related materials was developed at the National Institute
- of Standards and Technology (NIST) by employees of the Federal Government
- in the course of their official duties. Pursuant to title 17 Section 105
- of the United States Code, this software is not subject to copyright
- protection and is in the public domain.
- This software and/or related materials have been determined to be not subject
- to the EAR (see Part 734.3 of the EAR for exact details) because it is
- a publicly available technology and software, and is freely distributed
- to any interested party with no licensing requirements. Therefore, it is
- permissible to distribute this software as a free download from the internet.
- Disclaimer:
- This software and/or related materials was developed to promote biometric
- standards and biometric technology testing for the Federal Government
- in accordance with the USA PATRIOT Act and the Enhanced Border Security
- and Visa Entry Reform Act. Specific hardware and software products identified
- in this software were used in order to perform the software development.
- In no case does such identification imply recommendation or endorsement
- by the National Institute of Standards and Technology, nor does it imply that
- the products and equipment identified are necessarily the best available
- for the purpose.
- This software and/or related materials are provided "AS-IS" without warranty
- of any kind including NO WARRANTY OF PERFORMANCE, MERCHANTABILITY,
- NO WARRANTY OF NON-INFRINGEMENT OF ANY 3RD PARTY INTELLECTUAL PROPERTY
- or FITNESS FOR A PARTICULAR PURPOSE or for any purpose whatsoever, for the
- licensed product, however used. In no event shall NIST be liable for any
- damages and/or costs, including but not limited to incidental or consequential
- damages of any kind, including economic damage or injury to property and lost
- profits, regardless of whether NIST shall be advised, have reason to know,
- or in fact shall know of the possibility.
- By using this software, you agree to bear all risk relating to quality,
- use and performance of the software and/or related materials. You agree
- to hold the Government harmless from any claim arising from your use
- of the software.
- *******************************************************************************/
- /***********************************************************************
- LIBRARY: LFS - NIST Latent Fingerprint System
- FILE: RESULTS.C
- AUTHOR: Michael D. Garris
- DATE: 03/16/1999
- UPDATED: 10/04/1999 Version 2 by MDG
- 09/14/2004
- UPDATED: 03/16/2005 by MDG
- Contains routines useful in visualizing intermediate and final
- results when exercising the NIST Latent Fingerprint System (LFS).
- ***********************************************************************
- ROUTINES:
- write_minutiae_XYTQ()
- ***********************************************************************/
- #include <stdio.h>
- #include "lfs.h"
- /*************************************************************************
- **************************************************************************
- #cat: write_minutiae_XYTQ - Write just minutiae XYT's & Qualities to text
- #cat: file according to the specified mintuiae represenation
- Input:
- ofile - output file name
- reptype - specifies XYT output representation
- minutiae - structure containing a list of LFS detected minutiae
- iw - width (in pixels) of the input image
- ih - height (in pixels) of the input image
- Return Code:
- Zero - successful completion
- Negative - system error
- **************************************************************************/
- int write_minutiae_XYTQ(char *ofile, const int reptype, const MINUTIAE *minutiae, const int iw, const int ih){
- FILE *fp;
- int i, ox, oy, ot, oq;
- MINUTIA *minutia;
-
- /* A. If M1 flag set: */
- /* XYTQ's written according to M1 (ANSI INCITS */
- /* 378-2004) representation: */
- /* 1. pixel coordinates with origin top-left */
- /* 2. orientation in degrees on range [0..360] */
- /* with 0 pointing east and increasing counter */
- /* clockwise */
- /* 3. direction pointing up the ridge ending or */
- /* bifurcaiton valley */
- /* 4. minutiae qualities on integer range [0..100] */
- /* (non-standard) */
- /* */
- /* B. If M1 flag NOT set: */
- /* XYTQ's written according to NIST internal rep. */
- /* 1. pixel coordinates with origin bottom-left */
- /* 2. orientation in degrees on range [0..360] */
- /* with 0 pointing east and increasing counter */
- /* clockwise (same as M1) */
- /* 3. direction pointing out and away from the */
- /* ridge ending or bifurcation valley */
- /* (opposite direction from M1) */
- /* 4. minutiae qualities on integer range [0..100] */
- /* (non-standard) */
-
- if((fp = fopen(ofile, "wb")) == (FILE *)NULL){
- fprintf(stderr, "ERROR : write_minutiae_XYTQ : fopen : %s\n", ofile);
- return(-2);
- }
-
- for(i = 0; i < minutiae->num; i++){
- minutia = minutiae->list[i];
-
- switch(reptype){
- case M1_XYT_REP:
- lfs2m1_minutia_XYT(&ox, &oy, &ot, minutia);
- break;
-
- case NIST_INTERNAL_XYT_REP:
- lfs2nist_minutia_XYT(&ox, &oy, &ot, minutia, iw, ih);
- break;
-
- default:
- fprintf(stderr, "ERROR : write_minutiae_XYTQ : ");
- fprintf(stderr, "Invalid XYT representation type = %d\n", reptype);
- fclose(fp);
- return(-4);
-
- }
-
- oq = sround(minutia->reliability * 100.0);
-
- fprintf(fp, "%d %d %d %d\n", ox, oy, ot, oq);
- }
-
-
- if(fclose(fp)){
- fprintf(stderr, "ERROR : write_minutiae_XYTQ : fopen : %s\n", ofile);
- return(-5);
- }
-
- return(0);
- }
|