Borrar filtros
Borrar filtros

How to extract connected chains in canny edge image? Specifically asking, how would I extract connected chains when there are so many edges are available, so that I could come up with top 10 results (top 10 long edges).

1 visualización (últimos 30 días)

Respuesta aceptada

Matthew Eicholtz
Matthew Eicholtz el 21 de Mzo. de 2016
Would regionprops do the trick?
----
Read the image:
I = imread('cameraman.tif');
Compute edges and create label matrix:
J = edge(I,'canny');
L = bwlabel(J);
Extract properties for connected components:
s = regionprops(J,'PixelIdxList');
Sort based on number of pixels in each connected component:
d = cellfun('length',{s(:).PixelIdxList}); %total number of pixels in each region
[~,order] = sort(d,'descend');
Show top-10 connected components:
K = ismember(L,order(1:10)); %only show the top 10 edges
  1 comentario
Jay
Jay el 22 de Mzo. de 2016
thanks. Do you have any idea how would I fill the gaps in contours in canny image before extracting connected chains?
It may give more promising results, I guess.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Image Segmentation and Analysis en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by