Blame view

matlab/bsq2tensorflow.m 354 Bytes
33171769   David Mayerich   added hsiproc to ...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
  function T = bsq2tensorflow(I, n)
  
      sx = size(I, 1);
      sy = size(I, 2) / n;            %get the size of the tensor along Y
      sb = size(I, 3);
      
      T = zeros(sx * sy * sb, n);     %allocate space for the output matrix
      for i = 0:n-1
          ti = I(:, i * sy + 1 : i * sy + sy, :);
          T(:, i+1) = ti(:);
      end    
  end