androidGlesCamera2 | Handle camera2 preview drawing | Computer Vision library
kandi X-RAY | androidGlesCamera2 Summary
kandi X-RAY | androidGlesCamera2 Summary
Handle camera2 preview drawing.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Initializes the surface
- Initializes the texture
- Update viewport
- Compile vertex shader
- Called when an image is available
- Convert yUV to RGB
- Converts a YUV420 pixel image into an array of pixels
- Fills the yuv planes
- Implements requestPermissionsResult
- Get the permissions from the permissions array
- Get the parent fragment
- Called when the camera is resume
- Check if the app has the required permissions
- Resume camera
- Initializes the window
- Attaches a PermissionHelper to the FragmentManager
- Convert an image into a bitmap
- Fill the image with the yuv planes
- Initialize renderer
- Called when the user has permission failed
- Saves a bitmap to disk
- Compute a transformation matrix
- Crop and resize bitmap
- Creates the camera preview session
- Calculates the size of the preview size in pixels
- Called when a draw frame is drawn
androidGlesCamera2 Key Features
androidGlesCamera2 Examples and Code Snippets
Community Discussions
Trending Discussions on androidGlesCamera2
QUESTION
Intro
I'm using CaptureRequest.Builder and provide two surfaces as a target: a SurfaceTexture for drawing GL and an ImageReader (getSurface()) for processing frame.
I set desired resolution 640x480 by setting surfaceTexture.setDefaultBufferSize and by creating ImageReader.newInstance.
The problem
It appears that SurfaceTexture OpenGL texture is getting image that is of different aspect ration than 640x480 (4:3), more like 2560x1440 (16:9)(SurfaceTexture occupying full screen, see IMG 3). It has to be noted that both phones have same resolution aspect ratio 16:9. (Texture offset from the sides is left intentionally).
Below you can see IMG 1 displayed on a monitor screen, and IMG 2 and IMG 3 are phone screen captures where current activity view is showing camera preview.
The question
How to correctly force SurfaceTexture or GLSurfaceView.Renderer to get specific (4:3 in this case) aspect ratio texture image from camera for arbitrary size View?
Relevant
It has to be noted that there is an app that addresses issue, but for that they change the view size to correspond to desired aspect ratio.
See also:
IMG 1 - Displayed source image:
IMG 2 - Good aspect ratio (Google Nexus 5 - Android 6.0.1):
IMG 3 - Bad texture aspect ratio (LG-D855 - Android 5.0)
...ANSWER
Answered 2018-Feb-28 at 16:53"Fixed" the issue by updating LG phone to Android 6.0.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install androidGlesCamera2
You can use androidGlesCamera2 like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the androidGlesCamera2 component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page