Split highgui module to videoio and highgui

This commit is contained in:
vbystricky
2014-07-10 18:27:32 +04:00
committed by VBystricky
parent f773cd9a3e
commit d58f736935
149 changed files with 1673 additions and 1309 deletions

View File

@@ -6,7 +6,7 @@ import org.opencv.R;
import org.opencv.android.Utils;
import org.opencv.core.Mat;
import org.opencv.core.Size;
import org.opencv.highgui.Highgui;
import org.opencv.videoio.Videoio;
import android.app.Activity;
import android.app.AlertDialog;
@@ -46,7 +46,7 @@ public abstract class CameraBridgeViewBase extends SurfaceView implements Surfac
protected int mMaxHeight;
protected int mMaxWidth;
protected float mScale = 0;
protected int mPreviewFormat = Highgui.CV_CAP_ANDROID_COLOR_FRAME_RGBA;
protected int mPreviewFormat = Videoio.CV_CAP_ANDROID_COLOR_FRAME_RGBA;
protected int mCameraIndex = CAMERA_ID_ANY;
protected boolean mEnabled;
protected FpsMeter mFpsMeter = null;
@@ -151,10 +151,10 @@ public abstract class CameraBridgeViewBase extends SurfaceView implements Surfac
public Mat onCameraFrame(CvCameraViewFrame inputFrame) {
Mat result = null;
switch (mPreviewFormat) {
case Highgui.CV_CAP_ANDROID_COLOR_FRAME_RGBA:
case Videoio.CV_CAP_ANDROID_COLOR_FRAME_RGBA:
result = mOldStyleListener.onCameraFrame(inputFrame.rgba());
break;
case Highgui.CV_CAP_ANDROID_GREY_FRAME:
case Videoio.CV_CAP_ANDROID_GREY_FRAME:
result = mOldStyleListener.onCameraFrame(inputFrame.gray());
break;
default:
@@ -168,7 +168,7 @@ public abstract class CameraBridgeViewBase extends SurfaceView implements Surfac
mPreviewFormat = format;
}
private int mPreviewFormat = Highgui.CV_CAP_ANDROID_COLOR_FRAME_RGBA;
private int mPreviewFormat = Videoio.CV_CAP_ANDROID_COLOR_FRAME_RGBA;
private CvCameraViewListener mOldStyleListener;
};

View File

@@ -2,8 +2,8 @@ package org.opencv.android;
import org.opencv.core.Mat;
import org.opencv.core.Size;
import org.opencv.highgui.Highgui;
import org.opencv.highgui.VideoCapture;
import org.opencv.videoio.Videoio;
import org.opencv.videoio.VideoCapture;
import android.content.Context;
import android.util.AttributeSet;
@@ -88,9 +88,9 @@ public class NativeCameraView extends CameraBridgeViewBase {
synchronized (this) {
if (mCameraIndex == -1)
mCamera = new VideoCapture(Highgui.CV_CAP_ANDROID);
mCamera = new VideoCapture(Videoio.CV_CAP_ANDROID);
else
mCamera = new VideoCapture(Highgui.CV_CAP_ANDROID + mCameraIndex);
mCamera = new VideoCapture(Videoio.CV_CAP_ANDROID + mCameraIndex);
if (mCamera == null)
return false;
@@ -119,8 +119,8 @@ public class NativeCameraView extends CameraBridgeViewBase {
AllocateCache();
mCamera.set(Highgui.CV_CAP_PROP_FRAME_WIDTH, frameSize.width);
mCamera.set(Highgui.CV_CAP_PROP_FRAME_HEIGHT, frameSize.height);
mCamera.set(Videoio.CV_CAP_PROP_FRAME_WIDTH, frameSize.width);
mCamera.set(Videoio.CV_CAP_PROP_FRAME_HEIGHT, frameSize.height);
}
Log.i(TAG, "Selected camera frame size = (" + mFrameWidth + ", " + mFrameHeight + ")");
@@ -139,13 +139,13 @@ public class NativeCameraView extends CameraBridgeViewBase {
@Override
public Mat rgba() {
mCapture.retrieve(mRgba, Highgui.CV_CAP_ANDROID_COLOR_FRAME_RGBA);
mCapture.retrieve(mRgba, Videoio.CV_CAP_ANDROID_COLOR_FRAME_RGBA);
return mRgba;
}
@Override
public Mat gray() {
mCapture.retrieve(mGray, Highgui.CV_CAP_ANDROID_GREY_FRAME);
mCapture.retrieve(mGray, Videoio.CV_CAP_ANDROID_GREY_FRAME);
return mGray;
}