使用MATLAB将图像分成相等大小的块并使用Gabor滤波器 [英] Divide an image into equal sized blocks using MATLAB and use Gabor filter

查看:170
本文介绍了使用MATLAB将图像分成相等大小的块并使用Gabor滤波器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用MATLAB将大小为120x120的面部图像划分为64个15x15像素大小的块?然后我想用Gabor滤波器对每个15x15块进行卷积。我没能使用blkproc函数。我怎么能这样做?

How to divide a facial image of size 120x120 into 64 blocks of 15x15 pixel size using MATLAB? Then I want to convolve each 15x15 block with Gabor filter. I failed in using the blkproc function.How can I do this?

推荐答案

要提取这些块,你可以使用以下方法,假设 img 是一个120x120的图像矩阵, c = 15 w = 8

To extract these blocks you can use the following, assuming img is a 120x120 image matrix, c=15, w=8:

blocks = reshape(permute(reshape(img, c, w, c, w), [1 3 2 4]), c, c, w * w)

现在是一个15x15x64矩阵,块(:,:,i)是一个15x15矩阵,表示 i -th block。

Now blocks is a 15x15x64 matrix, and blocks(:, :, i) is a 15x15 matrix representing the i-th block.

这篇关于使用MATLAB将图像分成相等大小的块并使用Gabor滤波器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