Effacer les filtres
Effacer les filtres

how to calculate black pixel ratio by dividing image into blocks

2 vues (au cours des 30 derniers jours)
javeed miyandad
javeed miyandad le 7 Mar 2011
good evening sir
i have a binary image of size 320X640 and i need to divide image into 32X64 blocks ie totally there will be 100 blocks,
i need to calculate ratio of black pixel and white pixel of EACH BLOCK of image and store it in a matrix of size 32X64
plz help me

Réponse acceptée

Sean de Wolski
Sean de Wolski le 7 Mar 2011
blkproc(I,[32 64],@(x)sum(~x(:))/sum(x(:)))
Won't the result by 10x10?

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by