Page 1
Programming Guide ICAM-500 Series Industrial AI Camera...
Page 2
No part of this manual may be reproduced, copied, translated or transmitted in any form or by any means without the prior written permission of Advantech Co., Ltd. Information provided in this manual is intended to be accurate and reliable. How- ever, Advantech Co., Ltd.
Page 3
This product has passed the CE test for environmental specifications when shielded cables are used for external wiring. We recommend the use of shielded cables. This kind of cable is available from Advantech. Please contact your local supplier for ordering information.
Page 4
In accordance with IEC 704-1:1982 specifications, the sound pressure level at the operator's position does not exceed 70 dB (A). DISCLAIMER: These instructions are provided according to IEC 704-1 standards. Advantech disclaims all responsibility for the accuracy of any statements contained herein. ICAM-500 Programming Guide...
The Advantech CAMNavi SDK offers the tools which provide developer/ ISV to oper- ating ICAM-500 series Industrial AI camera and deploy the vision AI APP. based on NVIDIA Jetpack. The CAMNavi SDK uses Python language by default and is better adapted to image acquisition and AI algorithm integration.
ICAM-500 Web Service ICAM-500 could use Web browser (Chrome) to operate from its web service. The service use ICAM-500 restful API to control functions of ICAM-500 device. ICAM-500 Programming Guide...
ICAM-500 Web Service and CamNavi2 SDK Operation ICAM-500 web service uses CamNavi2 SDK to control ICAM-500 device. Only one instance could control ICAM-500 functions. If developer use SDK to writing python appli- cations, web service should turn off to release SDK control. This flow chart shows start/stop web.service decision path.
Page 22
CamNavi2 SDK provide API of iCam-500. Include sensor operation, lighting control, board control… Below digram is SDK compoments hierarchy: Module CamNavi2 Function Description get_device_by_name() Use device name to get camera instance. get_info() Get BSP information. get_fw_info() Get firmware information. advcam_config_pipeline() Camera property configuration.
Requirement 4.1.1 Basic Packages has contained in ICAM-500 BSP: python 3 python3-gst-1.0 python3-networkmanager 4.1.2 Option For ICAM-500 samples: sudo apt install python3-opencv module CamNavi2 4.2.1 class CamNavi2 class CamNavi2.CamNavi2(*args, **kwargs) CamNavi2 is a module for management ICAM device. enum_camera_list() Enumerate devices on iCam-500. Returns: dict A dict device name and device path mapping.
Page 25
advcam_register_new_image_handler(cam, new_image_cb) Register a new image event handler. Event handler sample: def new_sample_cb(sample): buf = smaple.get_buffer() Parameters: cam: ABSCamera Camera instance new_sample_cb New image event handler(callback). Returns: 0: Success. advcam_play(cam) Start image acquisition step. (Continuous mode or single shot) Parameters: cam: ABSCamera Camera instance Returns: bool...
Page 26
advcam_get_acq_mode(cam) Get acquisition mode property. Parameters: cam: ABSCamera Camera instance Returns: Acquisition mode: 0: Free run mode 1: Software trigger mode 2: Hardware trigger mode advcam_set_acq_mode(cam, acq_mode) Set acquisition mode property. Parameters: cam: ABSCamera Camera instance acq_mode : int Acquisition mode: 0: Free run mode ...
Page 27
advcam_get_lighting_pos(cam) Get LED lighting location mode. Parameters: cam: ABSCamera Camera instance. Returns: 8 LED trigger location modes. range = [0..7] See also: iCam500.iCam500.get_lighting_pos() advcam_set_lighting_pos(cam, pos) Set LED lighting location mode. Parameters: cam: ABSCamera Camera instance. pos: int Trigger 8 LED lighting location. init value = 3 range = [0..7] 0: off...
Page 28
advcam_get_lighting_gain(cam) Get LED lighting intensity. Parameters: cam: ABSCamera Camera instance. Returns: LED lighting gain intensity. See also: iCam500.iCam500.get_lighting_gain() advcam_set_lighting_gain(cam, gain) Get LED lighting gain. Parameters: cam: ABSCamera Camera instance. gain: int LED lighting gain value. init value = 9 range = [0..25] step = 1 Returns: 0: Success...
Page 29
advcam_set_lighting_strobe_enable(cam, strobe) Set LED lighting enable state. Parameters: cam: ABSCamera Camera instance. strobe: enable = 1 disable = 0 Returns: 0: Success See also: HYPERLINK \l "iCam500.iCam500.set_lighting_strobe_enable() advcam_get_img_brightness(cam) Get camera sensor brightness. Parameters: cam: ABSCamera Camera instance. Returns: Sensor brightness value. See also: iCam500.iCam500.get_img_brightness() advcam_set_img_brightness(cam, brt)
Page 30
advcam_set_img_gain(cam, gain) Set camera sensor gain value. Parameters: cam: ABSCamera Camera instance. gain Camera sensor gain value. init value = 0 range = [0..24] step = 1 Returns: 0: Success advcam_get_img_sharpness(cam) Get camera image sharpness value. Parameters: cam: ABSCamera Camera instance. Returns: Camera image sharpness value.
Page 31
advcam_get_output_resolution(cam) Get camera instance status. Parameters: cam: ABSCamera Camera instance. Returns: tuple(int, int) Get (width, height) tuple. advcam_set_output_resolution(cam, out_res) Set frame resolution. Parameters: cam: ABSCamera Camera instance. out_res: tuple(int, int) Tuple contains (width, height) Returns: tuple(int, int) Assigned value width, height Raises: ValueError width or height not in valid_resolution_list *** This API can be set at run-time, but need to re-open (ie.
module iCam500 4.3.1 class iCam500 class iCam500.iCam500(*args, **kwargs) iCam500 camera class Control items: camera sensor image streaming lens movement strobe digital valid_resolution_list ICAM-500 supported resolution. ICAM-500: {1408:1080, 1280:960, 640:480, 320:240} type:dict image Camera sensor properties control. type: CImage focus Lens focusing motor control.
Page 33
snap_image(timeout=60 s) Snap an image. Parameters: timeout: int Wait image time. Returns: Image data in JPEG format. software_trigger() Invoke software trigger command. property hw_trigger_delay Hardware trigger delay time setting. Sku: color Getter: Read hardware trigger delay time value. Setter: Set hardware trigger delay time value. Value: init value: 0 ...
Page 34
get_pipeline_params(**params) Get properties value in defined pipeline. # Get width and height of image params = {'width': 0, 'height': 0} params = camera.get_pipeline_params(params) for key in params: print("key %s, value %d" % (key, params[key])) Parameters: params: dict{str, str} Dict of pipeline paramters. Returns: dict{str, str} config_pipeline(**params)
Page 35
close(quiet=0) Close ICAM-500 device. Parameters: quiet: int 0: default 1: Force turn off lighting. Returns: 0: Success. 1: Error in exception. register_new_sample(new_sample_cb) Register a new image event handler. Event handler sample: def new_sample_cb(sample): buf = smaple.get_buffer() Parameters: new_sample_cb New image event handler(callback).
Page 36
get_lighting_pos() Get LED lighting location mode. Returns: 8 LED trigger location modes. range = [0..7] See also: lighting.Lighting.selector Control by lighting instance. set_lighting_pos(pos) Set LED lighting location mode. Parameters: pos: int Trigger 8 LED lighting location. init value = 3 range = [0..7] 0: off Returns:...
Page 37
get_lighting_strobe_enable() Get LED lighting enable state. Returns: LED lighting enable state. init value = 1 range [0..1] See also: lighting.Lighting.strobe_enable Control by lighting instance. set_lighting_strobe_enable(strobe) Set LED lighting enable state. Parameters: strobe enable = 1 disable = 0 Returns: 0: Success See also:...
Page 38
get_img_gain() Get camera sensor gain value. Returns: Camera sensor gain value. See also: image.CImage.gain Control by image instance. set_img_gain(gain) Set camera sensor gain value. Parameters: gain Camera sensor gain value. init value = 0 range = [0..24] step = 1 Returns: 0: Success See also:...
Page 39
get_img_exposure_time() Get camera sensor exposure time value. Returns: Camera sensor exposure time. Convert equation: value * 100 (micro sec.) See also: image.CImage.exposure_time Control by image instance. set_img_exposure_time(exp_time) Set camera sensor exposure time value. Parameters: exp_time Camera sensor exposure value. init value = 50 range = [1..1000] step = 1 Convert equation: exp_time * 100 (micro sec.) Returns:...
Page 40
set_img_auto_exposure(enable) Enable camera auto exposure function. Parameters: enable 1: Enabled 0: Disabled Returns: bool Camera auto exposure function status. 1: Enabled 0: Disabled See also: image.CImage.auto_exposure Control by image instance. get_img_auto_exposure_range() Get auto exposure range. Returns: tuple(int, int) Auto exposure range.
Page 41
get_img_auto_gain() Get camera auto gain function status. Returns: Camera auto gain function status. 1: Enabled 0: Disabled See also: image.CImage.auto_gain Control by image instance. set_img_auto_gain(enable) Enable camera auto gain function. Parameters: enable 1: Enabled 0: Disabled Returns: bool Camera auto gain function status.
Page 42
See also: image.CImage.auto_gain_range Control by image instance. get_img_digital_gain() Get camera digital gain value. Returns: Camera digital gain value. See also: image.CImage.digital_gain Control by image instance. set_img_digital_gain(new_dgain) Set camera digital gain value. Parameters: new_dgain New camera digital gain. Returns: New digital gain value. See also: image.CImage.digital_gain Control by image instance.
Page 43
get_focus_direction() Get lens focusing motor movement direction. Returns: 1: Forward 0: Backward See also: focus.Focus.direction Control by focus instance. set_focus_direction(new_direction) Set lens focusing motor movement direction. And invoke set_focus_distance(step) to move lens. Parameters: new_direction Change motor direction. 1: Forward ...
Page 44
get_status() Get camera status. Camera connection and acquisition status. Returns: CameraMode Reference iCam500.CameraMode get_output_ress() Get current frame resolution. Returns: tuple(int, int) Get width and height tuple. set_output_res(out_res) Set frame resoultion. Parameters: out_res : tuple(int, int) Tuple contains (width, height) Returns: tuple(int, int) Assigned value width, height Returns:...
get_timestamp_switch() Get timestamp on output image state. Returns: 0: Disable 1: Enabled pos_zero() Set lens focusing motor to home. See also: focus.Focus.pos_zero() Control by focus instance. focus_abs_position() Get lens focusing motor abs position. Returns: Motor position. See also: focus.Focus.position() Control by focus instance. 4.3.2 enum CameraMode class iCam500.CameraMode(value)
module image 4.4.1 class CImage class image.CImage(camera) Camera image properties controls. property brightness Image brightness setting. Getter: Read sensor brightness setting. Setter: Set sensor brightness setting. Value: init value: 100 range: [0..255] Type: Raises: ValueError Input value out of range. property gain Image gain setting.
Page 47
property saturation Color image saturation value. Enable property color_trans_op. Sku: color Getter: Read saturation value. Setter: Set saturation value. Value: init value: 0 range: [0..255] Type: Raises: ValueError Input value out of range. property sharpness Image sharpness setting. Support ‘GRAY8’ and ‘YUY2’ pixel format. Getter: Read sensor sharpness setting.
Page 48
property awb_op Color image enable auto white balance setting. Sku: color Getter: Read enable auto white balance setting. Setter: Enable auto white balance setting. Value: init value: 1 range: [0,1] 0: Off, manual mode 1: Auto mode ...
Page 49
property awb_green Set color image AWB green channel value. Sku: color Setter: Set AWB green channel value in image.awb_op manual mode. Value: init value: 1024 range: [1..16376] Type: Raises: ValueError Input value out of range. property awb_blue Set color image AWB blue channel value. Sku: color Setter:...
Page 50
Raises: ValueError Input value out of range. property color_trans_01 Color image color transform 01 value. CCM (color correction matrix) [C00, C01, C02] [C10, C11, C12] [C20, C21, C22] Sku: color Getter: Read color transform 01 value. Setter: Set color transform 01 value. Value: init value: 1024 ...
Page 51
property color_trans_11 Color image color transform 11 value. CCM (color correction matrix) [C00, C01, C02] [C10, C11, C12] [C20, C21, C22] Sku: color Getter: Read color transform 11 value. Setter: Set color transform 11 value. Value: init value: 1024 range: [-4096..4096] ...
Page 52
property color_trans_21 Color image color transform 21 value. CCM (color correction matrix) [C00, C01, C02] [C10, C11, C12] [C20, C21, C22] Sku: color Getter: Read color transform 21 value. Setter: Set color transform 21 value. Value: init value: 1024 range: [-4096..4096] ...
Page 53
property height Image height setting. Getter: Read image height setting. Setter: Set image height setting. Value: init value: 480 range: [240, 480, 960, 1080] Type: Raises: ValueError Input value out of range. property exposure_time Camera sensor exposure time setting. Getter: Read sensor exposure time setting.
Page 54
property auto_exposure_range Camera sensor auto exposure time range setting. Getter: Read sensor exposure time range setting. Setter: Set sensor exposure time range. Value: tuple(min, max) range: [1..10000] Type: tuple(int, int) Raises: ValueError Input value out of range. Minimum greater than maximum value.
Page 55
property digital_gain Camera sensor digital gain setting. Getter: Read sensor digital gain setting. Setter: Set sensor digital gain. Value: init value: 0 range: [-512..511] Type: Raises: ValueError Input value out of range. property pixel_format Camera sensor pixel format. Getter: Read sensor pixel format setting.
module focus 4.5.1 class Focus class focus.Focus(camera) Camera image properties controls. property distance Lens focusing motor distance control. Example: camera.focus.pos_zero() # Set motor to position 0 camera.focus.direction = 1 # Motor foreward camera.focus.distance = 30 # Foreward 30 camera.focus.distance = 30 # Foreward 30 camera.focus.position() # Get position value is 60 Getter: Read motor movement step.
pos_zero() Set lens focusing motor to position 0. module lighting 4.6.1 class Lighting class lighting.Lighting(camera) property selector LED lighting location mode control. 8 LED trigger location modes. Getter: Read LED lighting flash location. Setter: Set LED lighting flash location. Value: init value = 3 ...
module board 4.7.1 class Board class board.Board(camera) ICAM-500 board I/O control module Digital I/O control instance. type: DigitalIO module digitalio 4.8.1 digital I/O code slice # Get camera instance. camera = cn2.get_device_by_name('iCam500') # Open camera device cn2.advcam_open(camera) # Setting do0 parameters camera.dio.do0.op_mode = 0 # DO op mode: user output camera.dio.do0.user_output = 0 # DO low, DI high camera.dio.do0.reverse = 0...
4.8.2 class DigitalIO class digitalio.DigitalIO(board) digital input 0. type: DigitalInput digital input 1. type: DigitalInput digital output 0 type: DigitalOutput digital output 1 type: DigitalOutput 4.8.2.1 class DigitalInput class lighting.Lighting(board, dev_name) property level Digital input level state. Getter: Read input level state. Value: 1: high ...
Page 60
Value: 0: None 1: rising edge 2: falling edge 3: both Type: Raises: ValueError Input value out of range. property debounce_time DI trigger signal debounce time. Getter: Get debounce time value Setter: Set debounce time Value: range: [0..65535] ...
Page 61
4.8.2.2 class DigitalOutput class digitalio.DigitalOutput(board, dev_name) property user_output User set output level. This property works on op_mode is 0 Getter: Read output signal level. Setter: Set output signal level. Value: 0: low level 1: high level Raises: ValueError Input value out of range.
4.10 Exception iCam500 properties value out of range would raise ValueError exceptions. try: camera.lighting.seletor = 8 except ValueError: print("lighting selector out of range") ICAM-500 Programming Guide...