|
| 1 | +--- |
| 2 | +layout: default-layout |
| 3 | +title: CaptureVisionRouter Single-File Processing Methods - Dynamsoft Capture Vision Router Module Python Edition API Reference |
| 4 | +description: Definition of CaptureVisionRouter class Single-File Processing Methods in Dynamsoft Capture Vision Router Module Python Edition. |
| 5 | +keywords: capture vision, capture, image processing, api reference, python, single-file |
| 6 | +needAutoGenerateSidebar: true |
| 7 | +needGenerateH3Content: false |
| 8 | +--- |
| 9 | + |
| 10 | +# Single-File Processing Methods - CaptureVisionRouter Class |
| 11 | + |
| 12 | +| Method | Description | |
| 13 | +| --------------------- | --------------------------------------------------------- | |
| 14 | +| [`capture`](#capture) | Process an image or file to derive important information. | |
| 15 | + |
| 16 | +## capture |
| 17 | + |
| 18 | +Process an image or file to derive important information. It can optionally use a specified template for the capture. |
| 19 | + |
| 20 | +```python |
| 21 | +def capture(self, *args) -> CapturedResult: |
| 22 | +``` |
| 23 | + |
| 24 | +**Parameters** |
| 25 | + |
| 26 | +`args` <*tuple*>: A variable-length argument list. Can be one of the following: |
| 27 | + |
| 28 | +- `file_path` <*str*>, `template_name` <*str*, optional>: Specifies the path of the file to process and a `CaptureVisionTemplate` to use for capturing. |
| 29 | +- `file_bytes` <*bytes*>, `template_name` <*str*, optional>: Specifies the image file bytes in memory to process and a `CaptureVisionTemplate` to use for capturing. |
| 30 | +- `image_data` <*ImageData*>, `template_name` <*str*, optional>: Specifies the image data to process and a `CaptureVisionTemplate` to use for capturing. |
| 31 | + |
| 32 | +**Remarks** |
| 33 | + |
| 34 | +- There are two types of `CaptureVisionTemplate`: the [preset ones]({{ site.dcvb_enumerations }}capture-vision-router/preset-template.html) which come with the SDK and the custom ones that get initialized when the user calls [InitSettings]({{ site.dcvb_python_api }}capture-vision-router/settings.html#initsettings) / [InitSettingsFromFile]({{ site.dcvb_python_api }}capture-vision-router/settings.html#initsettingsfromfile). |
| 35 | +- Please be aware that the preset `CaptureVisionTemplates` will be overwritten should the user call `InitSettings` / `InitSettingsFromFile` and pass his own settings. |
| 36 | +- If parameter `template_name` is not specified, the preset one named 'Default' will be used. However, if the preset ones have been overwritten as described above, the first `CaptureVisionTemplate` from the user's own settings will be used instead. |
| 37 | + |
| 38 | +**Return Value** |
| 39 | + |
| 40 | +Returns a `CapturedResult` object containing the captured items. |
| 41 | + |
| 42 | +**See Also** |
| 43 | + |
| 44 | +[ImageData]({{ site.dcvb_python_api }}core/basic-classes/image-data.html) |
| 45 | + |
| 46 | +[CapturedResult]({{ site.dcvb_python_api }}capture-vision-router/auxiliary-classes/captured-result.html) |
0 commit comments