Computer vision and video motion detection for control of showers

With rising pollution at the local beaches, waterparks are rapidly becoming a favorite attraction among university students, and are competing in popularity with vacations to more distant beaches.

A common attraction at a waterpark is a high power deluge shower, supplied with a 3 inch diameter pipe directly from the city's water main.

The attraction described in this paper features a Vortex ``rainbow'', ``tree'', and six ground nozzles that can spray water up to 30 to 35 feet in the air, from right under a bather's feet. Each attraction is supplied by its own 1 inch diameter pipe coming from the three inch pipe supplying the waterpark. Three ground nozzles are considered one attraction, so ground nozzles are controllable only as an entire set of three.

To avoid concerns of disease, fresh water is used, and drained through the sewers afterwards. Thus, unlike pool water, you can actually drink from the deluge showers.

The experience is wonderfully refreshing, like drinking from a firehose (It was once said that "Getting an education from MIT is like taking a drink from firehose"

Unfortunately these attractions waste a lot of water.

In a time when showers are being fitted with low flow water saving showerheads, it is surprising that deluge showers are used for anything other than emergency eyewash fountains or for emergency processing victims of chemical spills.

Accordingly, computer vision can save water and lives. Cameras watching the bathers in the shower determine when bathers are present, and exactly where they are located with respect to known geometry of the showers. Only the showerheads that would wet a bather are activated, when the bather enters a spray zone. When the bather steps out of the spray zone, the showers shut off automatically to save water.

Computer vision with Digital Signal Processing allows for much more accurate tracking of the exact location of the bather than other similar systems used to automatically flush toilets or automatically actuate handwash fountains.

Moreover, the system can prevent injury or death of elderly people, when presently 15,000 people die annually while bathing due to the increased chance of slip-and-fall injuries. Such deaths could be avoided if an automated call for help were placed. Drowning prevention is also possible by automatically shutting off all water and automatically activating drains to eject any standing water if a bather slips and falls. (It should be noted that drowning deaths still occur in showers, even though there is no standing water in any kind of basin.)

Here is the facility with the showers off, and no bather present:

(in images s632 to s635 showers are off, no bather present)
At this time, the system continually monitors for the presence of a bather.

Here is the facility with the showers off, and a bather present:

(in images s636 to s677 showers are off, and the bather is present)

By differencing the images (e.g. try "difference" in the GIMP = Gnu Image Manipulation Program, or use octave, or Matlab to subtract and take the absolute value of the result), we obtain an absolute difference signal suitable for detecting the presence and location of the bather:

When a bather is present, the showers should be switched on:

(Images s563-583 and 591-607 depict a bather present while the showers are on.)

So far everything is quite easy. The problem arises in detecting bather absence so that the showers can be shut off.

This problem arises from ``noise'', e.g. the shower spray is detected as motion.

A simple solution would be to turn on the showers for a fixed time (e.g. 5 minutes) while ignoring input from the cameras. Then once the showers are shut off, the system can resume watching for new bathers.

However, such an approach is wasteful, because a bather may just run through for a few seconds, or may stand for longer.

Thus what we really need to do is to be able to distinguish between the condition of bather present with the shower on, and bather absent with the shower on (e.g. immediately detect the absence of the bather in the spray zone so that water can be shut off immediately). The system can ``learn'' a noise model for the showers, so that it ``knows'' when there are no bathers present (e.g. motion is due just to noise only).

Here is the facility with the showers on, and no bather present (ideally the system should learn this in ``blind'' training, e.g. not being told that these are examples of no bathers present):

(Image 561 and images 584-590 have showers on, no bather present. These images may be used to generate a noise model, e.g. for obtaining statistics of the noise model, etc..)

Here is an absolute difference between s599 and s590:

Note that the bather is much less visible, in the difference image, when the showers are running. This creates a challenging digital signal processing problem.

Note also that the bather will still show up when not in the spray zone, so it is necessary to locate the spray zone and switch on the showers ONLY when the bather is present IN THE SPRAY ZONE. Here, for example, a bather is present outside the spray zone when the showers are still running:

and the difference image shows the bather actually much more clearly than when obscurred by the spray of the showerheads:

Additionally, further processing on these difference images should isolate the region where the bather is located. Smoothing filters (lowpass filters) will help with this situation. For example, GIMP ``Despeckle'' (a nonlinear lowpass filter) with radius 19, produces the following:

Thresholding this result from 64 to 127, e.g. the half open interval [64,128), provides the following result:

from which the bather's location can be found in the image plane by computing the centroid of this distribution.

Try some signal processing on situations when the bather is present in the shower spray. What problems arise? How might they be solved?

Although the system described here is for use in a waterpark, digital signal processing can also be used to automate various other kinds of plumbing fixtures, soap and shampoo dispensers, and electric air hand dryers in homes or buildings.