Detect all branches in a plant picture
Asked Answered
H

1

10

I would like to know of something that will detect all the green branches from the following image

enter image description here

Currently i am starting with applying the Frangi filter

   options=struct('FrangiScaleRange', [5 5], 'FrangiScaleRatio', 1, 'FrangiBetaOne', 1,...
 'FrangiBetaTwo', 7, 'verbose',true,'BlackWhite',true);
[outIm,whatScale,Direction] = FrangiFilter2D(double(img), options);

The output of Frangi filter is as follows

enter image description here

This is followed by Hough Transform to detect all the lines

[H,theta,rho] = hough(outIm,'Theta',-90:1:89);
P = houghpeaks(H,100,'threshold',ceil(0.3*max(H(:))),'NhoodSize',[21 21]);
lines = houghlines(outIm,theta,rho,P,'FillGap',10,'MinLength',100);

The output is this

enter image description here

Any leads on what i can try apart from these techniques ?

Hallucinate answered 24/1, 2016 at 2:33 Comment(4)
If you want the green branches, then you need to stars by a color thresholding in order to detect the green parts. And then, you can apply the filter and the hough transform.Bac
That was my first step. I didn't mention it as it was obviousHallucinate
Not so obvious, because the Frangi filter gives also the brown branches contour. So the thresholding failed.Bac
Set 'BlackWhite',false here might help.Dymoke
M
2

You can use color based Gaussian mixture model(GMM) for segmenting out green branches. Fit 2 GMM models 1 for green branches, and 2nd for rest of the objects in image. But to initialize that you have to mark some mannual scribbles initially to make know GMM how branches and other look like. After fitting both GMM models on the basis of scribbles, you can find likelihood of all pixels for both GMM models, and on basis of that you divide your in two regions branch and non branch. Marking of scribbles should cover most of the color variation in image.

Midian answered 3/1, 2017 at 13:50 Comment(1)
Do you mean to suggest using GMM clustering for segmentation between green leaves and shoots ? If yes, do you have some sort of sample code where this technique is used ?Hallucinate

© 2022 - 2024 — McMap. All rights reserved.