Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to link face detector api with the photo activity
    text
    copied!<pre><code>public class PhotoActivity extends Activity implements SurfaceHolder.Callback { private ImageView imageView; private SurfaceView mSurfaceView; private Bitmap bmp; private SurfaceHolder mSurfaceHolder; private Camera mCamera; private Parameters parameters; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mSurfaceView = (SurfaceView) findViewById(R.id.surface_camera); imageView = (ImageView) findViewById(R.id.image_view); mSurfaceHolder = mSurfaceView.getHolder(); mSurfaceHolder.addCallback(this); mSurfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); } @Override public void surfaceChanged(SurfaceHolder arg0, int arg1, int arg2, int arg3) { parameters = mCamera.getParameters(); mCamera.setParameters(parameters); mCamera.startPreview(); Camera.PictureCallback mCall = new Camera.PictureCallback() { @Override public void onPictureTaken(byte[] data, Camera camera) { bmp = BitmapFactory.decodeByteArray(data, 0, data.length); imageView.setImageBitmap(bmp); mSurfaceView.setVisibility(View.INVISIBLE); // Call web service SendPhotoAsync photoToWeb = new SendPhotoAsync(data); photoToWeb.execute(); } }; mCamera.takePicture(null, null, mCall); } @Override public void surfaceCreated(SurfaceHolder holder) { mCamera = Camera.open(); mCamera.setDisplayOrientation(90); try { mCamera.setPreviewDisplay(holder); } catch (IOException exception) { mCamera.release(); mCamera = null; } } @Override public void surfaceDestroyed(SurfaceHolder holder) { mCamera.stopPreview(); mCamera.release(); mCamera = null; } @Override protected void onResume() { super.onResume(); } @Override protected void onPause() { super.onPause(); } </code></pre> <p>how i could modify this code to detect face on camera preview,using face detector api in android.. any help please.. i also want to detect eyes then..hope someone can help me..i went through <a href="http://android-er.blogspot.in/2012/04/face-detection-for-camera.html" rel="nofollow">this</a>which works on button click.in my case for taking photo no button click is there.. someone with some productive code will be appreciable..please help me its very critical</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload