Clear Filters
Clear Filters

extracting coordinates from image

4 views (last 30 days)
Balaji M. Sontakke
Balaji M. Sontakke on 30 Apr 2016
Edited: Geoff Hayes on 30 Apr 2016
I have already obtained a thinned version of the veins and now i have to proceed for the feature extraction. As seen from the attached pic, the first is the original image. Image normalisation followed by adaptive histogram equalistion, thresholding, wiener filter and thinning give the second image.
From there, I need to process the image for feature extraction to be used for matching.
I will be grateful if someone can provide me with the code to loop through all the pixels in the thinned vein pattern (image thin) using matlab and store each pixel value in a matrix which will be used for matching purpose.
Thank You
%%%%%%%%%%%%%The main.m file %%%%%%%%%%%%%%%
clear;
%%Reading image
% get a list of your *bmp images
my_pics = dir('*.tif'); % get a list of your *bmp images
% go through the images recursively
for kk = 1:numel(my_pics)
x=imread(my_pics(kk).name);
size(x);
x=imresize(x,[120 120]);
figure;
subplot(2,3,1);
imagesc(x);
title('Original image')
%%filter CLAHE
A = adapthisteq(x,'cliplimit',0.2,'Distribution','rayleigh'); %noise generate
subplot(2,3,2);
imagesc(A);
title('Noisy image')
f1 = wiener2(A,[5 5]);
subplot(2,3,3);
imagesc(f1);
title('Noise Removed')
colormap(gray);
%%canny edge detection i.e. segmentation
%BW1 = edge(temp,'canny');
%subplot(2,3,4)
%imshow(BW1)
%title('edge detection');
%%thinning
threshold = graythresh(f1);
bw = im2bw(f1,threshold);
subplot(2,3,4);
imshow(bw);
title('thresholding');
bw2 = ~bw; % it works on white (foreground) pixels instead of black pixels. So complement the image:
bw2 = bwmorph(bw2, 'remove');
bw3 = bwmorph(bw2, 'thin', inf);
bw3 = bwmorph(bw3, 'spur');
BW3 = bwmorph(bw3,'skel',Inf);
bw3 = bwareaopen(bw3, 25); % remove small foreground objects.
subplot(2,3,5);
imshow(bw3);
title('Thinning');
%%save roi file in folder ROI
saving_name = sprintf('thin/%g.tif',kk);
imwrite(bw3, saving_name,'tif');
end
%Close all opened figure
%allPlots = findall(0, 'Type', 'figure', 'FileName', []);
% Close.
%delete(allPlots);

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!