Hello,
Well actually i'm working on fingerprint recognition system and i'm using the minutia point algorithm. I'm backing openCV library and i m working now on extraction minutia step which is extract from the SKELETON imge the end of black pixel line points and the bifurcate pixel line points, then store the coordinate on text file and draw some cercles on those points. Meanwhile the algorithm i did seems to give me wrong minutia points. If any one could tell me what's wrong with my code.
here is the code :
///////////////////////////INCLUDE////////////////////////////////////
/////////////////////////////////////////////////////////////////////
#include <stdio.h>
#include <iostream.h>
#include <cv.h>
#include <highgui.h>
void main()
{
int whitecount;
IplImage* dst;
dst = cvLoadImage("Fingerprint_Thinning.jpg",0);
FILE* f1;
f1 = fopen("filename. txt", "w");
for(int height = 0; height < dst->height; height ++){
for(int width = 0; width < dst->width; width++){
if ((int)cvGetReal2D( dst,height, width) == 0)
{
whitecount = 0;
if ((int)cvGetReal2D( dst,height,width-1)!=255) whitecount++;
if ((int)cvGetReal2D( dst,height+1,width-1)!=255) whitecount++;
if ((int)cvGetReal2D( dst,height+1, width)!=255) whitecount++;
if ((int)cvGetReal2D( dst,height+1, width+1)!=255) whitecount++;
if ((int)cvGetReal2D( dst,height, width+1)!=255) whitecount++;
if ((int)cvGetReal2D( dst,height-1, width+1)!=255) whitecount++;
if ((int)cvGetReal2D( dst,height-1, width)!=255) whitecount++;
if ((int)cvGetReal2D( dst,height-1, width-1)!=255) whitecount++;
switch(whitecount)
{
case 0:
/* isolated point, ignore it */
break;
case 1:
fprintf(f1,"minutia type ending coord %d,%d\n",height,width);
cvCircle( dst, cvPoint(width,height), 3, CV_RGB(255, 0, 0),1, CV_AA, 0 );
break;
case 2:
fprintf(f1,"minutia type branching coord %d,%d\n",height,width);
cvCircle( dst, cvPoint(width,height), 1, CV_RGB(255, 0, 0),1, CV_AA, 0 );
break;
}
}
}
}
cvNamedWindow("Fingerprint_Thinning");
cvShowImage("Fingerprint_Thinning",dst);
cvWaitKey(0);
cvReleaseImage(&dst);
}
Partager