Skip to content

Commit

Permalink
Merge pull request #59 from dynamsoft-docs/preview
Browse files Browse the repository at this point in the history
Preview
  • Loading branch information
DMGithubPublisher authored Nov 7, 2024
2 parents 8ee8ca3 + f2429d4 commit 16bdd5b
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 0 deletions.
3 changes: 3 additions & 0 deletions _data/product_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@ useGroupedVersion: true

version_info_list_desktop:
- value: latest version
- value: 2.x
child:
- 2.4.2000_python

6 changes: 6 additions & 0 deletions assets/js/dcvServerVersionSearch.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
[
{
"version": "2.4.2100",
"matchVersion": {
"python": "10.4.2100"
}
},
{
"version": "2.4.2000",
"matchVersion": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
layout: default-layout
title: CaptureVisionRouter Single-File Processing Methods - Dynamsoft Capture Vision Router Module Python Edition API Reference
description: Definition of CaptureVisionRouter class Single-File Processing Methods in Dynamsoft Capture Vision Router Module Python Edition.
keywords: capture vision, capture, image processing, api reference, python, single-file
needAutoGenerateSidebar: true
needGenerateH3Content: false
---

# Single-File Processing Methods - CaptureVisionRouter Class

| Method | Description |
| --------------------- | --------------------------------------------------------- |
| [`capture`](#capture) | Process an image or file to derive important information. |

## capture

Process an image or file to derive important information. It can optionally use a specified template for the capture.

```python
def capture(self, *args) -> CapturedResult:
```

**Parameters**

`args` <*tuple*>: A variable-length argument list. Can be one of the following:

- `file_path` <*str*>, `template_name` <*str*, optional>: Specifies the path of the file to process and a `CaptureVisionTemplate` to use for capturing.
- `file_bytes` <*bytes*>, `template_name` <*str*, optional>: Specifies the image file bytes in memory to process and a `CaptureVisionTemplate` to use for capturing.
- `image_data` <*ImageData*>, `template_name` <*str*, optional>: Specifies the image data to process and a `CaptureVisionTemplate` to use for capturing.

**Remarks**

- 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).
- Please be aware that the preset `CaptureVisionTemplates` will be overwritten should the user call `InitSettings` / `InitSettingsFromFile` and pass his own settings.
- 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.

**Return Value**

Returns a `CapturedResult` object containing the captured items.

**See Also**

[ImageData]({{ site.dcvb_python_api }}core/basic-classes/image-data.html)

[CapturedResult]({{ site.dcvb_python_api }}capture-vision-router/auxiliary-classes/captured-result.html)
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def capture(self, *args) -> CapturedResult:
- `file_path` <*str*>, `template_name` <*str*, optional>: Specifies the path of the file to process and a `CaptureVisionTemplate` to use for capturing.
- `file_bytes` <*bytes*>, `template_name` <*str*, optional>: Specifies the image file bytes in memory to process and a `CaptureVisionTemplate` to use for capturing.
- `image_data` <*ImageData*>, `template_name` <*str*, optional>: Specifies the image data to process and a `CaptureVisionTemplate` to use for capturing.
- `image` <*numpy.ndarray*>, `image_pixel_format` <*EnumImagePixelFormat*, optional>, `template_name` <*str*, optional>: Specifies the image, formated in `numpy.ndarray`, and the image pixel format used in the image byte array to process and a `CaptureVisionTemplate` to use for capturing.

**Remarks**

Expand All @@ -43,4 +44,6 @@ Returns a `CapturedResult` object containing the captured items.

[ImageData]({{ site.dcvb_python_api }}core/basic-classes/image-data.html)

[EnumImagePixelFormat]({{ site.dcvb_enumerations }}core/image-pixel-format.html?lang=python)

[CapturedResult]({{ site.dcvb_python_api }}capture-vision-router/auxiliary-classes/captured-result.html)
1 change: 1 addition & 0 deletions programming/python/release-notes/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ noTitleIndex: true

# Module Release Notes - Dynamsoft Capture Vision Python Edition

- [2.4.2100 (11/07/2024)](python-2.md#242100-11072024)
- [2.4.2000 (10/10/2024)](python-2.md#242000-10102024)
15 changes: 15 additions & 0 deletions programming/python/release-notes/python-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,21 @@ needGenerateH3Content: false

# Release Notes for Python Edition - 2.x

## 2.4.2100 (11/07/2024)

### New

- Added support for `numpy.ndarray` image type in the `capture` interface.

### Improved

- Optimized the usage of list type member variables, allowing modification of individual objects within the list without needing to reassign the entire list.
- Improved the usage of `EnumPresetTemplate` and `EnumBarcodeFormat`, no longer requiring `.value` for accessing enum members.

### Fixed

- Fixed a bug where initializing `FileImageTag` would raise a `TypeError` exception.

## 2.4.2000 (10/10/2024)

### Highlights
Expand Down

0 comments on commit 16bdd5b

Please sign in to comment.