Skip to content

Commit d49e9a1

Browse files
Merge pull request #51 from dynamsoft-docs/preview
Preview
2 parents 765c228 + 279aeca commit d49e9a1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1959
-257
lines changed

_includes/api-reference/drawing-item-ios.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,56 @@
66

77
The property that identifies the ID of the `DrawingStyle`.
88

9+
<div class="sample-code-prefix"></div>
10+
>- Objective-C
11+
>- Swift
12+
>
13+
>1.
914
```objc
1015
@property (assign, nonatomic) NSInteger drawingStyleId;
1116
```
17+
2.
18+
```swift
19+
var drawingStyleId: Int { get set }
20+
```
1221

1322
&nbsp;
1423

1524
## state
1625

1726
The property that indicates the state of the `DrawingItem`. View all available `DrawingItem` states in [`EnumDrawingItemState`]({{ site.ios_camera_enhancer }}enum-drawing-item-state.html).
1827

28+
<div class="sample-code-prefix"></div>
29+
>- Objective-C
30+
>- Swift
31+
>
32+
>1.
1933
```objc
2034
@property (assign, nonatomic) EnumDrawingItemState state;
2135
```
36+
2.
37+
```swift
38+
var state: EnumDrawingItemState { get set }
39+
```
2240

2341
&nbsp;
2442

2543
## getMediaType
2644

2745
Get the media type of the `DrawingItem`.
2846

47+
<div class="sample-code-prefix"></div>
48+
>- Objective-C
49+
>- Swift
50+
>
51+
>1.
2952
```objc
3053
- (EnumDrawingItemMediaType) getMediaType;
3154
```
55+
2.
56+
```swift
57+
func getMediaType() -> EnumDrawingItemMediaType
58+
```
3259

3360
**Return Value**
3461

assets/visible-region.png

11.1 KB
Loading

programming/android/api-reference/camera-enhancer/dcecameraview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ Get the visible region of the video streaming.
321321
When the shape of your camera view is quite different from the shape of the video streaming, there might exist a large area that is invisible. You can use this method to get the region of this invisible area.
322322

323323
<div align="center">
324-
<p><img src="../../assets/visible-region.png" width="30%" alt="visible-region"></p>
324+
<p><img src="../../../../assets/visible-region.png" width="30%" alt="visible-region"></p>
325325
<p>What's Visible Region</p>
326326
</div>
327327

