Closed LongyuanCai closed 1 year ago
Hello The specific problem is that samson's data is "data_samson.mat" (9025,156), but the data input into the model framework is "data_samson_patch_3.mat"(9025,9,156). How should I operate to obtain the latter data? Your paper does not mention how to operate. I'd love to hear from you. Thank you.
Hello The specific problem is that samson's data is "data_samson.mat" (9025,156), but the data input into the model framework is "data_samson_patch_3.mat"(9025,9,156). How should I operate to obtain the latter data? Your paper does not mention how to operate. I'd love to hear from you. Thank you.
clear all clc data = importdata('data_linear.mat'); [a,b]=size(data); h = 100; w = 100; data = hyperConvert3d(data, h, w, a);
% window_size_3 data_new = [data(:,1,:),data,data(:,w,:)]; A =[data(1,1,:), data(1,:,:),data(h,1,:)]; B =[data(1,h,:), data(h,:,:),data(h,w,:)]; data_new = [A;data_new;B]; data_kuai = zeros(h*w,9,a); k = 1; for i=2:h+1 for j=2:w+1 C = data_new(i-1:i+1,j-1:j+1,:); C = reshape(C,[9,a]); %C = patch_sad(C,9); C = reshape(C,[1,9,a]); data_kuai(k,:,:)=C; k = k+1; end end data_patch =single(data_kuai);
Thank you very much for your answer. There is another question whether the hyperConvert3d function has the form of the following code.
function [img] = hyperConvert3d(img, h, w, numBands) if (ndims(img) ~= 2) error('Input image must be p x N.'); end [numBands, N] = size(img); if (1 == N) img = reshape( img, h, w); else img = reshape( img.', h, w, numBands); end return;
Hello I am a novice in this field. I've been trying to debug your program recently. If I have my own dataset, can you please tell me what parameters and code I need to change? Thank you.