Image Processing; converting images
古いコメントを表示
Hi guys. I have images in .im7 format. I've loaded them into Matlab using PivMat and ReadIMX, then formatted them into .mat files ( images ? ). Now, I'm trying to covert them to either .jpg , .tif , .png , .bmp using imwrite but I cannot do so because 'type was struct'. Can I efficiently go from 'structure' format to any of the formats that imwrite recognizes ?
2 件のコメント
KSSV
2017 年 7 月 6 日
You have to extract the required pixel information from the structure and use imwrite.
Damian Wierzbicki
2017 年 7 月 6 日
回答 (2 件)
KSSV
2017 年 7 月 6 日
0 投票
You need to pick the matrix 2048*2048 and use imwrite
8 件のコメント
Damian Wierzbicki
2017 年 7 月 6 日
KSSV
2017 年 7 月 6 日
Give the code what you have tried...You should only send the required matrix into imwrite
A = rand(2048);
imwrite(A,'myimage.png')
KSSV
2017 年 7 月 6 日
I guess you used something like
out = imwrite() ;
No imwrite doesn't give you any ouput, it writes your matrix into the filename and format which you have specified in the given folder.
Damian Wierzbicki
2017 年 7 月 6 日
KSSV
2017 年 7 月 6 日
What data does matrix have? Attach it.
Damian Wierzbicki
2017 年 7 月 6 日
Damian Wierzbicki
2017 年 7 月 6 日
Image Analyst
2017 年 7 月 6 日
Try this:
storedStructure = load(filename) % Don't use semicolon
% Now extract the image field into its own variable.
rgbImage = storedStructure.myImage; % Or whatever the field for the image is called.
imwrite(rgbImage, 'my RGB image.PNG');
カテゴリ
ヘルプ センター および File Exchange で Convert Image Type についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!