How to store information about material porosity?

1 Ansicht (letzte 30 Tage)
David Mrozek
David Mrozek am 9 Jun. 2021
Bearbeitet: David Mrozek am 9 Jun. 2021
Hello everyone,
I am currently reviewing the porosity levels of some CT scans (985422 in total). Since we only got a readonly version of the images we had to improvise a subroutine for counting the void level in the material (black pixel). With a for loop I wanted to store the value in a matrix and plot them as the following cutout shows:
Matrix overview
x-axis 1st y-axis 2nd y-axis 3rd y-axis
column 1 column 2 (blackpixel_percentage) column 3 (white_percentage) void growth factor
0.04 value 1 value 1 value 1 = values(column2) / values(column3)
0.08 value 2 value 2 value 2 = values(column2) / values(column3)
0.12 value 3 value 3 value 3 = values(column2) / values(column3)
With this I am facing some problems:
a.) Since the desired white and black values are being overwritten in the loop, I have no idea how to properly store them in a matrix. I tried using the CT_scan_num variable, but it does not work in the loop.
b.) I am not sure how to plot one x axis and three y axis. I would need this setup in order to obtain a "control graph" for additional scans
for CT_scan_num = 0000:0003
CT_index = sprintf('%04d',CT_scan_num);
CT = 'CT';
ind3_format = '.bmp';
ind_name = [CT CT_index ind3_format];
i=imread(ind_name);
%imshow(i);
%Image Adjust
adj=imadjust(i,stretchlim(i));
% imshow(adj);
%Convert RGB to Gray
gry=rgb2gray(adj);
% imshow(gry,[]);
%Image segementation by thresholding
level = 0.45;
thres=im2bw(gry,level);
% imshow(thres);
% Image morphological operation
bw=bwmorph(thres,'clean',20);
% imshow(bw);
%End
black = length(find(bw==0));
white = length(find(bw==1));
% a.) Porosity (void level)
blackpixel_percentage = (black/(black+white))*100;
% b.) Material content (matrix level)
white_percentage = (white/(black+white))*100;
% c.)increment of the CT images (distance where image plane was cutted
% out = from 0 to 3
i_CT = 0.04
end
Best Regards

Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by