How to input any formate of image in Matlab ?

Input Image In Matlab:

It is very easy process. When i started image processing, I spent 2 hours for input image from different folder in my computer. In this topics, I will show how to input any type of image from any where in my computer.

Process 1:

At first create a folder any where in your computer. Then open MATLAB and create new file, select location.

Now,store images into the same folder. 
We used a matlab build in function name imread. Here imread means image read.
                                  im = imread('images.jpg');

Here im is variable and store image as a 2D matrix.

  Above picture, we see that lots of picture , so we rearrange all the image into one folder and it gives pretty good.
 

Now the Matlab code will be following :
im = imread('images/images.jpg');
im = imread('images/Digitaize.GIF');

Process 2:
This process helps to input any format image from any where in the computer. Matlab code is given below:

    [fname,path]=uigetfile('*');
fname=strcat(path,fname);
im = imread(fname);

fname select the input image and path variable select the location of the input image and then concatenate the both variable fname and path and get original location. And then imread function is used. This is the best way to input image/video/audio everything. 


Manually select the location and select the image then click open. 
Hopes so this tutorial helps for the new matlab coder. 


No comments:

Post a Comment