Close

Who's taking the candy?

A project log for Pyball - A Smart Eye on the World

Pyball is a automated, Raspberry Pi based camera to remotely keep track of the world.

J. PetersonJ. Peterson 11/23/2015 at 00:200 Comments

We live in a neighborhood that's pretty quiet around Halloween, but we leave a bowl of candy out just in case. And it's always empty by the time we get home.

So, who was taking the candy?

I tried to set up a Pyball to find out. This was done in a hurry, so my hacked together image-difference algorithm was not sophisticated. It just captures two images a second apart, finds the difference of the two images, and computes the mean of the RMS of the differences. In Python, using the PIL library, this is:

    deltaImg = ImageChops.difference( baseImg, newImg )
    deltaStats = ImageStat.Stat( deltaImg )
    rmsValue = numpy.mean( deltaStats.rms )

In reasonable light this seemed to work OK. But when I deployed it to watch the candy bowl I ran into some unexpected problems.

I'll be looking into more sophisticated algorithms, both for exposure control and motion detection.

So here's the one photo that sort of worked (though the contrast was massively boosted in Photoshop)

Discussions