| layout | default-layout |
|---|---|
| title | CaptureVisionRouter Settings - Dynamsoft Capture Vision Router Module Python Edition API Reference |
| description | API reference for the settings methods of the CaptureVisionRouter class in Dynamsoft Capture Vision Python Edition, including template management and parameter configuration. |
| keywords | capture vision, router, settings, api reference, python |
| needAutoGenerateSidebar | true |
| needGenerateH3Content | false |
| Method | Description |
|---|---|
init_settings |
Loads and initializes a template from a string. |
init_settings_from_file |
Loads and initializes a template from a file. |
output_settings |
Exports a specific CaptureVisionTemplate to a string. |
output_settings_to_file |
Exports a specific CaptureVisionTemplate to a file. |
get_simplified_settings |
Retrieves a SimplifiedCaptureVisionSettings object for a specific CaptureVisionTemplate. |
update_settings |
Updates a CaptureVisionTemplate with SimplifiedCaptureVisionSettings object. |
reset_settings |
Resets all templates to factory settings. |
get_parameter_template_count |
Gets the total number of available parameter templates. |
get_parameter_template_name |
Gets the name of a specific parameter template by its index. |
Loads and initializes a template from a string.
def init_settings(self, content: str) -> Tuple[int, str]:Parameters
content The string containing the template.
Return Value
Returns a tuple containing following elements:
error_code<int>: The error code indicating the status of the operation.error_message<str>: A descriptive message explaining the error.
See Also
[EnumErrorCode]({{ site.dcvb_python_api }}core/enum-error-code.html)
Loads and initializes a template from a file.
def init_settings_from_file(self, file_path: str) -> Tuple[int, str]:Parameters
file_path The path to the file containing the template.
Return Value
Returns a tuple containing following elements:
error_code<int>: The error code indicating the status of the operation.error_message<str>: A descriptive message explaining the error.
See Also
[EnumErrorCode]({{ site.dcvb_python_api }}core/enum-error-code.html)
Exports a specific template to a string.
def output_settings(self, template_name: str, include_default_values: bool = False) -> Tuple[int, str, str]:Parameters
template_name The name of the CaptureVisionTemplate to be exported.
include_default_values Specifies whether to include default values in the exported template.
Remarks
- It is supported to export all loaded templates by specifying the
template_nameas '*'. - There are two types of
CaptureVisionTemplate: the [preset ones]({{ site.dcvb_python_api }}capture-vision-router/enum-preset-template.html) which come with the SDK and the custom ones that get initialized when the user calls [init_settings]({{ site.dcvb_python_api }}capture-vision-router/settings.html#init_settings) / [init_settings_from_file]({{ site.dcvb_python_api }}capture-vision-router/settings.html#init_settings_from_file). - When using a custom template, the parameter
template_nameshould be the name of the [CaptureVisionTemplateobject]({{ site.dcvb_parameters }}file/capture-vision-template.html) in the JSON template file. - Please be aware that the preset
CaptureVisionTemplateswill be overwritten should the user callinit_settings/init_settings_from_fileand pass his own settings. - If parameter
template_nameis not specified, the preset one named 'Default' will be used. However, if the preset ones have been overwritten as described above, the firstCaptureVisionTemplatefrom the user's own settings will be used instead.
Return Value
Returns a tuple containing following elements:
error_code<int>: The error code indicating the status of the operation.template_content<str>: A string containing the exported template.error_message<str>: A descriptive message explaining the error.
See Also
[EnumErrorCode]({{ site.dcvb_python_api }}core/enum-error-code.html)
Exports a specific template to a file.
def output_settings_to_file(self, template_name: str, file_path: str, include_default_values: bool = False) -> Tuple[int, str]:Parameters
template_name The name of the template to be exported.
file_path The path to the output file.
include_default_values Specifies whether to include default values in the exported template.
Remarks
- It is supported to export all loaded templates by specifying the
template_nameas '*'. - There are two types of
CaptureVisionTemplate: the [preset ones]({{ site.dcvb_python_api }}capture-vision-router/enum-preset-template.html) which come with the SDK and the custom ones that get initialized when the user calls [init_settings]({{ site.dcvb_python_api }}capture-vision-router/settings.html#init_settings) / [init_settings_from_file]({{ site.dcvb_python_api }}capture-vision-router/settings.html#init_settings_from_file). - When using a custom template, the parameter
template_nameshould be the name of the [CaptureVisionTemplateobject]({{ site.dcvb_parameters }}file/capture-vision-template.html) in the JSON template file. - Please be aware that the preset
CaptureVisionTemplateswill be overwritten should the user callinit_settings/init_settings_from_fileand pass his own settings. - If parameter
template_nameis not specified, the preset one named 'Default' will be used. However, if the preset ones have been overwritten as described above, the firstCaptureVisionTemplatefrom the user's own settings will be used instead.
Return Value
Returns a tuple containing following elements:
error_code<int>: The error code indicating the status of the operation.error_message<str>: A descriptive message explaining the error.
See Also
[EnumErrorCode]({{ site.dcvb_python_api }}core/enum-error-code.html)
Retrieves a simplified version of the capture settings for a specific template.
def get_simplified_settings(self, template_name: str) -> Tuple[int, str, SimplifiedCaptureVisionSettings]:Parameters
template_name The name of the template.
Remarks
- There are two types of
CaptureVisionTemplate: the [preset ones]({{ site.dcvb_python_api }}capture-vision-router/enum-preset-template.html) which come with the SDK and the custom ones that get initialized when the user calls [init_settings]({{ site.dcvb_python_api }}capture-vision-router/settings.html#init_settings) / [init_settings_from_file]({{ site.dcvb_python_api }}capture-vision-router/settings.html#init_settings_from_file). - When using a custom template, the parameter
template_nameshould be the name of the [CaptureVisionTemplateobject]({{ site.dcvb_parameters }}file/capture-vision-template.html) in the JSON template file. - Please be aware that the preset
CaptureVisionTemplateswill be overwritten should the user callinit_settings/init_settings_from_fileand pass his own settings. - If parameter
template_nameis not specified, the preset one named 'Default' will be used. However, if the preset ones have been overwritten as described above, the firstCaptureVisionTemplatefrom the user's own settings will be used instead.
Return Value
Returns a tuple containing following elements:
error_code<int>: The error code indicating the status of the operation.error_message<str>: A descriptive message explaining the error.settings<SimplifiedCaptureVisionSettings>: ASimplifiedCaptureVisionSettingsobject containing all settings.
See Also
[EnumErrorCode]({{ site.dcvb_python_api }}core/enum-error-code.html)
[SimplifiedCaptureVisionSettings]({{ site.dcvb_python_api }}capture-vision-router/auxiliary-classes/simplified-capture-vision-settings.html)
Updates a template with simplified capture settings.
def update_settings(self, template_name: str, settings: SimplifiedCaptureVisionSettings) -> Tuple[int, str]:Parameters
template_name The name of the template to be updated.
settings A SimplifiedCaptureVisionSettings object.
Remarks
- There are two types of
CaptureVisionTemplate: the [preset ones]({{ site.dcvb_python_api }}capture-vision-router/enum-preset-template.html) which come with the SDK and the custom ones that get initialized when the user calls [init_settings]({{ site.dcvb_python_api }}capture-vision-router/settings.html#init_settings) / [init_settings_from_file]({{ site.dcvb_python_api }}capture-vision-router/settings.html#init_settings_from_file). - When using a custom template, the parameter
template_nameshould be the name of the [CaptureVisionTemplateobject]({{ site.dcvb_parameters }}file/capture-vision-template.html) in the JSON template file. - Please be aware that the preset
CaptureVisionTemplateswill be overwritten should the user callinit_settings/init_settings_from_fileand pass his own settings. - If parameter
template_nameis not specified, the preset one named 'Default' will be used. However, if the preset ones have been overwritten as described above, the firstCaptureVisionTemplatefrom the user's own settings will be used instead.
Return Value
Returns a tuple containing following elements:
error_code<int>: The error code indicating the status of the operation.error_message<str>: A descriptive message explaining the error.
See Also
[EnumErrorCode]({{ site.dcvb_python_api }}core/enum-error-code.html)
[SimplifiedCaptureVisionSettings]({{ site.dcvb_python_api }}capture-vision-router/auxiliary-classes/simplified-capture-vision-settings.html)
Resets all templates to factory settings.
def reset_settings(self) -> Tuple[int, str]:Return Value
Returns a tuple containing following elements:
error_code<int>: The error code indicating the status of the operation.error_message<str>: A descriptive message explaining the error.
See Also
[EnumErrorCode]({{ site.dcvb_python_api }}core/enum-error-code.html)
Gets the total number of available parameter templates.
def get_parameter_template_count(self) -> int:Return value
Returns an integer representing the count of parameter templates.
Gets the name of a specific parameter template by its index.
def get_parameter_template_name(self, index: int) -> Tuple[int, str]:Parameters
index The index of the parameter template to get.
Return value
Returns a tuple containing following elements:
error_code<int>: The error code indicating the status of the operation.template_name<str>: The name of the parameter template.