Split highgui module to videoio and highgui
This commit is contained in:
@@ -11,7 +11,7 @@ except:
|
||||
class_ignore_list = (
|
||||
#core
|
||||
"FileNode", "FileStorage", "KDTree", "KeyPoint", "DMatch",
|
||||
#highgui
|
||||
#videoio
|
||||
"VideoWriter",
|
||||
)
|
||||
|
||||
@@ -536,13 +536,13 @@ JNIEXPORT jdoubleArray JNICALL Java_org_opencv_core_Core_n_1getTextSize
|
||||
"""\n private static native String getSupportedPreviewSizes_0(long nativeObj);\n""",
|
||||
'cpp_code' :
|
||||
"""
|
||||
JNIEXPORT jstring JNICALL Java_org_opencv_highgui_VideoCapture_getSupportedPreviewSizes_10
|
||||
JNIEXPORT jstring JNICALL Java_org_opencv_videoio_VideoCapture_getSupportedPreviewSizes_10
|
||||
(JNIEnv *env, jclass, jlong self);
|
||||
|
||||
JNIEXPORT jstring JNICALL Java_org_opencv_highgui_VideoCapture_getSupportedPreviewSizes_10
|
||||
JNIEXPORT jstring JNICALL Java_org_opencv_videoio_VideoCapture_getSupportedPreviewSizes_10
|
||||
(JNIEnv *env, jclass, jlong self)
|
||||
{
|
||||
static const char method_name[] = "highgui::VideoCapture_getSupportedPreviewSizes_10()";
|
||||
static const char method_name[] = "videoio::VideoCapture_getSupportedPreviewSizes_10()";
|
||||
try {
|
||||
LOGD("%s", method_name);
|
||||
VideoCapture* me = (VideoCapture*) self; //TODO: check for NULL
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
from __future__ import print_function
|
||||
import os, sys, re, string, fnmatch
|
||||
allmodules = ["core", "flann", "imgproc", "ml", "imgcodecs", "highgui", "video", "features2d", "calib3d", "objdetect", "legacy", "contrib", "cuda", "androidcamera", "java", "python", "stitching", "ts", "photo", "nonfree", "videostab", "softcascade", "superres"]
|
||||
allmodules = ["core", "flann", "imgproc", "ml", "imgcodecs", "videoio", "highgui", "video", "features2d", "calib3d", "objdetect", "legacy", "contrib", "cuda", "androidcamera", "java", "python", "stitching", "ts", "photo", "nonfree", "videostab", "softcascade", "superres"]
|
||||
verbose = False
|
||||
show_warnings = True
|
||||
show_errors = True
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user