Buckle counting in image processing
1 次查看(过去 30 天)
显示 更早的评论
I am currently working on an image and I wanted to know how I can count the numbers of buckles (lines) on an image. Find attached is the image in question and I wait in anticipation for a positive response.
0 个评论
回答(2 个)
Nitin Kapgate
2020-12-16
You can refer the following code snippet to count the approximate number of number of buckles using bwlabel function:
% Read image
I = imread("0050.png");
% Binarize image
BW = im2bw(I);
% Label connected components in 2-D binary image
% numOfConnComponents is approximately equal to number of buckles
[labels numOfConnComponents] = bwlabel(~BW);
% Show the labelled connected components
coloredLabelsImage = label2rgb(labels, 'hsv', 'k', 'shuffle');
imshow(coloredLabelsImage);
You can use bwareaopen function to further improve the accuracy of detected number of components by removing smaller buckles from the binary image.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Convert Image Type 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!