Automatic Image Segmentation of three steel ropes using Image Processing Tools
2 views (last 30 days)
Show older comments
Hello there,
I have an issue with dividing the image of three ropes into segments. You can see the original image (3104x3104) below:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/621218/image.png)
I'd like to get some results of segmentation process like this:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/621223/image.png)
How can I divide image into segments? What is the background should I choose? Please, help me with that.
I've written the code below, but I get unexpected results. How can I fix it?
I = imread('rope.jpg')
gs = im2gray(I)
imshow(gs)
imhist(gs)
%Adjust image contrast ratio%
Aadj = imadjust(gs);
imshow(Aadj)
%create binary image automatically
imhist(Aadj)
bw = im2bw(Aadj);
imshow(bw);
%Extract the first two largest objects from the binary image.
bw = bwareafilt(bw,[400, inf]);
%Fill holes in the extracted object regions.
bw = 1 - bw;
imshow(bw)
0 Comments
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!