From iLab Cookbook

Toolkits: UnderstandingCameraClientServer

<< Back to the EasyImage Toolkit page

How To - Understanding the Camera Client and Camera Server

What you will learn

This How-To describes most of the things you will need to know about the Camera Client and Camera Server. You will learn

Why you should use a camera server

Conceptually, if you have a web camera attached to your computer, you should just be able to ask it for a frame. Alternately, you should be able to set a frame rate and be notified when a new frame is ready for you to use. If only all of life were that simple.

The reality is that accessing frames on a web camera is a mess. In fact, one of our motivations for writing EasyImages was to try to reduce this mess to a manageable state! Here are a few reasons:

To get around some of these issues, we include a Camera Server with Easy Images. The first job of the server is to start a web camera with some certain properties set (e.g., frame rate, size, and a name), and then capture frames from an attached web camera. Multiple client programs can then access those frames. Under the covers, the camera server writes frames to a named location (that is what the Camera name is used for), and the camera clients just read from that location.

For most people, all you need to know how to do is start the camera server and set properties that work well with your program.

We should mention that you don't have to use the Camera Client / Server model in your own programs. You can use the Camera object supplied in EasyImages to access frames directly. This approach will actually work for most things, but see the issues mentioned above.

Starting the Client Server.

This sequence illustrates two ways to start the Camera Server.

Method 1: The Start Menu

If you have installed the CameraServer Installer package (in the Easy Images download and installation section), you will find an entry on your start menu called Grouplab -> EasyImages -> Camera Server. Select this, and the window below should appear:

At this point, you can specify the following properties of the camera server:

When you are done, you can start generating frames from the web camera, or you can generate a test pattern instead. The two images below show both cases. The left starts the server using actual camera frames by clicking the Start Camera checkbox, while the right does the same except that it generates a test pattern by clicking the Start Test Pattern button. You can see the video or the test pattern as it is being generated by clicking the ''Display video' checkbox (see image below). Note that the test pattern shows the current time in one second intervals.

Method 2: Automatic Server Starting through your Client Programs.

If you try to start a program that uses the Camera Client to access frames (e.g., all the tutorials are written this way), that program will expect the server to be running. However, if for some reason you have not started the Server, the program will recognize and try to remedy this.

Instead of failing, thatprogram will install its own version of the server (which is actually included in the EasyImages.dll, and then try to invoke it. You will then see the series of dialog boxes below. You then need to select the Start checkbox in the Camera Server window, and the Ok button in the Start Camera dialog box after the camera is started.

A few other things to know:

Retrieved from
Page last modified on July 17, 2007, at 06:21 PM