face-detection/src/org/opencv/samples/facedetect/NewFaceDetection.java
@Override
    public void onCreate(Bundle savedInstanceState) {
        Log.i(TAG, "called onCreate");
        super.onCreate(savedInstanceState);
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

        setContentView(R.layout.face_detect_surface_view);

        mOpenCvCameraView = (CameraBridgeViewBase) findViewById(R.id.fd_activity_surface_view);
        mOpenCvCameraView.setCvCameraViewListener(this);

        mMethodSeekbar = (SeekBar) findViewById(R.id.methodSeekBar);
        mValue = (TextView) findViewById(R.id.method);

        mMethodSeekbar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {

            @Override
            public void onStopTrackingTouch(SeekBar seekBar) {
            }

            @Override
            public void onStartTrackingTouch(SeekBar seekBar) {
            }

            @Override
            public void onProgressChanged(SeekBar seekBar, int progress,
                                          boolean fromUser) {
                method = progress;
                switch (method) {
                    case 0:
                        mValue.setText("TM_SQDIFF");
                        break;
                    case 1:
                        mValue.setText("TM_SQDIFF_NORMED");
                        break;
                    case 2:
                        mValue.setText("TM_CCOEFF");
                        break;
                    case 3:
                        mValue.setText("TM_CCOEFF_NORMED");
                        break;
                    case 4:
                        mValue.setText("TM_CCORR");
                        break;
                    case 5:
                        mValue.setText("TM_CCORR_NORMED");
                        break;
                }


            }
        });
    }
/** Called when the activity is first created. */
Called when the activity is first created.
Called when the activity is first created .
@Override
    public void onCreate(Bundle savedInstanceState) {
        Log.i(TAG, "called onCreate");
        super.onCreate(savedInstanceState);
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
        setContentView(R.layout.face_detect_surface_view);
        mOpenCvCameraView = (CameraBridgeViewBase) findViewById(R.id.fd_activity_surface_view);
        mOpenCvCameraView.setCvCameraViewListener(this);
        mMethodSeekbar = (SeekBar) findViewById(R.id.methodSeekBar);
        mValue = (TextView) findViewById(R.id.method);
        mMethodSeekbar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
            @Override
            public void onStopTrackingTouch(SeekBar seekBar) {
            }
            @Override
            public void onStartTrackingTouch(SeekBar seekBar) {
            }
            @Override
            public void onProgressChanged(SeekBar seekBar, int progress,
                                          boolean fromUser) {
                method = progress;
                switch (method) {
                    case 0:
                        mValue.setText("TM_SQDIFF");
                        break;
                    case 1:
                        mValue.setText("TM_SQDIFF_NORMED");
                        break;
                    case 2:
                        mValue.setText("TM_CCOEFF");
                        break;
                    case 3:
                        mValue.setText("TM_CCOEFF_NORMED");
                        break;
                    case 4:
                        mValue.setText("TM_CCORR");
                        break;
                    case 5:
                        mValue.setText("TM_CCORR_NORMED");
                        break;
                }
            }
        });
    }
@ Override public void onCreate ( Bundle savedInstanceState ) { Log . i ( TAG , "called onCreate" ) ; super . onCreate ( savedInstanceState ) ; getWindow ( ) . addFlags ( WindowManager . LayoutParams . FLAG_KEEP_SCREEN_ON ) ; setContentView ( R . layout . face_detect_surface_view ) ; mOpenCvCameraView = ( CameraBridgeViewBase ) findViewById ( R . id . fd_activity_surface_view ) ; mOpenCvCameraView . setCvCameraViewListener ( this ) ; mMethodSeekbar = ( SeekBar ) findViewById ( R . id . methodSeekBar ) ; mValue = ( TextView ) findViewById ( R . id . method ) ; mMethodSeekbar . setOnSeekBarChangeListener ( new SeekBar . OnSeekBarChangeListener ( ) { @ Override public void onStopTrackingTouch ( SeekBar seekBar ) { } @ Override public void onStartTrackingTouch ( SeekBar seekBar ) { } @ Override public void onProgressChanged ( SeekBar seekBar , int progress , boolean fromUser ) { method = progress ; switch ( method ) { case 0 : mValue . setText ( "TM_SQDIFF" ) ; break ; case 1 : mValue . setText ( "TM_SQDIFF_NORMED" ) ; break ; case 2 : mValue . setText ( "TM_CCOEFF" ) ; break ; case 3 : mValue . setText ( "TM_CCOEFF_NORMED" ) ; break ; case 4 : mValue . setText ( "TM_CCORR" ) ; break ; case 5 : mValue . setText ( "TM_CCORR_NORMED" ) ; break ; } } } ) ; }
Called when the activity is first created.
Called when the activity is first created .