Skip to content

Commit 8bfc6d0

Browse files
mbg1Gerrit Code Review
authored and
Gerrit Code Review
committed
Merge "Up the preview size requested to better handle smaller barcodes."
2 parents 6b45abf + c269483 commit 8bfc6d0

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

face/multi-tracker/app/src/main/java/com/google/android/gms/samples/vision/face/multitracker/MultiTrackerActivity.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@
2020
import android.os.Bundle;
2121
import android.util.Log;
2222

23+
import com.google.android.gms.samples.vision.face.multitracker.ui.camera.CameraSourcePreview;
24+
import com.google.android.gms.samples.vision.face.multitracker.ui.camera.GraphicOverlay;
25+
2326
import com.google.android.gms.vision.CameraSource;
2427
import com.google.android.gms.vision.MultiDetector;
2528
import com.google.android.gms.vision.MultiProcessor;
2629
import com.google.android.gms.vision.barcode.BarcodeDetector;
2730
import com.google.android.gms.vision.face.FaceDetector;
28-
import com.google.android.gms.samples.vision.face.multitracker.ui.camera.CameraSourcePreview;
29-
import com.google.android.gms.samples.vision.face.multitracker.ui.camera.GraphicOverlay;
3031

3132
import java.io.IOException;
3233

@@ -95,11 +96,12 @@ public void onCreate(Bundle icicle) {
9596
Log.w(TAG, "Detector dependencies are not yet available.");
9697
}
9798

98-
// Creates and starts the camera. Note that this will use a higher resolution by default
99-
// (1024x768) in comparison to other face detection examples, because the barcode detector
100-
// works better at higher resolutions.
99+
// Creates and starts the camera. Note that this uses a higher resolution in comparison
100+
// to other detection examples to enable the barcode detector to detect small barcodes
101+
// at long distances.
101102
mCameraSource = new CameraSource.Builder(context, multiDetector)
102103
.setFacing(CameraSource.CAMERA_FACING_BACK)
104+
.setRequestedPreviewSize(1600, 1024)
103105
.setRequestedFps(15.0f)
104106
.build();
105107
startCameraSource();

0 commit comments

Comments
 (0)