How to select the highest number of branches/branch points?

1 visualización (últimos 30 días)
vidya
vidya el 10 de Mzo. de 2014
Comentada: vidya el 12 de Mzo. de 2014
good day I want to detect branches by applying 8 component and find the branch with highest pixel. i tried first with finding the branch points..but since there are many branch split i could not perform the operation i needed can somebody help me . so far i have tried this..with this i get a image with all branch points
bp =bwmorph(vesimg,'branchpoints')
[row column] = find(bp)
branchPts = [row column]
figure;imshow(vesimg);
hold on ;
plot(branchPts(:,2),branchPts(:,1),'+');
% branches = mn;
% branchesLabeled = bwlabel( branches, 8 )% label connected components
% sts = regionprops( branchesLabeled, 'Area', 'Perimeter' )
my input image is

Respuestas (1)

Sean de Wolski
Sean de Wolski el 10 de Mzo. de 2014
Editada: Sean de Wolski el 10 de Mzo. de 2014
One way to approach this would be to:
  1. First, remove the branchpoints from the skeleton image (dilate them first to make sure you sever the branches in 8-connectivity on)
  2. Now loop over branch points and add them back in. Do a connected components analysis (bwconncomp) and look at the NumObjects field of the connected components structure. The number of branches connected to each branch point is the original number of objects (image without branchpoints) subtracted from the number of objects in the image with that branchpoint restored.
Pseudocode
skeletonize
branchpoints
dilate branchpoints
ccbranches = bwconncomp(dilated branchpoints)
number of branchpoints = ccbranches.NumObjects
vessel without branches = vessel
vessel without branches(dilate branchpoints) = 0
cc = bwconncomp(vessel without branches)
Noriginal = ccbranches.NumObjects;
for ii = 1:number of branch points
X = vessel without branches
X(branchii) = true;
ccii = bwconncomp(X);
numbranches(ii) = ccii-Noriginal
end
[maximumbranches,index] = max(numbranches)
  12 comentarios
Sean de Wolski
Sean de Wolski el 11 de Mzo. de 2014
@IA, Are you referring to Vidya's plan or my pseudocode above?
vidya
vidya el 12 de Mzo. de 2014
@ image Analyst...sir i worked out a research paper and found a method ..and was successfully able to extract optic disc. The problem it works for many images but not for all..can u please help me to improve my code

Iniciar sesión para comentar.

Community Treasure Hunt

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

Start Hunting!

Translated by