Dec. 27th, 2010

boutell: (Default)

Difficulties in the application of web technology to the measurement of snow on Jill's bucket

Or, I'm Dreaming of a White Paper

Thomas Boutell, BSS, BSL (**)

In February 2010 we had remarkable success in measuring snowfall on Jill's bucket through the misapplication of web technology. This experience led us to deploy the same technology with great confidence in December 2010 (*). However, new challenges arose.

Chief among these was camera drift. As we will see, the camera's viewpoint drifted upwards considerably during the night. Consider these three images taken by Jill's snowcam:







Figs. 1-3: camera drift.

As you can see, the top of Jill's snow gauge has drifted downwards by many pixels in each successive image (34 pixels from the top, then 56 pixels from the top, then 70 pixels from the top). This is the easiest way to observe the drift problem, although there was also horizontal drift as you can see in Figure 4.

What does this mean for our snow measurement system?

The snow measurement system (SMS) depends on the advance selection of a calibration point which is definitively (1) on the bucket, and (2) already in the snow. The snow detection algorithm then proceeds upwards until it encounters a significant discontinuity in pixel brightness. This is presumed to be the point at which the snow stops. Since Jill's snow gauge is of a contrasting color this worked well in February.

However, last night, with significant wind, the camera's view drifted upwards steadily through the night. That is, the bucket appeared to sink.

The end result was this:



Fig. 4: SMS FAIL!

What went awry? As you can see, the original calibration point (indicated by a red dot) is now well above and to the left of the actual presumed origin point of the snow (also indicated by a red dot). The snow detection algorithm obediently measured upwards from this point until it encountered a discontinuity (the bottom of the swingset), resulting in an incorrect snowfall measurement. Had the camera and the bucket remained in exactly the same position and orientation the snowfall measurement would have been accurate. Alas, under heavy wind conditions this is not a reasonable expectation.

Thus we have (inadvertently) shown that advance selection of a snow calibration point (SCP) is a problematic strategy for the measurement of snow via PHP, gd, webcams, equally obsessive friends in adjacent states and the Internets.

Future Directions


What steps can be taken to improve our results? It is apparent that the snow gauge is a difficult feature for the human eye to miss. It is reasonable to ask whether the gd-based PHP script responsible for measuring snowfall could detect the snow gauge.

We believe this is possible since the gauge is by a considerable margin the darkest feature in the image. One strategy would be to identify the snow gauge as a contiguous group of dark pixels, count them, compare this to the known result for the first frame in the series, and thus determine the amount of snowfall.

Looking at an early frame, this seems quite viable:



Fig. 5: a frame from the beginning of the series, representing no snow (to a first approximation)

However there is the problem of glare (see fig. 1). At differing times of night there is a considerable white glare on the upper part of the snow gauge.

A possible solution can be seen in the less reflective, non-monochromatic snow gauge of February 2010 (see Fig. 6).



Fig. 6: February 2010 snow gauge

The wooden snow gauge has two distinct advantages: color, and a relative lack of glare.

This suggests a way forward. It is believed that a blue, green or other distinctly non-grayscale snow gauge of a non-glossy nature may be the best option as it offers the option of distinguishing snow from snow gauge by hue as well as value.

Although it initially appeared that the original yellow snow gauge could be a viable option, analysis of images from February 2010 indicates that the top of the snow gauge was in fact registered as pure white by the webcam. There is also the possible problem of incorrect analysis due to the presence of unruly canines.

Green, however, is distinguishable even under full glare conditions and thus may be a better choice, provided that unseasonable vegetative growth is not present. Blue and red also have potential.

In an ideal world, the present conditions at Jill's house (e.g. snow on the ground) would be harnessed to test this option. Images of a green snow gauge of known height, with and without several inches of snow on the bucket, and with and without nighttime floodlamp conditions, would be captured and made available for analysis at our laboratories. It would then be possible to tune the SMS appropriately in advance of the next snowfall, testing the potential for automatic detection of the snow gauge and automatic measurement of the percentage as yet uncovered by snow, resulting in an accurate snowfall figure. It is our hope that such experiments may be carried out in the near future.

The author wishes to thank [livejournal.com profile] xtingu for making her snowcam available and aiding and abetting his misapplication of the data in any number of ways over the course of these experiments, and [livejournal.com profile] mrlich for his patient assistance, indulgence and tacit endorsement of these activities.

(*) Bullshitter in Snow Science, living near the Broad Street Line.
(**) While the December 2010 results appear correct on the official page, this is the result of a retroactive recalibration of the system and thus unsatisfying.
boutell: (Default)
The tape unspools. The mp3 decodes.
The cd samples six times (silence wins).
The record spins (the groove is getting old).
The pianola's hammers, struck by pins,

Reiterate a statement of intent.
The wheel squeaks. The propagandist speaks.
The elevator sings in its descent
Of only one thing, one place. Compass seeks

A single pole. I whistle while I work.
You whisper. Beauty traces subtle lines
With ugliness. A harmony is heard
Between them, a seductive lullaby,

A pretty sameness. Shut it out. Eschew
The concert hall. Embrace the red kazoo.

September 2014

S M T W T F S
 123456
78910111213
14151617181920
2122232425 2627
282930    

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Oct. 17th, 2017 10:08 pm
Powered by Dreamwidth Studios