Segmentation of interconnected lines
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
James Ben
am 5 Nov. 2022
Verschoben: Image Analyst
am 10 Nov. 2022
Hi!
I'm working on a project that require to segment shapes or features from an image. My actual approach is to first detect all lines with Hough Transform and after try to segment each line by its slope, hower I've tried k-means, DBSCAN, and I didn't get the result that I would like to achieve.
I would like to know if someone can help me with a idea or documentation.
Thank You!

5 Kommentare
Akzeptierte Antwort
Image Analyst
am 10 Nov. 2022
Verschoben: Image Analyst
am 10 Nov. 2022
You can get all the angles like this:
lines = houghlines(BW,T,R,P,'FillGap',50,'MinLength',0.5)
allAngles = [lines.theta]
If you want to get each segment individually find crossing points and delete them, then label the image. Untested code:
% Find branchpoints
bpImage = bwmorph(BW, 'branchpoints');
% Erase branchpoints from main binary image.
BW(bpImage) = false;
% Label what's left.
[labeledImage, numSegments] = bwlabel(BW, 4);
% Show them all one at a time.
for k = 1 : numSegments
thisImage = ismember(labeledImage, k);
imshow(thisImage);
drawnow;
% Delay a bit so we can see it.
pause(0.5);
end
0 Kommentare
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!