Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reading an image using the output of uigetfile

Tags:

image

matlab

How to store the image into a variable (say I) retrieved using a uigetfile() command? For instance, I selected the image through

[FileName PathName] = uigetfile('E:\*.jpg','Select an image');

Now I want to store the selected image in the variable I.

like image 368
meena Avatar asked Feb 02 '12 19:02

meena


People also ask

How do I use Uigetfile?

file = uigetfile opens a modal dialog box that lists files in the current folder. It enables a user to select or enter the name of a file. If the file exists and is valid, uigetfile returns the file name when the user clicks Open. If the user clicks Cancel or the window close button (X), uigetfile returns 0 .

How do I use Imread in Matlab?

A = imread( filename ) reads the image from the file specified by filename , inferring the format of the file from its contents. If filename is a multi-image file, then imread reads the first image in the file.


1 Answers

the below code will work for you:-

[FileName,PathName] = uigetfile('*.jpg','Select an image');
image=imread(strcat(PathName,FileName));
like image 99
Vicky Budhiraja Avatar answered Sep 30 '22 16:09

Vicky Budhiraja