Vous êtes sur la page 1sur 17

Mapua University

School of Electric, Electronics, and Computer Engineering

Signals Spectra, and Signals Processing Laboratory

Digital Image Processing :


Enhancement and Segmentation using MATLAB
Project

Date Submitted: July 24, 2019

Guanzing, Jacob Christian P.


EECE107L – E02
Terminal No 15

Engr. Valiente, E.
Instructor
I. Introduction
Digital image processing is an application of many different field of studies, namely
electronics, electric, and computer engineering. Its use widely ranges from changing
the filter of your photo for Instagram, up to climate detection, face recognition, etc…
It is being used daily around the world and had become an integral part of the today’s
modern and sophisticated living.
MATLAB is only one of many integrated development environment (IDE) available
on the market. Digital image processing is taking a image file (in jpg, jpeg, png, bmp,
etc…) and perform image processes to extract meaningful information from the image
using the available functions on an IDE. Different IDEs uses different algorithms to
solve different kind of problems.

II. Acknowledgement
I would like to express my gratitude to our very instructor, Engr. Leonardo Valiente
for being the light for us in learning about the different signal simulations, filters, and
techniques on MATLAB, because not every student is fluent in this programming
language.
I would also like to thank the different youtube channels; MATLAB,
pantechsolutions, for introducing me the tools I need to enhance the effectivity of the
project I created.
III. Program Description

The program can do two basic techniques of digital image processing: image
enhancement and image segmentation. The user can upload their image file by
clicking the Choose and Image button.

On the Enhancement Tab, the image will undergo the process of Deep Correlation
Stretch to enhance a poorly contrasted image. Adjusting the brightness is also
available, from pitch black up to brightest white. On the left of the processed image
is the histogram and the 3D scatter plot of the product image. (Samples on Section V)
On the Segmentation Tab, the image will be separated by 3 planes, namely the
red, green, and blue plane. By this, the image can be segmented more specifically,
depending on the user. The holes created by the sum of the red, green, and blue plane
will be morphologically processed, and the final product image will be shown.

IV. Scope and Limitation

This program only uses the most basic enhancement and segmentation
techniques; it is not designed for any specific uses. This program was only created to
demonstrate the course requirements in digital image processing using MATLAB as
the integrated development environment. Although, the sample pictures presented
could be converted into meaningful data.
V. Screen Capture of Images
VI. M-File

classdef imgprocess1_exported < LevelGreenPlaneLabel


