I'm trying to find simple examples of using OpenGL with Camera preview. Help me with code examples.
Luxand FaceSDK contains samples for Android using OpenGL to draw image from camera - you can look at the code.
Related
What is the best way for Camera Live filters. I am recently using GPUImage Library from Link: https://github.com/CyberAgent/android-gpuimagelibrary.
Than I have found SurfaceView and GLSurfaceView.
Problem is:
How to apply live filter to camera using SurfaceView or GLSurfaceView.
Thanks in advance.
This link uses Texture View
https://github.com/google/grafika/blob/master/app/src/main/java/com/android/grafika/LiveCameraActivity.java
This uses surface view to play a movie..u can manipulate it for live camera
https://github.com/google/grafika/blob/master/app/src/main/java/com/android/grafika/PlayMovieSurfaceActivity.java
To choose on whether to use surfaceView or GLSurfaceView
take a look at this
Difference between SurfaceView and GLSurfaceView in Android
I want to implement visualization on camera image. For Example: if in camera view there is any wall and closed surface you can color that surface by choosing color from colorPicker. For a reference you can see dulux visualizer.
Can anyone suggest me how to implement visualizer that I have explained above?
Dulux Visualizer uses image processing capabilites. They extract whole element structure from the visualized picture, and manipulate it - in this case, paint it.
I would suggest you to look at OpenCV. It will provide all the necessary powerful image processing you need.
OpenCV Tutorials
About OpenCV
Can I set an ImageView to a camerapreview? Instead of using a surfaceview? I'm trying to make a camera preview semi transparent with setAlpha method, but It doesn't work on surfaceview. I mean it does work, but the camera preview is not semi transparent.
Well actually you can but not using SurfaceView. You achieve this by using GLSurface view, where you render each of your frame using shaders. In the fragment shader you can specify the opacity of your video. If you don't know OpenGL ES 2.0 you can start from here http://developer.android.com/training/graphics/opengl/index.html, but there are also many tutorial including rendering frames using opengl.
No you cannot do this, SurfaceView is the only way to create a Camera preview in Android.
i need to create a camera class which draw animation from openGL ES. image which captured from camera will be surfaceholder for image animation from OpenGL.
its like navigation on Wikitude or Layar.
Is there any way to do this?
you can start from make a surfaceView and add a callback to it. this example maybe can help solve your problem
John,
i have ever tried to texture the 3d cube in android using opengl es according to the example in c++, but after several times , the result is disappointed!
so i wanna know, who have ever done it before? may you give me some suggestions?
thanks in advance!
Lesson 6 on this page has a well described Android example of showing a textured cube:
http://insanitydesign.com/wp/projects/nehe-android-ports/