Back to Adaptive Vision Library website

You are here: Start » Function Reference » Flir Spinnaker » Spinnaker_GrabImage_WithTimeout

Spinnaker_GrabImage_WithTimeout


Header:ThirdPartySdk.h
Namespace:avl

Captures images from a Flir camera using Spinnaker interface; returns Nil if no frame comes in the specified time.

Syntax

bool avl::Spinnaker_GrabImage_WithTimeout
(
	Spinnaker_State& ioState,
	const atl::Optional<atl::String>& inDeviceSerialNumber,
	int inTimeout,
	atl::Optional<int> inBufferCount,
	atl::Optional<avl::SpinnakerPixelFormat::Type> inPixelFormat,
	avl::SpinnakerBayerConverter::Type inBayerConverter,
	atl::Optional<avl::SpinnakerAutoSettings::Type> inExposureAuto,
	atl::Optional<double> inExposureTime,
	atl::Optional<bool> inFrameRateEnable,
	atl::Optional<double> inFrameRate,
	atl::Optional<avl::SpinnakerAutoSettings::Type> inGainAuto,
	atl::Optional<double> inGain,
	atl::Conditional<avl::Image>& outImage,
	atl::Conditional<atl::int64>& outFrameID,
	atl::Conditional<atl::int64>& outTimestamp
)

Parameters

Name Type Range Default Description
ioState Spinnaker_State& Object used to maintain state of the function.
inDeviceSerialNumber const Optional<String>& NIL Source device serial number
inTimeout int 10 - 100 Maximum time to wait for frame in milliseconds
inBufferCount Optional<int> 1 - 10 Number of image buffers
inPixelFormat Optional<SpinnakerPixelFormat::Type> NIL Image pixel format
inBayerConverter SpinnakerBayerConverter::Type Image bayer converter. Used only with Bayer pixel format
inExposureAuto Optional<SpinnakerAutoSettings::Type> NIL Sets the automatic exposure mode
inExposureTime Optional<double> 6 - NIL Exposure time in microseconds
inFrameRateEnable Optional<bool> NIL If enabled, inFrameRate can be used to manually control the frame rate
inFrameRate Optional<double> 1 - NIL Frame rate in Hertz
inGainAuto Optional<SpinnakerAutoSettings::Type> NIL Sets the automatic gain mode
inGain Optional<double> 0 - NIL Controls the amplification of the video signal in dB
outImage Conditional<Image>& Captured frame
outFrameID Conditional<int64>& Captured frame ID
outTimestamp Conditional<int64>& Captured frame timestamp

Description

This filter is intended for establishing connection with general camera device using Spinnaker SDK, for streaming images out of it in continuous mode.

This filter will wait for next valid frame not more that selected timeout value (on inTimeout port) in milliseconds. After timeout occurs a Nil value is returned on outImage port instead of image.

Similarly to outImage, outputs outFrameID and outTimestamp will return Nil on timeout condition.

Remarks

Camera driver software

This filter is intended to cooperate with camera using its vendor Spinnaker SDK. To be able to connect to camera it is required to install Spinnaker SDK software with camera dedicated drivers. Currently Adaptive Vision Studio uses Spinnaker version v1.20.0.15.

Spinnaker SDK can be downloaded from the following website: https://www.flir.com/support/browse/camera-cores--components/machine-vision-cameras/sdks (registration may be required).

During installation you should select "Application Development". Visual Studio Version should be also changed to "Visual Studio 2015".

Camera identification

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

inDeviceSerialNumber can be used to pick one of multiple cameras connected to computer. Set this field to device serial number (for example "1234567", should be available on device casing as "s/n: 1234567").

Camera parameters

Most of parameters exposed by camera filters are optional, setting them to 'Auto' leaves related parameters for default configuration by camera driver.

To change other and more advanced camera parameters use configuration tool "SpinView" available with Spinnaker SDK. Refer to SDK documentation to find information about parameters and how to save parameters into memory channels.

It is also possible to adjust more advanced parameters using Spinnaker_SetParameter filters. The parameters name should be obtained from SpinView application or from Spinnaker SDK.

Multithreaded environment

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

See Also