Glossary Item Box
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.
|Get||Returns the entire state of the webcam service.|
|QueryFrame||Returns the most recently captured frame with the timestamp of when it was captured. This includes the image data.|
|UpdateFrame||Indicates 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.|
|WebCamReplace||Updates or indicates an update to the webcam's state.|
The state of a webcam is represented the following properties.
|CameraName||string||Specifies the (device) name of the camera.|
|Pose||Pose||Indicates the position and orientation of the camera.|
|ImageSize||Vector2||Indicates the size of the camera's image.|
|ViewAngle||float||Specifies the camera's Field Of View (FOV) angle.|
|Quality||double||Specifies the camera's compression level setting.|
|LastFrameUpdate||DateTime||Timestamp 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.
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:
Robotics Common: Robotics Common Overview
© 2012 Microsoft Corporation. All Rights Reserved.