matlab.apps.AppBase matlab.ui.control.Label
SliderGreen
% Properties that correspond to matlab.ui.control.Slider
app components LevelBluePlaneSliderLabel
properties (Access = public) matlab.ui.control.Label
DSP_LAB SliderBlue
matlab.ui.Figure matlab.ui.control.Slider
AxesImage DiskRadiusEditFieldLabel
matlab.ui.control.UIAxes matlab.ui.control.Label
ChooseanImageButton TextEditRadius
matlab.ui.control.Button matlab.ui.control.EditField
FilenameLabel CheckRed
matlab.ui.control.Label matlab.ui.control.CheckBox
TabGroup CheckGreen
matlab.ui.container.TabGroup matlab.ui.control.CheckBox
EnhancementTab CheckBlue
matlab.ui.container.Tab matlab.ui.control.CheckBox
AxesEnhance FilterModesButtonGroup
matlab.ui.control.UIAxes matlab.ui.container.ButtonGroup
AxesHistogram DiskButton
matlab.ui.control.UIAxes matlab.ui.control.RadioButton
Axes3DPlot SquaresButton
matlab.ui.control.UIAxes matlab.ui.control.RadioButton
DeepCorrelationStrechLabel SquareLengthLabel
matlab.ui.control.Label matlab.ui.control.Label
SliderDeepCorr TextEditSquare
matlab.ui.control.Slider matlab.ui.control.EditField
LabelCoeff
matlab.ui.control.Label GuanzingJacobChristianPECE107LE04Lab
LabelVal el matlab.ui.control.Label
matlab.ui.control.Label end
BrightnessSliderLabel
matlab.ui.control.Label
BrightnessSlider methods (Access = private)
matlab.ui.control.Slider
SegmentationTab function enhanceimage(app,
matlab.ui.container.Tab filename)
AxesSegment % try
matlab.ui.control.UIAxes im =
AxesGreen imread(filename);
matlab.ui.control.UIAxes
AxesRed imagesc(app.AxesImage, im);
matlab.ui.control.UIAxes
AxesBlue %imagesc(app.AxesEnhance,im);
matlab.ui.control.UIAxes
LevelRedPlaneSliderLabel
matlab.ui.control.Label %For enhancement
SliderRed enhanceim = im;
matlab.ui.control.Slider val =
get(app.SliderDeepCorr,'value');
%Brightness levelb =
valu = get(app.SliderBlue,'value');
get(app.BrightnessSlider,'value'); radvalue =
decor_im = get(app.TextEditRadius, 'value');
imadd(enhanceim,valu); rad = str2double(radvalue);
boolr =
%DeepCorrStrech get(app.CheckRed,'value');
decor_im = boolg =
decorrstretch(decor_im, 'Tol', val); get(app.CheckGreen,'value');
%Display boolb =
Image get(app.CheckBlue,'value');
booldisk =
imagesc(app.AxesEnhance, decor_im); get(app.DiskButton,'value');
% boolsquare =
app.AxesHistogram.Visible = 'on'; get(app.SquaresButton,'value');
r = widthval =
decor_im(:,:,1); get(app.TextEditSquare,'value');
b = width =
decor_im(:,:,2); str2double(widthval);
g = imagesc(app.AxesImage,
decor_im(:,:,3); im);

plot3(app.Axes3DPlot,r(:),g(:),b(:), segim =
'.'); imcomplement(im);
rmat = segim(:,:,1);
grid(app.Axes3DPlot, "on"); gmat = segim(:,:,2);
bmat = segim(:,:,3);
histim =
histogram(app.AxesHistogram, ir =
decor_im(:,:,1)); imbinarize(rmat,levelr);
maxg = imagesc(app.AxesRed,
max(histim.BinCounts); ir);
ig =
app.AxesHistogram.YLim = [0 maxg]; imbinarize(gmat,levelg);
imagesc(app.AxesGreen,
app.AxesHistogram.YTick = round([0 ig);
maxg/2 maxg], 2, 'significant'); ib =
% catch ME imbinarize(bmat,levelb);
% If problem imagesc(app.AxesBlue,
reading image, display error message ib);
%
uialert(app.DSP_LAB, ME.message, if(not(boolr))
'Image Error'); ir = 1;
% return; end
% end if(not(boolg))
end ig = 1;
end
if(not(boolb))
function segmentimage(app, ib = 1;
filename) end
im = imread(filename);
levelr = itotal = (ir&ig&ib);
get(app.SliderRed,'value'); ifilled = imfill(itotal,
levelg = 'holes');
get(app.SliderGreen,'value'); if(booldisk)
se = end
strel('disk',rad);
else % Callback function
se = function
strel('square',width); ProcessButtonGroupSelectionChanged(a
end pp, event)
iop = selectedButton =
imopen(ifilled,se); app.ProcessButtonGroup.SelectedObjec
t;
imagesc(app.AxesSegment, im =
iop); imread(app.FilenameLabel.Text);

