saving images into ImageDatastore
4 ビュー (過去 30 日間)
古いコメントを表示
Hello all, I am working with some code where I am tasked with recreating a new imageDatastore in order to retrain a neural network. The entire code is in a for loop and I am having trouble saving a reproduced image to a datastore without it getting overwritten every iteration. I need to save Irec into a datastore so that I can then move to retraning the neural network however I am at a bit of a loss regarding how to do this.
% set negative values to zero and scale reconstructed image
% to integers in range [0,255];
Irec = max(0,Irec);
Irecmax = max(max(Irec));
Irec = 255*Irec/Irecmax;
%Irec = floor(Irec+.5-eps);
subplot(222)
imshow(Irec,[0 255]);
title(['Reconstructed with ' num2str(pview) ' views in [0, ' num2str(thetamax) ']']);
dr = classify(netTransfer,Irec);
xlabel(['Classified as: ' char(dr)]);
subplot(223);
plotrow=14;
plot(Irec(plotrow,:));
title(['Reconstruction: Plot of row ' num2str(plotrow)])
1 件のコメント
Walter Roberson
2019 年 9 月 13 日
When you go through the image data store, if you use readImage instead of read, then you can be tracking which image you are reading. Use the image number to index into the Files property of the datastore in order to find the source for the current file. fileparts() to extract the directory and base name and extension, and create a modified version of the name, put the parts back together to get an output file name. Now save content to that output file.
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Deep Learning Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!