programming/android/api-reference/document-normalizer-normalizing.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ try {
209209

210210
DetectedQuadResult[] quads = normalizer.detectQuad(buffer);
211211
if(quads.length > 0) {
212-
NormalizedImageResult normalizedImage = normalizer.normalize(buffer, quads[0]);
212+
NormalizedImageResult normalizedImage = normalizer.normalize(buffer, quads[0].location);
213213
}
214214
} catch (DocumentNormalizerException e) {
215215
e.printStackTrace();
@@ -247,7 +247,7 @@ try {
247247

248248
DetectedQuadResult[] quads = normalizer.detectQuad(imageFilePath);
249249
if(quads.length > 0) {
250-
NormalizedImageResult normalizedImage = normalizer.normalize(imageFilePath, quads[0]);
250+
NormalizedImageResult normalizedImage = normalizer.normalize(imageFilePath, quads[0].location);
251251
}
252252
} catch (DocumentNormalizerException e) {
253253
e.printStackTrace();
@@ -286,7 +286,7 @@ try {
286286

287287
DetectedQuadResult[] quads = normalizer.detectQuad(bitmap);
288288
if(quads.length > 0) {
289-
NormalizedImageResult normalizedImage = normalizer.normalize(bitmap, quads[0]);
289+
NormalizedImageResult normalizedImage = normalizer.normalize(bitmap, quads[0].location);
290290
}
291291
} catch (DocumentNormalizerException e) {
292292
e.printStackTrace();

programming/android/api-reference/document-normalizer-settings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,5 +108,5 @@ The output JSON string which stores the contents of runtime settings.
108108

109109
```java
110110
DocumentNormalizer reader = new DocumentNormalizer();
111-
String settingStr = reader.outputSettingsToString("");
111+
String settingStr = reader.outputRuntimeSettings("");
112112
```

programming/android/api-reference/document-normalizer-video.md

Lines changed: 62 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -4,43 +4,17 @@ title: Dynamsoft Document Normalizer Android API Reference - Camera Methods
44
description: This page shows Camera methods of Dynamsoft Document Normalizer for Android SDK.
55
keywords: Camera methods, DocumentNormalizer, api reference, android
66
needAutoGenerateSidebar: true
7+
needGenerateH3Content: true
78
noTitleIndex: true
89
pageStartVer: 1.0
910
---
1011

1112

1213
# Video Detecting Methods
1314

14-
> Note:
15-
>
16-
> - You have to include `CameraEnhancer` when using **Video Detecting Methods**.
17-
> - `CameraEnhancer` provide APIs that help you quickly deploy a camera module and capture video streaming for document normalizer.
18-
> - Through **Video Detecting Methods** you can control whether to start video streaming document detecting and get the detection results.
19-
20-
| Method | Description |
21-
|--------|-------------|
22-
| [`setImageSource`](#setimagesource) | Sets an instance of ImageSource to get images. |
23-
| [`startDetecting`](#startdetecting) | Start the document quad detection thread in the video streaming scenario. |
24-
| [`stopDetecting`](#stopdetecting) | Stop the document quad detection thread in the video streaming scenario. |
25-
| [`setDetectResultListener`](#setdetectresultlistener) | Set callback interface to process detection results generated during frame detecting. |
26-
27-
---
28-
29-
## setImageSource
15+
## How to Implement Video Detecting
3016

31-
Sets an instance of ImageSource to get images. `CameraEnhancer` is a specific implementation of ImageSource, which can help the Document Normalizer to acquire video frames continuously for recognition.
32-
33-
```java
34-
void setImageSource(ImageSource source)
35-
```
36-
37-
**Parameters**
38-
39-
`[in] source`: An instance of ImageSource. If you are using `Dynamsoft Camera Enhancer`(DCE) to capture camera frames, pass an instance of `CameraEnhancer`.
40-
41-
**Code Snippet**
42-
43-
This code snippet displays a complete code on how to add CameraEnhancer to your project and start detecting and get detection results from the video streaming.
17+
This code snippet displays a complete code on how to configure camera module, start detecting and get detection results from the video streaming.
4418

4519
```java
4620
DocumentNormalizer normalizer;
@@ -103,7 +77,46 @@ public void onPause() {
10377
}
10478
```
10579

106-
## startDetecting
80+
> Note:
81+
>
82+
> - `DynamsoftCameraEnhancer` library is included when implementing **Video Quad Detecting**. It provides APIs that help you quickly deploy a camera module and capture video streaming for document normalizer.
83+
84+
## Methods
85+
86+
Use the following methods to control the start/stop of video streaming document detecting and get the detection results.
87+
88+
| Method | Description |
89+
|--------|-------------|
90+
| [`setImageSource`](#setimagesource) | Sets an instance of ImageSource to get images. |
91+
| [`startDetecting`](#startdetecting) | Start the document quad detection thread in the video streaming scenario. |
92+
| [`stopDetecting`](#stopdetecting) | Stop the document quad detection thread in the video streaming scenario. |
93+
| [`setDetectResultListener`](#setdetectresultlistener) | Set callback interface to process detection results generated during frame detecting. |
94+
95+
---
96+
97+
### setImageSource
98+
99+
Sets an instance of ImageSource to get images. `CameraEnhancer` is a specific implementation of ImageSource, which can help the Document Normalizer to acquire video frames continuously for recognition.
100+
101+
```java
102+
void setImageSource(ImageSource source)
103+
```
104+
105+
**Parameters**
106+
107+
`[in] source`: An instance of ImageSource. If you are using `Dynamsoft Camera Enhancer`(DCE) to capture camera frames, pass an instance of `CameraEnhancer`.
108+
109+
**Code Snippet**
110+
111+
```java
112+
// Create an instance of DynamsoftCameraEnhancer and set it as the image source.
113+
DCECameraView cameraView = findViewById(R.id.cameraView);
114+
CameraEnhancer mCameraEnhancer; = new CameraEnhancer(MainActivity.this);
115+
mCameraEnhancer.setCameraView(cameraView);
116+
normalizer.setImageSource(mCameraEnhancer);
117+
```
118+
119+
### startDetecting
107120

108121
Start the document quad detection thread in the video streaming scenario. Please be sure that you have bound a Camera Enhancer to the document normalizer before you trigger `startDetecting`.
109122

@@ -113,9 +126,11 @@ void startDetecting()
113126

114127
**Code Snippet**
115128

116-
You can view the complete code snippet in [`setImageSource`](#setimagesource).
129+
```java
130+
normalizer.startDetecting();
131+
```
117132

118-
## stopDetecting
133+
### stopDetecting
119134

120135
Stop the document quad detection thread in the video streaming scenario.
121136

@@ -125,9 +140,11 @@ void stopDetecting()
125140

126141
**Code Snippet**
127142

128-
You can view the complete code snippet in [`setImageSource`](#setimagesource).
143+
```java
144+
normalizer.startDetecting();
145+
```
129146

130-
## setDetectResultListener
147+
### setDetectResultListener
131148

132149
Set the callback interface to process detection results generated during frame detecting.
133150

@@ -141,4 +158,14 @@ void setDetectResultListener(DetectResultListener detectResultListener)
141158

142159
**Code Snippet**
143160

144-
You can view the complete code snippet in [`setImageSource`](#setimagesource).
161+
```java
162+
// Result callback configurations
163+
DetectResultListener mDetectResultListener = new DetectResultListener() {
164+
// Obtain the detected quad detection results and display.
165+
@Override
166+
public void detectResultCallback(int id, ImageData imageData, DetectedQuadResult[] detectedResults) {
167+
// Add your code to execute when quad detection results are returned.
168+
}
169+
};
170+
normalizer.setDetectResultListener(mDetectResultListener);
171+
```

programming/ios/api-reference/camera-enhancer/camera-enhancer-v3.0.0.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ let frameRate = dce.getFrameRate()
664664
Input one of the preset resolution value in Enumeration `Resolution`. The camera enhancer will try to set the resolution to the target value or the closest available value below the target value.
665665

666666
```objc
667-
- (Void)setResolution:(Resolution)resolution;
667+
- (void)setResolution:(Resolution)resolution;
668668
```
669669

670670
**Parameters**
@@ -722,7 +722,7 @@ let resolution = dce.getResolution()
722722
Set the zoom factor. Once `setZoom` is triggered and approved, the zoom factor of the activated camera will immediately become the input value.
723723

724724
```objc
725-
- (Void)setZoom:(CGFloat)factor
725+
- (void)setZoom:(CGFloat)factor
726726
```
727727

728728
**Parameters**
@@ -751,7 +751,7 @@ dce.setZoom(3.0)
751751
Set the focus position (value range from 0.0f to 1.0f) and trigger a focus at the configured position.
752752

753753
```objc
754-
- (Void)setFocus:(CGPoint)focusPosition;
754+
- (void)setFocus:(CGPoint)focusPosition;
755755
```
756756

757757
**Parameters**

programming/ios/api-reference/camera-enhancer/camera-enhancer-v3.0.1.md

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,11 @@ Select the camera position (front-facing or back-facing).
225225
```
226226
2.
227227
```swift
228-
try? dce.selectCameraWithPosition(EnumCameraPosition.back)
228+
do{
229+
try dce.selectCameraWithPosition(EnumCameraPosition.back)
230+
}catch{
231+
// Add your code to deal with the exceptions.
232+
}
229233
```
230234

231235
&nbsp;
@@ -283,7 +287,11 @@ Select camera by `cameraID`. The camera will be selected and further camera cont
283287
```
284288
2.
285289
```swift
286-
try? dce.selectCamera("BACK_FACING_CAMERA")
290+
do{
291+
try dce.selectCamera("BACK_FACING_CAMERA")
292+
catch{
293+
// Add your code to deal with the exceptions.
294+
}
287295
```
288296

289297
**Remarks**
@@ -684,7 +692,11 @@ The `EnumEnhancerFeatures` members:
684692
```
685693
2.
686694
```swift
687-
try? dce.enableFeatures(EnumEnhancerFeature.EnumFRAME_FILTER.rawValue)
695+
do{
696+
try dce.enableFeatures(EnumEnhancerFeature.EnumFRAME_FILTER.rawValue)
697+
catch{
698+
// Add your code to deal with the exceptions.
699+
}
688700
```
689701

690702
**Remarks**
@@ -800,7 +812,7 @@ let frameRate = dce.getFrameRate()
800812
Input one of the preset resolution value in Enumeration `Resolution`. The camera enhancer will try to set the resolution to the target value or the closest available value below the target value.
801813

802814
```objc
803-
- (Void)setResolution:(Resolution)resolution;
815+
- (void)setResolution:(Resolution)resolution;
804816
```
805817

806818
**Parameters**
@@ -858,7 +870,7 @@ let resolution = dce.getResolution()
858870
Set the zoom factor. Once `setZoom` is triggered and approved, the zoom factor of the activated camera will immediately become the input value.
859871

860872
```objc
861-
- (Void)setZoom:(CGFloat)factor
873+
- (void)setZoom:(CGFloat)factor
862874
```
863875

864876
**Parameters**
@@ -916,7 +928,7 @@ let maxZoomFactor = dce.getMaxZoomFactor()
916928
Set the focus position (value range from 0.0f to 1.0f) and trigger a focus at the configured position.
917929

918930
```objc
919-
- (Void)setFocus:(CGPoint)focusPosition;
931+
- (void)setFocus:(CGPoint)focusPosition;
920932
```
921933

922934
**Parameters**
@@ -978,7 +990,11 @@ scanRegion.regionBottom = 75
978990
scanRegion.regionLeft = 25
979991
scanRegion.regionRight = 75
980992
scanRegion.regionMeasuredByPercentage = 1
981-
try? dce.setScanRegion(scanRegion)
993+
do{
994+
try dce.setScanRegion(scanRegion)
995+
catch{
996+
// Add your code to deal with the exceptions.
997+
}
982998
```
983999

9841000
**Remarks**
@@ -1058,7 +1074,11 @@ Update the advanced camera controlling and video streaming processing parameters
10581074
```
10591075
2.
10601076
```swift
1061-
try? dce.updateAdvancedSettingsFromFile("Put your JSON file path here.")
1077+
do{
1078+
try dce.updateAdvancedSettingsFromFile("Put your JSON file path here.")
1079+
catch{
1080+
// Add your code to deal with the exceptions.
1081+
}
10621082
```
10631083

10641084
**Remarks**
@@ -1091,5 +1111,9 @@ Update the advanced camera controlling and video streaming processing parameters
10911111
```
10921112
2.
10931113
```swift
1094-
try? dce.updateAdvancedSettingsFromString("Put your stringified JSON data here.")
1114+
do{
1115+
try dce.updateAdvancedSettingsFromString("Put your stringified JSON data here.")
1116+
catch{
1117+
// Add your code to deal with the exceptions.
1118+
}
10951119
```

0 commit comments

Comments
 (0)