diff --git a/programming/android/api-reference/candidate-quad-edges-unit.md b/programming/android/api-reference/candidate-quad-edges-unit.md index 05b9f6f..3f240f8 100644 --- a/programming/android/api-reference/candidate-quad-edges-unit.md +++ b/programming/android/api-reference/candidate-quad-edges-unit.md @@ -16,7 +16,7 @@ The `CandidateQuadEdgesUnit` class represents an intermediate result unit whose *Namespace:* com.dynamsoft.ddn.intermediate_results -*Assembly:* DynamsoftDocumentNormalizer.aar +*Assembly:* DynamsoftCaptureVisionBundle.aar ```java class CandidateQuadEdgesUnit extends IntermediateResultUnit diff --git a/programming/android/api-reference/corners-unit.md b/programming/android/api-reference/corners-unit.md index 2c77c3c..d028a67 100644 --- a/programming/android/api-reference/corners-unit.md +++ b/programming/android/api-reference/corners-unit.md @@ -16,7 +16,7 @@ The `CornersUnit` class represents an intermediate result unit whose type is cor *Namespace:* com.dynamsoft.ddn.intermediate_results -*Assembly:* DynamsoftDocumentNormalizer.aar +*Assembly:* DynamsoftCaptureVisionBundle.aar ```java class CornersUnit extends IntermediateResultUnit diff --git a/programming/android/api-reference/deskewed-image-element.md b/programming/android/api-reference/deskewed-image-element.md new file mode 100644 index 0000000..73770a1 --- /dev/null +++ b/programming/android/api-reference/deskewed-image-element.md @@ -0,0 +1,58 @@ +--- +layout: default-layout +title: DeskewedImageElement - Dynamsoft Document Normalizer Android SDK API Reference +description: The class DeskewedImageElement represents an intermediate result whose type is deskewed image, It is inherited from RegionObjectElement and contains image data of deskewed result as additional parameter. +keywords: deskewed image element, java, kotlin +needGenerateH3Content: true +needAutoGenerateSidebar: true +noTitleIndex: true +--- + +# DeskewedImageElement + +The `DeskewedImageElement` class represents an intermediate result whose type is deskewed image. It is inherited from `RegionObjectElement` and contains image data of deskewed result as an additional parameter. + +## Definition + +*Namespace:* com.dynamsoft.ddn.intermediate_results + +*Assembly:* DynamsoftCaptureVisionBundle.aar + +```java +class DeskewedImageElement extends RegionObjectElement +``` + +## Methods + +| Methods | Description | +| ---------- | ----------- | +| [`setImageData`](#getimagedata) | Sets the image data of the deskewed image with a `DSImageData` object. | +| [`getSourceDeskewQuad`](#sourcedeskewquad) | Returns the quadrilateral from which you get the deskewed image result item. | + +The following methods are inherited from class [`RegionObjectElement`]({{ site.dcv_android_api }}core/intermediate-results/region-object-element.html). + +{%- include api-reference/region-object-element-android.md -%} + +### setImageData + +Gets an [`ImageData`]({{site.dcv_android_api}}core/basic-structures/image-data.html) object as the deskewed image. + +```java +void setImageData(ImageData imageData); +``` + +**Parameters** + +`imageData`: A [`ImageData`]({{site.dcv_android_api}}core/basic-structures/image-data.html) object that represents the deskewed image. + +### getSourceDeskewQuad + +Returns the quadrilateral from which you get the deskewed image result item. + +```java +Quadrilateral getSourceDeskewQuad(); +``` + +**Return Value** + +The quadrilateral from which you get the deskewed image result item. diff --git a/programming/android/api-reference/deskewed-image-result-item.md b/programming/android/api-reference/deskewed-image-result-item.md new file mode 100644 index 0000000..66ee671 --- /dev/null +++ b/programming/android/api-reference/deskewed-image-result-item.md @@ -0,0 +1,89 @@ +--- +layout: default-layout +title: DeskewedImageResultItem - Dynamsoft Document Normalizer Android SDK API Reference +description: The class DeskewedImageResultItem represents a captured result item whose type is a deskewed image. It stores the deskewed image information. +keywords: deskewed image result item, java, kotlin +needGenerateH3Content: true +needAutoGenerateSidebar: true +noTitleIndex: true +--- + +# DeskewedImageResultItem + +The `DeskewedImageResultItem` class is an extension of [`CapturedResultItem`]({{ site.dcv_android_api }}core/basic-structures/captured-result-item.html) that represents a deskewed image. This is the most basic unit of the deskewed image result, one of the captured result types that the Capture Vision Router can output. + +## Definition + +*Namespace:* com.dynamsoft.ddn + +*Assembly:* DynamsoftCaptureVisionBundle.aar + +```java +class DeskewedImageResultItem extends CapturedResultItem +``` + +## Methods + +| Methods | Description | +| ---------- | ----------- | +| [`getImageData`](#getimagedata) | Returns an `ImageData` object as the deskewed image. | +| [`getSourceDeskewQuad`](#getlocation) | Returns the quadrilateral from which you get the deskewed image result item. | +| [`getCrossVerificationStatus`](#getcrossverificationstatus) | Returns the cross verification status of the result item. | +| [`getOriginalToLocalMatrix`](#getoriginaltolocalmatrix) | Returns the transformation matrix from the original image coordinate system to the local coordinate system. | + +The following methods are inherited from [`CapturedResultItem`]({{ site.dcv_android_api }}core/basic-structures/captured-result-item.html). + +| Method | Description | +| ------ | ----------- | +| [`getType`]({{ site.dcv_android_api }}core/basic-structures/captured-result-item.html#gettype) | Returns the type of the captured result item, indicating what kind of data it represents. | +| [`getReferencedItem`]({{ site.dcv_android_api }}core/basic-structures/captured-result-item.html#getreferenceditem) | Returns a property of type `CapturedResultItem` that represents a reference to another captured result item. | +| [`getTargetROIDefName`]({{ site.dcv_android_api }}core/basic-structures/captured-result-item.html#gettargetroidefname) | Returns the name of the [`TargetROIDef`]({{ site.dcv_parameters_reference }}target-roi-def/) object which includes a task that generated the result. | +| [`getTaskName`]({{ site.dcv_android_api }}core/basic-structures/captured-result-item.html#gettaskname) | Returns the name of the task that generated the result. | + +### getImageData + +Returns an [`ImageData`]({{ site.dcv_android_api }}core/basic-structures/image-data.html) object for the deskewed image. + +```java +ImageData getImageData(); +``` + +**Return Value** + +The `ImageData` object as the deskewed image. + +### getSourceDeskewQuad + +Returns the soure [Quadrilateral]({{ site.dcv_android_api }}core/basic-structures/quadrilateral.html) that used to deskew the image. + +```java +Quadrilateral getLocation(); +``` + +**Return Value** + +The soure [Quadrilateral]({{ site.dcv_android_api }}core/basic-structures/quadrilateral.html) that used to deskew the image. + +### getCrossVerificationStatus + +Returns the cross verification status of the result item. The cross verification status determines whether the result item is approved by the multi-frame cross verification mechanism. If approved, the cross verification status is `CVS_PASSED`. Otherwise, it is `CVS_FAILED`. + +```java +EnumCrossVerificationStatus getCrossVerificationStatus(); +``` + +**Return Value** + +Returns the cross verification status of type [`EnumCrossVerificationStatus`]({{ site.dcv_enumerations }}core/cross-verification-status.html). + +### getOriginalToLocalMatrix + +Returns the transformation matrix from the original image coordinate system to the local coordinate system. + +```java +Matrix getOriginalToLocalMatrix(); +``` + +**Return Value** + +The transformation matrix of type `android.graphics.Matrix`. diff --git a/programming/android/api-reference/deskewed-image-unit.md b/programming/android/api-reference/deskewed-image-unit.md new file mode 100644 index 0000000..4984a9b --- /dev/null +++ b/programming/android/api-reference/deskewed-image-unit.md @@ -0,0 +1,60 @@ +--- +layout: default-layout +title: DeskewedImagesUnit - Dynamsoft Document Normalizer Android SDK API Reference +description: The class DeskewedImagesUnit represents an intermediate result unit whose type is deskewed images. +keywords: deskewed images, java, kotlin +needGenerateH3Content: true +needAutoGenerateSidebar: true +noTitleIndex: true +--- + +# DeskewedImagesUnit + +The `DeskewedImagesUnit` class represents an intermediate result unit whose type is deskewed images. + +## Definition + +*Namespace:* com.dynamsoft.ddn.intermediate_results + +*Assembly:* DynamsoftCaptureVisionBundle.aar + +```java +class DeskewedImagesUnit extends IntermediateResultUnit +``` + +## Methods + +| Methods | Description | +| ---------- | ----------- | +| [`getDeskewedImage`](#getdeskewedimage) | Gets the deskewed image of type [`DeskewedImageElement`](deskewed-image-element.md). | +| [`setDeskewedImage`](#setdeskewedimage) | Sets the deskewed image with a [`DeskewedImageElement`](deskewed-image-element.md) object | + +The following methods are inherited from class [`IntermediateResultUnit`]({{ site.dcv_android_api }}core/intermediate-results/intermediate-result-unit.html). + +{%- include api-reference/intermediate-result-unit-android.md -%} + +### getDeskewedImage + +Gets a deskewed image. + +```java +DeskewedImageElement getDeskewedImage(); +``` + +**Return Value** + +A [`DeskewedImageElement`](deskewed-image-element.md) object that represents the deskewed image. + +### setDeskewedImage + +Sets a [`DeskewedImageElement`](deskewed-image-element.md) as the deskewed image. + +```java +void setDeskewedImage(DeskewedImageElement element, Matrix matrixToOriginalImage); +``` + +**Parameters** + +`[in] element`: The deskewed image to be set. + +`[in] matrixToOriginalImage`: The matrix to the original image. diff --git a/programming/android/api-reference/detected-quad-element.md b/programming/android/api-reference/detected-quad-element.md index 774856f..0ba3071 100644 --- a/programming/android/api-reference/detected-quad-element.md +++ b/programming/android/api-reference/detected-quad-element.md @@ -16,7 +16,7 @@ The `DetectedQuadElement` class represents a detected quadrilateral element, whi *Namespace:* com.dynamsoft.ddn.intermediate_results -*Assembly:* DynamsoftDocumentNormalizer.aar +*Assembly:* DynamsoftCaptureVisionBundle.aar ```java class DetectedQuadElement extends RegionObjectElement diff --git a/programming/android/api-reference/detected-quad-result-item.md b/programming/android/api-reference/detected-quad-result-item.md index 900081d..50dc464 100644 --- a/programming/android/api-reference/detected-quad-result-item.md +++ b/programming/android/api-reference/detected-quad-result-item.md @@ -16,7 +16,7 @@ The `DetectedQuadResultItem` class is an extension of the [`CapturedResultItem`] *Namespace:* com.dynamsoft.ddn -*Assembly:* DynamsoftDocumentNormalizer.aar +*Assembly:* DynamsoftCaptureVisionBundle.aar ```java class DetectedQuadResultItem extends CapturedResultItem diff --git a/programming/android/api-reference/detected-quads-result.md b/programming/android/api-reference/detected-quads-result.md index f767c61..e43817a 100644 --- a/programming/android/api-reference/detected-quads-result.md +++ b/programming/android/api-reference/detected-quads-result.md @@ -16,7 +16,7 @@ The `DetectedQuadsResult` class represents a collection of [`DetectedQuadResultI *Namespace:* com.dynamsoft.ddn -*Assembly:* DynamsoftDocumentNormalizer.aar +*Assembly:* DynamsoftCaptureVisionBundle.aar ```java class DetectedQuadsResult diff --git a/programming/android/api-reference/detected-quads-unit.md b/programming/android/api-reference/detected-quads-unit.md index f0692cf..ca3968d 100644 --- a/programming/android/api-reference/detected-quads-unit.md +++ b/programming/android/api-reference/detected-quads-unit.md @@ -16,7 +16,7 @@ The `DetectedQuadsUnit` class represents an intermediate result unit whose type *Namespace:* com.dynamsoft.ddn.intermediate_results -*Assembly:* DynamsoftDocumentNormalizer.aar +*Assembly:* DynamsoftCaptureVisionBundle.aar ```java class DetectedQuadsUnit extends IntermediateResultUnit diff --git a/programming/android/api-reference/document-normalizer-module.md b/programming/android/api-reference/document-normalizer-module.md index f62ba7e..71d11af 100644 --- a/programming/android/api-reference/document-normalizer-module.md +++ b/programming/android/api-reference/document-normalizer-module.md @@ -16,7 +16,7 @@ The `DocumentNormalizerModule` class defines general functions of the document n *Namespace:* com.dynamsoft.ddn -*Assembly:* DynamsoftDocumentNormalizer.aar +*Assembly:* DynamsoftCaptureVisionBundle.aar ```java class DocumentNormalizerModule diff --git a/programming/android/api-reference/enhanced-image-element.md b/programming/android/api-reference/enhanced-image-element.md new file mode 100644 index 0000000..6f7048e --- /dev/null +++ b/programming/android/api-reference/enhanced-image-element.md @@ -0,0 +1,45 @@ +--- +layout: default-layout +title: EnhancedImageElement - Dynamsoft Document Normalizer Android SDK API Reference +description: The class EnhancedImageElement represents an intermediate result whose type is enhanced image, It is inherited from RegionObjectElement and contains image data of enhanced result as additional parameter. +keywords: enhanced image element, java, kotlin +needGenerateH3Content: true +needAutoGenerateSidebar: true +noTitleIndex: true +--- + +# EnhancedImageElement + +The `EnhancedImageElement` class represents an intermediate result whose type is enhanced image. It is inherited from `RegionObjectElement` and contains image data of enhanced result as an additional parameter. + +## Definition + +*Namespace:* com.dynamsoft.ddn.intermediate_results + +*Assembly:* DynamsoftCaptureVisionBundle.aar + +```java +class EnhancedImageElement extends RegionObjectElement +``` + +## Methods + +| Methods | Description | +| ---------- | ----------- | +| [`setImageData`](#getimagedata) | Sets the image data of the deskewed image with a `DSImageData` object. | + +The following methods are inherited from class [`RegionObjectElement`]({{ site.dcv_android_api }}core/intermediate-results/region-object-element.html). + +{%- include api-reference/region-object-element-android.md -%} + +### setImageData + +Gets an [`ImageData`]({{site.dcv_android_api}}core/basic-structures/image-data.html) object as the enhanced image. + +```java +void setImageData(ImageData imageData); +``` + +**Parameters** + +`imageData`: A [`ImageData`]({{site.dcv_android_api}}core/basic-structures/image-data.html) object that represents the enhanced image. diff --git a/programming/android/api-reference/enhanced-image-result-item.md b/programming/android/api-reference/enhanced-image-result-item.md new file mode 100644 index 0000000..d8739d3 --- /dev/null +++ b/programming/android/api-reference/enhanced-image-result-item.md @@ -0,0 +1,63 @@ +--- +layout: default-layout +title: EnhancedImageResultItem - Dynamsoft Document Normalizer Android SDK API Reference +description: The class EnhancedImageResultItem represents a captured result item whose type is a enhanced image. It stores the enhanced image information. +keywords: enhanced image result item, java, kotlin +needGenerateH3Content: true +needAutoGenerateSidebar: true +noTitleIndex: true +--- + +# EnhancedImageResultItem + +The `EnhancedImageResultItem` class is an extension of [`CapturedResultItem`]({{ site.dcv_android_api }}core/basic-structures/captured-result-item.html) that represents a enhanced image. This is the most basic unit of the enhanced image result, one of the captured result types that the Capture Vision Router can output. + +## Definition + +*Namespace:* com.dynamsoft.ddn + +*Assembly:* DynamsoftCaptureVisionBundle.aar + +```java +class EnhancedImageResultItem extends CapturedResultItem +``` + +## Methods + +| Methods | Description | +| ---------- | ----------- | +| [`getImageData`](#getimagedata) | Returns an `ImageData` object as the enhanced image. | +| [`getOriginalToLocalMatrix`](#getoriginaltolocalmatrix) | Returns the transformation matrix from the original image coordinate system to the local coordinate system. | + +The following methods are inherited from [`CapturedResultItem`]({{ site.dcv_android_api }}core/basic-structures/captured-result-item.html). + +| Method | Description | +| ------ | ----------- | +| [`getType`]({{ site.dcv_android_api }}core/basic-structures/captured-result-item.html#gettype) | Returns the type of the captured result item, indicating what kind of data it represents. | +| [`getReferencedItem`]({{ site.dcv_android_api }}core/basic-structures/captured-result-item.html#getreferenceditem) | Returns a property of type `CapturedResultItem` that represents a reference to another captured result item. | +| [`getTargetROIDefName`]({{ site.dcv_android_api }}core/basic-structures/captured-result-item.html#gettargetroidefname) | Returns the name of the [`TargetROIDef`]({{ site.dcv_parameters_reference }}target-roi-def/) object which includes a task that generated the result. | +| [`getTaskName`]({{ site.dcv_android_api }}core/basic-structures/captured-result-item.html#gettaskname) | Returns the name of the task that generated the result. | + +### getImageData + +Returns an [`ImageData`]({{ site.dcv_android_api }}core/basic-structures/image-data.html) object for the enhanced image. + +```java +ImageData getImageData(); +``` + +**Return Value** + +The `ImageData` object as the enhanced image. + +### getOriginalToLocalMatrix + +Returns the transformation matrix from the original image coordinate system to the local coordinate system. + +```java +Matrix getOriginalToLocalMatrix(); +``` + +**Return Value** + +The transformation matrix of type `android.graphics.Matrix`. diff --git a/programming/android/api-reference/enhanced-image-unit.md b/programming/android/api-reference/enhanced-image-unit.md new file mode 100644 index 0000000..24d8e36 --- /dev/null +++ b/programming/android/api-reference/enhanced-image-unit.md @@ -0,0 +1,58 @@ +--- +layout: default-layout +title: EnhancedImagesUnit - Dynamsoft Document Normalizer Android SDK API Reference +description: The class EnhancedImagesUnit represents an intermediate result unit whose type is enhanced images. +keywords: enhanced images, java, kotlin +needGenerateH3Content: true +needAutoGenerateSidebar: true +noTitleIndex: true +--- + +# EnhancedImagesUnit + +The `EnhancedImagesUnit` class represents an intermediate result unit whose type is enhanced images. + +## Definition + +*Namespace:* com.dynamsoft.ddn.intermediate_results + +*Assembly:* DynamsoftCaptureVisionBundle.aar + +```java +class EnhancedImagesUnit extends IntermediateResultUnit +``` + +## Methods + +| Methods | Description | +| ---------- | ----------- | +| [`getEnhancedImage`](#getenhancedimage) | Gets the enhanced image of type [`EnhancedImageElement`](enhanced-image-element.md). | +| [`setEnhancedImage`](#setenhancedimage) | Sets the enhanced image with a [`EnhancedImageElement`](enhanced-image-element.md) object | + +The following methods are inherited from class [`IntermediateResultUnit`]({{ site.dcv_android_api }}core/intermediate-results/intermediate-result-unit.html). + +{%- include api-reference/intermediate-result-unit-android.md -%} + +### getEnhancedImage + +Gets a enhanced image. + +```java +EnhancedImageElement getEnhancedImage(); +``` + +**Return Value** + +A [`EnhancedImageElement`](enhanced-image-element.md) object that represents the enhanced image. + +### setEnhancedImage + +Sets a [`EnhancedImageElement`](enhanced-image-element.md) as the enhanced image. + +```java +void setEnhancedImage(EnhancedImageElement element); +``` + +**Parameters** + +`[in] element`: The enhanced image to be set. diff --git a/programming/android/api-reference/logic-lines-unit.md b/programming/android/api-reference/logic-lines-unit.md index 0580b4c..ba11d49 100644 --- a/programming/android/api-reference/logic-lines-unit.md +++ b/programming/android/api-reference/logic-lines-unit.md @@ -16,7 +16,7 @@ The `LogicLinesUnit` class represents an intermediate result unit containing log *Namespace:* com.dynamsoft.ddn.intermediate_results -*Assembly:* DynamsoftDocumentNormalizer.aar +*Assembly:* DynamsoftCaptureVisionBundle.aar ```java class LogicLinesUnit extends IntermediateResultUnit diff --git a/programming/android/api-reference/long-lines-unit.md b/programming/android/api-reference/long-lines-unit.md index b3f6ca9..04f7882 100644 --- a/programming/android/api-reference/long-lines-unit.md +++ b/programming/android/api-reference/long-lines-unit.md @@ -16,7 +16,7 @@ The `LongLinesUnit` class represents an intermediate result unit whose type is l *Namespace:* com.dynamsoft.ddn.intermediate_results -*Assembly:* DynamsoftDocumentNormalizer.aar +*Assembly:* DynamsoftCaptureVisionBundle.aar ```java class LongLinesUnit extends IntermediateResultUnit diff --git a/programming/android/api-reference/normalized-image-element.md b/programming/android/api-reference/normalized-image-element.md index a5410b0..e454db5 100644 --- a/programming/android/api-reference/normalized-image-element.md +++ b/programming/android/api-reference/normalized-image-element.md @@ -16,7 +16,7 @@ The `NormalizedImageElement` class represents an intermediate result whose type *Namespace:* com.dynamsoft.ddn.intermediate_results -*Assembly:* DynamsoftDocumentNormalizer.aar +*Assembly:* DynamsoftCaptureVisionBundle.aar ```java class NormalizedImageElement extends RegionObjectElement diff --git a/programming/android/api-reference/normalized-image-result-item.md b/programming/android/api-reference/normalized-image-result-item.md index cf9e1b0..7a7153f 100644 --- a/programming/android/api-reference/normalized-image-result-item.md +++ b/programming/android/api-reference/normalized-image-result-item.md @@ -16,7 +16,7 @@ The `NormalizedImageResultItem` class is an extension of [`CapturedResultItem`]( *Namespace:* com.dynamsoft.ddn -*Assembly:* DynamsoftDocumentNormalizer.aar +*Assembly:* DynamsoftCaptureVisionBundle.aar ```java class NormalizedImageResultItem extends CapturedResultItem diff --git a/programming/android/api-reference/normalized-image-unit.md b/programming/android/api-reference/normalized-image-unit.md index b40f69a..e2e3ea9 100644 --- a/programming/android/api-reference/normalized-image-unit.md +++ b/programming/android/api-reference/normalized-image-unit.md @@ -16,7 +16,7 @@ The `NormalizedImagesUnit` class represents an intermediate result unit whose ty *Namespace:* com.dynamsoft.ddn.intermediate_results -*Assembly:* DynamsoftDocumentNormalizer.aar +*Assembly:* DynamsoftCaptureVisionBundle.aar ```java class NormalizedImagesUnit extends IntermediateResultUnit diff --git a/programming/android/api-reference/normalized-images-result.md b/programming/android/api-reference/normalized-images-result.md index 27aeac2..bc6fd6d 100644 --- a/programming/android/api-reference/normalized-images-result.md +++ b/programming/android/api-reference/normalized-images-result.md @@ -16,7 +16,7 @@ The `NormalizedImagesResult` class represents a collection of [`NormalizedImageR *Namespace:* com.dynamsoft.ddn -*Assembly:* DynamsoftDocumentNormalizer.aar +*Assembly:* DynamsoftCaptureVisionBundle.aar ```java class NormalizedImagesResult diff --git a/programming/android/api-reference/processed-document-result.md b/programming/android/api-reference/processed-document-result.md new file mode 100644 index 0000000..011b754 --- /dev/null +++ b/programming/android/api-reference/processed-document-result.md @@ -0,0 +1,77 @@ +--- +layout: default-layout +title: ProcessedDocumentResult - Dynamsoft Document Normalizer Android SDK API Reference +description: The class ProcessedDocumentResult represents a collection of captured result items whose types are detected boundaries, deskew images or enhanced images. +keywords: detected boundaries, deskew images, enhanced images, java, kotlin +needGenerateH3Content: true +needAutoGenerateSidebar: true +noTitleIndex: true +--- + +# ProcessedDocumentResult + +The class `ProcessedDocumentResult` represents a collection of captured result items whose types are detected boundaries, deskew images or enhanced images. + +## Definition + +*Namespace:* com.dynamsoft.ddn + +*Assembly:* DynamsoftCaptureVisionBundle.aar + +```java +class ProcessedDocumentResult +``` + +## Methods + +| Methods | Description | +| ---------- | ----------- | +| [`getDeskewedImageResultItems`](#getdeskewedimageresultitems) | Gets the deskew images with an array of [`DeskewedImageResultItem`](deskewed-image-result-item.md). | +| [`getDetectedQuadResultItems`](#getdetectedquadresultitems) | Gets the detected boundaries with an array of [`DetectedImageResultItem`](detected-image-result-item.md). | +| [`getEnhancedImageResultItems`](#getenhancedimageresultitems) | Gets the enhanced images with an array of [`EnhancedImageResultItem`](enhanced-image-result-item.md). | + +The following methods are inherited from [`CapturedResultBase`]({{ site.dcv_android_api }}core/basic-structures/captured-result-base.html): + +| Method | Description | +| ------ | ----------- | +| [`getOriginalImageHashId`]({{ site.dcv_android_api }}core/basic-structures/captured-result-base.html#getoriginalimagehashid) | Gets the hash id of the original image. | +| [`getOriginalImageTag`]({{ site.dcv_android_api }}core/basic-structures/captured-result-base.html#getoriginalimagetag) | Gets the [ImageTag](image-tag.md) of the original image. | +| [`getRotationTransformMatrix`]({{ site.dcv_android_api }}core/basic-structures/captured-result-base.html#getrotationtransformmatrix) | Gets the rotation transformation matrix of the original image relative to the rotated image. | +| [`getErrorCode`]({{ site.dcv_android_api }}core/basic-structures/captured-result-base.html#geterrorcode) | Gets the error code of this result. | +| [`getErrorMessage`]({{ site.dcv_android_api }}core/basic-structures/captured-result-base.html#geterrormessage) | Gets the error message of this result. | + +### getDeskewedImageResultItems + +Returns an array of [`DeskewedImageResultItem`](deskewed-image-result-item.md) objects, where each `DeskewedImageResultItem` represents a single deskewed image. + +```java +DeskewedImageResultItem[] getDeskewedImageResultItems(); +``` + +**Return Value** + +The array of the deskewed image result items. + +### getDetectedQuadResultItems + +Returns an array of [`DetectedQuadResultItem`](detected-quad-result-item.md) objects, where each `DetectedQuadResultItem` represents a single detected boundary. + +```java +DetectedQuadResultItem[] getDetectedQuadResultItems(); +``` + +**Return Value** + +The array of the detected quad result items. + +### getEnhancedImageResultItems + +Returns an array of [`EnhancedImageResultItem`](enhanced-image-result-item.md) objects, where each `EnhancedImageResultItem` represents a single enhnanced image. + +```java +EnhancedImageResultItem[] getEnhancedImageResultItems(); +``` + +**Return Value** + +The array of the enhanced image result items. diff --git a/programming/android/api-reference/simplified-document-normalizer-settings.md b/programming/android/api-reference/simplified-document-normalizer-settings.md index ff518af..7442b81 100644 --- a/programming/android/api-reference/simplified-document-normalizer-settings.md +++ b/programming/android/api-reference/simplified-document-normalizer-settings.md @@ -16,7 +16,7 @@ The `SimplifiedDocumentNormalizerSettings` class represents a series of simple s *Namespace:* com.dynamsoft.ddn -*Assembly:* DynamsoftDocumentNormalizer.aar +*Assembly:* DynamsoftCaptureVisionBundle.aar ```java class SimplifiedDocumentNormalizerSettings diff --git a/programming/android/user-guide-v2.6.1003.md b/programming/android/user-guide-v2.6.1003.md new file mode 100644 index 0000000..93cd08b --- /dev/null +++ b/programming/android/user-guide-v2.6.1003.md @@ -0,0 +1,403 @@ +--- +layout: default-layout +title: Detect and Normalize Document - Android User Guide +description: This page introduce how to detect and normalize document with Dynamsoft Capture Vision Android SDK. +keywords: user guide, android, document scanner +needAutoGenerateSidebar: true +needGenerateH4Content: true +noTitleIndex: true +permalink: /programming/android/user-guide.html +--- + +# Android User Guide for Document Scanner Integration + +In this guide, you will learn step by step on how to build a document scanner application with Dynamsoft Capture Vision Android SDK. + +- [Android User Guide for Document Scanner Integration](#android-user-guide-for-document-scanner-integration) + - [Requirements](#requirements) + - [Add the SDK](#add-the-sdk) + - [Build Your First Application](#build-your-first-application) + - [Create a New Project](#create-a-new-project) + - [Include the Library](#include-the-library) + - [Initialize License](#initialize-license) + - [MainActivity for Realtime Document Normalization](#mainactivity-for-realtime-document-normalization) + - [Initialize Camera Module](#initialize-camera-module) + - [Initialize Capture Vision Router](#initialize-capture-vision-router) + - [Add a Captured Result Receiver and Filter](#add-a-captured-result-receiver-and-filter) + - [Start and Stop Video Document Normalization](#start-and-stop-video-document-normalization) + - [Additional Steps in MainActivity](#additional-steps-in-mainactivity) + - [ResultActivity for Displaying the Normalized Image](#resultactivity-for-displaying-the-normalized-image) + - [Display the Normalized Image](#display-the-normalized-image) + - [Build and Run the Project](#build-and-run-the-project) + +## Requirements + +- Supported OS: Android 5.0 (API Level 21) or higher. +- Supported ABI: **armeabi-v7a**, **arm64-v8a**, **x86** and **x86_64**. +- Development Environment: Android Studio 2022.2.1 or higher. + +## Add the SDK + +1. Open the file `[App Project Root Path]\app\build.gradle` and add the Maven repository: + + ```groovy + allprojects { + repositories { + maven { + url "https://download2.dynamsoft.com/maven/aar" + } + } + } + ``` + +2. Add the references in the dependencies: + + ```groovy + dependencies { + implementation 'com.dynamsoft:dynamsoftcapturevisionbundle:2.6.1003' + } + ``` + + > Read more about the modules of [dynamsoftcapturevisionbundle]({{site.dcv_android_api}}index.html) + +## Build Your First Application + +In this section, let's see how to create a HelloWorld app for detecting and normalizing documents from camera video input. + +>Note: +> +> - Android Studio 2022.2.1 is used here in this guide. +> - You can get the similar source code of the HelloWorld app from the following link +> - [DocumentScanner Android Sample](https://github.com/Dynamsoft/capture-vision-mobile-samples/tree/main/Android/DocumentScanner){:target="_blank"}. + +### Create a New Project + +1. Open Android Studio, select **File > New > New Project**. + +2. Choose the correct template for your project. In this sample, we use **Empty Activity**. + +3. When prompted, choose your app name 'HelloWorld' and set the **Save** location, **Language**, and **Minimum SDK** (we use 21 here). + > Note: + > + > - With **minSdkVersion** set to 21, your app is compatible with more than 94.1% of devices on the Google Play Store (last update: March 2021). + +### Include the Library + +Add the SDK to your new project. Please read [Add the SDK](#add-the-sdk) section for more details. + +### Initialize License + +1. Import the `LicenseManager` class and initialize the license in the file `MyApplication.java`. + + ```java + import com.dynamsoft.license.LicenseManager; + + public class MyApplication extends Application { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + LicenseManager.initLicense("DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9", this, (isSuccess, error) -> { + if (!isSuccess) { + Log.e("License", "InitLicense Error: " + error); + } + }); + } + ``` + + >Note: + > + >- The license string here grants a time-limited free trial which requires network connection to work. + >- You can request a 30-day trial license via the [Request a Trial License](https://www.dynamsoft.com/customer/license/trialLicense?product=ddn&utm_source=guide&package=android){:target="_blank"} link + +### MainActivity for Realtime Document Normalization + +#### Initialize Camera Module + +1. In the Project window, open **app > res > layout > `activity_main.xml`** and create a DCE camera view section under the root node. + + ```xml + + + ``` + +2. Import the camera module, initialize the camera view and bind to the created Camera Enhancer instance in the file `MainActivity.java`. + + ```java + ... + + import com.dynamsoft.dce.CameraView; + import com.dynamsoft.dce.CameraEnhancer; + import com.dynamsoft.dce.CameraEnhancerException; + import com.dynamsoft.dce.utils.PermissionUtil; + + public class MainActivity extends AppCompatActivity { + private CameraEnhancer mCamera; + + @Override + protected void onCreate(Bundle savedInstanceState) { + + ... + + CameraView cameraView = findViewById(R.id.camera_view); + mCamera = new CameraEnhancer(cameraView, MainActivity.this); + + PermissionUtil.requestCameraPermission(MainActivity.this); + } + } + ``` + +#### Initialize Capture Vision Router + +1. Import and initialize the capture vision router, and set the created Camera Enhancer instance as the input image source. + + ```java + ... + + import com.dynamsoft.cvr.CaptureVisionRouter; + import com.dynamsoft.cvr.CaptureVisionRouterException; + + public class MainActivity extends AppCompatActivity { + + ... + + private CaptureVisionRouter mRouter; + + @Override + protected void onCreate(Bundle savedInstanceState) { + + ... + + mRouter = new CaptureVisionRouter(MainActivity.this); + try { + mRouter.setInput(mCamera); + } catch (CaptureVisionRouterException e) { + e.printStackTrace(); + } + } + } + ``` + +#### Add a Captured Result Receiver and Filter + +1. Add a result receiver to get the normalized image results. + + ```java + ... + + import com.dynamsoft.core.basic_structures.CapturedResultReceiver; + import com.dynamsoft.core.basic_structures.ImageData; + import com.dynamsoft.cvr.EnumPresetTemplate; + import com.dynamsoft.ddn.NormalizedImagesResult; + + public class MainActivity extends AppCompatActivity { + + ... + + public static ImageData mNormalizedImageData; + private boolean mJumpToOtherActivity = false; + + @Override + protected void onCreate(Bundle savedInstanceState) { + + ... + + mRouter.addResultReceiver(new CapturedResultReceiver() { + @Override + public void onNormalizedImagesReceived(NormalizedImagesResult result) { + if (result.getItems().length > 0) { + NormalizedImageResultItem normalizedImageResultItem = result.getItems()[0]; + if (normalizedImageResultItem.getCrossVerificationStatus() == EnumCrossVerificationStatus.CVS_PASSED || mJumpToOtherActivity) + { + mJumpToOtherActivity = false; + mNormalizedImageData = result.getItems()[0].getImageData(); + + Intent intent = new Intent(MainActivity.this, ResultActivity.class); + startActivity(intent); + } + } + } + }); + } + } + ``` + +2. Add a result cross filter to validate the normalized image result across multiple frames. + + ```java + ... + import com.dynamsoft.core.basic_structures.EnumCapturedResultItemType; + import com.dynamsoft.utility.MultiFrameResultCrossFilter; + + public class MainActivity extends AppCompatActivity { + + ... + + @Override + protected void onCreate(Bundle savedInstanceState) { + + ... + MultiFrameResultCrossFilter filter = new MultiFrameResultCrossFilter(); + filter.enableResultCrossVerification(EnumCapturedResultItemType.CRIT_NORMALIZED_IMAGE, true); + mRouter.addResultFilter(filter); + } + } + ``` + +#### Start and Stop Video Document Normalization + +1. Override the `MainActivity.onResume` function to open camera and start video document normalization, override the `MainActivity.onPause` function to close camera and stop video document normalization. + + ```java + public class MainActivity extends AppCompatActivity { + + ... + + @Override + public void onResume() { + super.onResume(); + try { + mCamera.open(); + mRouter.startCapturing(EnumPresetTemplate.PT_DETECT_AND_NORMALIZE_DOCUMENT, new CompletionListener() { + @Override + public void onSuccess() { + + } + @Override + public void onFailure(int i, String s) { + Log.e(TAG, "onFailure: "+s); + } + }); + } catch (CameraEnhancerException e) { + e.printStackTrace(); + } + } + + @Override + public void onPause() { + super.onPause(); + try { + mCamera.close(); + } catch (CameraEnhancerException e) { + e.printStackTrace(); + } + + mRouter.stopCapturing(); + } + } + ``` + +2. Add `onCaptureBtnClick` function to start the video document normalization. After start capturing, the SDK will process the video frames from the Camera Enhancer, then send the normalized image results to the registered result receiver. + + ```java + public class MainActivity extends AppCompatActivity { + + ... + + public void onCaptureBtnClick(View v) { + mJumpToOtherActivity = true; + } + } + ``` + +#### Additional Steps in MainActivity + +1. In the Project window, open **app > res > layout > `activity_main.xml`**, create a button under the root node to capture the quads detected on the image. + + ```xml + ... + +