Shion’s New Eyes

Shion 3.0a7 introduced the new Camera device and I wanted to share some information about this new feature and how to use it.

The rationale behind including this device type is that in this day and age, it’s difficult to purchase a new Apple computer that doesn’t include a webcam of some sort and I thought that it might be useful to put these devices to work in the same way we use other kinds of sensors within Shion. It you happen to use multiple computers with cameras, we can put this mostly-neglected hardware to use with Shion. No home automation hardware is necessary to use this device.

Camera Device

In short, the camera interface consists of two main elements: the image list view and the preview window. Clicking “+” and “-” will capture and remove images from the device’s list, while clicking the magnifying glass icon will toggle a preview window that displays the selected item in the list. To look at other images, simply select them from the list and the window will update automatically.

To setup a new camera device, simply add it as you would any other. From the Console window, use the “+” button in the bottom-left and select Device: Built-In: Camera. Shion will add the device and prompt you for some configuration options.

Camera Settings

Name, location, model, and description are all descriptive elements that function the same as they do with the other devices. Beneath those fields is a box with camera-specific options:

Capture images automatically: By default, you can take pictures manually by clicking the “+” button in the main camera interface. However, if you’d like to configure the camera to take pictures at set intervals, you can enable this option and choose the time interval between snapshots. For example, if you enable this and specify that you’d like an image captured every 5 minutes, the system will automatically take a picture on that interval and add it to the list in the main camera view.

Discard similar subsequent images: Enabling this option tells Shion to compare a newly-captured image with the last saved image and to discard the new image if it’s too similar to the older image. This feature is intended to help you keep your image collection manageable by only capturing new information. In my case, this helps me avoid capturing too many pitch-black images during the night.

Play alert sound on image capture: Enabling this instructs the camera to play a sound effect (a camera click) when an image is captured. This is intended to alert anyone in the immediate vicinity that their picture has been taken in order that they can retain control of information about themselves by deleting any unflattering or otherwise undesired images. Unless you are using this device for security purposes (and I highly recommend against that at the moment), please enable this feature as a courtesy to the other people in your environment.

If you’re using Shion Touch, the images from the camera will show up in that application and you can remotely instruct the camera to capture a new image as desired. I’m still working out some of the interaction details, but the feature does work.

This is a version 1.0 implementation of support for this device type, so please let me know how I can improve it. I’m actually quite excited about the camera device because it has a ways to grow. Underneath the implementation, I am using an open-source computer vision framework called OpenCV to implement the image similarity tests. This is probably the most basic use of that framework, and it’s powerful enough to do other things like object tracking and face recognition. As the camera device matures, I’m looking forward to making it a more fully featured sensor using computer vision techniques.

Questions or comments?