フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

i create a gui there is two image upload button for two different axes now i want to convert this two image in binary form with help of one process button.....could any one help me .how to create?bellow is the code

1 回表示 (過去 30 日間)
indrani dalui
indrani dalui 2017 年 6 月 27 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
% --- Executes on button press in pushbutton1. function pushbutton1_Callback(hObject, eventdata, handles) % hObject handle to pushbutton1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)
[filename, pathname] = uigetfile({'*.bmp';'*.jpg';'*.gif';'*.*'}, 'Pick an Image File'); S = imread([pathname,filename]); axes(handles.axes1); imshow(S); handles.f=[pathname,filename]; guidata(hObject, handles);
% --- Executes on button press in pushbutton2. function pushbutton2_Callback(hObject, eventdata, handles) % hObject handle to pushbutton2 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) [filename, pathname] = uigetfile({'*.bmp';'*.jpg';'*.gif';'*.*'}, 'Pick an Image File'); S = imread([pathname,filename]); axes(handles.axes2); imshow(S); handles.f=[pathname,filename]; guidata(hObject, handles);
now the process button can convert two different image to binary form..........................
% --- Executes on button press in Process. function Process_Callback(hObject, eventdata, handles) % hObject handle to Process (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) if isfield(handles, 'f') % convert to binary binary_image = im2bw( imread(handles.f) ); %Thinning thin_image=~bwmorph(binary_image,'thin',Inf); figure;imshow(thin_image);title('Thinned Image');
%Minutiae extraction s=size(thin_image); N=3;%window size n=(N-1)/2; r=s(1)+2*n; c=s(2)+2*n; double temp(r,c); temp=zeros(r,c);bifurcation=zeros(r,c);ridge=zeros(r,c); temp((n+1):(end-n),(n+1):(end-n))=thin_image(:,:); outImg=zeros(r,c,3);%For Display outImg(:,:,1) = temp .* 255; outImg(:,:,2) = temp .* 255; outImg(:,:,3) = temp .* 255; for x=(n+1+10):(s(1)+n-10) for y=(n+1+10):(s(2)+n-10) e=1; for k=x-n:x+n f=1; for l=y-n:y+n mat(e,f)=temp(k,l); f=f+1; end e=e+1; end; if(mat(2,2)==0) ridge(x,y)=sum(sum(~mat)); bifurcation(x,y)=sum(sum(~mat)); end end; end;
% RIDGE END FINDING [ridge_x ridge_y]=find(ridge==2); len=length(ridge_x); %For Display for i=1:len outImg((ridge_x(i)-3):(ridge_x(i)+3),(ridge_y(i)-3),2:3)=0; outImg((ridge_x(i)-3):(ridge_x(i)+3),(ridge_y(i)+3),2:3)=0; outImg((ridge_x(i)-3),(ridge_y(i)-3):(ridge_y(i)+3),2:3)=0; outImg((ridge_x(i)+3),(ridge_y(i)-3):(ridge_y(i)+3),2:3)=0;
outImg((ridge_x(i)-3):(ridge_x(i)+3),(ridge_y(i)-3),1)=255;
outImg((ridge_x(i)-3):(ridge_x(i)+3),(ridge_y(i)+3),1)=255;
outImg((ridge_x(i)-3),(ridge_y(i)-3):(ridge_y(i)+3),1)=255;
outImg((ridge_x(i)+3),(ridge_y(i)-3):(ridge_y(i)+3),1)=255;
end
%BIFURCATION FINDING [bifurcation_x bifurcation_y]=find(bifurcation==4); len=length(bifurcation_x); %For Display for i=1:len outImg((bifurcation_x(i)-3):(bifurcation_x(i)+3),(bifurcation_y(i)-3),1:2)=0; outImg((bifurcation_x(i)-3):(bifurcation_x(i)+3),(bifurcation_y(i)+3),1:2)=0; outImg((bifurcation_x(i)-3),(bifurcation_y(i)-3):(bifurcation_y(i)+3),1:2)=0; outImg((bifurcation_x(i)+3),(bifurcation_y(i)-3):(bifurcation_y(i)+3),1:2)=0;
outImg((bifurcation_x(i)-3):(bifurcation_x(i)+3),(bifurcation_y(i)-3),3)=255;
outImg((bifurcation_x(i)-3):(bifurcation_x(i)+3),(bifurcation_y(i)+3),3)=255;
outImg((bifurcation_x(i)-3),(bifurcation_y(i)-3):(bifurcation_y(i)+3),3)=255;
outImg((bifurcation_x(i)+3),(bifurcation_y(i)-3):(bifurcation_y(i)+3),3)=255;
end
figure;imshow(outImg);title('Minutiae');
end
  1 件のコメント
Image Analyst
Image Analyst 2017 年 6 月 27 日
Attach the .m file and .fig file with the paper clip icon.

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by