jump to navigation

Creating a home security camera system, part 3 February 10, 2006

Posted by cnchapman in Technology.
trackback

Getting the picture.  In this part, I talk about how to get the images from the Toshiba camera so they can be used by other programs for archiving and motion detection.  This was trickier than I anticipated.

As mentioned earlier, I selected the Toshiba IK-WB11A camera for the visual part of the network.  The camera worked well right out of the box.  There are various options that can be set on it and are self-explanatory.

My first requirement for this system was to store pictures continually, regardless of whether motion was detected in the images.  That way, regardless of whether the motion detection algorithm works or failes, I will always have a real time backup (backed up in two places).  To do that, I needed to access the images in real time.

This posed a problem: how to access the Toshiba’s photos without using a web browser or their software.  The documentation does not describe how to capture the current image as a simple JPG file.  Eventually I found the answer from another user online: access the current image as :http://your.ip.address/__live.jpg?&&&

With that working, I wrote a Windows program using Delphi that would retrieve the images every second (or at any specified interval) and save them to the network locations.  This uses the Delphi Indy socket components for the http download, http://www.indyproject.org/.  I won’t post my code, as there are good examples online already, such as http://www.swissdelphicenter.ch/torry/showcode.php?id=2391.

Unfortunately, if you want to archive the images indefinitely, you will need to invest in a program to read the image files and save them.  There are a lot of ways to solve that, ranging from writing your own (as I did) to buying one online.  The Toshiba camera offers the onboard ability to detect motion and send email.  However, I did not want to bog it down sending mail and the like — I wanted a fast, responsive camera, not a camera trying to be a server.

Now the second problem arose: I wanted to do motion detection on the live images.  If there was motion detected from one frame to the next, I wanted the frame with motion to be stored on an external machine (not in my house) in real time and also backed up to various local locations.  I set up “motion” on my linux server to monitor the images.  It likes to look at a live stream, not at sequentially saved files with different names.  So I pointed it to the camera URL as above — but it didn’t work.  It seemed that it could not authenticate successfully against the camera, and thus could not get the image.

I solved this with a two-step approach.  First, I modified my file-saving program to save the latest image for a camera to a specific, unchanging file name (in addition to the incrementing file names for the archived images).  Second, I installed the Abyss web server http://www.aprelium.com/ (free for personal use) and configured it to serve up the current camera image files on my network.  Now Motion could look at the file for a given camera and run motion detection perfectly. 

Here’s a screenshot from my application, showing how it archives the images to multiple places and to the web server location.  (Note that the picture quality is low because the hard drive box is very close to the lens.)

camera-sample.JPG

This also solved one of my other requirements: to be able to monitor cameras.   I can simply point a web browser to the appropriate file on the web site.  Of course that only runs locally, since I don’t want to serve up images on the Internet.  (That would be easy to configure with Abyss, just not necessary for me since any with motion detected are stored externally anyway).

 

Advertisements

Comments»

1. Ken Deaton - June 15, 2006

Wow, what a trial… So sorry to hear you were robbed.

I’m very impressed by the effort you went to and the degree of technical savvy required. Would that new Panasonic Camera allow one to do this in another (easier) way? I think it’s the Model BL-C10A (albeit at spmewhat lower res than what you did).

URL here:
http://www.thinkgeek.com/computing/input/7715/

Specs here:

This Panasonic network camera can be viewed and controlled from a standard Web browser, video display, or even a compatible cell phone or PDA. Place one in your home, office, vacation home or almost anywhere else that you’d like to keep an eye on things, with no PC required on location!. They are easy to install and operate and require no additional software for the PC that you’re viewing them on. Each camera also comes with a free Web address, which can track the camera automatically. All you need is a regular Web browser to view them on your PC, as all of the other required software, including control software (TCP/UDP) and e-mail software (SMTP), is already inside the camera.

This network camera is truly easy to install and use in most cases. With industry standard automatic configuration (UPnP), the camera and your router or PC will automatically decide the best settings allowing you to access your camera without any complicated setup. Once connected, using a simple Web browser, just enter in your free, permanent Web address which comes with the camera and you can see and move the camera! It’s that simple.

Using a standard Web browser, video display, or even a compatible cell phone or PDA, you can control the movement of the camera. There is 120º of Pan (left & right) movement and 90º of Tilt (up & down) movement available. You can also assign a “Home Position” that allows you to return the camera to a pre-designated shooting position. Up to eight shooting positions can be registered in advance, so you can aim the camera exactly where you want it. You can also click on the part of the image you want to see, and automatically bring that part to the center of the screen.

With the built in Privacy mode, your privacy is protected by simply pressing a button. An indicator on the front of the camera turns red, and you know at a glance that the camera is now only accessible by you. The camera can also be set up to show a green light when the camera is being accessed.

As an added plus, with the built-in heat sensor, the camera can be set to record and/or notify you by email when someone enters the room. It can even automatically move to a preset location when triggered, just in case someone was viewing a different part of the room.

Model BL-C10A

# Color Image Sensor: 1/4″ 320,000 pixel CMOS
# Image Compression: JPEG
# Video Streaming Format: Motion JPEG
# Video Resolution: 640 x 480, 320 x 240(default), 160 x 120 1
# Max Frame Rates: 7.5 frames/sec @ 640x 480, 15 frames/sec @ 320 x 240 or 160 x 120
# ID/Password authentication: Administrator/General Users (up to 50)
# Supported Network Protocols HTTP, FTP, SMTP, TCP, UDP, IP, DHCP, DNS, ARP, ICMP, and POP3 before SMTP
# Upgrades downloadable Via Ethernet connection
# Automatic Network Configuration with UPnP supported router
# Up to20 Simultaneous Viewers
# Image Transfer via E-Mail (SMTP) or FTP Triggered by built-in sensor alarm and/or timer
# Camera can record data to a web site through FTP or to the hard drive of a local computer
# View Snapshot and Control from Compatible Cell Phone
# Remote Pan: 50 degrees left and right max. (or less based upon user setting)
# Tilt Angle -40 to +10 degrees (or less based upon user setting)
# Maximum Pan/Tilt Speed: 50 degrees/sec
# Focus: Fixed, 1m-infinity
# Aperture: F2.8
# Illumination: 1 – 100,000 lux
# White Balance: Auto/Manual/Hold
# Auto Exposure
# Network Connection: Ethernet (10Base-T/100Base-X)
# Supported Network Protocols HTTP, FTP, SMTP, TCP, UDP, IP, DHCP, DNS, ARP, ICMP, and POP3 before SMTP
# Wall Mount/Tripod Mount
# Operating Temperature +5°C to +40°C (+41°F to +104°F) Indoor Only
# Includes AC Adaptor and Cord, Setup CD-ROM
# PC Requirements: Windows 95/98/NT4.0/2000/ME/XP, IE 6.0 or later
# Dimensions: 3.86″ x 2.91″ x 2.40″
# Manufacturer Warranty: 1 year

2. Joanne L - March 14, 2007

Wow, this is discouraging. I was thinking about setting up a monitoring cam and this pretty much changed my mind. I don’t have the time to futz with the complicated setup.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: