Saving Energy Via Webcam-Based Meter Reading?
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?
My meter reads in kilowatt hours, not amperes.
Give me Classic Slashdot or give me death!
I'd say your approach completely depends on your goal. If your goal is as stated, then I'd use the webcams to get shots of the meters, then I'd take the 2-3 minutes or whatever it takes a week to pull up those images and transcribe their values into the spreadsheet. If the goal is a programming exercise, then go to town with figuring out some way to automate that few-minutes-a-week task. Of course, in order to do that, you'll expend a whole lot more energy than you'd take to read the meters (via the webcam shots) yourself.
This guy's the limit!
Post the images as CAPTCHAs that protect porn pictures. You'll have the values typed in for you in no time.
UTF-8: There and Back Again
Depending on the color of the faceplate and the hand, you might be able to mask off everything you don't care about (say everything but a small area around the center of the dial), run it through a hi/low filter to map the faceplate to white and the hand to black, and then just calculate the angle of the hand by searching the edge of the image for black pixels. So long as the cam is fixed and you know the coordinates of the pivot point it should be trivially easy to determine the angle of the hand based on the point at which it crosses the edge of the detection area. Once you've got the angle it should be trivially easy to map that back to a set of values.
Curiosity was framed, Ignorance killed the cat.
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" or other similar personal wireless power meters (also sold out everywhere, but there a cheaper more functional equivalents around)
A Kill-A-Watt 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 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 lens with a C-mount to CS-mount adapter, you can just wget the image however often you want. Image processing is another issue, but I don't know anything about that.
If I have nothing to hide, don't search me
Your power company is probably already looking into standards like Homeplug (main org site) (wiki link) that provide meter data much more accurately than a webcam and image analysis software. This allows them to save money on paying sneaker-net meter readers, and real-time usage data for load balancing and prediction.
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 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.
everything in moderation
There are many open source OCR tools available. Write a script to capture a JPG or PNG image every day from your camera and run it through one of the command-line OCR tools..
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.
Often the meter supports some sort of data export mechanism, and you just need to tie into it. Hacker extraordinaire Poul-Henning Kamp did this with his gas meter.
-bugg
Dear /.
Like so many others, I have a project I want to do. The project involves doing X, but alas I can not do X myself. Have any other /.ers done this and have some sample code I can look at and learn how to do this myself?
regards,
someGuyWhoWantsToBeABetterGeek
whois gawk date unzip strip find touch finger mount join nice man top fsck grep eject more yes exit umount sleep dump
But you must not block the meter dials from view. Someone goes to check the values manually, every once in a while (monthly?).
If you have the same kind of "spinning wheel with a mark" under the small dials, it might be easier to check for the number of revolutions of that wheel.
Of course your biggest power drain will be from the computer that is always on reading the meter.
134340: I am not a number. I am a free planet!
For the sake of your family sanity.
The image analysis question is interesting. You are trying to read dial positions, so conventional OCR is probably useless (unless there is a package to do exactly that?).
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" Physical Review E 2002, 66, (1), 011706. DOI: 10.1103/PhysRevE.66.011706
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 in my case). So maybe it is useful for you.
How is it lame to ask other people questions when learning how to do something yourself?
They changed all our electricity meters (madison, WI) to wireless now. they just drive the truck by and read them all instantly.
I assume it would be getting popular elsewhere too. it would be fun if you could tap into that.....
they are wireless, but not wifi
Mechanical or Spinning disk type meters can be read optically or magnetically, or if you have a dig meter with LED interface you can monitor the LED frequency; Both allow for real time monitoring of your homes load. Monitoring the aggregate by collecting at all load points would be better, but that's a bit more complicated. try: http://web.archive.org/web/20060509092108/http://www.seanadams.com/pge/ ...for a head start.
SLR-
FYI, here in holland you just pay a guesstimate every month, and they give you a final bill every year.
They try to get a meter reading every year. They trust you to do it yourself. They send a guy over every once in a while (i.e. every 5 years or so) to keep you honest. All you can do is postpone the stuff for a while. If you move you either have to arrange for an official meter-taking, or you have to sign a common "agreed meter-positions" note with the next inhabitant.
Apparently they HAVE to check the readings every three years. In practise they don't.
So, here in the Netherlands, most meters are on the insides of houses, and accessible for home owners to put a camera in front.
Lots of folks have suggested methods for developing an algorithm so I'll point you to some software that is free and very powerful. ImageJ is funded by the National Institutes of health, it is freely available and more than capable of the degree of image analysis you'll require. As others have mentioned image quality and consistency can be a huge hurdle so make life easier by setting everything up with care.