Back to Aurora Vision Library website

You are here: Start » Function Reference » Camera Support » Basler » Pylon_GrabImage

Pylon_GrabImage


Header: ThirdPartySdk.h
Namespace: avl
Module: ThirdParty

Captures an image stream from a camera using Pylon library.

Syntax

bool avl::Pylon_GrabImage
(
	Pylon_State& ioState,
	atl::Optional<const atl::String&> inDeviceID,
	int inOutputQueueSize,
	atl::Optional<avl::PylonImageFormat::Type> inPixelFormat,
	atl::Optional<float> inFrameRate,
	atl::Optional<const avl::Box&> inAoi,
	atl::Optional<float> inExposureTime,
	atl::Optional<float> inGain,
	atl::Optional<float> inBlackLevel,
	atl::Optional<bool> inTriggerEnabled,
	atl::Optional<avl::PylonTriggerSource::Type> inTriggerSource,
	atl::Optional<avl::PylonTriggerActivation::Type> inTriggerActivation,
	avl::Image& outImage,
	atl::int64& outFrameID,
	atl::int64& outTimestamp
)

Parameters

Name Type Range Default Description
Input will be modified ioState Pylon_State& Object used to maintain state of the function.
Input value inDeviceID Optional<const String&> NIL Serial number, model name, user defined name or full name of camera device to be opened
Input value inOutputQueueSize int 1 - 200 3 Capacity of output frames queue
Input value inPixelFormat Optional<PylonImageFormat::Type> NIL Image pixel format
Input value inFrameRate Optional<float> 0.1 - 400.0 NIL Requested camera frame rate in frames per second
Input value inAoi Optional<const Box&> NIL Required fragment of image to stream. To reset AOI set Box(0,0,0,0).
Input value inExposureTime Optional<float> 0.0 - NIL Camera frame exposition time
Input value inGain Optional<float> 0.0 - NIL Analog gain of source image in device raw unit
Input value inBlackLevel Optional<float> 0.0 - NIL Black level of source image
Input value inTriggerEnabled Optional<bool> NIL Configure trigger enable
Input value inTriggerSource Optional<PylonTriggerSource::Type> NIL Source of acquisition trigger
Input value inTriggerActivation Optional<PylonTriggerActivation::Type> NIL Circumstances defining when the trigger is activated
Output value outImage Image& Captured frame
Output value outFrameID int64& Captured frame ID
Output value outTimestamp int64& Captured frame timestamp

Remarks

Camera driver software

This filter is intended to cooperate with a camera using its vendor SDK. To be able to connect to a camera, it is required to install Pylon SDK software with camera dedicated drivers.

Pylon SDK can be downloaded from the following website: https://www2.baslerweb.com/en/downloads/software-downloads/#type=pylonsoftware;language=all;version=7.4.0 (registration may be required).

Recommended Pylon SDK version for Aurora Vision Studio usage is 7.4.0.

Other SDK versions from the same family (for example 7.4.1) can be compatible with Aurora Vision Studio but correct operation is not guaranteed.

Camera identification

When there is only one camera connected to a computer, field inDeviceID can be set to Auto. In this case, first available camera will be found and connected.

inDeviceID field can be used to pick one of multiple cameras connected to computer. DeviceID can be set to:

  • Serial number - should be specified on device casing, for example "12345678".
  • User defined name - user defined device name.
  • Friendly name - human readable name of the device.
  • Device full name - full name identifying the device.
  • Model name - model name of the device.
  • Ip Address - camera IP address. Only for GigEVision cameras.
Camera parameters

Setting inAoi parameter to 'Auto' will select maximum possible camera frame size.

All the other parameters exposed by camera filters are optional, setting them to 'Auto' leaves related parameter unchanged in camera (device default or user set configuration).

To change other, more advanced camera parameters, use configuration tool "Pylon Viewer" available with Pylon SDK or Pylon_SetXXXParameter filters. Refer to Pylon documentation to find information about parameters and how to create user parameters sets.

Output outFrameId
  • GigE Camera Devices - The sequence number starts with 1 and wraps at 65535. The value 0 has a special meaning and indicates that this feature is not supported by the camera.
  • USB Camera Devices - The sequence number starts with 0 and uses the full 64 Bit range.

A block ID of value -1 indicates that the Block ID is invalid and must not be used.

Output outTimeStamp

In case of GigE-Vision this describes when the image exposure was started. Cameras that do not support this feature return zero. If supported this may be used to determine which ROIs were acquired simultaneously.

Multithreaded environment

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

Errors

List of possible exceptions:

Error type Description
RuntimeError Not implemented

See Also

  • Pylon_GrabImage_WithTimeout – Captures an image stream from a camera using Pylon library; returns Nil if no frame comes in the specified time.