Saving Energy Via Webcam-Based Meter Reading? 215
squoozer writes "Like many people, I am trying to cut down on the amount of energy my family and I use in order to save both the environment and my pay packet. Since I want to do this in as scientific a way as possible, I'm taking meter readings every day and recording them in a spreadsheet (OOo Calc naturally). Currently, in the UK at least, neither gas nor electricity meters can be hooked up to any sort of device that can query the meter for its current reading. Rather than climb down into the cellar every day to read the meters, it would be great if I could simply position a webcam in front of each meter and have the value logged automatically each day. The problem is that while I am a software developer (Java mostly) I have no experience in image processing (dials from the electricity meter) and don't really know where to start with this project." Does anyone have any advice for analyzing the visual data this reader would be gathering?
Rubbish (Score:4, Informative)
Rubbish. Look up smart meters gas & electric meters which update the utility company continously on usage which they can provide to you as well. (currently insanely popular after the recent documentry on smart meters)
If your supplier is reluctant to include you in the trials, for electrical use try "Wattson" [diykyoto.com] or other similar personal wireless power meters (also sold out everywhere, but there a cheaper more functional equivalents around)
Kill-A-Watt? (Score:4, Informative)
A Kill-A-Watt [thinkgeek.com] might be a better choice for "power trimming", since you can get an instant reading of the power used by anything that plugs in.
On my website [phot.ogra.ph] I have a couple of webcams that I grab the image from at a specific interval and store the result. Basically, if you get a Trendnet TV-IP201 and a Pentax 10mm f/1.2 [bhphotovideo.com] lens with a C-mount to CS-mount [bhphotovideo.com] adapter, you can just wget the image however often you want. Image processing is another issue, but I don't know anything about that.
The standards are coming (some already here) (Score:5, Informative)
Whether or not they'll specifically give you access to the data is somewhat moot, since it's network-over-powerline and there are already consumer devices [google.com] that can access the same network and (eventually if not already) be hacked to reveal the data being sent from your meter.
It's an exploding industry (like 20-30% CAGR in the US alone, higher in other less-developed areas where the first power meters will be homeplug-capable) so I wouldn't suggest putting too much effort into your image-analysis idea at least for a few months to see what happens in homeplug-world.
OCR plugins? (Score:3, Informative)
As long as your web cam doesn't get moved, you can set static cropping on the image so only the numbers are in the jpg file without a huge complicated border than might confuse the OCR engine.
Re:OCR plugins? (Score:3, Informative)
Re:OCR plugins? (Score:5, Informative)
This guy [eissq.com] has an algorithm run in matlab to convert dial indicator readings to numbers using MatLab. He claims 99% accuracy over 2000 readings.
Orientation analysis in an image (Score:4, Informative)
What you can do is use image processing commands (in your favorite programming language; a shell script, Python, etc.) to crop the image to generate a small image for each dial. Then convert to grayscale (and maybe increase the contrast to highlight the dial). To then calculate the preferred orientation in the image, you calculate gradients along different directions. There will be a much higher value for the gradient along directions perpendicular to the preferred axis. This procedure is described very briefly in this paper:
Harrison, C.; Cheng, Z.; Sethuraman, S.; Huse, D. A.; Chaikin, P. M.; Vega, D. A.; Sebastian, J. M.; Register, R. A.; Adamson, D. H. "Dynamics of pattern coarsening in a two-dimensional smectic system [aps.org]" Physical Review E 2002, 66, (1), 011706. DOI: 10.1103/PhysRevE.66.011706 [doi.org]
This is easiest to do if you use a graphics package that has directional gradients built-in (but coding it yourself probably wouldn't be too hard). Basically you create copies of the image and on one you do a differentiation in the x-direction, and for the other one a differentiation in the y-direction. Let's call these images DIFX and DIFY. Then you compose two new images:
NUMERATOR = 2*DIFX*DIFY
DENOMINATOR = DIFX^2-DIFY^2
Then you calculate a final image:
ANGLES = atan2( NUMERATOR, DENOMINATOR )
(All the above calculations are done in a pixel-by-pixel mode.) The final image will have an angle map (with values between -pi to pi) for the image. It should be easy to then use the avg or max over that image to pull out the preferred direction. You may also improve results by tweaking the initial thresholding, or by adding an initial "Sharpen Edges" step, or by blurring the NUMERATOR and DENOMINATOR images slightly before doing the next step.
In any case, the above procedure has worked for me when coding image analysis for orientation throughout an image (coding was done in Igor Pro [wavemetrics.com] in my case). So maybe it is useful for you.
Re:Rubbish (Score:3, Informative)
Mechanical? (Score:2, Informative)