How to convert structure to gray image
2 ビュー (過去 30 日間)
古いコメントを表示
Hello, i'd like to ask something about converting data to image.
i have structure(xxx.mat file) and i'd like to convert it to grayimage.
when i use 'imshow' function, it comes to error. i think it is not double,single ... type. it's structure.
please help me..
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1168378/image.png)
this is my data file and i'd like to convert and save it to gray image file.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1168383/image.bmp)
i want the binary image like this.
thank you.
0 件のコメント
回答 (1 件)
KALYAN ACHARJYA
2022 年 10 月 25 日
編集済み: KALYAN ACHARJYA
2022 年 10 月 25 日
Read the individual cell array data element, apply image function
% cell_element=....
% image(cell_element)
% axis off;
You might be required to use loop to call the individual cell array data element. Later it can be save as image in the directory or any other ways, you wish for.
Example:
data=randi(500,500);
image(data)
axis off;
Hope it helps!
2 件のコメント
KALYAN ACHARJYA
2022 年 10 月 25 日
ok, still you can separate real and complex part of data and visualize with image function.
image(real(data));
image(imag(data));
image(abs(data));
参考
カテゴリ
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!