MATLAB:将图像分解为图像块,然后撤消此操作

MATLAB:将图像分解为图像块,然后撤消此操作,matlab,reshape,permute,Matlab,Reshape,Permute,我使用以下代码行将图像分解为块(子区域): x/ysrh和x/ynum是x/y中的块的长度和数量 然后,我对每个图像块执行一个操作(每个块输出一个数字),然后想要撤消上述重塑。您如何执行与上述相反的操作?谢谢 %stitch together search image blocks srhblocksall = num2cell(srhblocks, [1 2]); %split the stack into a cell array srhblocksall = reshape(srhblo

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

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

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

%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

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

您需要重塑图像才能进行计算,还是只需获得用于计算的子区域并保持图像不变就足够了?im的大小是多少?不在此处使用
blocproc
的具体原因?您的计算结果的输出大小是多少?您期望最终结果的大小是多少?大小(im2)=357 x 441。这将生成119x49x27像素的srhblocks,因此有27个119x49像素块。我想用9(x)x 3(y)个2D图像将其重塑为3D堆栈。我认为我不能使用blocproc,因为我正在使用每个子区域块计算归一化互相关。@2一个-当然可以。只需向
blockproc
提供一个匿名函数,计算每个块的标准化互相关?
%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