Microsoft Robotics

Glossary Item Box

Robotics Common: Robotics Common Overview

Microsoft Robotics Developer StudioSend feedback on this topic


Generic WebCam

The Generic WebCam service contract enables you to obtain data from a conventional webcam (web camera) that is connected using USB or IEEE 1394 (Firewire).

The Generic WebCam service provides the following operations. All except the Get operation also are available as notifications.

GetReturns the entire state of the webcam service.
QueryFrameReturns the most recently captured frame with the timestamp of when it was captured. This includes the image data.
UpdateFrameIndicates when a new frame has been captured. It does not contain the image data so that these messages are small. You must explicitly request the image data using QueryFrame.
WebCamReplaceUpdates or indicates an update to the webcam's state.


The state of a webcam is represented the following properties.

CameraNamestringSpecifies the (device) name of the camera.
PosePoseIndicates the position and orientation of the camera.
ImageSizeVector2Indicates the size of the camera's image.
ViewAnglefloatSpecifies the camera's Field Of View (FOV) angle.
QualitydoubleSpecifies the camera's compression level setting.
LastFrameUpdateDateTimeTimestamp of the last image that was captured.


In addition to the generic contract, there is a Webcam Sample implementation that works with cameras that have DirectShow drivers for the latest version of DirectX or the older VideoForWindows capture model.

There is no viewer in VPL for the webcam service. You must use a web browser to examine the service state while it is running. Once your application has started, open a web browser and navigate to http://localhost:50000/webcam.

A web page should be displayed with an image from your camera as shown below. Using the controls on the web page you can select a different camera (if you have one) and the display format. You can set the page to automatically refresh (and specify the interval), or just display a single snapshot whenever you click on the Refresh button.

Sample WebCam service exposing data as structured data and as video.

Note that processing webcam images is a very complex task and VPL is not a suitable programming environment for this. You can however use pre-written services that do the image processing. For example, there are color segmentation and blob tracking services provided as sample code in C#.


Updated information might be available online in the MSDN Library page:
WebCam Sample

Robotics Common: Robotics Common Overview



© 2012 Microsoft Corporation. All Rights Reserved.