Ask Your Question
0

FINGERPRINT IMAGE ORIENTATION ESTIMATION

asked 2013-04-18 01:50:16 -0500

updated 2013-04-18 01:58:30 -0500

berak gravatar image

hi i am new to image processing. i have tried to create a fingerprint image orientation using gardient based method. i have used the following c code to compute the orientation. while i try to overlay the orientation on fingerprint image its not well. can any suggest me if any changes is to be made in the code and also suggest me the best fingerprint image orientation algorithm.

// extracts the orientations
        orientations = malloc(sizeof(byte*)*fgRows);
        for (y = 0; y < fgRows; y++)
        {
            orientations[y] = malloc(fgColumns);
            ZeroMemory(orientations[y],fgColumns);
            for (x = 0; x < fgColumns; x++)
            {
                if (foreground[y][x])
                {
                    int px = border + x * step;
                    int py = border + y * step;
                    int i,j,k,l,m,n;
                    double dx[step][step],dy[step][step];
                    double gx,gy;
                    double nx,ny,ne,coh;
                    int sx[3][3] = {{-1,0,1},{-2,0,2},{-1,0,1}};
                    int sy[3][3] = {{-1,-2,-1},{0,0,0},{1,2,1}};
                    int sumX,sumY;

                    // TODO: estimate local orientation at pixel (px,py)
                    //  and store it into orientations[y][x]

                    if(px<imageWidth && py<imageHeight)
                    {

                    for(i=py,k=0; i<py+step; i++,k++)
                    {
                        for(j=px,l=0; j<px+step; j++,l++)
                        {


                            dx[k][l] = image[i*imageWidth+(j+1)]-image[i*imageWidth+(j-1)];
                            dy[k][l] = image[(i+1)*imageWidth+j]-image[(i-1)*imageWidth+j]; 
                        }
                    }

                    for(i=0; i<step; i++)
                    {
                        for(j=0; j<step; j++)
                        {
                            gx += 2*dx[i][j]*dy[i][j];
                            gy += dx[i][j]*dx[i][j]-dy[i][j]*dy[i][j];
                        }
                    }
                    orientations[y][x] = (int)(0.5*atan2(gx,gy)+(3.14159265358f*0.5));

                    gx = 0.0;
                    gy = 0.0;

                }

            }
        }
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2013-04-19 09:27:37 -0500

Guanta gravatar image
edit flag offensive delete link more
Login/Signup to Answer

Question Tools

Stats

Asked: 2013-04-18 01:50:16 -0500

Seen: 1,566 times

Last updated: Apr 19 '13