Segmentation of interconnected lines
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
James Ben
el 5 de Nov. de 2022
Movida: Image Analyst
el 10 de Nov. de 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 comentarios
Respuesta aceptada
Image Analyst
el 10 de Nov. de 2022
Movida: Image Analyst
el 10 de Nov. de 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 comentarios
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!