Skip to content

create_image_sourceCreateImageSourceCreateImageSourcecreate_image_sourceT_create_image_source🔗

Short description🔗

create_image_sourceCreateImageSourceCreateImageSourcecreate_image_sourceT_create_image_source — Create an image source handle.

Signature🔗

create_image_source( string PluginName, string DeviceID, attribute.name GenParamName, attribute.value GenParamValue, out image_source ImageSourceHandle )void CreateImageSource( const HTuple& PluginName, const HTuple& DeviceID, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* ImageSourceHandle )static void HOperatorSet.CreateImageSource( HTuple pluginName, HTuple deviceID, HTuple genParamName, HTuple genParamValue, out HTuple imageSourceHandle )def create_image_source( plugin_name: str, device_id: str, gen_param_name: Sequence[str], gen_param_value: Sequence[Union[int, float, str]] ) -> HHandle

Herror T_create_image_source( 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)

public HImageSource( string pluginName, string deviceID, HTuple genParamName, HTuple genParamValue )

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)

void HImageSource.CreateImageSource( string pluginName, string deviceID, HTuple genParamName, HTuple genParamValue )

Description🔗

create_image_sourceCreateImageSource creates an image source handle and returns it in ImageSourceHandleimageSourceHandleimage_source_handle. The created handle is in an unconnected state. The parameters PluginNamepluginNameplugin_name and DeviceIDdeviceIDdevice_id can be used to specify the plugin and device module of the image source handle. Alternatively, the generic parameters GenParamNamegenParamNamegen_param_name and GenParamValuegenParamValuegen_param_value can be used to specify modules using identifiers other than plugin name and device ID.

The image source handle can also be created with its modules already specified by reading an image source configuration file. Other parameters in the image source handle will also be set to the values configured in this file. The image source configuration files can also store the values of the persistable parameters of the image source modules (device, plugin, …), which will be applied during the call to connect_image_sourceConnectImageSource. To write such configuration files (for later use) refer to control_image_sourceControlImageSource.

For further information about the image source concept see Image Source. See the MVTec Interfaces Reference Documentation for the documentation of individual MVTec image source plugins.

The following options exist for PluginNamepluginNameplugin_name.

The following options exist for DeviceIDdeviceIDdevice_id.

You can also specify modules of the ImageSourceHandleimageSourceHandleimage_source_handle by providing one of the following options for GenParamNamegenParamNamegen_param_name:

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

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

Execution information🔗

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🔗

PluginNamepluginNameplugin_name (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)

Name of an image source plugin.

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

DeviceIDdeviceIDdevice_id (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)

ID of the image source device.

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

GenParamNamegenParamNamegen_param_name (input_control) attribute.name-array → (string)HTuple (HString)HTuple (string)Sequence[str]Htuple (char*)

Generic parameter name.

Default: [][]
Suggested values: 'plugin_path', 'interface_id', 'device_user_name', 'device_serial_number', 'stream_id', 'read_config_file'"plugin_path", "interface_id", "device_user_name", "device_serial_number", "stream_id", "read_config_file"

GenParamValuegenParamValuegen_param_value (input_control) attribute.value-array → (integer / real / string)HTuple (Hlong / double / HString)HTuple (int / long / double / string)Sequence[Union[int, float, str]]Htuple (Hlong / double / char*)

Generic parameter value.

Default: [][]

ImageSourceHandleimageSourceHandleimage_source_handle (output_control) image_source → (handle)HTuple (HHandle)HImageSource, HTuple (IntPtr)HHandleHtuple (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_sourceCreateImageSource returns the value 2 (H_MSG_TRUE). Otherwise an exception is raised.

Combinations with other operators🔗

Combinations

Possible successors

connect_image_sourceConnectImageSource, get_image_source_paramGetImageSourceParam, set_image_source_paramSetImageSourceParam

Alternatives

query_image_sourcesQueryImageSources

See also

query_image_sourcesQueryImageSources

Module🔗

Foundation