@Override public void onResume() { super.onResume(); Log.i(TAG, "on resume"); if (mOpenCvCameraView != null && !mOpenCvCameraView.isEnabled()) { mOpenCvCameraView.enableView(); } }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_signupcamera); getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); name = getIntent().getStringExtra("name"); userid = getIntent().getIntExtra("userid", -1); Log.i(TAG, "name = " + name + " && userid = " + userid); btn_camera_ok = (Button) findViewById(R.id.btn_camera_ok); btn_camera_takepic = (Button) findViewById(R.id.btn_camera_takepic); // / face detection! // xface = new XFaceLibrary();// hujiawei xface = CommonUtil.xFaceLibrary; xface.initFacedetect(CommonUtil.LBPCASCADE_FILEPATH, 0); // / face detection! mOpenCvCameraView = (SignupCameraView) findViewById(R.id.cv_camera_signup); mOpenCvCameraView.setVisibility(SurfaceView.VISIBLE); mOpenCvCameraView.setCvCameraViewListener(this); mOpenCvCameraView.enableView(); }