Ask Your Question

Revision history [back]

Can you capture screen and run a filter on Android?

Hi, I have written my Android app (java) so it can capture my Android app screen (framebuffer) put it in a bitmap then run a filter on the bitmap then put it back into a resultant bitmap to display (framebuffer) again. It is slower than I like it to be and was looking at using the NDK but was wondering if OpenCV can do that. If so what example(s) should I look at to accomplish that goal?

Thanks for the help! -Tony

Can you capture screen and run a filter on Android?

Hi, I have written my Android app (java) so it can capture my Android app screen (framebuffer) put it in a bitmap then run a filter on the bitmap then put it back into a resultant bitmap to display (framebuffer) again. I am using glreadpixels for opengl es 3.0 to get the image. It is slower than I like it to be and was looking at using the NDK but was wondering if OpenCV can do that. If so what example(s) should I look at to accomplish that goal?

Thanks for the help! -Tony

Can you capture screen and run a filter on Android?

Hi, I have written my Android app (java) so it can capture my Android app screen (framebuffer) put it in a bitmap then run a filter on the bitmap then put it back into a resultant bitmap to display (framebuffer) again. I am using glreadpixels for opengl es 3.0 to get the image. It is slower than I like it to be and was looking at using the NDK but was wondering if OpenCV can do that. If so what example(s) should I look at to accomplish that goal?

So basically the steps are that I am doing now:

  1. Capture the frame of pixels using GLES30.glreadpixels()
  2. Convert the frame buffer pixels from GLES30.GL_RGBA to RGBA_8888 and put into Bitmap
  3. Run the Bitmap from step 2 through the desired filter producing a resultant Bitmap
  4. Convert the Bitmap to a texture
  5. Overlay texture on glsurfaceview.

I want to do steps 1-4 faster using OpenCV. Step 1 is taking me around 60ms, step 2 around 200ms I have not measured the other steps yet. The steps are all done right now using java and GLES30 outside of NDK. If I can do all easily and quick using NDK with OpenCV that is good but most of the examples I have seen use a camera and save to a file. So not sure I can use OpenCV to do what I need.

Thanks for the help! -Tony

Can you capture screen and run a filter on Android?

Hi, I have written my Android app (java) so it can capture my Android app screen (framebuffer) put it in a bitmap then run a filter on the bitmap then put it back into a resultant bitmap to display (framebuffer) again. as a texture overlay. I am using glreadpixels for opengl es 3.0 to get the image. It is slower than I like it to be and was looking at using the NDK but was wondering if OpenCV can do that. If so what example(s) should I look at to accomplish that goal?

So basically the steps are that I am doing now:

  1. Capture the frame of pixels using GLES30.glreadpixels()
  2. Convert the frame buffer pixels from GLES30.GL_RGBA to RGBA_8888 and put into Bitmap
  3. Run the Bitmap from step 2 through the desired filter producing a resultant Bitmap
  4. Convert the Bitmap to a texture
  5. Overlay texture on glsurfaceview.

I want to do steps 1-4 faster using OpenCV. Step 1 is taking me around 60ms, step 2 around 200ms I have not measured the other steps yet. The steps are all done right now using java and GLES30 outside of NDK. If I can do all easily and quick using NDK with OpenCV that is good but most of the examples I have seen use a camera and save to a file. So not sure I can use OpenCV to do what I need.

Thanks for the help! -Tony

Can you capture screen and run a filter on Android?

Hi, I have written my Android app (java) so it can capture my Android app screen (framebuffer) put it in a bitmap then run a filter on the bitmap then put it back into a resultant bitmap to display as a texture overlay. I am using glreadpixels for opengl es 3.0 to get the image. It is slower than I like it to be and was looking at using the NDK but was wondering if OpenCV can do that. If so what example(s) should I look at to accomplish that goal?

So basically the steps are that I am doing now:

  1. Capture the frame of pixels using GLES30.glreadpixels()
  2. Convert the captured frame buffer pixels from GLES30.GL_RGBA to RGBA_8888 and put into Bitmap
  3. Run the Bitmap from step 2 through the desired filter producing a resultant Bitmap
  4. Convert the Bitmap to a texture
  5. Overlay texture on glsurfaceview.

I want to do steps 1-4 faster using OpenCV. Step 1 is taking me around 60ms, step 2 around 200ms I have not measured the other steps yet. The steps are all done right now using java and GLES30 outside of NDK. If I can do all easily and quick using NDK with OpenCV that is good but most of the examples I have seen use a camera and save to a file. So not sure I can use OpenCV to do what I need.

Thanks for the help! -Tony