Questions tagged [image-reader]

The ImageReader class allows direct application access to image data rendered into a Surface. This tag is to be used for questions relating to the android.media.ImageReader class in Java. Also include the "android" tag when you use this tag.

More information about this class can be found here.

43 questions
1
vote
0 answers

Camera2 live stream example

I am new to the Camera2 APIs and would like to see them in action in a project that captures live camera frames, post-processes them (ideally showing how to access the raw data buffer[] using ImageReader), and previews the post-processed data. Are…
Lolo
  • 3,935
  • 5
  • 40
  • 50
1
vote
1 answer

OnImageAvailableListener is not being invoked for Camera2 API for taking a photo

I am trying to take a photo using the Camera2 API. The API is currently used to produce a preview on a SurfaceView on my screen which works fine, but when i try to capture image, the OnImageAvailable listener doesn't get called at all. I need this…
Hazed 2.0
  • 133
  • 2
  • 14
1
vote
0 answers

Android camera2 ImageReader causing freeze

I have been using camera2 in an opengl application to write to a SurfaceTexture. Since this is going to put the image in the wrong format, I decided to use an ImageReader object to capture the camera output in : ImageFormat.YUV_420_888 as…
Luple
  • 481
  • 3
  • 21
1
vote
1 answer

Can I getBuffer after image.close?

I camera2 api, I save continuously image to Image[] and when want to capture picture, I call image.getPlanes()[0].getBuffer but app crashed and show error: Image is already close. How can I getBuffer after image.close ? Thank you!
1
vote
0 answers

ImageReader - discard some frames (decrease FPS)

I have application which is using hardware camera to make some analysis in OpenCV. I am using ImageReader to get frames, and then I am passing them to algorithm. But I would like to get only let's say 1 or 2 frames per second from ImageReader. I…
voximodo
  • 21
  • 1
1
vote
1 answer

Process Images obtained with ImageReader on Android

I am receiving an image from the ImageReader, with format PixelFormat.RGBA_8888 What I want is to transform that image to ARGB. Get the buffer is simple private OnImageAvailableListener frameObserver = new OnImageAvailableListener() { public…
Jano
  • 197
  • 1
  • 14
1
vote
1 answer

Android Camera 2: ImageReader's Images Have no Stride Values

I've been trying to route the images from the camera to an ImageReader so that I can manipulate the images directly using the Camera2 API. When I have the capture session stream to a SurfaceView, the stream works just fine. When I then set the…
Abahu
  • 40
  • 7
1
vote
1 answer

android camera2 preview lag when getting frame

I am using Android camera2 in order to extract frames in real time in preview mode to stitch them in NDK side(openCv). I use ImageReader surface to get frames, but it is limited to a max frame…
1
vote
1 answer

Difference between acquireNextImage Vs acquireLatestImage

I am working on Camera2 API to take pictures continuously and it's working fine, Here I am able to save the captured image using following code: ImageReader.OnImageAvailableListener readerListener = new ImageReader.OnImageAvailableListener() { …
Shailendra Madda
  • 20,649
  • 15
  • 100
  • 138
0
votes
1 answer

Camera2 api: Null image when using imageReader to capture image from surfaceView

I am using Camera2 api to take images. I am using imageReader to capture image from a surfaceView and acquireLatestImage() to collect the image. Images are getting captured but they are coming as null as shown by the Log.e message "Capture…
Sam11
  • 63
  • 6
0
votes
0 answers

In Android how can I take multiple images through ImageReader class

I am trying to take multiple images but the ImageAvailabeListener function is not moving forward. I guess it is waiting for next image. I tried aquireNextImage() but it is also not working. I'm taking images while MediaProjection. private class…
0
votes
0 answers

Android ImageReader - Invalid format specified 42

I have been working to capture images of the phone screen using ImageReader. The JPEG's I am receiving are not valid. With this setting: ImageReader mImageReader = ImageReader.newInstance(width, height, ImageFormat.JPEG, 10); I get this in…
seanfir
  • 13
  • 3
0
votes
0 answers

Image from ImageReader is not the same as my preview surface

i wrote my image from ImageReader surface and got a very bad photo, is it the ratio ? they are all the same (w & h), is it something with TotalCaptureResult ? , please check the photo and code below, appreciate your help. 1- My original photo from…
0
votes
1 answer

ImageReader in Kotlin & Camera 2 - saving .jpg file from a camera reader surface

I am trying to get a photo out of my ImageReader.surface that i have added as a target on my capture request for a CaptureSession, I am struggling on this as i have tried to use the imageReader.acquireLatestImage() but this alawys reference me to a…
0
votes
1 answer

What is the correct way to get Preview Frames using Android NDK Camera2

Based on NDK camera sample texture-view, I want to create an ImageReader to get preview frames. What I've done Create the ImageReader and the camera session: yuvReader_ = new ImageReader(&compatibleCameraRes_,…
yushulx
  • 11,695
  • 8
  • 37
  • 64