Justin Platz and Kevin Gleason from PubNub have published a tutorial that uses the Raspberry Pi camera module to take pictures and then upload them to online service Parse. The program hooks into a PIR sensor to detect movement then uses OpenCV to detect faces. The upload only happens if a face is detected. For fun, they overlay superhero masks onto the faces! All the code is available and there is also a wiring diagram for the PIR. Read more here.