How to convert Non Image data to images for use in CNN

3 ビュー (過去 30 日間)
Ambali Odebowale
Ambali Odebowale 2022 年 10 月 16 日
コメント済み: Ambali Odebowale 2022 年 10 月 17 日
I have non-image data that I would like to convert to images for use in CNN. Any help would be appreciated.

採用された回答

Image Analyst
Image Analyst 2022 年 10 月 16 日
Perhaps the reshape and imresize functions would work. What form is your non-image data in? Vectors? You can just write them into an image.
  7 件のコメント
Image Analyst
Image Analyst 2022 年 10 月 17 日
編集済み: Image Analyst 2022 年 10 月 17 日
Of course you can view the images but they will be very small so you need to magnify them to see them.
imshow(thisImage, [], 'InitialMagnification', 3000);
Remember images must be rectangular. 3 is not for gray scale. So since you have 21 elements, you can either have a 3x7 or a 7x3 image. So you don'[t really have much choice. 3*7 = 21 and 7*3 = 21. No other combinations multiply to give you 21. Or you can have a different size if you want if you paste it in to the upper left corner.
Remember some predefined networks require images of a certain size so you may have to use imresize() with the 'nearest' option if you want to use a prebuilt network such as AlexNet. Or you can build your own, which might train faster since your images will be so much smaller than those used for prebuilt networks, such as 227x227 for Alexnet.
Ambali Odebowale
Ambali Odebowale 2022 年 10 月 17 日
You are a genius! Thanks

サインインしてコメントする。

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2022 年 10 月 16 日
You can use an arrayDatastore after reading in the files, or perhaps a tabularTextDatastore . You probably do not need to convert to images.
  3 件のコメント
Walter Roberson
Walter Roberson 2022 年 10 月 16 日
predict(trainedNet, TESTDATA)
Ambali Odebowale
Ambali Odebowale 2022 年 10 月 16 日
Sorry could you please try it for me on the data I attached? I send me the complete code? Thanks for your time

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeImage Data Workflows についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by