how to divide image into 5*5 blocks

2 vues (au cours des 30 derniers jours)
Mahmoud Hassan
Mahmoud Hassan le 13 Jan 2019
Commenté : Walter Roberson le 26 Jan 2019
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

Réponse acceptée

Walter Roberson
Walter Roberson le 13 Jan 2019
Modifié(e) : Walter Roberson le 13 Jan 2019
blockproc(YourImage, [5 5], @(block) nnz(~block.data), 'trimborder', false)
  34 commentaires
Walter Roberson
Walter Roberson le 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.

Connectez-vous pour commenter.

Plus de réponses (1)

Matt J
Matt J le 14 Jan 2019
Modifié(e) : Matt J le 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).

Catégories

En savoir plus sur Blue dans Help Center et File Exchange

Produits


Version

R2014b

Community Treasure Hunt

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

Start Hunting!

Translated by