Image analysis of irregular shape of binary image
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello everyone,
I am very new to matlab and data analysis. My question might have some related answers but not all applicable to my questions. I have video of stretching transparent membrane with cross polarizers. Basically, If membrane is being stretched, there is stress inside membrane so light can penetrate through it. I extract image from video and use threshold to turn it into binary image. Figure 1 shows the comparison of image directly extracted from video and image after im2bw.
However, because the edge will reflect some light and the edge of the membrane is irreguular, it is difficult for me to know the height and area of the region where membrane is being stretched. I would like to know the length and area of the center region where there is light penetration. Following figures are my goal.
Also, it is a continuous process with around 1000 images so I want to export it continuously.
Thank you for your reading and I am looking forward to your advice.
1 Kommentar
Antworten (2)
Rohit Pappu
am 30 Dez. 2020
To analyse the region of interest, Image Segmentation can be done. Image Segmentation tutorial can be found here
0 Kommentare
Image Analyst
am 30 Dez. 2020
Is the width (left and right) always the same? If so you can just look between certain columns of the image and get the average or max extent in the vertical direction.
[rows, columns] = size(mask);
topRows = zeros(1, columns);
bottomRows = zeros(1, columns);
for col = column1 : column2
row = find(mask(:, col), 1, 'first');
if ~isempty(t)
topRows(col) = row;
row = find(mask(:, col), 1, 'last');
bottomRows(col) = row;
end
end
% Get rid of zeros
topRows(topRows == 0) = [];
bottomRows = bottomRows(bottomRows > 0); % just a different way
% Draw lines across and compute means.
meanTopRow = mean(topRows);
yline(meanTopRow, 'Color', 'r', 'LineWidth', 2)
meanBottomRow = mean(bottomRows);
yline(meanBottomRow, 'Color', 'r', 'LineWidth', 2)
meanHeight = mean(bottomRows - topRows)
message = sprintf('The mean height is %f pixels', meanHeight)
uiwait(helpdlg(message));
0 Kommentare
Siehe auch
Kategorien
Mehr zu Convert Image Type finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!