GetCameraImage Method

GetCameraImage returns an image, current viewpoint (if available), and collection time for a given camera.

Syntax

GetCameraImage8(int intCameraID, int intDesiredWidth, int intDesiredHeight, int intDesiredDepth, int intOptions, string strPassword)

Parameters

Name Type Description
intCameraID int Unique camera identifier, as returned by other API methods such as GetCamerasInBox.
intDesiredWidth int The desired width of the returned image. The image will be subsampled (or supersampled) to match the desired width/height in pixels. The aspect ratio of the original image data is always preserved. When necessary, the returned image will be padded with black pixels. The width must be between 32 and 4096 pixels, inclusive.
intDesiredHeight int The desired height of the returned image. The recommended ratio of desired width to desired height is 3 to 2 (e.g., 300x200). The height must be between 32 and 4096 pixels, inclusive.

Note: Applications should not modify the aspect ratio of the original data (e.g., by requesting a 300x200 image and displaying it in a 300x240 viewport).
intDesiredDepth int The desired bit depth of the returned image. Currently only depth 8 is supported.
intOptions int A set of bitwise flags OR’ed together:

If intOptions is OR’ed with the value 1, the camera's entire field of view will be returned, otherwise only the most relevant parts of the camera's field of view will be returned. Examples:

Example image Width 240, Height 195,
Options 1
Example image
Width 195, Height 195,
Options 1

Example image Width 240, Height 195,
Options 0
Example image
Width 195, Height 195,
Options 0

If intOptions is OR’ed with the value 2, the image dynamic range will be enhanced for better viewability. Examples:

Example image Options 0
Example image
Options 2

If intOptions is OR’ed with the value 4, dynamic image checks are not performed and any available image will be returned. By default, dynamic checks are made on the camera image for out-of-service or poor quality images. Errors will be returned in place of images that fail the checks. Examples of images that would fail dynamic checks:

Example image Video Loss
Example image
Video Loss

Example image Poor Quality
Example image
Video Loss

Example image Limited Hours
Example image
Operator Intervention

Example image Video Loss
Example image
Test Signal

Example image Noise
Example image
Operator Intervention

Example image Transmission Error
Example image
Video Loss
strPassword string Unique id/password supplied to you previously.

Return Value

Type: MIME text/xml (asmx) or MIME/jpeg (ashx)

Fields for the returned image will include:

Name Type Description
Image string
/ jpeg
A Base64 encoded jpeg image (asmx) or a jpeg image (ashx) for the given camera.
View string The current direction in which the camera is facing, if known.
Collected string The date and time at which the image was collected from the feed, in Coordinated Universal Time (UTC).

The “Collected” time is typically not the exact time at which the camera captured the image. For example, a camera with a 5 minute refresh rate may report a “Collected” time up to 5 minutes later than the capture time, depending on how soon after the capture time the feed was accessed. Accordingly, the “Collected” time may disagree with any capture time imprinted into the image by the originating authority, which may be visible if displaying the entire camera field. If displaying the “Collected” time to the end-user as a capture time, the approximate nature of the time should be indicated, e.g., “Image captured approx. 9:13am”.

Note: Subsequent calls will return the same “Collected” time for the duration of the refresh rate.
Speed int Speed of the vehicle, in kph, if the camera is a hotspot camera.
Visibility string Visibility conditions for this camera, if available. Possible values are “Low” and “Clear”, where “Low” indicates visibility less than 300m.
VisibilityConfidence int Confidence of the visibility conditions for this camera, if available. Confidence is expressed as a value between 0 and 100, where 100 indicates the highest possible confidence.

Example 1

Request
http://www.vizzion.com/TrafficCamsService/TrafficCams.asmx/GetCameraImage8?intCameraID=146550&intDesiredWidth=160&intDesiredHeight=120&intDesiredDepth=8&intOptions=0&strPassword=<password>
Response
...
<Image>/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDB...</Image>
<View>North</View>
<Collected>2019-10-31T11:22:02.0000000Z</Collected>
<Speed>50</Speed>
...

Example 2

Request
http://www.vizzion.com/TrafficCamsService/TrafficCams.ashx?strRequest=GetCameraImage8&intCameraID=1&intDesiredWidth=160&intDesiredHeight=120&intDesiredDepth=8&intOptions=0&strPassword=<password>
Response
Example of returned image
HTTP Header
View: North
Collected: 2018-10-26T11:22:02.0000000Z
Visibility: Clear
VisibilityConfidence: 77

Vizzion Confidential and Proprietary