Back to Adaptive Vision Studio website

You are here: Start » Filter Reference » WebCamera » WebCamera_GrabImage


Module: ThirdParty

Captures a frame from a camera using Direct Show interface.

Name Type Range Description
inCameraIndex Integer* 0 - + Index number of camera device to connect with
inFrameSize Size* Requested size of source frame in pixels selected from camera output formats
inPixelType WebCameraInputFormat Requested specific pixel type from camera (may change image quality)
outFrame Image Captured frame


Not recommended for industrial operation.


Filter uses DirectShow API to acquire images from devices registered in system. Images can be acquired from many sources like: web cameras with support for DirectShow , video grabbers and system video streams.

Input inCameraIndex selects device in order provided by the operational system.

Input inFrameSize selects output image size in pixels. If an image in requested size is not available an error occurs. If value of inFrameSize is not provided filter returns image with first available size found.


Description of usage of this filter can be found in examples and tutorial: Dynamic Template Matching, Basic filter usage..


Best quality of images can be achieved using inPixelType with values RGB24 or RGB32. Format YUY2 stores two RGB pixels using only 4 bytes.

To check which pixel types are supported you can use application GraphStudioNext


Multithreaded environment

This function is not guaranteed to be thread-safe. When used in multithreaded environment, it has to be manually synchronized.


This filter can throw an exception to report error. Read how to deal with errors in Error Handling.

"Unable to connect with chosen Web Camera." - error will occur when provided inCameraIndex is not valid device number.

"Unable to connect with media type of Web Camera. Required image format may not be supported. " - selected inFrameSize is not supported by selected device.

Complexity Level

This filter is available on Basic Complexity Level.