imagesc(app.AxesEnhance,im);
end
end switch selectedButton
case
app.ImageEnhancementButton
% Callbacks that handle app.AxesHistogram.Visible = 'on';
component events r = im(:,:,1);
methods (Access = private) b = im(:,:,2);
g = im(:,:,3);
% Code that executes after
component creation plot3(app.Axes3DPlot,r(:),g(:),b(:),
function startupFcn(app) '.');
app.AxesImage.Colormap =
gray(256); grid(app.Axes3DPlot, "on");
axis(app.AxesImage,
'image'); histim =
histogram(app.AxesHistogram,
im(:,:,1));
end maxg =
max(histim.BinCounts);
% Button pushed function:
ChooseanImageButton app.AxesHistogram.YLim = [0 maxg];
function
ChooseanImageButtonPushed(app, app.AxesHistogram.YTick = round([0
event) maxg/2 maxg], 2, 'significant');
filterspec =
{'*.jpg;*.tif;*.png;*.gif','All end
Image Files'}; end
[f, p] =
uigetfile(filterspec); % Value changed function:
SliderDeepCorr
if (ischar(p)) function
fname = [p f]; SliderDeepCorrValueChanged(app,
event)
app.FilenameLabel.Text = fname; value =
im = imread(fname); app.SliderDeepCorr.Value;
fname =
imagesc(app.AxesImage,im); app.FilenameLabel.Text;
enhanceimage(app, enhanceimage(app,
fname); fname);
segmentimage(app, labelvalue =
fname); num2str(value);
end
app.LabelVal.Text = value =
labelvalue; app.SliderBlue.Value;
end fname =
app.FilenameLabel.Text;
% Value changed function: segmentimage(app,
BrightnessSlider fname);
function end
BrightnessSliderValueChanged(app,
event) % Value changed function:
value = TextEditRadius
app.BrightnessSlider.Value; function
fname = TextEditRadiusValueChanged(app,
app.FilenameLabel.Text; event)
enhanceimage(app, value =
fname); app.TextEditRadius.Value;
end fname =
app.FilenameLabel.Text;
% Callback function segmentimage(app,
function fname);
SaveImageButtonPushed(app, event) end
out_image =
imread('eeee.jpg'); % Value changed function:
imwrite(out_image, CheckRed
'EnhancedImage.jpg'); function
end CheckRedValueChanged(app, event)
value =
% Value changed function: app.CheckRed.Value;
SliderRed fname =
function app.FilenameLabel.Text;
SliderRedValueChanged(app, event) segmentimage(app,
value = fname);
app.SliderRed.Value; end
fname =
app.FilenameLabel.Text; % Value changed function:
segmentimage(app, CheckGreen
fname); function
end CheckGreenValueChanged(app, event)
value =
% Value changed function: app.CheckGreen.Value;
SliderGreen fname =
function app.FilenameLabel.Text;
SliderGreenValueChanged(app, event) segmentimage(app,
value = fname);
app.SliderGreen.Value; end
fname =
app.FilenameLabel.Text; % Value changed function:
segmentimage(app, CheckBlue
fname); function
CheckBlueValueChanged(app, event)
end value =
app.CheckBlue.Value;
% Value changed function: fname =
SliderBlue app.FilenameLabel.Text;
function segmentimage(app,
SliderBlueValueChanged(app, event) fname);
end
0.5686 0.9373;0.1529 0.5922
% Selection changed 0.9216;0.1451 0.6078 0.9098;0.1373
function: FilterModesButtonGroup 0.6275 0.898;0.1255 0.6471
function 0.8902;0.1098 0.6627 0.8745;0.0941
FilterModesButtonGroupSelectionChang 0.6784 0.8588;0.0706 0.6941
ed(app, event) 0.8392;0.0314 0.7098 0.8157;0.0039
selectedButton = 0.7216 0.7922;0.0078 0.7294
app.FilterModesButtonGroup.SelectedO 0.7647;0.0431 0.7412 0.7412;0.098
bject; 0.749 0.7137;0.1412 0.7569
fname = 0.6824;0.1725 0.7686 0.6549;0.1922
app.FilenameLabel.Text; 0.7765 0.6235;0.2157 0.7843
segmentimage(app, 0.5922;0.2471 0.7922 0.5569;0.2902
fname); 0.7961 0.5176;0.3412 0.8
end 0.4784;0.3922 0.8039 0.4353;0.4471
0.8039 0.3922;0.5059 0.8
% Value changed function: 0.349;0.5608 0.7961 0.3059;0.6157
TextEditSquare 0.7882 0.2627;0.6706 0.7804
function 0.2235;0.7255 0.7686 0.1922;0.7725
TextEditSquareValueChanged(app, 0.7608 0.1647;0.8196 0.749
event) 0.1529;0.8627 0.7412 0.1608;0.902
value = 0.7333 0.1765;0.9412 0.7294
app.TextEditSquare.Value; 0.2118;0.9725 0.7294 0.2392;0.9961
fname = 0.7451 0.2353;0.9961 0.7647
app.FilenameLabel.Text; 0.2196;0.9961 0.7882 0.2039;0.9882
segmentimage(app, 0.8118 0.1882;0.9804 0.8392
fname); 0.1765;0.9686 0.8627 0.1647;0.9608
end 0.8902 0.1529;0.9608 0.9137
end 0.1412;0.9647 0.9373 0.1255;0.9686
0.9608 0.1059;0.9765 0.9843 0.0824];
app.DSP_LAB.Position =
% Component initialization [100 100 962 660];
methods (Access = private) app.DSP_LAB.Name = 'DSP
Laboratory Project';
% Create UIFigure and
components % Create AxesImage
function app.AxesImage =
createComponents(app) uiaxes(app.DSP_LAB);
title(app.AxesImage,
% Create DSP_LAB and 'Image')
hide until all components are xlabel(app.AxesImage,
created '')
app.DSP_LAB = ylabel(app.AxesImage,
uifigure('Visible', 'off'); '')
app.DSP_LAB.Colormap = app.AxesImage.XTick =
[0.2431 0.149 0.6588;0.251 0.1647 [];
0.7059;0.2588 0.1804 0.7529;0.2627 app.AxesImage.YTick =
0.1961 0.7961;0.2706 0.2157 [];
0.8353;0.2745 0.2353 0.8706;0.2784 app.AxesImage.Position =
0.2549 0.898;0.2784 0.2784 [20 400 308 239];
0.9216;0.2784 0.302 0.9412;0.2824
0.3216 0.9569;0.2784 0.3451 % Create
0.9725;0.2745 0.3686 0.9843;0.2706 ChooseanImageButton
0.3882 0.9922;0.2588 0.4118 app.ChooseanImageButton
0.9961;0.2431 0.4353 1;0.2196 0.4588 = uibutton(app.DSP_LAB, 'push');
0.9961;0.1961 0.4863 0.9882;0.1843
0.5059 0.9804;0.1804 0.5294 app.ChooseanImageButton.ButtonPushed
0.9686;0.1765 0.549 0.9529;0.1686
Fcn = createCallbackFcn(app,
@ChooseanImageButtonPushed, true); ylabel(app.AxesHistogram, 'Pixels')

app.ChooseanImageButton.Position = app.AxesHistogram.Position = [341


[79 363 189 38]; 364 229 202];

app.ChooseanImageButton.Text = % Create Axes3DPlot


'Choose an Image'; app.Axes3DPlot =
uiaxes(app.EnhancementTab);
% Create FilenameLabel title(app.Axes3DPlot,
app.FilenameLabel = '3-D Plot')
uilabel(app.DSP_LAB); xlabel(app.Axes3DPlot,
'Red')
app.FilenameLabel.Visible = 'off'; ylabel(app.Axes3DPlot,
'Blue')
app.FilenameLabel.Position = [90 173 app.Axes3DPlot.XGrid =
55 22]; 'on';
app.FilenameLabel.Text = app.Axes3DPlot.YGrid =
'Filename'; 'on';
app.Axes3DPlot.ZGrid =
% Create TabGroup 'on';
app.TabGroup = app.Axes3DPlot.Position
uitabgroup(app.DSP_LAB); = [255 43 315 249];
app.TabGroup.Position =
[372 17 571 625]; % Create
DeepCorrelationStrechLabel
% Create EnhancementTab
app.EnhancementTab = app.DeepCorrelationStrechLabel =
uitab(app.TabGroup); uilabel(app.EnhancementTab);
app.EnhancementTab.Title
= 'Enhancement'; app.DeepCorrelationStrechLabel.FontS
ize = 14;
% Create AxesEnhance
app.AxesEnhance = app.DeepCorrelationStrechLabel.Posit
uiaxes(app.EnhancementTab); ion = [12 302 168 33];
title(app.AxesEnhance,
'Processed') app.DeepCorrelationStrechLabel.Text
xlabel(app.AxesEnhance, = {'Deep Correlation Strech'; ''};
'')
ylabel(app.AxesEnhance, % Create SliderDeepCorr
'') app.SliderDeepCorr =
app.AxesEnhance.XTick = uislider(app.EnhancementTab);
[];
app.AxesEnhance.YTick = app.SliderDeepCorr.Limits = [0 0.5];
[];
app.AxesEnhance.Position app.SliderDeepCorr.ValueChangedFcn =
= [28 346 308 239]; createCallbackFcn(app,
@SliderDeepCorrValueChanged, true);
% Create AxesHistogram
app.AxesHistogram = app.SliderDeepCorr.Position = [14
uiaxes(app.EnhancementTab); 296 188 3];
title(app.AxesHistogram, app.SliderDeepCorr.Value
'Histogram') = 0.01;

xlabel(app.AxesHistogram, % Create LabelCoeff


'Intensity')
app.LabelCoeff = % Create AxesSegment
uilabel(app.EnhancementTab); app.AxesSegment =
app.LabelCoeff.Position uiaxes(app.SegmentationTab);
= [17 229 101 22]; title(app.AxesSegment,
app.LabelCoeff.Text = 'Processed')
{'Correlation Value:'; ''}; xlabel(app.AxesSegment,
'')
% Create LabelVal ylabel(app.AxesSegment,
app.LabelVal = '')
uilabel(app.EnhancementTab); app.AxesSegment.XTick =
app.LabelVal.Position = [];
[118 229 127 22]; app.AxesSegment.YTick =
app.LabelVal.Text = [];
'0.1'; app.AxesSegment.Position
= [17 346 308 239];
% Create
BrightnessSliderLabel % Create AxesGreen
app.AxesGreen =
app.BrightnessSliderLabel = uiaxes(app.SegmentationTab);
uilabel(app.EnhancementTab); title(app.AxesGreen,
'Green Plane')
app.BrightnessSliderLabel.Horizontal xlabel(app.AxesGreen,
Alignment = 'right'; '')
ylabel(app.AxesGreen,
app.BrightnessSliderLabel.FontSize = '')
14; app.AxesGreen.XTick =
[];
app.BrightnessSliderLabel.Position = app.AxesGreen.YTick =
[12 185 72 22]; [];
app.AxesGreen.Position =
app.BrightnessSliderLabel.Text = [356 231 196 167];
'Brightness';
% Create AxesRed
% Create app.AxesRed =
BrightnessSlider uiaxes(app.SegmentationTab);
app.BrightnessSlider = title(app.AxesRed, 'Red
uislider(app.EnhancementTab); Plane')
xlabel(app.AxesRed, '')
app.BrightnessSlider.Limits = [-255 ylabel(app.AxesRed, '')
255]; app.AxesRed.XTick = [];
app.AxesRed.YTick = [];
app.BrightnessSlider.ValueChangedFcn app.AxesRed.Position =
= createCallbackFcn(app, [356 418 196 167];
@BrightnessSliderValueChanged,
true); % Create AxesBlue
app.AxesBlue =
app.BrightnessSlider.Position = [17 uiaxes(app.SegmentationTab);
166 185 3]; title(app.AxesBlue,
'Blue Plane')
% Create SegmentationTab xlabel(app.AxesBlue, '')
app.SegmentationTab = ylabel(app.AxesBlue, '')
uitab(app.TabGroup); app.AxesBlue.XTick = [];
app.AxesBlue.YTick = [];
app.SegmentationTab.Title = app.AxesBlue.Position =
'Segmentation'; [356 44 196 167];
% Create app.SliderGreen =
LevelRedPlaneSliderLabel uislider(app.SegmentationTab);
app.SliderGreen.Limits =
app.LevelRedPlaneSliderLabel = [0 1];
uilabel(app.SegmentationTab);
app.SliderGreen.ValueChangedFcn =
app.LevelRedPlaneSliderLabel.Horizon createCallbackFcn(app,
talAlignment = 'right'; @SliderGreenValueChanged, true);

app.LevelRedPlaneSliderLabel.FontSiz app.SliderGreen.FontColor = [0.3922


e = 14; 0.8314 0.0745];
app.SliderGreen.Position
app.LevelRedPlaneSliderLabel.FontCol = [38 207 150 3];
or = [0.6353 0.0784 0.1843];
% Create
app.LevelRedPlaneSliderLabel.Positio LevelBluePlaneSliderLabel
n = [25 310 114 22];
app.LevelBluePlaneSliderLabel =
app.LevelRedPlaneSliderLabel.Text = uilabel(app.SegmentationTab);
'Level(Red Plane)';
app.LevelBluePlaneSliderLabel.Horizo
% Create SliderRed ntalAlignment = 'right';
app.SliderRed =
uislider(app.SegmentationTab); app.LevelBluePlaneSliderLabel.FontSi
app.SliderRed.Limits = ze = 14;
[0 1];
app.LevelBluePlaneSliderLabel.FontCo
app.SliderRed.ValueChangedFcn = lor = [0 0.4471 0.7412];
createCallbackFcn(app,
@SliderRedValueChanged, true); app.LevelBluePlaneSliderLabel.Positi
app.SliderRed.FontColor on = [23 137 116 22];
= [0.6353 0.0784 0.1843];
app.SliderRed.Position = app.LevelBluePlaneSliderLabel.Text =
[41 298 150 3]; 'Level(Blue Plane)';

% Create % Create SliderBlue


LevelGreenPlaneLabel app.SliderBlue =
app.LevelGreenPlaneLabel uislider(app.SegmentationTab);
= uilabel(app.SegmentationTab); app.SliderBlue.Limits =
[0 1];
app.LevelGreenPlaneLabel.HorizontalA
lignment = 'right'; app.SliderBlue.ValueChangedFcn =
createCallbackFcn(app,
app.LevelGreenPlaneLabel.FontSize = @SliderBlueValueChanged, true);
14; app.SliderBlue.FontColor
= [0 0.4471 0.7412];
app.LevelGreenPlaneLabel.FontColor = app.SliderBlue.Position
[0.3922 0.8314 0.0745]; = [41 125 150 3];

app.LevelGreenPlaneLabel.Position = % Create
[23 219 127 22]; DiskRadiusEditFieldLabel

app.LevelGreenPlaneLabel.Text = app.DiskRadiusEditFieldLabel =
'Level(Green Plane)'; uilabel(app.SegmentationTab);

% Create SliderGreen
createCallbackFcn(app,
app.DiskRadiusEditFieldLabel.Horizon @CheckBlueValueChanged, true);
talAlignment = 'right'; app.CheckBlue.Text = '';
app.CheckBlue.Position =
app.DiskRadiusEditFieldLabel.Positio [14 116 25 22];
n = [102 44 70 22]; app.CheckBlue.Value =
true;
app.DiskRadiusEditFieldLabel.Text =
'Disk Radius'; % Create
FilterModesButtonGroup
% Create TextEditRadius
app.TextEditRadius = app.FilterModesButtonGroup =
uieditfield(app.SegmentationTab, uibuttongroup(app.SegmentationTab);
'text');
app.FilterModesButtonGroup.Selection
app.TextEditRadius.ValueChangedFcn = ChangedFcn = createCallbackFcn(app,
createCallbackFcn(app, @FilterModesButtonGroupSelectionChan
@TextEditRadiusValueChanged, true); ged, true);

app.TextEditRadius.Position = [187 app.FilterModesButtonGroup.Title =


44 100 22]; 'Filter Modes';
app.TextEditRadius.Value
= '25'; app.FilterModesButtonGroup.Position
= [224 226 123 106];
% Create CheckRed
app.CheckRed = % Create DiskButton
uicheckbox(app.SegmentationTab); app.DiskButton =
uiradiobutton(app.FilterModesButtonG
app.CheckRed.ValueChangedFcn = roup);
createCallbackFcn(app, app.DiskButton.Text =
@CheckRedValueChanged, true); 'Disk';
app.CheckRed.Text = ''; app.DiskButton.Position
app.CheckRed.Position = = [11 60 58 22];
[14 288 25 22]; app.DiskButton.Value =
app.CheckRed.Value = true;
true;
% Create SquaresButton
% Create CheckGreen app.SquaresButton =
app.CheckGreen = uiradiobutton(app.FilterModesButtonG
uicheckbox(app.SegmentationTab); roup);
app.SquaresButton.Text =
app.CheckGreen.ValueChangedFcn = 'Squares';
createCallbackFcn(app,
@CheckGreenValueChanged, true); app.SquaresButton.Position = [11 38
app.CheckGreen.Text = 67 22];
'';
app.CheckGreen.Position % Create
= [14 197 25 22]; SquareLengthLabel
app.CheckGreen.Value = app.SquareLengthLabel =
true; uilabel(app.SegmentationTab);

% Create CheckBlue app.SquareLengthLabel.HorizontalAlig


app.CheckBlue = nment = 'right';
uicheckbox(app.SegmentationTab);
app.SquareLengthLabel.Position = [94
app.CheckBlue.ValueChangedFcn = 15 84 22];
end
app.SquareLengthLabel.Text = 'Square end
Length';
% App creation and deletion
% Create TextEditSquare methods (Access = public)
app.TextEditSquare =
uieditfield(app.SegmentationTab, % Construct app
'text'); function app =
imgprocess1_exported
app.TextEditSquare.ValueChangedFcn =
createCallbackFcn(app, % Create UIFigure and
@TextEditSquareValueChanged, true); components
createComponents(app)
app.TextEditSquare.Position = [193
15 100 22];
app.TextEditSquare.Value % Register the app with
= '25'; App Designer
registerApp(app,
app.DSP_LAB)
% Create
GuanzingJacobChristianPECE107LE04Lab
el % Execute the startup
function
app.GuanzingJacobChristianPECE107LE0 runStartupFcn(app,
4Label = uilabel(app.DSP_LAB); @startupFcn)

app.GuanzingJacobChristianPECE107LE0 if nargout == 0
4Label.VerticalAlignment = 'top'; clear app
end
app.GuanzingJacobChristianPECE107LE0 end
4Label.FontSize = 21;
% Code that executes before
app.GuanzingJacobChristianPECE107LE0 app deletion
4Label.Position = [38 60 272 55]; function delete(app)

app.GuanzingJacobChristianPECE107LE0 % Delete UIFigure when


4Label.Text = {'Guanzing Jacob app is deleted
Christian P.'; 'ECE107L / E04'; ''}; delete(app.DSP_LAB)
end
% Show the figure after end
all components are created end
app.DSP_LAB.Visible =
'on';
VII. Sample Outputs

Vous aimerez peut-être aussi