Filter löschen
Filter löschen

how to browse an image?

11 Ansichten (letzte 30 Tage)
bharath raavudi
bharath raavudi am 14 Mai 2013
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?

Antworten (3)

Image Analyst
Image Analyst am 14 Mai 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 Kommentare
Shashank Rao
Shashank Rao am 17 Mai 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 am 17 Mai 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.

Melden Sie sich an, um zu kommentieren.


David Sanchez
David Sanchez am 14 Mai 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 am 27 Aug. 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 Kommentare
Image Analyst
Image Analyst am 28 Aug. 2020
OK, so make sure that file exists. Then the problem will go away.
Jaliya Samarakkody
Jaliya Samarakkody am 28 Aug. 2020
Thanks.! I have already drop the file into the folder

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Startup and Shutdown finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by