Display modified live camera preview

I have currently created an Android app that can display a camera preview, but I'm looking for a way to manipulate live pixels (i.e. make the image in grayscale, sepia, etc.). At the moment, I have not found the code for those who have done this before.

Any help would be appreciated.

+8
android android camera
source share
2 answers

You can use Camera.Parameters to set the corresponding effect. More on this.

If you want to do the manipulation on your own, use the onPreviewFrame camera. This gives you the raw byte[] format of the YUV format (by default, it can also be set to other formats. See here for setting the preview format).

Now you can do whatever pixel manipulation you want on byte[] .

Hope this helps!

+7
source share

I answered this question here . In short, this tutorial gives you probably the best way to do this (using OpenCV, the free Computer Vision library). You can download their sample application from the site.

0
source share

All Articles