How to get an image and do some processing ?

7 Ansichten (letzte 30 Tage)
Arshia Saffari
Arshia Saffari am 22 Aug. 2021
Kommentiert: Arshia Saffari am 22 Aug. 2021
Hi. I want to get an image from the user and do some work on it. This code is what I put together from the internet and my own knowledge( which is not much).
[Picture_Orignal_Name,Picture_Orignal_Path] = uigetfile('*.bmp','Select an image');
uiopen(fullfile(Picture_Orignal_Path,Picture_Orignal_Name),1);
Lets say I have a file named 'Render1.bmp'. after using that code there is a variable named 'Render1' and its value is 1280x1280x3 uint8. in Command Window I could type something like
A = Render1(:,:,1);
but it's a script and I don't know the file name. It is in Picture_Orignal_Name but I wasn't able to make any use of that.
I would like to know if there is a way to use Picture_Orignal_Name to work on that variable and if there is a better way to do it in the first place.

Akzeptierte Antwort

Image Analyst
Image Analyst am 22 Aug. 2021
You would not do this:
uiopen(fullfile(Picture_Orignal_Path,Picture_Orignal_Name),1);
You would do
fullFileName = fullfile(Picture_Orignal_Path,Picture_Orignal_Name);
rgbImage = imread(fullFileName);
I suggest you start with my Image Segmentation Tutorial in my File Exchange:
It goes over the basics of reading in an image, thresholding it to find blobs, making measurements on the blobs, and filtering those measurements to find subsets of blobs meeting certain criteria.
  1 Kommentar
Arshia Saffari
Arshia Saffari am 22 Aug. 2021
oh yeah. It worked. Thanks. I'm definitely going to take a look at that.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Image Processing Toolbox 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