Detector for finding popular natural and man-made structures within an image.
A cloud landmark is created via
getVisionCloudLandmarkDetector(FirebaseVisionCloudDetectorOptions) or
getVisionCloudLandmarkDetector() if you wish to use the default
FirebaseVisionCloudDetectorOptions. For example, the code below creates a cloud
landmark detector with default options.
FirebaseVisionCloudLandmarkDetector cloudLandmarkDetector =
FirebaseVision.getInstance().getVisionCloudLandmarkDetector();
To find landmark in an image, you first need to create an instance of
FirebaseVisionImage from a Bitmap,
ByteBuffer, etc. See
detectInImage(FirebaseVisionImage) documentation for more details. For example,
the code below creates a FirebaseVisionImage
from a Bitmap.
FirebaseVisionImage image = FirebaseVisionImage.fromBitmap(bitmap);Then
the code below can detect landmarks in the supplied FirebaseVisionImage.
Task<List<FirebaseVisionCloudLandmark>> task =
cloudLandmarkDetector.detectInImage(image);
task.addOnSuccessListener(...).addOnFailureListener(...);
| void |
close()
|
| Task<List<FirebaseVisionCloudLandmark>> |
| IOException |
|---|
Detects landmarks from supplied image.
For best efficiency, create a
FirebaseVisionImage object using one of the following ways:
fromMediaImage(Image, int) with a JPEG
formatted image from android.hardware.camera2.
fromBitmap(android.graphics.Bitmap).
FirebaseVisionImage factory methods will work as well, but possibly slightly
slower.
Task
that asynchronously returns the detected List of
FirebaseVisionCloudLandmark. The list is empty if nothing is found.