Comments (3)
@petermolcany I was thinking of replacing the android.media.Image
with a custom data class very similar to LegacyImage
but for camera2 impl. Can you help me understand your overall use case and how do you currently use the Image
output? Would it be more useful to instead have ByteArray
output for preview frames with metadata like width, height, and rotation (maybe more)? What are your thoughts?
from cameraview-ex.
@pvasa I am using face recognition (draw overlay on preview) and simultaneous video recording. First, I need to convert preview frame to custom format to perform the detection. Library I am using requires the faces to be upright, sideways faces would not be detected. I need to know the camera sensor orientation to rotate the image and ensure faces are upright. Phone must be therefore held in portrait mode. (If person is lying on side I do not want the image to rotate due to device rotation)
Use case might be similar to one that is demonstrated in the sample. FirebaseVisionImage.fromMediaImage(image, 0).detectBarcodes()
has hardcoded value of 0
. If detection function was orientation dependent it would require a proper way of passing rotation. Or if preview overlay was required.
I think the cleanest solution might be extension of the API with a getter for cameraSensorOrientation
In cases where detection should be device orientation aware cameraSensorOrientation
in combination with OrientationEventListener
could be used.
In most cases exposing outputOrientation
would be sufficient but for my case where I just need the camera sensor orientation, this is not sufficient.
from cameraview-ex.
Orientation can now be accessed as below from version 3.2.0
// Inside picture taken listener and preview frame listener
outputImage.exifInterface.rotationDegrees // 0, 90, 180, 270
See com.priyankvasa.android.cameraviewex.Image
for more information
from cameraview-ex.
Related Issues (20)
- in android 6.0 not working HOT 2
- Camera.isVideoRecording always returns false HOT 2
- hi? HOT 2
- error: expected enum but got (raw string) single_capture. HOT 2
- Caused by kotlin.UninitializedPropertyAccessException HOT 2
- UnsupportedOperationException No supported camera found for facing 1 HOT 2
- CameraCaptureSession: Session 1: Failed to create capture session; configuration failed HOT 2
- Samsung J7 prime issue in video recording, video recording stops just after starting. HOT 2
- no preview on pixel and samsung moblie HOT 2
- manual focus HOT 2
- Method markState must be called on the main thread HOT 5
- Preview is stretched for every aspect ratio if I use full screen CameraView HOT 2
- Front Faceing HOT 2
- expected enum but got (raw string) single_capture. HOT 2
- in android 6.0 not working HOT 2
- Method markState must be called on the main thread HOT 2
- Camera not working on Android 12 HOT 2
- Error when building APK HOT 2
- Android 11 and 12 I'm facing some issue HOT 2
- Unable to start video recording. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cameraview-ex.