Converting 2-D array back to image??

1 次查看(过去 30 天)
Kyle Peterson
Kyle Peterson 2018-11-12
评论: Guillaume 2018-11-12
I am trying to apply a neural network that was trained on 2-D array data extracted from an image. I can successfully apply the trained network to the original image (2441,758,21) if I convert it to 2-D array (rows,columns*bands) = (2441,15918) then using cca fusion the band information is fused to a single band (2441,1) and used as the input data for the network. The resulting predicted values 't_img' are the shape (2441,1). How can this be mapped back to an image for display?
% reshape to 2-D array
img = reshape(im,2114,758*21);
normData = mapminmax(img);
TrainingData = normData(1:1000,1:end);
TestingData = normData(1001:end,1:end);
x = TrainingData(:,2:end);
y = TrainingData(:,7000);
y1 = TestingData(:,7001);
% Feature Fusion CCA %
[trainZ,testZ] = ccaFuse(x, y, TestingData(:,2:end), y1, 'sum');
trainZ = transpose(trainZ);
testZ = transpose(testZ);
t_img = [trainZ testZ];
% import trained network from file
y_img = net(t_img);
  4 个评论
Kyle Peterson
Kyle Peterson 2018-11-12
The input image is a multispectral image containing 21 bands/channels. The fusion technique is designed to 2-d matrix data.
Guillaume
Guillaume 2018-11-12
Well, as I said, in your result, not only have you fused the 21 bands, but you've also fused the 758 columns of the image, leaving you with just one column, so what would you display? Just that one column?

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Image Data Workflows 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by