Android Open Source - opencv-android-starter-project Camera View






From Project

Back to project page opencv-android-starter-project.

License

The source code is released under:

MIT License

If you think the Android project opencv-android-starter-project listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.computervision;
//  w w w. j a  v  a 2s.c  om
import java.util.List;

import org.opencv.android.JavaCameraView;

import android.content.Context;
import android.hardware.Camera.Size;
import android.util.AttributeSet;

public class CameraView extends JavaCameraView
{


  public CameraView(Context context, AttributeSet attrs)
  {
    super(context, attrs);

    mMaxWidth=1024;
        mMaxHeight=500;
  }
  
  public List<Size> getResolutionList() {
        return mCamera.getParameters().getSupportedPreviewSizes();
    }

    public void setResolution(Size resolution) {
        disconnectCamera();
        mMaxHeight = resolution.height;
        mMaxWidth = resolution.width;
        connectCamera(getWidth(), getHeight());

    }

    public Size getResolution() {
        return mCamera.getParameters().getPreviewSize();
    }

}




Java Source Code List

com.computervision.CameraViewFragment.java
com.computervision.CameraView.java
com.computervision.ComputerVision.java
com.computervision.ProcessImageFragment.java