-1

Working on Android Mobile Camera

Want to implement the motion blur effect to the Android mobile camera.

This is implemented in iOS using the filter GPUImageLowPassFilter. I want alternative for this in android.

Pavandroid
  • 1,586
  • 2
  • 15
  • 30
  • I see two options - with using OpenGL capabilities or RenderScript – Taras Jul 27 '15 at 08:08
  • Can you provide me a sample or solution for the above? – Pavandroid Jul 27 '15 at 08:18
  • please see the accepted answer - http://stackoverflow.com/questions/6478375/how-can-i-manipulate-the-camera-preview. You get the YUV data which you can try to modify. As for FPS - for sure it would be decreased and will not be so smooth. If it's not an option for you - do a post-processing for video/image. – Taras Jul 27 '15 at 13:55
  • @Taras Always null is returned from lockCanvas method in the onPreviewFrame of SurfaceView. There are many questions of this issue. But there is no proper solution. – Pavandroid Jul 28 '15 at 07:28

1 Answers1

7

The best way to do this is to take a screen shot of the control, apply a blur to it, and then show that image over the top of the original control. This is how the yahoo weather app does it and its how google suggest you do things like this.

Render script does bluring fast. I've also got some code, but it's not currently at hand right now.

These might help:

http://blog.neteril.org/blog/2013/08/12/blurring-images-on-android http://docs.xamarin.com/recipes/android/other_ux/drawing/blur_an_image_with_renderscript/

I've also read that there are methods built into Android that do this, but the API isn't public so we cannot use it... which sucks.

kuljeet singh
  • 2,792
  • 2
  • 12
  • 15
  • Thanks for the response. I am not asking about blur which can be done easily with the help of available filters and libraries. I want something like this http://farm5.static.flickr.com/4030/4335456430_280bc09717.jpg – Pavandroid Jul 28 '15 at 16:51