Clear Filters
Clear Filters

how to divide image into 5*5 blocks

1 view (last 30 days)
hello, i have a binarized image of fingerprint that i want to divide into 5*5 blocks and then count the number of zeros " black points " in each block
thanks in advance

Accepted Answer

Walter Roberson
Walter Roberson on 13 Jan 2019
Edited: Walter Roberson on 13 Jan 2019
blockproc(YourImage, [5 5], @(block) nnz(~block.data), 'trimborder', false)
  34 Comments
Walter Roberson
Walter Roberson on 26 Jan 2019
You should post a new Question with details showing how you rotate. It is not related to this Question as this question does not involve rotation.

Sign in to comment.

More Answers (1)

Matt J
Matt J on 14 Jan 2019
Edited: Matt J on 14 Jan 2019
A more efficient method than blockproc or mat2cell is to use sepblockfun (Download),
result = sepblockfun(~yourImage,[60,60],'sum');
This assumes that yourImage divides evenly into 60x60 blocks (if not, you should zero pad).

Products


Release

R2014b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!