Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何使用 MATLAB 将 120x120 大小的面部图像划分为 64 个 15x15 像素大小的块?然后我想用 Gabor 滤波器对每个 15x15 块进行卷积。我无法使用 blkproc 功能。我该怎么做?
要提取这些块,您可以使用以下内容,假设img是 120x120 图像矩阵,c=15, w=8:
img
c=15
w=8
blocks = reshape(permute(reshape(img, c, w, c, w), [1 3 2 4]), c, c, w * w)
现在blocks是一个 15x15x64 的矩阵,blocks(:, :, i)是一个 15x15 的矩阵,代表第i-th 块。
blocks
blocks(:, :, i)
i