MATLAB: How can i find out if two minutiae points in a fingerprint image are on the same ridge line

fingerprint matchingminutiae extraction

Please i need help on how to know if two minutiae points on a fingerprint image are on the same ridge so as to be able to remove fake minutiae points from the fingerprint.
So I have done the extraction of minutiae points in the fingeprint image but how can i know if two of these minutiae points are on the same ridge line i.e. the same white line.
Thanks.

Best Answer

Simple example
I0 = imread('image.jpg');
I1 = ~im2bw(I0);
I2 = bwmorph(I1,'thin',inf);
I3 = bwareaopen(I2,30); % remove lines bigger 30 pixels
[L,n] = bwlabel(I3); % label each region
for i = 1:n
Ic = L==i; % find region
Ib = bwmorph(Ic,'branchpoints'); % branch/minutae points
[y,x] = find(Ib); % find coordinates minutae points
II = cat(3,Ic,I3,I3*0);
imshow(II,'initialmagnification','fit')
hold on
plot(x,y,'or')
hold off
pause(1)
end
I used attached image. So how do you want to remove points? And which one?