Moving at the cam
The main problem w/ my webcam script, is that it always take a shot even when nothing is on the desk, by night for example or when i’m at work. Beside i can use something like monitor, it isn’t the best way since i use a huge amout of CPU. So i decide to save picture only if the previous one is not the same. But how to compare two pictures ? After a little googling I found this:
import Image h1 = Image.open(filename1).histogram() h2 = Image.open(filename2).histogram() rms = math.sqrt(reduce(operator.add,map(lambda a,b: (a-b)**2, h1, h2))/len(h1))
So now i only save the picture in my snapshot folder if the RMS is greater that 100, so no more 10 times the same one.
- How to convert matroska MKV to AVI on Linux ?
- Howto hack USB port on a LG LAC-M6500R MP3 Player (CD/Radio/MP3 Player)
- OverKill / Oh my god
- Webware Wiki: The anti-product
- IV-18 VFD vacuum Russian Clock (part 1)
admin December 13th, 2003
- Web
- Comments(0)