Continue to Site

Welcome to

Welcome to our site! is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Orientation Fiedl Estimation

Not open for further replies.


Newbie level 4
May 16, 2011
Reaction score
Trophy points
Activity points
Hello everybody, I'm doing a projec about fingerprints recognition, and to classify the fingerprints images into Five classes I need to calculate the ORIENTATION FIELD. I used for that the least square orientation estimation algorithm. The result must be an image NxN.But with the method I used it's not.Can anybody Help please.I'm realy confused and I need someone to help me.Thank you

I have the idea that you're rotating computer graphics of fingerprints. And you want to process the images automatically rather than having to do it manually using graphics editing software.

Is the question how to turn your images to odd orientations?

There's a mathematical formula for shifting each pixel, if that's what you need. It uses sines and cosines.

Or is the problem that you need a picture that exactly fills an NxN pixel grid?

What if you start with an empty NxN grid (all zeroes) and overlay your image into it? You would calculate the center pixel of your image, then put that in the center of the NxN grid.

Or is the problem that you must scale your image smaller or larger so it will fit the NxN grid?

There are algorithms to do that. Something to the effect of starting with your NxN grid, then calculating the brightness of each pixel based on average brightness of corresponding pixel(s) from your original image.

Hi Brad,
Ihave to classify the fingerprint image and for that I need to find the singular points(Core and Delta).There is many methods to Detect the singularities in a fingerprint image the one I use is the following:
1)Compute the orinetation Fields Estimation(Directional Image).
2)Calculate the poincare Index method to detect singular points.
3)and finally, based on the poinacre Index result we classify the finger print image.

The problem is the entry of the poincare Index algorithm is the DIRECTIONNAL IMAGE.
The orientation field of a fingerprint image defines the local orientation of theridges contained in the fingerprint.
The steps of the algorithm that I used to compute the directional field is based on the Raymon thai Document.2.2.3 Orientation estimation.
Thank You a Lot.

---------- Post added at 22:03 ---------- Previous post was at 21:56 ----------

This is the Matlab code for the Orientation Estimation;

imwrite(img,'image.bmp','bmp');%img is the squelittized Image.

[w,h] = size(image);
direct = zeros(w,h);
W = 16;

sum_value = 1;
bg_certainty = 0;

blockIndex = zeros(ceil(w/W),ceil(h/W));
%directionIndex = zeros(ceil(w/W),ceil(h/W));

times_value = 0;
minus_value = 0;

center = [];

%Note that the image coordinate system is
%x axis towards bottom and y axis towards right

filter_gradient = fspecial('sobel');
%to get x gradient
Gx = filter2(filter_gradient,o);

%to get y gradient
filter_gradient = transpose(filter_gradient);
Gy = filter2(filter_gradient,o);

g3 = (Gx.*Gx) + (Gy.*Gy);

for i=1:W:w
for j=1:W:h

if j+W-1 < h && i+W-1 < w
times_value = sum(sum(g1(i:i+W-1, j:j+W-1)));
minus_value = sum(sum(g2(i:i+W-1, j:j+W-1)));
sum_value = sum(sum(g3(i:i+W-1, j:j+W-1)));

if sum_value ~= 0 && times_value ~=0

bg_certainty = (times_value*times_value + minus_value*minus_value)/(W*W*sum_value);

if bg_certainty > 0.05
blockIndex(ceil(i/W),ceil(j/W)) = 1;

%tan_value = atan2(minus_value,2*times_value);
theta1 = pi/2+ atan2(2*times_value,minus_value)/2;
%now the theta is within [0,pi]

Oy = sin(theta2);
f = fspecial('gaussian');
cos2theta = filter2(f,Ox); % Smoothed sine and cosine of
sin2theta = filter2(f,Oy);
theta = atan2(sin2theta,cos2theta)/2;
%center = [center;[round(i + (W-1)/2),round(j + (W-1)/2),theta,bg_certainty]];
center = [center;[round(i + (W-1)/2),round(j + (W-1)/2),theta]];

figure;imagesc(direct);title('Orientation Field');
hold on
[u,v] = pol2cart(center:),3),8);
% quiver(x,y,px,py)trace les vecteurs gradient(px,py) en chaque pt (x,y)
colormap Gray;
hold off;

---------- Post added at 22:04 ---------- Previous post was at 22:03 ----------

Could you please try it.So you can understand Me better.

---------- Post added at 22:04 ---------- Previous post was at 22:04 ----------

Thanks a lot a lot.
Sorry, I have no experience with fingerprint recognition nor with microcontrollers nor with the program code you listed.

My reply came from my impression (based on your OP) that you weren't sure how to orient and resize the fingerprint image to fit the specified NxN pixel grid.

Don't be sorry.Thak you a lot any way.I really apreciate it.

Not open for further replies.

Part and Inventory Search

Welcome to