Skip to content

Commit

Permalink
Merge pull request #43 from dynamsoft-docs/preview
Browse files Browse the repository at this point in the history
update to internal commit f33aed92
  • Loading branch information
Dynamsoft-Henry authored Mar 21, 2024
2 parents e9648db + 4a6a10c commit 45970e4
Show file tree
Hide file tree
Showing 27 changed files with 103 additions and 111 deletions.
4 changes: 2 additions & 2 deletions programming/android/api-reference/detected-quad-element.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ class DetectedQuadElement extends RegionObjectElement

| Methods | Description |
| ------- | ----------- |
| [`getConfidenceAsDocumentBoundary`](#getconfidenceasdocumentboundary) | Get the confidence of the quadrilateral to be a document boundary. |
| [`getConfidenceAsDocumentBoundary`](#getconfidenceasdocumentboundary) | Returns the confidence score of the detected quadrilateral's boundary, measuring the certainty that the detected quadrilateral represents the boundary of a document. |

## getConfidenceAsDocumentBoundary

Get the confidence of the quadrilateral to be a document boundary.
Returns the confidence score of the detected quadrilateral's boundary, measuring the certainty that the detected quadrilateral represents the boundary of a document.

```java
int getConfidenceAsDocumentBoundary();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ noTitleIndex: true

# DetectedQuadResultItem

The `DetectedQuadResultItem` class represents a captured result item whose type is detected quad, which contains the location and confidence as a document boundary.
The `DetectedQuadResultItem` class is an extension of the [`CapturedResultItem`]({{ site.dcv_android_api }}core/basic-structures/captured-result-item.html) that represents a detected quadrilateral. This is the most basic unit of a detected quadrilateral, one of the captured result types that the Capture Vision Router can output.

## Definition

Expand All @@ -27,11 +27,11 @@ class DetectedQuadResultItem extends CapturedResultItem
| Methods | Description |
| ------- | ----------- |
| [`getLocation`](#getlocation) | Get a Quadrilateral object as the location of current object. |
| [`getConfidenceAsDocumentBoundary`](#getconfidenceasdocumentboundary) | Get the confidence of current object as a document boundary. |
| [`getConfidenceAsDocumentBoundary`](#getconfidenceasdocumentboundary) | Returns the confidence score of the detected quadrilateral's boundary, measuring the certainty that the detected quadrilateral represents the boundary of a document. |

### getLocation

Get a Quadrilateral object as the location of current object.
Returns a [Quadrilateral]({{ site.dcv_android_api }}core/basic-structures/quadrilateral.html) object that represents the location of the detected quadrilateral within the image or frame.

```java
Quadrilateral getLocation();
Expand All @@ -43,7 +43,7 @@ The location of current object.

### getConfidenceAsDocumentBoundary

Get the confidence of current object as a document boundary.
Returns the confidence score of the detected quadrilateral's boundary, measuring the certainty that the detected quadrilateral represents the boundary of a document.

```java
int getConfidenceAsDocumentBoundary();
Expand Down
14 changes: 5 additions & 9 deletions programming/android/api-reference/detected-quads-result.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ noTitleIndex: true

# DetectedQuadsResult

The `DetectedQuadsResult` class represents a captured result whose type is detected quads, which contains an array of `DetectedQuadResultItem` and the rotation transformation matrix of the original image relative to the rotated image.
The `DetectedQuadsResult` class represents a collection of [`DetectedQuadResultItems`](detected-quad-result-item.md), the basic unit of a detected quad result.

## Definition

Expand All @@ -33,7 +33,7 @@ class DetectedQuadsResult

### getItems

An array of [`DetectedQuadResultItem`](./detected-quad-result-item.md), which are the detected quadrilateral items.
Returns an array of [`DetectedQuadResultItem`](./detected-quad-result-item.md), which represents the basic unit of the captured result, in this case, a detected quadrilateral.

```java
DetectedQuadResultItem[] getItems();
Expand All @@ -45,7 +45,7 @@ The array of the detected quadrilateral items.

### getRotationTransformMatrix

The rotation transformation matrix of the original image relative to the rotated image.
Returns the rotation transformation matrix of the original image relative to the rotated image. Please see [Matrix](https://developer.android.com/reference/android/opengl/Matrix){:target="_blank"} for more info.

```java
Matrix getRotationTransformMatrix();
Expand All @@ -57,19 +57,15 @@ The rotation transformation matrix of the original image relative to the rotated

### getOriginalImageHashId

The hash id of the original image. You can use this ID to get the original image via `IntermediateResultManager` class.
Returns the hash ID of the original image. You can use this ID to get the original image via [`IntermediateResultManager`]({{ site.dcv_android_api }}core/intermediate-results/intermediate-result-manager.html) class.

```java
String getOriginalImageHashId();
```

**Return Value**

The hash id of the original image.

### getOriginalImageTag

The tag of the original image.
Returns the [`ImageTag`]({{ site.dcv_android_api }}core/basic-structures/image-tag.html) of the original image, which contains various information about the image.

```java
ImageTag getOriginalImageTag();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ noTitleIndex: true

# NormalizedImageResultItem

The `NormalizedImageResultItem` class represents a captured result item whose type is a normalized image. It stores the normalized image information.
The `NormalizedImageResultItem` class is an extension of [`CapturedResultItem`]({{ site.dcv_android_api }}core/basic-structures/captured-result-item.html) that represents a normalized image. This is the most basic unit of the normalized image result, one of the captured result types that the Capture Vision Router can output.

## Definition

Expand All @@ -31,7 +31,7 @@ class NormalizedImageResultItem extends CapturedResultItem

### getImageData

Gets an `ImageData` object as the normalized image.
Returns an [`ImageData`]({{ site.dcv_android_api }}core/basic-structures/image-data.html) object for the normalized image.

```java
ImageData getImageData();
Expand All @@ -43,7 +43,7 @@ The `ImageData` object as the normalized image.

### getLocation

Gets the quadrilateral from which you get the normalized image result item.
Returns the [Quadrilateral]({{ site.dcv_android_api }}core/basic-structures/quadrilateral.html) that represents the location of the normalized image within the original image or frame.

```java
Quadrilateral getLocation();
Expand Down
14 changes: 5 additions & 9 deletions programming/android/api-reference/normalized-images-result.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ noTitleIndex: true

# NormalizedImagesResult

The `NormalizedImagesResult` class represents a collection of captured result items whose type are normalized images.
The `NormalizedImagesResult` class represents a collection of [`NormalizedImageResultItem`](normalized-image-result-item.md), the basic unit of a normalized image result.

## Definition

Expand All @@ -33,7 +33,7 @@ class NormalizedImagesResult

### getItems

Gets an array of `NormalizedImageResultItem` objects, where each object represents a single normalized image.
Returns an array of [`NormalizedImageResultItem`](normalized-image-result-item.md) objects, where each `NormalizedImageResultItem` represents a single normalized image.

```java
NormalizedImageResultItem[] getItems();
Expand All @@ -45,7 +45,7 @@ The array of the normalized image result items.

### getRotationTransformMatrix

Gets the rotation transformation matrix of the original image relative to the rotated image.
Returns the rotation transformation matrix of the original image relative to the rotated image. Please see [Matrix](https://developer.android.com/reference/android/opengl/Matrix){:target="_blank"} for more info.

```java
Matrix getRotationTransformMatrix();
Expand All @@ -57,7 +57,7 @@ The rotation transformation matrix of the original image relative to the rotated

### getOriginalImageHashId

Gets the hash id of the original image. You can use this ID to get the original image via `IntermediateResultManager` class.
Returns the hash ID of the original image. You can use this ID to get the original image via [`IntermediateResultManager`]({{ site.dcv_android_api }}core/intermediate-results/intermediate-result-manager.html) class.

```java
String getOriginalImageHashId();
Expand All @@ -69,7 +69,7 @@ The hash id of the original image.

### getOriginalImageTag

Gets the tag of the original image.
Returns the [`ImageTag`]({{ site.dcv_android_api }}core/basic-structures/image-tag.html) of the original image, which contains various information about the image.

```java
ImageTag getOriginalImageTag();
Expand All @@ -78,7 +78,3 @@ ImageTag getOriginalImageTag();
**Return Value**

The tag of the original image.

**See Also**

* [ImageTag]({{ site.dcv_android_api }}core/basic-structures/image-tag.html)
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ noTitleIndex: true

# SimplifiedDocumentNormalizerSettings

The `SimplifiedDocumentNormalizerSettings` class represents the simplified document normalizer settings.
The `SimplifiedDocumentNormalizerSettings` class represents a series of simple settings related to the Document Normalizer. Please note that this is not the full list of settings that can be utilized by the Document Normalizer, which you can find on the [Dynamsoft Document Normalizer Parameters]({{ site.parameters }}reference/index.html){:target="_blank"} page.

## Definition

Expand All @@ -37,63 +37,63 @@ class SimplifiedDocumentNormalizerSettings

### grayscaleTransformationModes

Defines the grayscale transformation mode with an array of [`EnumGrayscaleTransformationMode`]({{ site.dcv_enumerations }}core/grayscale-transformation-mode.html?lang=android). It controls whether to detect the inverted document boundary.
Defines the grayscale transformation modes with an array of [`EnumGrayscaleTransformationMode`]({{ site.dcv_enumerations }}core/grayscale-transformation-mode.html?lang=android) items. This parameter is important when working with inverted documents, and must be used in order to locate the inverted document boundary.

```java
EnumGrayscaleTransformationMode[] grayscaleTransformationModes;
```

### grayscaleEnhancementModes

Defines the grayscale enhancement mode with an array of [`EnumGrayscaleEnhancementModes`]({{ site.dcv_enumerations }}core/grayscale-enhancement-modes.html?lang=android).
Defines the grayscale enhancement modes with an array of [`EnumGrayscaleEnhancementModes`]({{ site.dcv_enumerations }}core/grayscale-enhancement-modes.html?lang=android) items. This parameter can be quite powerful in increasing the border detection rate of your application should you experience any trouble in that area. To learn more about the `grayscaleEnhancementModes` and how they can be used, please visit the main [GrayscaleEnhancementModes]({{ site.dcv_parameters }}reference/image-parameter/grayscale-enhancement-modes.html) parameter page.

```java
EnumGrayscaleEnhancementMode[] grayscaleEnhancementModes;
```

### colourMode

Defines the colour mode of the normalized image with an [`EnumImageColourMode`]({{ site.dcv_enumerations }}core/image-colour-mode.html?lang=android) member.
Defines the colour mode of the normalized image with an [`EnumImageColourMode`]({{ site.dcv_enumerations }}document-normalizer/image-colour-mode.html?lang=android) member. By default, the normalized image will output in colour. In order to make the result image grayscale or binary, setting the `colourMode` to the corresponding pixel type will do the trick.

```java
EnumImageColourMode colourMode;
```

### pageSize

Defines the page size of the normalized image with the width and height in an int array.
Defines the page size of the normalized image through an integer array.

```java
int[] pageSize;
```

### brightness

Defines the brightness of the normalized image with an integer.
Defines the brightness of the normalized image result with an integer.

```java
int brightness;
```

### contrast

Defines the contrast of the normalized image with an integer.
Defines the contrast of the normalized image result with an integer.

```java
int contrast;
```

### maxThreadsInOneTask

Defines the maximum number of threads in one task.
Defines the maximum number of threads dedicated to a single task.

```java
int maxThreadsInOneTask;
```

### scaleDownThreshold

Defines the scale down threshold. If the image size is larger than the scale down threshold, the image is scaled down by half.
If the original image size is quite large, then the `scaledownThreshold` can be used to shrink the image and speed up the processing. If the shorter edge size is larger than the defined scale down threshold, the library will calculate the required width and height of the image and shrink it to that size before moving forward in the process.

```java
int scaleDownThreshold;
Expand Down
22 changes: 11 additions & 11 deletions programming/android/upgrade-instruction.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ permalink: /programming/android/upgrade-instruction.html

## From version 1.x to 2.x

`DynamsoftDocumentNormalizer` SDK has been revamped to integrate with `DynamsoftCaptureVision (DCV)` architecture. To upgrade from version 1.x to 2.x, we recommend you to follow the [`User Guide`](user-guide.md) and re-write your codes.
`DynamsoftDocumentNormalizer` SDK has been revamped to integrate with `DynamsoftCaptureVision (DCV)` architecture. To upgrade from version 1.x to 2.x, we recommend that you follow the [`User Guide`](user-guide.md) and re-write your code to match what is in the guide.

Here are some of the main actions you may take:

### Update the Dependencies

Since the SDK architecture is changed, you have to change your `build.gradle` for including the following libraries:
Since the SDK architecture has changed, you have to change your `build.gradle` to include the following libraries:

```groovy
dependencies {
Expand All @@ -31,11 +31,11 @@ dependencies {
}
```

>Note: Please view [user guide](user-guide.md#add-the-library-via-maven) for the correct version number.
>Note: Please view [user guide](user-guide.md#add-the-library-via-maven) for the most up-to-date version number.
### Migrate from Class DocumentNormalizer to Class CaptureVisionRouter

The `CaptureVisionRouter` class serves as the central class of the DCV framework's execution flow. It encompasses the following functionalities:
The `CaptureVisionRouter` class serves as the central class of DCV's execution flow. It encompasses the following functionalities:

- Retrieving images from the `ImageSourceAdapter`.
- Updating templates and configuring settings.
Expand All @@ -44,13 +44,13 @@ The `CaptureVisionRouter` class serves as the central class of the DCV framework

### Convert Parameter Templates

The parameter system is restructured and the template you used for v1.x can't be directly recognized by the new version. Please <a href="https://www.dynamsoft.com/company/customer-service/#contact" target="_blank">contact us</a> to upgrade your parameter template.
The parameter system has been restructured and the template you used for v1.x cannot be directly recognized by v2.x (and beyond). Please <a href="https://www.dynamsoft.com/company/customer-service/#contact" target="_blank">contact us</a> to upgrade your parameter template.

### Update Your Codes

#### Single Image Processing

You should now utilize the provided `capture` APIs instead of the previous `detectQuad` and `normalize` APIs. These `capture` APIs directly return results for boundary detection or document normalization.
You should now utilize the provided `capture` API methods instead of the previous `detectQuad` and `normalize` API methods. These `capture` API methods directly return results for boundary detection or document normalization.

```java
CapturedResult capture(String filePath, String templateName) throws CaptureVisionRouterException
Expand All @@ -61,12 +61,12 @@ CapturedResult capture(ImageData imageData, String templateName) throws CaptureV

#### Batch Image Processing

The DCV architecture allows you to conveniently and continuously obtain frames from `CameraEnhancer`, and detect or normalize them. The key steps are as follows:
The DCV architecture allows you to conveniently and continuously obtain frames from the `CameraEnhancer`, and then detect or normalize them. The key steps are as follows:

- Set a `CameraEnhancer` object as the input of the `CaptureVisionRouter` object via `setInput` API.
- Register a `CapturedResultReceiver` object as the output of the `CaptureVisionRouter` object via `addResultReceiver` API.
- Open/Close camera via `CameraEnhancer.open` and `CameraEnhancer.close` API.
- Start/Stop capturing via `CaptureVisionRouter.startCapturing` and `CaptureVisionRouter.stopCapturing` API.
- Set a `CameraEnhancer` object as the input of the `CaptureVisionRouter` object via the `setInput` API method.
- Register a `CapturedResultReceiver` object as the output of the `CaptureVisionRouter` object via the `addResultReceiver` API method.
- Open/Close camera via `CameraEnhancer.open` and `CameraEnhancer.close` API methods.
- Start/Stop capturing via `CaptureVisionRouter.startCapturing` and `CaptureVisionRouter.stopCapturing` API methods.

```java
public class MainActivity extends AppCompatActivity {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The `DSCandidateQuadEdgesUnit` class represents an intermediate result unit whos

## Definition

*Assembly:* DynamsoftDocumentNormalizer.framework
*Assembly:* DynamsoftDocumentNormalizer.xcframework

<div class="sample-code-prefix"></div>
>- Objective-C
Expand Down
2 changes: 1 addition & 1 deletion programming/ios/api-reference/candidate-quad-edges-unit.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The `DSCandidateQuadEdgesUnit` class represents an intermediate result unit whos

## Definition

*Assembly:* DynamsoftDocumentNormalizer.framework
*Assembly:* DynamsoftDocumentNormalizer.xcframework

<div class="sample-code-prefix"></div>
>- Objective-C
Expand Down
2 changes: 1 addition & 1 deletion programming/ios/api-reference/corners-unit-v2.0.20.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The `DSCornersUnit` class represents an intermediate result unit whose type is c

## Definition

*Assembly:* DynamsoftDocumentNormalizer.framework
*Assembly:* DynamsoftDocumentNormalizer.xcframework

<div class="sample-code-prefix"></div>
>- Objective-C
Expand Down
2 changes: 1 addition & 1 deletion programming/ios/api-reference/corners-unit.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The `DSCornersUnit` class represents an intermediate result unit whose type is c

## Definition

*Assembly:* DynamsoftDocumentNormalizer.framework
*Assembly:* DynamsoftDocumentNormalizer.xcframework

<div class="sample-code-prefix"></div>
>- Objective-C
Expand Down
6 changes: 3 additions & 3 deletions programming/ios/api-reference/detected-quad-element.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The `DSDetectedQuadElement` class represents a detected quadrilateral element, w

## Definition

*Assembly:* DynamsoftDocumentNormalizer.framework
*Assembly:* DynamsoftDocumentNormalizer.xcframework

<div class="sample-code-prefix"></div>
>- Objective-C
Expand All @@ -33,11 +33,11 @@ class DetectedQuadElement: RegionObjectElement

| Attributes | Type | Description |
| ---------- | ---- | ----------- |
| [`confidenceAsDocumentBoundary`](#confidenceasdocumentboundary) | *NSInteger* | The confidence of the quadrilateral to be a document boundary. |
| [`confidenceAsDocumentBoundary`](#confidenceasdocumentboundary) | *NSInteger* | The confidence score of the detected quadrilateral's boundary, measuring the certainty that the detected quadrilateral represents the boundary of a document. |

## confidenceAsDocumentBoundary

The confidence of the quadrilateral to be a document boundary.
The confidence score of the detected quadrilateral's boundary, measuring the certainty that the detected quadrilateral represents the boundary of a document.

<div class="sample-code-prefix"></div>
>- Objective-C
Expand Down
Loading

0 comments on commit 45970e4

Please sign in to comment.