Operator Reference

create_image_sourceT_create_image_sourceCreateImageSourceCreateImageSourcecreate_image_source (Operator)

create_image_sourceT_create_image_sourceCreateImageSourceCreateImageSourcecreate_image_source — Create an image source handle.

Signature

Herror T_create_image_source(const Htuple PluginName, const Htuple DeviceID, const Htuple GenParamName, const Htuple GenParamValue, Htuple* ImageSourceHandle)

void CreateImageSource(const HTuple& PluginName, const HTuple& DeviceID, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* ImageSourceHandle)

void HImageSource::HImageSource(const HString& PluginName, const HString& DeviceID, const HTuple& GenParamName, const HTuple& GenParamValue)

void HImageSource::HImageSource(const char* PluginName, const char* DeviceID, const HTuple& GenParamName, const HTuple& GenParamValue)

void HImageSource::HImageSource(const wchar_t* PluginName, const wchar_t* DeviceID, const HTuple& GenParamName, const HTuple& GenParamValue)   ( Windows only)

void HImageSource::CreateImageSource(const HString& PluginName, const HString& DeviceID, const HTuple& GenParamName, const HTuple& GenParamValue)

void HImageSource::CreateImageSource(const char* PluginName, const char* DeviceID, const HTuple& GenParamName, const HTuple& GenParamValue)

void HImageSource::CreateImageSource(const wchar_t* PluginName, const wchar_t* DeviceID, const HTuple& GenParamName, const HTuple& GenParamValue)   ( Windows only)

def create_image_source(plugin_name: str, device_id: str, gen_param_name: Sequence[str], gen_param_value: Sequence[Union[int, float, str]]) -> HHandle

Description

create_image_sourcecreate_image_sourceCreateImageSourceCreateImageSourcecreate_image_source creates an image source handle and returns it in ImageSourceHandleImageSourceHandleImageSourceHandleimageSourceHandleimage_source_handle. The created handle is in an unconnected state. The parameters PluginNamePluginNamePluginNamepluginNameplugin_name and DeviceIDDeviceIDDeviceIDdeviceIDdevice_id can be used to specify the plugin and device module of the image source handle. Alternatively, the generic parameters GenParamNameGenParamNameGenParamNamegenParamNamegen_param_name and GenParamValueGenParamValueGenParamValuegenParamValuegen_param_value can be used to specify modules using identifiers other than plugin name and device ID. For further information about the image source concept see Image Source.

The following options exist for PluginNamePluginNamePluginNamepluginNameplugin_name.

<plugin name>

Specify an image source plugin by setting the plugin name in PluginNamePluginNamePluginNamepluginNameplugin_name. You can use query_image_sourcesquery_image_sourcesQueryImageSourcesQueryImageSourcesquery_image_sources to retrieve the 'plugin_name'"plugin_name""plugin_name""plugin_name""plugin_name" of all available plugins.

'none'"none""none""none""none"

No plugin will be specified in ImageSourceHandleImageSourceHandleImageSourceHandleimageSourceHandleimage_source_handle.

'ignore'"ignore""ignore""ignore""ignore"

Set PluginNamePluginNamePluginNamepluginNameplugin_name to 'ignore'"ignore""ignore""ignore""ignore", when specifying the plugin using generic parameters (see below).

The following options exist for DeviceIDDeviceIDDeviceIDdeviceIDdevice_id.

<device ID>

Specify a device by setting its device ID in DeviceIDDeviceIDDeviceIDdeviceIDdevice_id. You can use query_image_sourcesquery_image_sourcesQueryImageSourcesQueryImageSourcesquery_image_sources to retrieve the 'device_id'"device_id""device_id""device_id""device_id" of all available devices.

'none'"none""none""none""none"

No device will be specified in ImageSourceHandleImageSourceHandleImageSourceHandleimageSourceHandleimage_source_handle.

'ignore'"ignore""ignore""ignore""ignore"

Set DeviceIDDeviceIDDeviceIDdeviceIDdevice_id to 'ignore'"ignore""ignore""ignore""ignore", when specifying the device using generic parameters (see below).

You can also specify modules of the ImageSourceHandleImageSourceHandleImageSourceHandleimageSourceHandleimage_source_handle by providing one of the following options for GenParamNameGenParamNameGenParamNamegenParamNamegen_param_name:

'plugin_path'"plugin_path""plugin_path""plugin_path""plugin_path":

Create a handle specifying a plugin by providing the path to the .cti plugin file as the corresponding GenParamValueGenParamValueGenParamValuegenParamValuegen_param_value.

PluginNamePluginNamePluginNamepluginNameplugin_name needs to be set to 'ignore'"ignore""ignore""ignore""ignore". DeviceIDDeviceIDDeviceIDdeviceIDdevice_id needs to be set to 'none'"none""none""none""none" or a device ID.

'interface_id'"interface_id""interface_id""interface_id""interface_id":

Create a handle specifying an interface by providing the interface ID as the corresponding GenParamValueGenParamValueGenParamValuegenParamValuegen_param_value.

PluginNamePluginNamePluginNamepluginNameplugin_name needs to be set to 'none'"none""none""none""none" or a plugin name. DeviceIDDeviceIDDeviceIDdeviceIDdevice_id needs to be set to 'none'"none""none""none""none" or a device ID.

'device_user_name'"device_user_name""device_user_name""device_user_name""device_user_name":

Create a handle specifying a device by providing the device user name as the corresponding GenParamValueGenParamValueGenParamValuegenParamValuegen_param_value.

PluginNamePluginNamePluginNamepluginNameplugin_name needs to be set to a plugin name. DeviceIDDeviceIDDeviceIDdeviceIDdevice_id needs to be set to 'ignore'"ignore""ignore""ignore""ignore".

