How can I use uiimport to import an image and then store the data in common variables (from struct to other data structures)?

1 view (last 30 days)
I'm studying image processing, and I built this function to perform piecewise linear transformation. I'd like to prompt the user to choose a file from the disk to be processed. Let's say I use: a = uiimport; and then I choose an image, let's say cameraman.tif. When I do so, a (the struct) has the data I need in a.cameraman (I don't get to choose the struct field name or whatever), which can in turn be stored as, for example, an uint8 variable: x = uint8(a.cameraman); My problem is, once the user is going to choose the image, and I want the function to work on supposedly any monochrome image, how can I write a command line that will have this content stored the way I want (and be accessible/worked on simply by assigning the content to a basic variable), regardless of the filename, and therefore regardless of the struct field name?

Answers (1)

Image Analyst
Image Analyst on 25 Jan 2013
I've never seen that. Why don't you simply want to use imread()? Why make it hard on yourself?
grayImage = imread(fullFileName);

Categories

Find more on Convert Image Type in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!