Why can't I save this BMP file in an array after converting it?

2 vues (au cours des 30 derniers jours)
John Kau
John Kau le 31 Juil 2015
Commenté : John Kau le 1 Août 2015
Hi!
I can't save the attached BMP file in an array after converting it to class double.
[tmp, cmap] = imread('10.bmp');
tmp = ind2gray(tmp, cmap);
gabDouble{i} = im2double(tmp);
Saving images (JPGs) as class double in an array works without any problems.
Would be nice if someone knows what the issue is.
Many thanks!
  4 commentaires
John Kau
John Kau le 1 Août 2015
The error message was saying something along the lines like "Cell contents reference from a non-cell array object"
The thing now is that after a restart this morning, the error message no longer comes up. I promise that I haven't changed anything.
Jan
Jan le 1 Août 2015
@John Kau: Please post as an answer, that you've solved the problem by restarting the computer and accept it. Of course we believe, that you are convinced, that you have not changed anything. But without any doubt restarting the computer removed the problem, e.g. by saving a changed M-file. So you did change something, even if you are not aware of what it was. Computers are not magic!

Connectez-vous pour commenter.

Réponse acceptée

Image Analyst
Image Analyst le 1 Août 2015
I've never heard of BMP format being able to store floating point values. I only hear of integer values. Where in https://en.wikipedia.org/wiki/BMP_file_format do you see that it can take floating point values? If you want to store floating point values, you can save it with save() in a .mat file.
  1 commentaire
John Kau
John Kau le 1 Août 2015
Thanks! I didn't know that, I'm still too new to all this.

Connectez-vous pour commenter.

Plus de réponses (1)

Walter Roberson
Walter Roberson le 31 Juil 2015
You did not initialize "i", so it will have its default value as being sqrt(-1), the imaginary unit. You cannot index a cell array at an imaginary unit.

Catégories

En savoir plus sur Convert Image Type dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by