How to handle 100 binary images with a single matrix?
古いコメントを表示
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.
採用された回答
その他の回答 (1 件)
Image Analyst
2018 年 4 月 9 日
0 投票
Use blockproc() in a loop over all images.
4 件のコメント
Zara Khan
2018 年 4 月 10 日
Image Analyst
2018 年 4 月 10 日
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
2018 年 4 月 11 日
Zara Khan
2018 年 4 月 12 日
カテゴリ
ヘルプ センター および File Exchange で Image Arithmetic についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!