Commit 3317176983c94fc6bbfbdcdc13f4dc88fea45c92
1 parent
ebd02452
added hsiproc to tensorflow conversion application in Matlab
Showing
1 changed file
with
14 additions
and
0 deletions
Show diff stats
1 | +function T = bsq2tensorflow(I, n) | |
2 | + | |
3 | + sx = size(I, 1); | |
4 | + sy = size(I, 2) / n; %get the size of the tensor along Y | |
5 | + sb = size(I, 3); | |
6 | + | |
7 | + T = zeros(sx * sy * sb, n); %allocate space for the output matrix | |
8 | + for i = 0:n-1 | |
9 | + ti = I(:, i * sy + 1 : i * sy + sy, :); | |
10 | + T(:, i+1) = ti(:); | |
11 | + end | |
12 | +end | |
13 | + | |
14 | + | |
0 | 15 | \ No newline at end of file | ... | ... |