Monday, June 24, 2013

Counting Gym Freqs

So let's measure the amount of wear on Jon Purdy's image of exercise weights from a previous post.  Here is a Photoshop image of the weights modified by rotation and perspective correction. Unfortunately, the weight selection plug (in red) has hidden the amount of wear at 30lbs/14kgs. Its coiled cord has only partially hidden the full wear pattern at 45lbs/20kgs and at 60lbs/27kgs. We can attempt to impute these last two. The amount of wear behind the coiled cord at 45lbs/20kgs appears to be about the same as at 135lbs/61kgs. We will replicate the 150lbs/68kgs pattern over the top of the image of the coiled cord at 45lbs/20kgs. In this image, the cord also obscures the upper portion of the wear pattern at 60lbs/27kgs. We will replicate only the upper portion of this wear pattern with with upper portion from its neighbor 75lbs/34kgs resulting in the image below.
We then convert the selected wear region to black and weight and increase the contrast. A portion of this is shown below.
Notice that, as a result of our imputation, the first panel of this sequence (30lbs/14kgs) is a duplicate of the eighth panel (150lbs/68kgs) and the upper half of the second panel is a duplicate of the upper half of the third panel. The overall balance of dark and light pixels can be seen with the Photoshop histogram option that displays lines whose height represents the count of pixels corresponding to total black (a level of 0, on the left) to total white (a level of 255, on the right), as shown below.
We see peaks of predominately dark pixels levels (on the left) and light pixels (on the right). On this histogram I have selected the approximate midpoint between the two peaks (level 133) and shaded in all the pixels that are lighter (levels 133...255). Of the 106512 pixels in this image, 44443 were thus selected. For each weight, a region of the same size size was placed around the panel and the number of light pixels (above 133) was computed, as shown below for panel 6 (120lbs/55kgs).
Of the 7504 pixels commonly selected from each panel, this panel had a count of 4781 light pixels (those with levels 133...255). Repeating this for all the panels (1 through 14), the total number of light pixels is 33651, so that panel 6 accounts for 4781/33651 or 14% of the light colored wear. The other panels can be similarly computed finally resulting in the rounded wear percentages shown in the bar chart below.

1 comment:

Ken Lonseth said...

Nice post, I like the statistical angle on, well pretty much everything.

On a related note, I've been looking at my wear patterns on various shoes. It's a cheap way of seeing where I apply most force to the ground. If you had any other insights I'd appreciate it.