I am progressing in the branching problem described here. After having extracted my tree structure and done a lot of manipulations on it (very interesting, but not described here), I would like to associate a radius (and/or weight) to each edge of the tree, based on the initial radius R of the branches as seen on this image:
Having that value (approximated), I would be able to calculate some interesting properties of my tree, to which I don't have access for now.
I have thought about an algorithm that would progress along each edge and stop at the middle, then taking the normal and following it up to the border, which would give me the answer... but this method is not really elegant in my opinion.
The base image:
The code to produce the tree graph for now:
arbre2 = Import["https://i.stack.imgur.com/unIQA.png"];
mask = FillingTransform[Thinning[Binarize[ColorReplace[arbre2, White -> Black, .055], 0]], CornerNeighbors -> True]; skel2 = Thinning[mask]; HighlightImage[skel2, MorphologicalBranchPoints[skel2], 1]; morphograph2 = MorphologicalGraph[skel2, VertexSize -> 2, VertexLabels -> Automatic]; newtreegraph2 = TreeGraph[DeleteCases[EdgeList[morphograph2], x_ \[UndirectedEdge] x_], VertexCoordinates -> GraphEmbedding[morphograph2], VertexSize -> 5, VertexLabels -> Automatic];