How to get an image and do some processing ?
7 views (last 30 days)
Show older comments
Arshia Saffari
on 22 Aug 2021
Commented: Arshia Saffari
on 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.
0 Comments
Accepted Answer
Image Analyst
on 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.
More Answers (0)
See Also
Categories
Find more on Image Processing Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!