Back to Adaptive Vision Library website

You are here: Start » Function Reference » Hikvision » Hikvision_GrabImage_WithTimeout

Hikvision_GrabImage_WithTimeout


Header:ThirdPartySdk.h
Namespace:avl

Captures an image from a Hikvision device.

Syntax

bool avl::Hikvision_GrabImage_WithTimeout
(
	Hikvision_State& ioState,
	atl::Optional<const atl::String&> inDeviceID,
	int inTimeout,
	int inInputQueueSize,
	avl::HikvisionPixelFormat::Type inPixelFormat,
	atl::Optional<const avl::Box&> inRoi,
	atl::Optional<float> inFrameRate,
	bool inFrameRateAuto,
	atl::Optional<float> inExposureTime,
	bool inExposureTimeAuto,
	atl::Optional<float> inGain,
	bool inGainAuto,
	atl::Conditional<avl::Image>& outImage,
	atl::Conditional<int>& outFrameID
)

Parameters

Name Type Range Default Description
ioState Hikvision_State& Object used to maintain state of the function.
inDeviceID Optional<const String&> NIL Camera serial number, name or IP address, Auto = first camera
inTimeout int Maximum time to wait for frame in milliseconds
inInputQueueSize int 1 - 8 Sets size of image queue (on acquisition start)
inPixelFormat HikvisionPixelFormat::Type Image pixel format (set on acquisition start)
inRoi Optional<const Box&> NIL Region of interest (set on acquisition start)
inFrameRate Optional<float> 0.0 - NIL Sets the frame rate limit
inFrameRateAuto bool True True if frame rate is not limited
inExposureTime Optional<float> 0.0 - 10000.0f Sets the target exposure time in microseconds
inExposureTimeAuto bool True if using automatic exposure time
inGain Optional<float> 0.0 - 0.0f Sets gain in dB
inGainAuto bool True if using automatic gain
outImage Conditional<Image>& Captured image
outFrameID Conditional<int>& Captured frame ID

Remarks

Camera driver software

This filter is intended to cooperate with camera using its vendor Hikvision SDK. To be able to connect to camera it is required to install Hikvision Machine Vision Software with camera dedicated drivers. Currently Adaptive Vision Studio uses Hikvision SDK version 3.2.0 (DLL version 3.2.0.3).

Hikvision SDK can be downloaded from the following website: http://en.hikrobotics.com/service/soft.htm?type=1

Setting bandwidth for GigEVision cameras

Bandwidth of Hikvision GigEVision cameras needs to be configured before use, otherwise packet loss and image artifacts may occur.

Open MVS software from Hikvision and connect to the camera. Open Settings / Options menu and go to Network tab. Bandwidth Control slider will be shown. To preserve new value of bandwidth after disconnecting power from the camera, you will need to save it using User Set Control parameters in Features tab.

Multithreaded environment

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

See Also