-1

我正在使用以下代码行将图像分解为块(子区域):

srhblocks = reshape(permute(reshape(im2, ysrh, ynum, xsrh, xnum), [1 3 2 4]), ysrh, xsrh, xnum * ynum);

x/ysrh 和 x/ynum 是 x/y 中块的长度和数量

然后我对每个图像块执行一个操作(每个块输出一个数字),然后想要撤消上述重塑。您如何执行与上述相反的操作?谢谢

4

1 回答 1

0
%stitch together search image blocks
srhblocksall = num2cell(srhblocks, [1 2]); %split the stack into a cell array 
srhblocksall = reshape(srhblocksall, ynum, xnum); %reshape the tiles into their final position.
srhblocksall = cell2mat(srhblocksall); %convert to matrix

上面的代码适用于我的应用程序。

于 2015-10-21T16:13:40.640 回答