'device_serial_number'"device_serial_number""device_serial_number""device_serial_number""device_serial_number":

Create a handle specifying a device by providing the device serial number as the corresponding GenParamValueGenParamValueGenParamValuegenParamValuegen_param_value.

PluginNamePluginNamePluginNamepluginNameplugin_name needs to be set to a plugin name. DeviceIDDeviceIDDeviceIDdeviceIDdevice_id needs to be set to 'ignore'"ignore""ignore""ignore""ignore".

'stream_id'"stream_id""stream_id""stream_id""stream_id":

Create a handle specifying a stream by providing the stream ID as the corresponding GenParamValueGenParamValueGenParamValuegenParamValuegen_param_value.

PluginNamePluginNamePluginNamepluginNameplugin_name needs to be set to a plugin name. DeviceIDDeviceIDDeviceIDdeviceIDdevice_id needs to be set to a device ID.

You can use query_image_sourcesquery_image_sourcesQueryImageSourcesQueryImageSourcesquery_image_sources to retrieve the values for all available image sources.

An empty image source handle can be created by setting both PluginNamePluginNamePluginNamepluginNameplugin_name and DeviceIDDeviceIDDeviceIDdeviceIDdevice_id to 'none'"none""none""none""none" and not specifying any generic parameters. The empty image source handle can be extended using set_image_source_paramset_image_source_paramSetImageSourceParamSetImageSourceParamset_image_source_param.

Execution Information

  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).
  • Multithreading scope: global (may be called from any thread).
  • Processed without parallelization.

This operator returns a handle. Note that the state of an instance of this handle type may be changed by specific operators even though the handle is used as an input parameter by those operators.

Parameters

PluginNamePluginNamePluginNamepluginNameplugin_name (input_control)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Name of an image source plugin.

Default: 'none' "none" "none" "none" "none"

Suggested values: 'none'"none""none""none""none", 'ignore'"ignore""ignore""ignore""ignore", 'mvtec_gigevision'"mvtec_gigevision""mvtec_gigevision""mvtec_gigevision""mvtec_gigevision", 'mvtec_usb3vision'"mvtec_usb3vision""mvtec_usb3vision""mvtec_usb3vision""mvtec_usb3vision", 'mvtec_realsense'"mvtec_realsense""mvtec_realsense""mvtec_realsense""mvtec_realsense", 'mvtec_gstreamer'"mvtec_gstreamer""mvtec_gstreamer""mvtec_gstreamer""mvtec_gstreamer", 'mvtec_mediafoundation'"mvtec_mediafoundation""mvtec_mediafoundation""mvtec_mediafoundation""mvtec_mediafoundation", '<plugin_name>'"<plugin_name>""<plugin_name>""<plugin_name>""<plugin_name>"

DeviceIDDeviceIDDeviceIDdeviceIDdevice_id (input_control)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

ID of the image source device.

Default: 'none' "none" "none" "none" "none"

Suggested values: 'none'"none""none""none""none", 'ignore'"ignore""ignore""ignore""ignore"

GenParamNameGenParamNameGenParamNamegenParamNamegen_param_name (input_control)  attribute.name-array HTupleSequence[str]HTupleHtuple (string) (string) (HString) (char*)

Generic parameter name.

Default: []

Suggested values: 'plugin_path'"plugin_path""plugin_path""plugin_path""plugin_path", 'interface_id'"interface_id""interface_id""interface_id""interface_id", 'device_user_name'"device_user_name""device_user_name""device_user_name""device_user_name", 'device_serial_number'"device_serial_number""device_serial_number""device_serial_number""device_serial_number", 'stream_id'"stream_id""stream_id""stream_id""stream_id"

GenParamValueGenParamValueGenParamValuegenParamValuegen_param_value (input_control)  attribute.value-array HTupleSequence[Union[int, float, str]]HTupleHtuple (integer / real / string) (int / long / double / string) (Hlong / double / HString) (Hlong / double / char*)

Generic parameter value.

Default: []

ImageSourceHandleImageSourceHandleImageSourceHandleimageSourceHandleimage_source_handle (output_control)  image_source HImageSource, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Created image source handle storing module identifiers.

Example (HDevelop)

* Specify the plugin for GigE Vision devices via its name.
create_image_source ('mvtec_gigevision', 'none', [], [], ImageSourceHandle)
* Specify a plugin by providing its path.
create_image_source ('ignore', 'none', 'plugin_path', 'path/to/plugin.cti', ImageSourceHandle)
*
* Specify a GigE Vision device by providing its unique ID.
create_image_source ('mvtec_gigevision', '00305324c805_Basler_acA244020gc', [], [], ImageSourceHandle)
* Specify a GigE Vision camera by providing its user name.
create_image_source ('mvtec_gigevision', 'ignore', 'device_user_name', 'MyDevice', ImageSourceHandle)

Result

If the parameter values are correct, create_image_sourcecreate_image_sourceCreateImageSourceCreateImageSourcecreate_image_source returns the value 2 ( H_MSG_TRUE) . Otherwise an exception is raised.

Possible Successors

connect_image_sourceconnect_image_sourceConnectImageSourceConnectImageSourceconnect_image_source, get_image_source_paramget_image_source_paramGetImageSourceParamGetImageSourceParamget_image_source_param, set_image_source_paramset_image_source_paramSetImageSourceParamSetImageSourceParamset_image_source_param

Alternatives

query_image_sourcesquery_image_sourcesQueryImageSourcesQueryImageSourcesquery_image_sources

See also

query_image_sourcesquery_image_sourcesQueryImageSourcesQueryImageSourcesquery_image_sources

Module

Foundation