How to read image matrix stored in a structure
Mostra commenti meno recenti
I have a letters.mat file which has one variable dataset which is a struct and dataset has 2 more fields as train , test which both are also structures, In train structures 2 fields are images and labels ...images is of 124800*784 unit8 type... I want to read those images and store them in a folder. How can I do that? I used the code load('dataset.mat') train = dataset.train images = train.images; Now when I show the image using imshow() it displays error that Error using imread>parse_inputs (line 450) The file name or URL argument must be a character vector.
Error in imread (line 322) [filename, fmt_s, extraArgs, was_cached_fmt_used] = parse_inputs(cached_fmt, varargin{:});
Error in ex (line 46) imgArray = imread(images)
Can anyone help me with the code? Thanks in advance
12 Commenti
KSSV
il 12 Lug 2018
imshow is your inbuilt function or you have typed it? What does which imshow give
HJ Akhtar
il 12 Lug 2018
HJ Akhtar
il 12 Lug 2018
HJ Akhtar
il 12 Lug 2018
Guillaume
il 12 Lug 2018
Can you attach your letters.mat.
Can you also show the code you've been using that gives you the error.
The error is very clear, the function expects a character vector (aka a string), you're giving it something else. It doesn't know what to do that.
HJ Akhtar
il 12 Lug 2018
HJ Akhtar
il 12 Lug 2018
KSSV
il 12 Lug 2018
Are you sure that you are inputting image name in imread?
Guillaume
il 12 Lug 2018
What is
class(dataset.train.images)
size(dataset.train.images)
HJ Akhtar
il 12 Lug 2018
KSSV
il 12 Lug 2018
YOu have the data already in hand...you cannot use imread.
HJ Akhtar
il 12 Lug 2018
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Convert Image Type in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

