Condition monitoring of steel ropes using Automatic Width. How to measure real widths of steel ropes?

2 次查看(过去 30 天)
Hello, everyone!
I need to measure the real width of each steel ropes using Image Processing ToolBox at the picture below. The algorithm must measure widths automaticly.
The algorithm must measure widths automatically. Software gets several photos of steel ropes. Then each photo is being analyzed and processed. Therefore results must be like this:
I have the code below, but it works for single rope. How can I change or redevelop the algorithm to measure the widths of three steel ropes?
rgbImage = imread('rope.jpg')
% extracting the red channel
redChannel = rgbImage(:,:,1);
[rows, columns] = size(redChannel)
% then thresholding it
mask = redChannel > 115
% then taking the largest blob
mask = bwareafilt(mask, [210, inf]);
imshow(mask)
% then you might go down the image using sum() to get the width
widths = zeros(rows, 1)
for row = 1 : rows
thisRow = mask(row, :);
w = sum(thisRow)
widths(row) = sum(thisRow)
end
% Get rid of zero widths
widths(widths == 0) = [];
meanWidth = mean(widths)
Please, help me with this issue.
Yours faithfully,
Darya Yakovleva,
South Russian State Polytechnic University by Platov

采纳的回答

Walter Roberson
Walter Roberson 2021-4-22
编辑:Walter Roberson 2021-4-22
In order to do that, you are going to need to look carefully at the right-most cable, about 3/4 of the way down, and notice on the right hand side, the single side strand. And look on the left edge of that same cable roughly half-way down and see the side strand there. Also look at the single side strand on the left side of the middle cable, about 1/10th of the way down the cable.
Why are these important? Because you know something about the material properties of narrow steel wire. The side strand on the middle left cable and on the left side of the right cable, are both a little curved; the side strand on the right edge of the right cable is slightly thicker and is curved only a little. The curve of the two on the left gives us an upper limit on the thickness: they would not have curved the way they are if they had been thicker. The fact that the two on the left are curved instead of kinked puts a lower bound on their thickness.
Are the two side strands on the left the same thickness as the one on the right? The one on the right is much more distinct. Can we explain it by differences in distance to the camera? No, the scale on which steel strands could be not kinked but can be curved a little is not too different than the size we see the photograph on our display, and on that scale, there would not be noticable blurring that would permit the strands to be fully visible across the width of the cable. If the cables were each sharp in the middle and blurred towards the edges then we could entertain the possibility of distance blur.
So what do we have left? This: that the two side strands on the left are single wire strands, but that the side strand on the right is two side strands together (I cannot rule out three at the moment), retaining more stiffness for that reason. So one individual strand is stiff enough to curve but not kink, and two together is stiff enough to curve only a little, but not to be at an even sharper angle and a more visible cut.
My estimate would be that the cables are between 2.5 cm and 3 cm in diameter.
  5 个评论

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Geographic Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by