Clear Filters
Clear Filters

Automatic Image Segmentation of three steel ropes using Image Processing Tools

2 views (last 30 days)
Hello there,
I have an issue with dividing the image of three ropes into segments. You can see the original image (3104x3104) below:
I'd like to get some results of segmentation process like this:
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)

Answers (0)

Community Treasure Hunt

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

Start Hunting!