Skip to main content

A mouse in the house : Webcam motion detection

video

We have a mouse in the house. I wanted to have the little intruder on camera. I dug out the old webcam and started to google for webcam motion detection software. Unfortunately a free but closed source program (Yawcam) won over a open source one (Dorgem). You can see the results in the video above.

The mouse makes its appearances at 3:00am, 3:50am and 5:26am. I forgot to add in time stamps to the images, but Yawcam can do that.

Dorgem was not satisfactory because I couldn't get motion detection to work. There was no way to adjust the threshold. I set it to take shots every 1s and it saved images with time stamped filenames (and a time stamp on the image itself) but the motion detection did not work. Perhaps the CCD noise kept triggering the software, I just got image dumps regularly at the 1s rate. [Help page on how to use Dorgem for motion detection]

Yawcam is more professionally designed. It has a motion detection preview pane where you can adjust thresholds or have the software adjust it automatically. The software highlights in real-time parts of the image where it detects motion. I found the auto-set tolerance level (20%) to be a bit high, perhaps because my motion trigger - a mouse - occupied a small part of the frame. I set the tolerance to 5% and the threshold to 95%.

Yawcam logs each motion event with several useful parameters. It has a "motion %". The first mouse appearance is triggered by a value of 5%. In contrast me walking across the kitchen is at 48%. My guess is that the % is the percentage of the screen that goes above motion detection threshold.

Once again:









Comments

  1. I would love to know more about how you did this, Do you think that there is any way I could rig a wireless wifi cam to do the same thing?

    ReplyDelete
  2. Hi, yes it should be possible same as with a wired cam.

    You could check if the software the webcam came with motion detection in which case it should be very straight forward. If not, do a web search for "webcam motion detection" which should let you do it. I see that dorgem has shut down.

    Best

    ReplyDelete

Post a Comment

Popular posts from this blog

Flowing text in inkscape (Poster making)

You can flow text into arbitrary shapes in inkscape. (From a hint here).

You simply create a text box, type your text into it, create a frame with some drawing tool, select both the text box and the frame (click and shift) and then go to text->flow into frame.

UPDATE:

The omnipresent anonymous asked:
Trying to enter sentence so that text forms the number three...any ideas?
The solution:
Type '3' using the text toolConvert to path using object->pathSize as necessaryRemove fillUngroupType in actual text in new text boxSelect the text and the '3' pathFlow the text

Pandas panel = collection of tables/data frames aligned by index and column

Pandas panel provides a nice way to collect related data frames together while maintaining correspondence between the index and column values:


import pandas as pd, pylab #Full dimensions of a slice of our panel index = ['1','2','3','4'] #major_index columns = ['a','b','c'] #minor_index df = pd.DataFrame(pylab.randn(4,3),columns=columns,index=index) #A full slice of the panel df2 = pd.DataFrame(pylab.randn(3,2),columns=['a','c'],index=['1','3','4']) #A partial slice df3 = pd.DataFrame(pylab.randn(2,2),columns=['a','b'],index=['2','4']) #Another partial slice df4 = pd.DataFrame(pylab.randn(2,2),columns=['d','e'],index=['5','6']) #Partial slice with a new column and index pn = pd.Panel({'A': df}) pn['B'] = df2 pn['C'] = df3 pn['D'] = df4 for key in pn.items: print pn[key] -> output …

Drawing circles using matplotlib

Use the pylab.Circle command

import pylab #Imports matplotlib and a host of other useful modules cir1 = pylab.Circle((0,0), radius=0.75, fc='y') #Creates a patch that looks like a circle (fc= face color) cir2 = pylab.Circle((.5,.5), radius=0.25, alpha =.2, fc='b') #Repeat (alpha=.2 means make it very translucent) ax = pylab.axes(aspect=1) #Creates empty axes (aspect=1 means scale things so that circles look like circles) ax.add_patch(cir1) #Grab the current axes, add the patch to it ax.add_patch(cir2) #Repeat pylab.show()