ZC2 Camera settings demo script


The following camera settings are specific to systems purchased after April 2021 (Z2 systems). Most users of these versions of the systems will never need to adjust the camera settings. The example script below details how to change the camera settings through the running of a Zanscript.

Top

Commands to change Z2 camera settings


There are 3 setting commands and 1 camera profile setting which will allow you to alter the camera settings.

SET(GAINVAL,#)
SET(EXPVAL,#)

SET(GAINVAL,#): The gain value can be set within the range of 0-480. This command is used when one needs to brightness the image of the system's camera. The camera gain is the amplification of the camera 'signal' which makes it brighter. Increasing the gain, increases brightness. However, it also increases background noise, which can lead to false tracking.

NOTE: In Zantiks MWP units, the typical camera gain is set to 0. In Zantiks AD or LT units, the typical camera gain is set to 100.


SET(EXPVAL,#): The exposure value is the camera's shutter speed and is set in μsec. Reducing shutter speed reduces the blurry aspect of the image.

NOTE: In Zantiks MWP units, the typical exposure time is 3000 (i.e., 3ms shutter speed). In Zantiks AD units, typical exposure time is 20000 (i.e., 20ms shutter speed) and in the Zantiks LT units it is set to 15000 (i.e., 15ms shutter speed).


SET(FRAME_RATE,#)

SET(FRAME_RATE,#): sets the camera's frame rate. The frame rate can be set between 1-120 frames per second (fps). Frame rates are stepped (i.e., 1 ,5, 15, 30, 60, 120). The standardised settings are currently 30 fps at standard resolution (i.e., 720x540). For the zoomed in view (640 x 480), frame rate can be set 1, 5, 15, 30, 60, 120, 240, 480 or 600 fps.

NOTE: Exposure time has priority over frame rate - so if a exposure time of 100 ms is set, then the frame rate will not be able to be higher than 10. When creating a full video (i.e., no frames removed / not a timelapse), we recommend 5 fps at high resolution. Also of note, high resolution can be good for imaging, but only very rarely leads to significantly better tracking.


CAMERAPROFILE(1)
CAMERAPROFILE(11)
CAMERAPROFILE(12)

CAMERAPROFILE(#): this setting controls the image resolution. The default resolution is set as Half - 720x540 or CAMERAPROFILE(12). This leads to a clear image for most sized animals. The partial mode, CAMERAPROFILE(1), is a 'zoomed in area' of the centre of the image. When running in this mode the system can run at very high frame rates (up to 600 fps). The full resolution mode, CAMERAPROFILE(11), runs at a resolution of 1440x1080.

CAMERAPROFILE(1): Partial - 640x480; zoomed in
CAMERAPROFILE(11): Full - 1440x1080
CAMERAPROFILE(12): Half - 720x540

NOTE: Scripts will abort if an asset file (zones or arenas) is loaded, but does not match the current system image resolution. Changing the camera resolution means the arena and zones assets need to be rebuilt to be in the correct resolution. In Z2 systems (those purchased after April 2021), it may not be possible to adjust the resolution to CAMERAPROFILE(1): 640x480.

Top

Example script


DEFINE WAIT_TIME 3
 
 
ACTION MAIN
 
    SET(FRAME_RATE,30)
 
    #CAMERAPROFILE(11)  
    CAMERAPROFILE(12)    
    #CAMERAPROFILE(1)    
 
    WAIT(WAIT_TIME)
    SET(EXPVAL,3000)  
 
    WAIT(WAIT_TIME)
    SET(GAINVAL,0)        
 
COMPLETE
Top

Script explanation


SET(FRAME_RATE,30) - The frame rate is set to 30 frames per second.

CAMERAPROFILE(12) - The default resolution of 720x540 is used and the other two CAMERAPROFILEs are hashed out/not set.

WAIT(WAIT_TIME) - The system waits the amount of time set in the DEFINE WAIT_TIME statement at the top of the script, i.e., 3 seconds.

SET(EXPVAL,3000) - After waiting the 3 seconds, the system changes the exposure time to 3000 and then waits another 3 seconds as defined for the WAIT(WAIT_TIME) command.

SET(GAINVAL,0) - The camera's gain to set to 0.

NOTE: The above values are the typical values for the Zantiks MWP (0 gain, 3000 exposure, 30fps and a default resolution).

Top

Script download

To download the Z2 camera settings demo script as a .zs file (file type Zantiks software reads), choose the Save File As option in the right-click dialogue box. Clicking on the script name hyperlink will open a read-only version of the script.

Script download: Z2_camera_settings.zs

Top

NOTE: We do not recommend using automatic gain or exposure. The lighting within the system is fixed and keeping a consistently lit image during tracking is important in avoiding false tracks. If the auto modes are turned on, the lighting can change based on the location of the animal in the arena.

However, it is possible to change the camera's setting to allow auto-gain and auto-exposure. To do this, the following two commands can be used to turn of auto mode.

SET(GAINMODE,1) 
SET(EXPMODE,1)

SET(GAINMODE,1): allows you to switch on the automatic gain setting.

SET(EXPMODE,1): allows you to switch on the automatic exposure time setting.