Problem with imshow command

2 visualizaciones (últimos 30 días)
Muhammad Zaigham Zaheer
Muhammad Zaigham Zaheer el 14 de Mayo de 2015
Respondida: Muhammad Zaigham Zaheer el 20 de Mayo de 2015
I am trying to display multiple images in one figure using the following code:
[imgs labels] = readMNIST('t10k-images-idx3-ubyte', 't10k-labels-idx1-ubyte', 50, 10);
for i=2:50
im=imgs(:,:,i);
im=255.*im;
name = ['image',num2str(i),'.jpeg'];
imwrite (im,['image',num2str(i),'.jpeg']);
end
imshow(im);
But the code gives this error:
Error using fopen
First input must be a file name of type char, or a file identifier of type double.
Error in imshow (line 25)
fid = fopen(imgFile, 'r', 'b');
Error in test (line 24)
imshow(BW2,'notruesize')
if I remove the imshow (im); command, the code works fine and save the image files without any problem. I am using Matlab 2014b. Thanks in advance.

Respuesta aceptada

Muhammad Zaigham Zaheer
Muhammad Zaigham Zaheer el 20 de Mayo de 2015
Thanks for the answers. But it was may be some corrupted files problem. I have re-installed matlab and everything is working fine now.

Más respuestas (2)

Ashish Uthama
Ashish Uthama el 14 de Mayo de 2015
Which imshow are you using? line 25 of the toolbox version does not appear to have an fopen.
Try which -all imshow. You might have a shadowed version.
  2 comentarios
Muhammad Zaigham Zaheer
Muhammad Zaigham Zaheer el 15 de Mayo de 2015
Thanks, but no. Still giving this same error.
Walter Roberson
Walter Roberson el 15 de Mayo de 2015
What did
which -all imshow
report in its output?
Also try
clear imshow
in case you just happen to have a function handle by that name around.

Iniciar sesión para comentar.


Image Analyst
Image Analyst el 15 de Mayo de 2015
I don't see 'notruesize' as being one of the available input arguments. Why are you sending that in when it's not allowed?

Categorías

Más información sobre Low-Level File I/O en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by