With the help of almighty Mathematica 9, I got from this
To this:
with this code:
MorphologicalBinarize[
Import["http://i.stack.imgur.com/79l19.jpg"]~
ColorConvert~"Grayscale"];
Binarize[LaplacianGaussianFilter[%, 10]];
CommonestFilter[MaxFilter[DeleteSmallComponents[%], 2.3], 10];
SelectComponents[MorphologicalComponents[%], "Length", -1] // Image;
Pruning[Thinning[%, Padding -> 1], Padding -> 1]
I'm sure the code could be shorter and is perhaps in places redundant, but that's not why I'm posting here, as because now, I'm interested in measuring the length of the curve that I got.
I wanted to create a tool to test this theory whenever would I want so.
I couldn't find a way - I thought I was close when I transposed ImageData
position on ListPlot, alas, I swiftly got lost there.
I am very new to this wonderful tool and am learning it by trial and error.
I'd appreciate any form of help.
PerimeterLength
is the "total length of outer pixel sides" whilePolygonalLength
is the "total length of the polygon formed by the centers of the perimeter elements." I wonder if the latter is what you are looking for. $\endgroup$ – bobthechemist Apr 18 '14 at 14:24