Tracing one line image
9 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi,
I need to trace a oneline image for a project. A one line image is an drawing/image made with just one line. Im trying to write a code that traces the line and exports this to x y coordinates, (an array). Does anyone have a clue how to do this?
Thank you!!
0 comentarios
Respuestas (2)
Image Analyst
el 22 de Dic. de 2021
Editada: Image Analyst
el 22 de Dic. de 2021
I'd first call edge with 'Canny' to get your edges. Then I'd label the edges so that you draw each edge one at a time
[labeledEdges, numCurves] = bwlabel(edgeImage);
Then for each one, get the coordinates and put them in a loop to draw them
hold on; % Don't let plotting blow away image.
for k = 1 : numCurves
thisCurve = ismember(labeledEdges, k);
[rows, columns] = find(thisCurve);
for k2 = 1 : length(rows)
plot(columns(k2), rows(k2), 'r.', 'MarkerSize', 10)
drawnow;
pause(0.2);
end
end
hold off;
0 comentarios
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

