How to make the function has many process in GUI image processing?

조회 수: 1 (최근 30일)
Nur Suhada
Nur Suhada 2022년 1월 22일
답변: Cris LaPierre 2022년 1월 22일
% --- Executes on button press in uploadimage.
function uploadimage_Callback(hObject, eventdata, handles)
%% to import the image into the matlab
global a im2
[filename, pathname]=uigetfile('*.*', 'Pick a MATLAB code file');
filename=strcat(pathname,filename);
a=imread(filename);
a=im2double(a);
im2 = a;
axes(handles.axes1);
imshow(a)
title('\fontsize{20}\color[rgb]{0.996, 0.592, 0.0}Kidney Ultrasound')
% --- Executes on button press in preprocessedimage.
function preprocessedimage_Callback(hObject, eventdata, handles)
global a
axes(handles.axes2);
%% change it into gray scale image
b=rgb2gray(a);
%% make the image into binary image
impixelinfo;
c=b>20;
%% to fill the holes
d=imfill(c,'holes');
%% remove some lighting remove the unwanted things in the image
e=bwareaopen(d,1000);
PreprocessedImage=uint8(double(a).*repmat(e,[1 1 3]));
imshow(a);
title('\fontsize{20}\color[rgb]{0.996, 0.592, 0.0}Preprocessed Image')

답변 (1개)

Cris LaPierre
Cris LaPierre 2022년 1월 22일

카테고리

Help CenterFile Exchange에서 Biomedical Imaging에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by