不怎么实用,希望各位批评指导,相互学习
clear all,close all,
TestDatabasePath = uigetdir('E:\我的大学', 'Select test database path');%自己设置地址
prompt = {'Enter test image name:'};
dlg_title = 'finger Recognition System';
num_lines= 1;
def = {'1'};
TestImage = inputdlg(prompt,dlg_title,num_lines,def);
TestImage = strcat(TestDatabasePath,'\',char(TestImage),'.bmp');
im = imread(TestImage);
tic
I=imresize(im,[200 200]);
figure(1),subplot(131),imshow(I),title('原图');
set(gcf,'position',[1 1 600 600]);
level=graythresh(I);
J=im2bw(I,level);
figure(1),subplot(132),imshow(J),title('二值图');
1