Hi guys,
I'm working on worm images. After image processing, a worm looks like this:
Positions of the worm points / pixels:
wormpoints = Position[Transpose@ImageData[worm, "Bit", DataReversed -> True], 1]
Here's the problem:
The points are not necessarily ordered correctly, from the worm head (left) to its tail. I've tried ordering them by:
wormpointsordered = wormpoints[[First@FindCurvePath[wormpoints]]];
Unfortunately, this step is not very reliable. It should give me all worm points, but ordered. In reality, it sometimes gives me only 10 points. Sometimes even only 3 points!
Any ideas? Thanks
David.