Skip to content

Commit a4b4126

Browse files
Updating side list and content
1 parent de61f53 commit a4b4126

4 files changed

Lines changed: 216 additions & 85 deletions

File tree

_includes/sidelist-programming/programming-android.html

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,13 @@
99
</li>
1010

1111
<li lang="android"><a href="{{ site.android }}user-guide/concept/capture-vision-architecture.html" class="otherLinkColour">Core Concepts</a></li>
12-
<!-- <li><a href="{{ site.android }}user-guide/concept/barcode-format.html" class="otherLinkColour">Barcode Formats</a></li> -->
13-
<!-- <li><a href="{{ site.android }}user-guide/concept/capture-vision-architecture.html" class="otherLinkColour">Capture Vision Architecture</a></li>
14-
<li><a class="otherLinkColour">Input-Process-Output</a></li>
15-
<li><a href="{{ site.android }}user-guide/concept/parameters-and-templates.html" class="otherLinkColour">Parameters, Settings & Templates</a></li> -->
16-
<!-- <li><a href="{{ site.android }}user-guide/concept/understand-barcode-results.html" class="otherLinkColour">Barcode Interpretation</a></li> -->
17-
<!-- <li><a href="{{ site.android }}user-guide/concept/models.html" class="otherLinkColour">Deep Learning Models</a></li> -->
18-
1912
<li lang="android"><a href="{{ site.android }}user-guide/capabilities/index.html" class="otherLinkColour">Functionality & Capabilities</a>
2013
<ul>
2114
<li lang="android"><a class="otherLinkColour">Input</a>
2215
<ul lang="android">
2316
<li lang="android"><a href="{{ site.android }}user-guide/capabilities/read-from-camera.html" class="otherLinkColour">Read from Camera</a></li>
2417
<li lang="android"><a href="{{ site.android }}user-guide/capabilities/read-from-an-image.html" class="otherLinkColour">Read from Image</a></li>
25-
<li lang="android"><a class="otherLinkColour">Advanced Camera Settings</a></li>
18+
<li lang="android"><a href="{{ site.android }}user-guide/capabilities/camera-control.html" class="otherLinkColour">Camera Focus Control</a></li>
2619
</ul>
2720
</li>
2821
<li lang="android"><a class="otherLinkColour">Control the Scanning Process</a>
@@ -32,10 +25,9 @@
3225
<li lang="android"><a href="{{ site.android }}user-guide/capabilities/barcode-formats.html" class="otherLinkColour">Configure Barcode Format</a></li>
3326
<li lang="android"><a href="{{ site.android }}user-guide/capabilities/read-specific-area.html" class="otherLinkColour">Read a specific area/region</a></li>
3427
<li lang="android"><a href="{{ site.android }}user-guide/capabilities/single-multiple.html" class="otherLinkColour">Switch Single & Multiple</a></li>
35-
<li lang="android"><a href="{{ site.android }}user-guide/capabilities/zoom-control.html" class="otherLinkColour">Zoom Control</a></li>
3628
</ul>
3729
</li>
38-
<li lang="android"><a href="{{ site.android }}user-guide/concept/understand-barcode-results.html" class="otherLinkColour">Working with Results</a>
30+
<li lang="android"><a class="otherLinkColour">Working with Results</a>
3931
<ul lang="android">
4032
<li lang="android"><a href="{{ site.features }}filter-and-sort.html?lang=android" class="otherLinkColour">Parameter Based Result Filter</a></li>
4133
<li lang="android"><a href="{{ site.android }}user-guide/capabilities/get-original-image.html" class="otherLinkColour">Get Original Image</a></li>
@@ -337,7 +329,6 @@
337329
</li>
338330
<li lang="android"><a>DynamsoftUtility</a>
339331
<ul lang="android">
340-
341332
<li lang="android"><a class="otherLinkColour">Classes</a>
342333
<ul lang="android">
343334
<li lang="android"><a href="{{ site.dcv_android_api }}utility/cross-verification-criteria.html" class="otherLinkColour">CrossVerificationCriteria</a></li>
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
---
2+
layout: default-layout
3+
title: Camera Control - Dynamsoft Barcode Reader Android
4+
description: Learn how to control the camera for Dynamsoft Barcode Reader Android, including zoom, focus and other features.
5+
keywords: camera, Android, auto-zoom, zoom, auto-focus, focus, enhanced features
6+
needAutoGenerateSidebar: true
7+
needGenerateH3Content: true
8+
noTitleIndex: true
9+
---
10+
11+
# Camera Control
12+
13+
This page introduces the main camera control features available in Dynamsoft Barcode Reader for Android. It explains how to manage focus behavior, configure zoom for small or distant barcodes, and enable additional camera enhancement features to improve scanning performance in specific scenarios.
14+
15+
## Focus Control & Focus Modes
16+
17+
In most cases, the camera automatically determines when focus is needed and adjusts the focal length accordingly. This behavior is called continuous auto-focus. In addition, the camera view supports tap-to-focus, which allows the user to trigger auto-focus manually. When these default focus behaviors do not meet your requirements, you can use the methods described in this page to control focus more precisely.
18+
19+
### Trigger an Auto-Focus
20+
21+
Use the following code to trigger auto-focus:
22+
23+
<div class="sample-code-prefix"></div>
24+
>- Java
25+
>- Kotlin
26+
>
27+
>1.
28+
```java
29+
mCamera.setFocus(new PointF(0.5f,0.5f));
30+
```
31+
2.
32+
```kotlin
33+
cameraEnhancer.setFocus(PointF(0.5f,0.5f))
34+
```
35+
36+
Optionally, you can specify the focus mode when triggering auto-focus.
37+
38+
- FM_LOCKED: Lock the focal-length after this focus.
39+
- FM_CONTINUOUS_AUTO: Allow the camera to adjust the focal-length automatically after this focus.
40+
41+
<div class="sample-code-prefix"></div>
42+
>- Java
43+
>- Kotlin
44+
>
45+
>1.
46+
```java
47+
mCamera.setFocus(new PointF(0.5f,0.5f), EnumFocusMode.FM_LOCKED);
48+
mCamera.setFocus(new PointF(0.5f,0.5f), EnumFocusMode.FM_CONTINUOUS_AUTO);
49+
```
50+
2.
51+
```kotlin
52+
cameraEnhancer.setFocus(PointF(0.5f,0.5f), EnumFocusMode.FM_CONTINUOUS_AUTO)
53+
cameraEnhancer.setFocus(PointF(0.5f,0.5f), EnumFocusMode.FM_LOCKED)
54+
```
55+
56+
### Enhanced Focus
57+
58+
Use this feature if your device has difficulty focusing.
59+
60+
<div class="sample-code-prefix"></div>
61+
>- Java
62+
>- Kotlin
63+
>
64+
>1.
65+
```java
66+
CameraEnhancer mCamera = new CameraEnhancer(this);
67+
try {
68+
mCamera.enableEnhancedFeatures(EnumEnhancerFeatures.EF_ENHANCED_FOCUS);
69+
} catch (CameraEnhancerException e) {
70+
throw new RuntimeException(e);
71+
}
72+
```
73+
2.
74+
```kotlin
75+
val mCamera = CameraEnhancer(this)
76+
mCamera.enableEnhancedFeatures(EnumEnhancerFeatures.EF_ENHANCED_FOCUS)
77+
```
78+
79+
**Related API**
80+
81+
- [`enableEnhancedFeatures`]({{ site.dce_android }}primary-api/camera-enhancer.html#enableenhancedfeatures)
82+
83+
## Auto-Zoom & Zoom Factor
84+
85+
Zoom control is commonly used when processing small barcodes or scanning from a long distance. There are two zoom control features:
86+
87+
- Auto-zoom: Lets the library determine whether to zoom in.
88+
- Zoom factor: Lets you set the zoom factor directly. This is commonly used when focusing on small barcodes.
89+
90+
### Auto Zoom
91+
92+
If your application mainly scans barcodes at a normal distance but also needs to recognize barcodes that are farther away, enabling auto-zoom is recommended.
93+
94+
<div align="center">
95+
<p><img src="../../../assets/auto-zoom.gif" width="30%" alt="auto-zoom"></p>
96+
<p>Auto Zoom</p>
97+
</div>
98+
99+
<div class="sample-code-prefix"></div>
100+
>- Java
101+
>- Kotlin
102+
>
103+
>1.
104+
```java
105+
CameraEnhancer mCamera = new CameraEnhancer(this);
106+
try {
107+
mCamera.enableEnhancedFeatures(EnumEnhancerFeatures.EF_AUTO_ZOOM);
108+
} catch (CameraEnhancerException e) {
109+
throw new RuntimeException(e);
110+
}
111+
```
112+
2.
113+
```kotlin
114+
val mCamera = CameraEnhancer(this)
115+
mCamera.enableEnhancedFeatures(EnumEnhancerFeatures.EF_AUTO_ZOOM)
116+
```
117+
118+
**Related API**
119+
120+
- [`enableEnhancedFeatures`]({{ site.dce_android }}primary-api/camera-enhancer.html#enableenhancedfeatures)
121+
122+
### Zoom Factor
123+
124+
If your application mainly targets small barcodes or barcodes that are far from the camera, it is recommended to control the zoom factor directly.
125+
126+
<div class="sample-code-prefix"></div>
127+
>- Java
128+
>- Kotlin
129+
>
130+
>1.
131+
```java
132+
CameraEnhancer mCamera = new CameraEnhancer(this);
133+
mCamera.setZoomFactor(2.0f);
134+
```
135+
2.
136+
```kotlin
137+
val mCamera = CameraEnhancer(this)
138+
mCamera.zoomFactor = 2.0f
139+
```
140+
141+
**Related API**
142+
143+
- [`setZoomFactor`]({{ site.dce_android }}primary-api/camera-enhancer.html#setzoomfactor)
144+
145+
## Enhanced Features
146+
147+
| Feature | Description |
148+
| ------- | ----------- |
149+
| EF_FRAME_FILTER | Filters blurry video frames using algorithm-based processing. It is usually unnecessary for standard barcode scanning unless you are facing significant accuracy issues. |
150+
| EF_SENSOR_CONTROL | Filters video frames captured while the device is moving based on sensor data. It is usually unnecessary for standard barcode scanning unless you are facing significant accuracy issues. |
151+
| EF_ENHANCED_FOCUS | Improves autofocus performance on older devices. If you enable this feature, it is recommended to use it only on older devices, as it may have a negative effect on cameras whose autofocus already works well. |
152+
| EF_AUTO_ZOOM | Automatically zooms in to recognize barcodes that are far from the camera. |
153+
| EF_SMART_TORCH | Provides a smart torch button prompt. When lighting conditions are poor, the torch button appears automatically. |

0 commit comments

Comments
 (0)