October 2018
Intermediate to advanced
246 pages
6h 26m
English
Let's create this instance of a FirebaseVisionImage using a media.Image instance . This will be captured using the device camera. After the image is captured, we need to pass it on to the rotation method as well. rotation must be called before calling the fromMediaImage() method. The following method gets the angle by which an image must be rotated given the device's current orientation:
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)private int getRotationCompensation(String cameraId, Activity activity, Context context) throws CameraAccessException {// Get the device's current rotation relative to its "native" orientation.// Then,from the ORIENTATIONS table,look up the angle the image must be// rotated to compensate for ...
Read now
Unlock full access