Matlab GUI for Image Processing, explained with examples

(Last Updated On: December 8, 2021)

MATLAB GUI for image processing:

Matlab GUI for Image Processing– In this tutorial, we are going to discuss about image processing GUI using MATLAB. In order to make the GUI for the image processing, we will first write guide in the MATLAB command window.

Matlab gui for image processing

When we type command guide it will open a design layout we can adjust will the size of the layer. There are certain tools which will be helpful for designing a GUI.

Matlab gui for image processing


Insert button:

So first we will click on button group which will perform certain functionality.

Matlab gui for image processing

Now we have to insert buttons, so click on the button icon that is nothing but push buttons. You can just click and drop it wherever you want, so you can drop number of push buttons and you can place it wherever you want.

Matlab gui for image processing

You can increase or decrease the size of the button and to do the changes you just have to double click on those buttons there will be number of options to make the required changes.

Matlab gui for image processing



Now, in order to change the background color we will select the background color and we will keep as red.  I will be highlighting on the required changes you can go through all the characteristics of inspector. So foreground color is nothing but those text color so yellow are white you can view. Similarly, the important is string which is nothing but the written text about the button it will be helpful for user to tell what functionality it will do so here we will use upload picture.

Matlab gui for image processing

Similarly, when you change string you don’t forget to change the tag which is nothing but it is the function name. If we keep it as push button the same function name will be there in code but we for better readability we have to change and you have to follow the rules of identifiers that is you can’t initiate a tag name using a number or spaces are not allowed and underscores are allowed. So required changes are done and you make sure that visibility is on if this is not on in the output window. You would not see that button it will be hidden.

Matlab gui for image processing


The same changes operations you can perform on push buttons change the background color and if you want extra button so you can keep place it here and to change the pattern group background you just have to double click on that change the background color then title you can change instead of button group we will give simple operation group so the name has changed.

Matlab gui for image processing

Similarly, we will rename the other two push button as add noise and remove the noise.

Matlab gui for image processing

Then we will add three axes one axis will be used to display the upload picture. The second axis will be used to display the noise image and the third axes will be used to display the image when the noise is removed.

Matlab gui for image processing

Now save the project by clicking the save button and after saving the file a code will appear

Matlab gui for image processing


Now we will write the code:

Upload picture:

First of all we will write the command for the upload picture button.

Adding Noise to the image:

Now in order to add noise to the image in our case we are using salt and pepper noise whose values can be adjust according to the requirement and this image will be saved in the axes 2 for which we will write the command:


Removing noise:

Now in order to remove the noise from the image we will use the median filter. First of all we will save the image in the variable “j” then we will apply median filter to the noisy image whose size can be adjusted according to our requirement.

Matlab GUI for Image Processing Complete code:



Working of the project:

Now in order to run the project we will click on the run button and then click on the upload picture in order to upload picture.

Matlab gui for image processing

The image will be displayed in the first axis

Matlab gui for image processing


Then click on the add noise button the noise will be added to the picture which will be displayed in the second axis

Matlab gui for image processing

Then we will click on the remove noise button in order to remove the noise from the image and will be shown in the third axis.

Matlab gui for image processing

 

Recommended For You

About the Author: Engr Fahad

My name is Shahzada Fahad and I am an Electrical Engineer. I have been doing Job in UAE as a site engineer in an Electrical Construction Company. Currently, I am running my own YouTube channel "Electronic Clinic", and managing this Website. My Hobbies are * Watching Movies * Music * Martial Arts * Photography * Travelling * Make Sketches and so on...

1 Comment

Leave a Reply

%d bloggers like this: