Skip to content

Commit efa154d

Browse files
Merge pull request #35 from dynamsoft-docs/preview
update to internal commit 54e0f0cc
2 parents d2470bb + 304d1d5 commit efa154d

File tree

8 files changed

+393
-37
lines changed

8 files changed

+393
-37
lines changed

_data/product_version.yml

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ version_info_list:
2424
- 2.2.0_c
2525
- 2.0.0_c
2626
- 2.0.0_dotnet
27+
- 2.2.10_java
2728
- 2.0.0_java
2829
- value: 1.x
2930
child:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
---
2+
layout: default-layout
3+
title: Class DLRRuntimeSettings - Dynamsoft Label Recognizer Java Edition
4+
description: This page shows the DLRRuntimeSettings struct of Dynamsoft Label Recognizer for Java Language.
5+
keywords: DLRRuntimeSettings, struct, java
6+
needAutoGenerateSidebar: true
7+
needGenerateH3Content: true
8+
noTitleIndex: true
9+
permalink: /programming/java/api-reference/dlr-runtime-settings-v2.0.0.html
10+
---
11+
12+
13+
# DLRRuntimeSettings
14+
Defines a struct to configure the text recognizer runtime settings. These settings control the text recognition process.
15+
16+
```java
17+
class com.dynamsoft.dlr.DLRRuntimeSettings
18+
```
19+
20+
## Attributes
21+
22+
| Attribute | Type |
23+
|---------- | ---- |
24+
| [`maxThreadCount`](#maxthreadcount) | *int* |
25+
| [`characterModelName`](#charactermodelname) | *String* |
26+
| [`referenceRegion`](#referenceregion) | [`DLRReferenceRegion`](dlr-reference-region.md) |
27+
| [`textArea`](#textarea) | [`DLRQuadrilateral`](dlr-quadrilateral.md) |
28+
| [`dictionaryPath`](#dictionarypath) | *String* |
29+
| [`dictionaryCorrectionThreshold`](#dictionarycorrectionthreshold) | [`DLRDictionaryCorrectionThreshold`](dlr-dictionary-correction-threshold.md) |
30+
| [`binarizationModes`](#binarizationmodes) | *int\[\]* |
31+
| [`furtherModes`](#furthermodes) | [`DLRFurtherModes`](dlr-further-modes.md)|
32+
33+
 
34+
35+
### maxThreadCount
36+
Sets the number of threads the algorithm will use to recognize label.
37+
38+
```java
39+
int maxThreadCount
40+
```
41+
42+
**Value Range**
43+
44+
[1, 4]
45+
46+
**Default value**
47+
48+
4
49+
50+
**Remarks**
51+
52+
To keep a balance between speed and quality, the library concurrently runs four different threads by default.
53+
54+
 
55+
56+
### characterModelName
57+
The name of the CharacterModel.
58+
59+
```java
60+
String characterModelName
61+
```
62+
63+
 
64+
65+
### referenceRegion
66+
Sets the reference region to search for text.
67+
68+
```java
69+
DLRReferenceRegion referenceRegion
70+
```
71+
72+
 
73+
74+
### textArea
75+
Sets the text area relative to the reference region.
76+
77+
```java
78+
Quadrilateral textArea
79+
```
80+
81+
 
82+
83+
### dictionaryPath
84+
Sets the path of the dictionary file.
85+
86+
```java
87+
String dictionaryPath
88+
```
89+
90+
 
91+
92+
### dictionaryCorrectionThreshold
93+
Sets the threshold of dictionary error correction.
94+
95+
```java
96+
DLRDictionaryCorrectionThreshold dictionaryCorrectionThreshold
97+
```
98+
99+
100+
 
101+
102+
### binarizationModes
103+
Sets the mode and priority for binarization.
104+
105+
```java
106+
int[] binarizationModes
107+
```
108+
109+
**Value Range**
110+
111+
Each array item can be any one of the [`EnumBinarizationMode`]({{ site.dlr_enumerations }}binarization-mode.html) Enumeration items.
112+
113+
**Default value**
114+
115+
`[EnumBinarizationMode.BM_LOCAL_BLOCK, EnumBinarizationMode.BM_SKIP, EnumBinarizationMode.BM_SKIP, EnumBinarizationMode.BM_SKIP, EnumBinarizationMode.BM_SKIP, EnumBinarizationMode.BM_SKIP, EnumBinarizationMode.BM_SKIP, EnumBinarizationMode.BM_SKIP]`
116+
117+
**Remarks**
118+
119+
The array index represents the priority of the item. The smaller index is, the higher priority is.
120+
121+
 
122+
123+
### furtherModes
124+
Sets further modes.
125+
126+
```java
127+
DLRFurtherModes furtherModes
128+
```
129+
130+
**See also**
131+
132+
[`DLRFurtherModes`](dlr-further-modes.md)

programming-old/java/api-reference/dlr-runtime-settings.md

+19
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class com.dynamsoft.dlr.DLRRuntimeSettings
2929
| [`dictionaryCorrectionThreshold`](#dictionarycorrectionthreshold) | [`DLRDictionaryCorrectionThreshold`](dlr-dictionary-correction-threshold.md) |
3030
| [`binarizationModes`](#binarizationmodes) | *int\[\]* |
3131
| [`furtherModes`](#furthermodes) | [`DLRFurtherModes`](dlr-further-modes.md)|
32+
| [`timeout`](#timeout) | *int* |
3233

3334
 
3435

@@ -132,3 +133,21 @@ DLRFurtherModes furtherModes
132133

133134
[`DLRFurtherModes`](dlr-further-modes.md)
134135

136+
 
137+
138+
### timeout
139+
140+
Sets the maximum amount of time (in milliseconds) that should be spent searching for labels per page. It does not include the time taken to load/decode an image (TIFF, PNG, etc.) from disk into memory.
141+
142+
```cpp
143+
int timeout
144+
```
145+
146+
**Value Range**
147+
[0, 0x7fffffff]
148+
149+
**Default value**
150+
10000
151+
152+
**Remarks**
153+
If you want to stop searching for labels after a certain period of time, you can use this parameter to set a timeout.

programming-old/java/release-notes/index.md

+1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@ permalink: /programming/java/release-notes/index.html
99

1010
# Release Notes - Java
1111

12+
- [2.2.10 (06/27/2024)](java-2.md#2210-06272024)
1213
- [2.0 (08/26/2021)](java-2.md#20-08262021)
1314
- [1.2.1 (06/08/2021)](java-1.md#121-06082021)

programming-old/java/release-notes/java-2.md

+22
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,28 @@ permalink: /programming/java/release-notes/java-2.html
99

1010
# Release Notes - Java 2.x
1111

12+
## 2.2.10 (06/27/2024)
13+
14+
### Highlights
15+
16+
{%- include release-notes/product-highlight-2.2.md -%}
17+
18+
### Changelog
19+
20+
#### New
21+
22+
- Added a new property [`timeout`](../../java/api-reference/dlr-runtime-settings.md#timeout) to [`DLRRuntimeSettings`](../../java/api-reference/dlr-runtime-settings.md) class.
23+
- Added modes parameter `CharacterNormalizationModes` to normalize the text. The parameter is available under the following classes:
24+
- `LabelRecognizerParameter`
25+
- `TextArea`
26+
- `LineSpecification`
27+
28+
#### Improved
29+
30+
- Reduced the size of MRZ model from 10MB to 2.56MB.
31+
- Improved single-line text confidence. This enables users to implement a result confidence filter to improve the recognition accuracy.
32+
- Improved character segmentation when processing some connected characters. This improves the recognition accuracy.
33+
1234
## 2.0 (08/26/2021)
1335

1436
### Highlights
+137
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
---
2+
layout: default-layout
3+
title: Java User Guide - Dynamsoft Label Recognizer
4+
description: This is the user guide page of Dynamsoft Label Recognizer for Java Language.
5+
keywords: java, user guide
6+
needAutoGenerateSidebar: true
7+
needGenerateH3Content: true
8+
permalink: /programming/java/user-guide-v2.0.0.html
9+
---
10+
11+
# User Guide - Java
12+
13+
- [User Guide - Java](#user-guide---java)
14+
- [Requirements](#requirements)
15+
- [Installation](#installation)
16+
- [Build your First Application](#build-your-first-application)
17+
- [Create a New Project](#create-a-new-project)
18+
- [Include the Label Recognizer library](#include-the-label-recognizer-library)
19+
- [Initialize the Label Recognizer](#initialize-the-label-recognizer)
20+
- [Recognition Process and How to Use the Results](#recognition-process-and-how-to-use-the-results)
21+
- [Build and Run the Project](#build-and-run-the-project)
22+
23+
## Requirements
24+
25+
- Operating systems:
26+
- Windows 7, 8, 10
27+
- Windows Server 2003, 2008, 2008 R2, 2012
28+
- Linux x64 (Ubuntu 14.04.4+ LTS, Debian 8+, etc.)
29+
- JDK 1.7 and above
30+
31+
- Environment: Eclipse 3.7 and above.
32+
33+
## Installation
34+
35+
If you don't have SDK yet, please go to <a href="https://www.dynamsoft.com/survey/dlr/?utm_source=docs" target="_blank">Dynamsoft website</a> to get it. After the sdk is decompressed, the root directory of the DLR installation package is `DynamsoftLabelRecognizer`, which is represented by `[INSTALLATION FOLDER]`.
36+
37+
## Build your First Application
38+
39+
Let's start by creating a console application which demonstrates how to use the minimum code to recognize text from an image file.
40+
41+
>You can download the similar complete source code from [Here](https://github.com/Dynamsoft/label-recognizer-java-samples/tree/master/samples/HelloWorld).
42+
43+
### Create a New Project
44+
45+
1. Open Eclipse. Go to File > New > Project, create a new Java project `DLRJavaSample`.
46+
47+
2. Add a new Class named `DLRJavaSample` into the project.
48+
49+
### Include the Label Recognizer library
50+
51+
1. Add the Dynamsoft Label Recognizer JAR file to your project.
52+
Click File > Properties > Java Build Path > Libraries > Add external JARs, add `dynamsoft-labelrecognizer-{version number}.jar` and `dynamsoft-core-{version number}.jar` click Apply.
53+
>Note: The JAR file can be found at `[INSTALLATION FOLDER]\lib`.
54+
55+
2. Import the package in the file `DLRJavaSample.java`
56+
57+
```java
58+
import com.dynamsoft.dlr.*;
59+
```
60+
61+
### Initialize the Label Recognizer
62+
63+
1. Initialize the license key
64+
65+
```java
66+
// 1.Initialize license.
67+
LabelRecognizer.initLicense("DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSIsInByb2R1Y3RzIjoyfQ==");
68+
```
69+
70+
>Note:
71+
>- Network connection is required for the license to work.
72+
>- "DLS2***" is a default free public trial license used in the sample.
73+
>- You can request a 30-day trial license via the [Request a Trial License](https://www.dynamsoft.com/customer/license/trialLicense?product=dlr&utm_source=guide&package=java){:target="_blank"} link.
74+
75+
2. Create an instance of Dynamsoft Label Recognizer
76+
77+
```java
78+
// 2.Create an instance of Label Recognizer.
79+
LabelRecognizer dlr = new LabelRecognizer();
80+
```
81+
82+
### Recognition Process and How to Use the Results
83+
84+
1. Recognizing text in an image
85+
86+
```java
87+
DLRResult[] results = null;
88+
89+
try {
90+
results = dlr.recognizeByFile("../../SampleImages/dlr-sample-vin.png", "");
91+
} catch (LabelRecognizerException ex) {
92+
ex.printStackTrace();
93+
}
94+
```
95+
96+
>You can download the image [dlr-sample-vin.png](../assets/dlr-sample-vin.png) for testing. In addition, you can replace it with the full path of the image you want to recognize.
97+
>For the error handling mechanism, when an error occurs during the recognition process, an exception will be thrown. You should add codes for error handling based on your needs. Check out [Error Code]({{site.dlr_enumerations}}error-code.html) for full supported error codes.
98+
99+
2. Get and output the recognition results
100+
101+
```java
102+
if (results != null && results.length > 0) {
103+
for (int i = 0; i < results.length; i++) {
104+
105+
// Get result of each text area (also called label).
106+
DLRResult result = results[i];
107+
System.out.println("Result " + i + ":");
108+
for (int j = 0; j < result.lineResults.length; j++) {
109+
110+
// Get the result of each text line in the label.
111+
DLRLineResult lineResult = result.lineResults[j];
112+
System.out.println(">>Line Result " + j + ": " + lineResult.text);
113+
}
114+
}
115+
} else {
116+
System.out.println("No data detected.");
117+
}
118+
```
119+
120+
The recognition results of SDK are organized into a four-tier structure:
121+
- `DLRResult[]` corresponds to the results of an `image`
122+
- `DLRResult` corresponds to the result of a `TextArea` (also called Label)
123+
- `DLRLineResult` corresponds to the result of each `TextLine` in the Label
124+
- `DLRCharacterResult` corresponds to the result of each `Character` in the `TextLine`
125+
126+
The structure is shown in the figure below:
127+
128+
<div align="center">
129+
<img src="../assets/dlr_result2.png" alt="DLR Result Structure" width="80%"/>
130+
<p>Figure 1DLR Result Structure</p>
131+
</div>
132+
133+
You can download the similar complete source code from [Here](https://github.com/Dynamsoft/label-recognizer-java-samples/tree/master/samples/HelloWorld).
134+
135+
### Build and Run the Project
136+
137+
1. Right click the project, click Run As > Java Application.

0 commit comments

Comments
 (0)