Start » Filter Reference » Camera Support » WebCamera » WebCamera_GrabImage

WebCamera_GrabImage


Module: ThirdParty

Captures a frame from a camera using Direct Show interface.

Applications

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

Description

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.

Examples

Description of usage of this filter can be found in examples and tutorial: Dynamic Template Matching, Starting Notepad with Execute filter, Turning computer off using Execute.

Remarks

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

.

Parallel execution

This filter cannot be placed in multiple Workers.

Errors

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.