Open .mat file containing images
37 views (last 30 days)
Hi, I am trying to open a .mat folder that contains 2 objects: IMG1N and IMG2. Object IMG1N has 12 images that I need to perform contrast-noise-ratio analysis on. However, I haven't been able to extract and use the 12 images. I have been searching the internet but I dont understand how. This is one of the codes I tried.
allimages = load('A1images.mat')
And this is the result I have been getting
struct with fields:
IMG1N: [256×256×12 double]
IMG2: [300×400 double]
Name Size Bytes Class Attributes
allimages 1x1 7251808 struct
Error using image
Color data must be an m-by-n-by-3 or m-by-n matrix.
Error in untitled (line 8)
Please help , I do think it's probably a very simple solution but I just can't figure how.
ILoveMATLAB on 13 Jan 2019
Image() fucntion requires either an m-by-n-by-3 or m-by-n. When you write
you are giving the image function an m by n by 12 array
If you want to view one of the images, you must call image like this
If you have the image processing tool box, you should use imshow.
If you want to view the other images, just change the number 1 to the image you want to view.