How to get an image and do some processing ?

6 次查看(过去 30 天)
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.

采纳的回答

Image Analyst
Image Analyst 2021-8-22
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.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Image Processing Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by