---
layout: default-layout
title: CaptureVisionRouter Class- Dynamsoft Capture Vision Router Module Python Edition API Reference
description: API reference for the CaptureVisionRouter class in Dynamsoft Capture Vision Python Edition, the central class for managing image capture and recognition workflows.
keywords: capture vision router, router, python, api reference
---

# CaptureVisionRouter

The `CaptureVisionRouter` class is what a user uses to interact with image-processing and semantic-processing products in their applications. It accepts an image source and returns processing results which may contain [Final results]({{ site.dcvb_architecture }}output.html#final-results).

## Definition

*Module:* cvr

```python
class CaptureVisionRouter
```

## Thread Safety

Instances of `CaptureVisionRouter` are not thread-safe.  
Do not access the same `CaptureVisionRouter` instance from multiple threads concurrently.  
Create a separate instance for each thread if concurrent processing is required.


## Constructor Methods

| Method | Description |
| ------ | ----------- |
| [`__init__`](#__init__) | Initializes a new instance of the `CaptureVisionRouter` class. |

## Single-File Processing Methods

| Method                                         | Description                                               |
| ---------------------------------------------- | --------------------------------------------------------- |
| [`capture`](single-file-processing.md#capture) | Processes an image or file to derive important information. |
| [`capture_multi_pages`](single-file-processing.md#capture_multi_pages) | Processes an image or file containing multiple pages to derive important information. |

## Multiple-File Processing Methods

| Method | Description |
| ------- | ---------- |
| [`set_input`](multiple-file-processing.md#set_input)                                             | Sets an image source to provide images for consecutive process.              |
| [`get_input`](multiple-file-processing.md#get_input)                                             | Gets the attached image source adapter object of the capture vision router.  |
| [`add_capture_state_listener`](multiple-file-processing.md#add_capture_state_listener)               | Adds an object that listens to the state changes of the capture process.     |
| [`remove_capture_state_listener`](multiple-file-processing.md#remove_capture_state_listener)         | Removes an object which listens to the state changes of the capture process. |
| [`add_image_source_state_listener`](multiple-file-processing.md#add_image_source_state_listener)       | Adds an object that listens to state changes of the image source.            |
| [`remove_image_source_state_listener`](multiple-file-processing.md#remove_image_source_state_listener) | Removes an object which listens to state changes of the image source.        |
| [`add_result_receiver`](multiple-file-processing.md#add_result_receiver)                           | Adds an object as the receiver of captured results.                          |
| [`remove_result_receiver`](multiple-file-processing.md#remove_result_receiver)                     | Removes an object which was added as a receiver of captured results.         |
| [`add_result_filter`](multiple-file-processing.md#add_result_filter)                               | Adds an object as the filter of captured results.                            |
| [`remove_result_filter`](multiple-file-processing.md#remove_result_filter)                         | Removes an object which was added as a filter of captured results.           |
| [`start_capturing`](multiple-file-processing.md#start_capturing)                                 | Starts to process images consecutively.                                      |
| [`stop_capturing`](multiple-file-processing.md#stop_capturing)                                   | Stops the consecutive process.                                               |
| [`pause_capturing`](multiple-file-processing.md#pause_capturing)                                 | Pauses the capture process. The current thread will be blocked until the capture process is resumed. |
| [`resume_capturing`](multiple-file-processing.md#resume_capturing)                               | Resumes the capture process. The current thread will be unblocked after the capture process is resumed. |
| [`switch_capturing_template`](multiple-file-processing.md#switch_capturing_template)    | Switches the capturing template during the image processing workflow.                            |

## Setting Methods

| Method                                                       | Description                                                                                  |
| ------------------------------------------------------------ | -------------------------------------------------------------------------------------------- |
| [`init_settings`](settings.md#init_settings)                   | Loads and initializes a template from a string.                                              |
| [`init_settings_from_file`](settings.md#init_settings_from_file)   | Loads and initializes a template from a file.                                                |
| [`output_settings`](settings.md#output_settings)               | Exports a specific `CaptureVisionTemplate` to a string.                                      |
| [`output_settings_to_file`](settings.md#output_settings_to_file)   | Exports a specific `CaptureVisionTemplate` to a file.                                        |
| [`get_simplified_settings`](settings.md#get_simplified_settings) | Retrieves a `SimplifiedCaptureVisionSettings` object for a specific `CaptureVisionTemplate`. |
| [`update_settings`](settings.md#update_settings)               | Updates a `CaptureVisionTemplate` with `SimplifiedCaptureVisionSettings` object.             |
| [`reset_settings`](settings.md#reset_settings)                 | Resets all templates to factory settings.                                                    |
| [`get_parameter_template_count`](settings.md#get_parameter_template_count)  | Retrieves the total number of available parameter templates.                                 |
| [`get_parameter_template_name`](settings.md#get_parameter_template_name)    | Retrieves the name of a specific parameter template by its index.                            |

## Buffered Items Methods

| Method                                                       | Description                                                                                  |
| ------------------------------------------------------------ | -------------------------------------------------------------------------------------------- |
| [`get_buffered_items_manager`](buffered-items.md#get_buffered_items_manager)                   | Gets a `BufferedItemsManager` object.  |

## Intermediate Result

The following method returns an `IntermediateResultManager` object which allows the application to tap into the algorithmic process.

| API Name                                                                            | Description                                     |
| ----------------------------------------------------------------------------------- | ----------------------------------------------- |
| [`get_intermediate_result_manager`](intermediate-result.md#get_intermediate_result_manager) | Returns an `IntermediateResultManager` object. |

## Auxiliary Methods

| Method                                      | Description                                               |
| --------------------------------------------- | --------------------------------------------------------- |
| [`set_global_intra_op_num_threads`](auxiliary-methods.md#set_global_intra_op_num_threads) | Sets the global number of threads used internally for model execution. |
| [`append_dl_model_buffer`](auxiliary-methods.md#append_dl_model_buffer) | Appends a deep learning model to the memory buffer. |
| [`clear_dl_model_buffers`](auxiliary-methods.md#clear_dl_model_buffers) | Clears all deep learning models from buffer to free up memory. |
| [`append_model_buffer`](auxiliary-methods.md#append_model_buffer) | Deprecated. Will be removed in future versions. Use `append_dl_model_buffer` instead. |
