With the experimental work on this project pretty much wrapped up I’ve been spending a large amount of time playing with spreadsheets, making frame-by-frame measurements from high-speed video files, and plotting data up as I start to draw together a paper. With hundreds of experiments completed the real task is identifying those which demonstrate the results in the best way, without displaying so much data that the whole thing becomes unmanageable.
Part of this process is deciding which types of results show things best. For example, if I am trying to demonstrate the effect of mass flux (how much material is put into the experiments per second), am I best showing the effect on the speed that the flow moves, or in how far the flow finally reaches? Should I be plotting mass flux at all, or should I actually be plotting things in terms of the concentration of the flow (which varies as a function of mass flux)? Should I describe the deposit rather than the flow?
Because different types of flow form different shaped deposits one of the ways of describing the deposit is by its centre of mass; how far down the flume is the midpoint of the resting mass? A long flat deposit will have a midpoint much further away then a simple wedge, where much of the material as not travelled far at all. This is a really useful way of describing how mobile the flow must have been which formed the deposit, but it’s a non-trivial thing to measure.
Today, I worked out a solution and I’m going to put it up here in case a) anyone else finds it useful, and b) I forget how I did it.
All you need is a copy of Photoshop. I’m guessing GIMP might do it as well, but it’s a long time since I’ve used it.
So, we start off with an image of a deposit.
Now, you move your cursor across the histogram window, looking for the point which represents the 50th percentile (you could equally do this for any other percentile you’re interested in). Note it also gives you the colour level (in this case 76):
This level represents where on the scale of 0 – 255 levels of grey the midpoint lies. So in our case 50% of the pixels have shades between 0-75, and the other 50% of the pixels have shades between 77-255. It’s also worth remembering that level 0 is black (no brightness) while 255 is white (full brightness).
So now we simply open the info panel, and move our cursor over the image itself to identify whereabouts along it we get level 76 (you might have to ensure the image is in RGB). That’s our mid point. The image below shows a selection which divides the left 50% of deposit from the right 50%. We can verify the result by looking at the pixel count in the histogram window which is showing the number of pixels within the selection in the gradient layer (should be half that we started with – in this case 31125 / 15560 = 2).
Hopefully this may be of use to someone somewhere.