Borrar filtros
Borrar filtros

how to browse an image?

11 visualizaciones (últimos 30 días)
bharath raavudi
bharath raavudi el 14 de Mayo de 2013
Comentada: Jaliya Samarakkody el 28 de Ag. de 2020
i need to browse an image and give the same image as input in a file to process it. i am new in matlab and dont know much about matlab. can anyone here help me?

Respuestas (3)

Image Analyst
Image Analyst el 14 de Mayo de 2013
I'm not sure what browse an image means to you. Maybe it means to select an image file from a folder on your computer (browse for an image), in which case you'd do
[baseFileName, folder] = uigetfile({'*.png';'*.jpg';'*.JPG';'*.bmp';'*.tif'})
fullFileName = fullfile(folder, baseFileName)
or perhaps you want to inspect an image's color values:
imtool(rgbImage); % Can also use a gray image.
If you mean something other than one of those two, then please explain in more detail what "browse an image" means.
  2 comentarios
Shashank Rao
Shashank Rao el 17 de Mayo de 2013
Hi, I think Mr. Bharath and me are facing same problem. Here Bharath want to say that in some folder or directory he have some image. He want to access it using matlab coading so that he can do some changes to it. Am i right Mr. Bharath?
Image Analyst
Image Analyst el 17 de Mayo de 2013
But I don't know where your difficulty lies. So what's the problem? Just construct the filename, call imread() to bring it from disk into a variable in your program, and start doing something with it.
rgbImage = imread(fullFileName); % or call it grayImage if it's monochrome.

Iniciar sesión para comentar.


David Sanchez
David Sanchez el 14 de Mayo de 2013
To get a image from any location, try this:
MY_IMAGE = uigetfile({'*.jpg','*.JPG','*.bmp','*.tif'}) % add any extension you need
MY_IMAGE will be a string with your file name, later, you can read it, load it or do whatever you need to do.
For files in a directory other than the working one:
[MY_IMAGE MY_PATH] = uigetfile({'*.jpg','*.JPG','*.bmp','*.tif'})
my_file = fullfile(MY_PATH.MY_IMAGE) % full directory of your file

Jaliya Samarakkody
Jaliya Samarakkody el 27 de Ag. de 2020
When I am trying to read image from my desktop following error appears
Error using imread > get_full_filename(line567)
File 'C:\Users\Pehelinie\Desktop\digital-images-week2_quizzes-lena.gif' does not exist
Error in imread (line 374)
fullname = get_full_filename(filename);
  2 comentarios
Image Analyst
Image Analyst el 28 de Ag. de 2020
OK, so make sure that file exists. Then the problem will go away.
Jaliya Samarakkody
Jaliya Samarakkody el 28 de Ag. de 2020
Thanks.! I have already drop the file into the folder

Iniciar sesión para comentar.

Categorías

Más información sobre Startup and Shutdown en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by