We have 8*8*96 matrix and we want to convert this matrix into an image. How to convert it?
3 ビュー (過去 30 日間)
古いコメントを表示
imwrite(newcolor,'output','bmp'); %we used this function but it went wrong
Error using writebmp (line 27)
Invalid dimensions for X.
7 件のコメント
Walter Roberson
2017 年 3 月 15 日
If it has color information then does it currently correspond to 8 x 8 x 3 x 32, or does it correspond to 8 x 8 x 32 x 3 ?
If it is 32 color images then it is probably 8 x 8 x 3 x 32
回答 (1 件)
Walter Roberson
2017 年 3 月 15 日
編集済み: Walter Roberson
2017 年 3 月 15 日
"is there any other way to get an image from the matrix?"
Not with .bmp file format.
With GIF file format you could use 'writemode', 'append' to create an animated GIF
With TIFF file format, you can use 'writemode', 'append' to add a "page" to the TIFF file. However, for TIFF files and multiple images I recommend the more detailed controls of using Tiff objects.
For any of the other image types you have two options:
- Write out a series of images with related names, such as output001.bmp output002.bmp and so on; or
- reshape to 8 by (8 times 96) -- a short and wide series of images side by side.
You also have the option of writing a 3D volume with dicomwrite(), or of writing a multiband data file https://www.mathworks.com/help/matlab/ref/multibandwrite.html
Oh yes, there are also ways to write each image as a "page" in a PDF file. Which really seems a waste for 8 x 8 images.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Convert Image Type についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!