Gud evening everyone, today i'll be posting something related to MATLAB image processing coding.
After the installation of MATLAB the first look of the software is shown in image below.
After the installation of MATLAB the first look of the software is shown in image below.
As you can see in above image whole window of the software is divided in four parts.
1.Command Window
2.Workspace
3.Command History
4.Current Folder.
Command Window is the place where you can directly write the code and get results immediately but there is also a disadvantage of this window that you can't make correction in the code if there's any error in the code you have written you have to write that code again in next line.
But, there's a solution to this problem you can work in editor of MATLAB.
Select the FILE option and then select NEW and then select M-File then an editor will open where you can write desired code.
Workspace is a place where whatever variable you declare its value will be stored there.
Command History is space dedicated for what ever commands you are writing in command window will be saved in command history for your reusability of commands.
The very basic command of image processing is
imread
This command is used to read the image from the hard disk of your computer and display it on the matlab window using imshow comand.
Explanation of imread command , how to use tthis command in MATLAB command window to read image
step1.
Make a variable example "i" is a variable no need of declaring the type of variable in MATLAB,
i=imread('location of image on your hard disk\name of image as on your hard disk.extension of image')
LOCATION: Right click on image select properties and copy the location and paste in colons as mentioned above in command.
NAME: Whatever is the name given to the image by you on your computer.
EXTENSION: Extension of images are .jpg,.bmp,.tiff etc..
Example of the use of command.
i=imread('C:\Users\RISHI\Pictures\certificates\MIT.jpg');
The semicolon above mentions the end of the command.
The other command is conversion of the image into BINARY scale and GRAY scale.
The command are as above:
1.im2bw(variable in which the image is stored "i" as above example)- To convert image into BINARY scale.
2.rgb2gray(variable in which the image is stored "i" as above example)- To convert image into GRAY scale
The command to display the read image is imshow(name of variable in which image is stored "i" as above).
I hope everyone get benefits from this blog, tommorow i'll be posting about the robotics LED controll using microcontroller and also about webcam controll using MATLAB.
what is binary image?
ReplyDeleteHi aredee, how are you?
ReplyDeleteI hope you are clear with your previous doubts you asked about BASCOMM coding.
So you asked about binary image , as name suggest i.e binary which means two(2) so the binary image as shown above in image contains only two colors WHITE and BLACK.