my poblem is that i have a database for human dorsal hand veins ,but with intra-class variations , so this problem have a large effect on my results when i need to do matching between my samples for recognition purpose(testing phase after finishing trainning phase ) .
therefore , i need to know what are the possible solutions that may be suitable here. are there any function in matlab can overcome this problem?
examples of my images(5 images for the same person):
class 1:
class 2:
class 3:
and the code that i wrote to obtain the above images was as below:
in_dir = 'E:\master_matlab\HandVein_DataSet';
out_dir = 'E:\master_matlab\final resultant images';
for px = 1 : 50,
for hx = 1 : 5,
fname = sprintf('%04dhv%d.bmp', px, hx);
current_image = imread(fullfile(in_dir, fname));
% do processing
level=graythresh(current_image);
x=im2bw(current_image,level);
% figure,imshow(x);
nnew=current_image.*cast(x,class(current_image));
medimage=medfilt2(nnew,[5 5]);%median Filtering image
% figure,imshow(medimage);
z=adapthisteq(medimage);
% figure,imshow(z);
H = fspecial('unsharp');
y=imfilter(z,H);
% figure,imshow(y);
mIm=imfilter(y,fspecial('average',15),'symmetric');%%%%%%here mask is 15*15 and method is symmetric(not replicate)
sIm=y-mIm;
bw=im2bw(sIm,0); % Convert to binary image
ALT_img=imcomplement(bw); % Complement binary image
% figure,imshow(ALT_img);
%%%%%% morphological on binary images.
open_img =bwmorph(ALT_img,'open' ,Inf);
% figure,imshow(open_img);title('open_img');
major_img =bwmorph(open_img,'majority' ,Inf);
ske_img = bwmorph(major_img,'skel',100);
%removal outer boundary
without_border=ske_img.*x;
% figure,imshow(without_border);
%%%%spurs removal can be added or removed
spur_img=bwmorph(without_border,'spur',1);%8 spurs
% figure,imshow(spur_img);
% centering the resultant spur_image
measurements = regionprops(im2double(spur_img), 'Centroid');
[rows columns] = size(spur_img);
rowsToShift = round(rows/2- measurements.Centroid(2));
columnsToShift = round(columns/2 - measurements.Centroid(1));
shiftedImage = circshift(spur_img, [rowsToShift columnsToShift]);
%%%%%cropping to remove the below white lines
rect=[26 ,37 ,255 ,138];
ssdc=imcrop(shiftedImage, rect);
q12=imresize((ssdc),1.25);
% figure,imshow(q12);
%
% save output
imwrite(q12, fullfile(out_dir, fname));
end
end
regards for all