How to measure line shape

I would like to quantify the shape of a line on the wings of butterflies which can vary from quite straight to squiggly similar to the horizon in a landscape, or similar to a graph (per each x value there is only 1 y value), although overall orientation varies. My idea is to use the free hand tool to trace the line of interest and then let an ImageJ macro quantify it (automating this may be tricky because there are many line-like structures). Two traits seem useful to me;

  1. the proportion between the length of the drawn line and the straight line between the end points.
  2. ‘Dispersion’ of the line such as calculated in the Directionality plugin.

Other traits such as what proportion of the line is below or under the straight line that connects the extremes may also be useful. How can this be coded? I am building an interactive macro that prompts the measuring of various traits for an open image.

You’ll find a lot of useful links in the archives, see:

Search:

https://forum.image.sc/search?q=butterfly