简体   繁体   中英

Divide an image into equal sized blocks using MATLAB and use Gabor filter

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?

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)

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM