How to handle 100 binary images with a single matrix?
Afficher commentaires plus anciens
My folder consists of 100 binary images. I want to divide each of these images into some parts and want to calculate area of each block and want to store it in a matrix. Later that matrix I want to map to excel sheet I mean to say that I want to write these values to excel sheet. How to implement this repeated process so that 100 images each blocks area value will be stored in a matrix.
Réponse acceptée
Plus de réponses (1)
Image Analyst
le 9 Avr 2018
0 votes
Use blockproc() in a loop over all images.
4 commentaires
Zara Khan
le 10 Avr 2018
Image Analyst
le 10 Avr 2018
For 4 areas, the area of each quadrant is numel(binaryImage)/4.
If you divide it into 8, the area is numel(binaryImage)/8 pixels.
For one image, you could of course store all the quadrant areas into one matrix.
areas4 = numel(binaryImage)/4 * ones(1, 4);
areas8 = numel(binaryImage)/8 * ones(1, 8);
If you want the foreground area of the binary image rather than the area of the image, you'll have to sum each quadrant
q1 = binaryImage(1:rows/2, 1:columns/2);
q2 = binaryImage(1:rows/2, columns/2:end);
q3 = binaryImage(rows/2:end, 1:columns/2);
q4 = binaryImage(rows/2:end, columns/2:end);
area1 = sum(q1(:));
area2 = sum(q2(:));
area3 = sum(q3(:));
area4 = sum(q4(:));
Zara Khan
le 11 Avr 2018
Zara Khan
le 12 Avr 2018
Catégories
En savoir plus sur Image Arithmetic dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!