how to divide image into 5*5 blocks

1 次查看(过去 30 天)
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

采纳的回答

Walter Roberson
Walter Roberson 2019-1-13
编辑:Walter Roberson 2019-1-13
blockproc(YourImage, [5 5], @(block) nnz(~block.data), 'trimborder', false)
  34 个评论
Walter Roberson
Walter Roberson 2019-1-26
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.

请先登录,再进行评论。

更多回答(1 个)

Matt J
Matt J 2019-1-14
编辑:Matt J 2019-1-14
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).

类别

Help CenterFile Exchange 中查找有关 Blue 的更多信息

标签

产品


版本

R2014b

Community Treasure Hunt

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

Start Hunting!

Translated by