qt for android opencv 笔记

#-------------------------------------------------
#
# Project created by QtCreator 2016-02-25T14:06:59
#
#-------------------------------------------------

QT       += core gui

QT += androidextras

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = AdasKing
TEMPLATE = app

unix {
message("Using unix configuration")

ANDROID_OPENCV = D:/android_opencv/OpenCV-2.4.9-android-sdk/sdk/native

INCLUDEPATH +=D:/android_opencv/OpenCV-2.4.9-android-sdk/sdk/native/jni/include



INCLUDEPATH += \
$$ANDROID_OPENCV/jni/include/opencv    \
$$ANDROID_OPENCV/jni/include/opencv2    \
$$ANDROID_OPENCV/jni/include            \

OPENCVNATIVELIBS =D:/android_opencv/OpenCV-2.4.9-android-sdk/sdk/native/libs/armeabi-v7a


LIBS +=\
        $$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_contrib.a \
        $$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_legacy.a \
        $$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_ml.a \
        $$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_objdetect.a \
        $$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_calib3d.a \
        $$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_video.a \
        $$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_features2d.a \
        $$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_highgui.a \
        $$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_androidcamera.a \
        $$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_flann.a \
        $$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_imgproc.a \
        $$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_core.a     \
        $$ANDROID_OPENCV/3rdparty/libs/armeabi-v7a/liblibjpeg.a \
        $$ANDROID_OPENCV/3rdparty/libs/armeabi-v7a/liblibpng.a \
        $$ANDROID_OPENCV/3rdparty/libs/armeabi-v7a/liblibtiff.a \
        $$ANDROID_OPENCV/3rdparty/libs/armeabi-v7a/liblibjasper.a \
        $$ANDROID_OPENCV/3rdparty/libs/armeabi-v7a/libtbb.a

 LIBS +=$$OPENCVNATIVELIBS/libopencv_java.so
}



SOURCES += main.cpp\
        mainwindow.cpp \
    camerax.cpp \
    algsource/adas_alg.cpp \
    algsource/RdWrIni.c

HEADERS  += mainwindow.h \
    camerax.h \
    algsource/adas_alg.h \
    algsource/driveassist.hpp \
    algsource/RdWrIni.h

FORMS    += mainwindow.ui

CONFIG += mobility
MOBILITY =

DISTFILES += \
    android/AndroidManifest.xml \
    android/gradle/wrapper/gradle-wrapper.jar \
    android/gradlew \
    android/res/values/libs.xml \
    android/build.gradle \
    android/gradle/wrapper/gradle-wrapper.properties \
    android/gradlew.bat

ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android

contains(ANDROID_TARGET_ARCH,armeabi-v7a) {
    ANDROID_EXTRA_LIBS = \
        D:/android_opencv/OpenCV-2.4.9-android-sdk/sdk/native/libs/armeabi-v7a/libopencv_java.so \
        D:/android_opencv/OpenCV-2.4.9-android-sdk/sdk/native/libs/armeabi-v7a/libnative_camera_r4.1.1.so
}

RESOURCES += \
    classfile.qrc

另外的版本
//----------------------------------------------------------------------------------------------
TEMPLATE = app

CONFIG += c++11
QT += qml quick widgets multimedia multimediawidgets positioning

TARGET=See

SOURCES += main.cpp \
    presentationpropertyholder.cpp \
    geolocationmanager.cpp \
    imageprocessor.cpp \
    cameracontrol.cpp \
    flowcontroller.cpp

RESOURCES += qml.qrc

# Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH =

# Default rules for deployment.
include(deployment.pri)

HEADERS += \
    presentationpropertyholder.h \
    geolocationmanager.h \
    imageprocessor.h \
    cameracontrol.h \
    flowcontroller.h





android {
message("Using unix configuration")

ANDROID_OPENCV = D:/android_opencv/OpenCV-2.4.9-android-sdk/sdk/native

INCLUDEPATH +=D:/android_opencv/OpenCV-2.4.9-android-sdk/sdk/native/jni/include



INCLUDEPATH += \
$$ANDROID_OPENCV/jni/include/opencv    \
$$ANDROID_OPENCV/jni/include/opencv2    \
$$ANDROID_OPENCV/jni/include            \

OPENCVNATIVELIBS =D:/android_opencv/OpenCV-2.4.9-android-sdk/sdk/native/libs/armeabi-v7a


LIBS +=\
        $$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_contrib.a \
        $$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_legacy.a \
        $$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_ml.a \
        $$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_objdetect.a \
        $$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_calib3d.a \
        $$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_video.a \
        $$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_features2d.a \
        $$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_highgui.a \
        $$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_androidcamera.a \
        $$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_flann.a \
        $$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_imgproc.a \
        $$ANDROID_OPENCV/libs/armeabi-v7a/libopencv_core.a     \
        $$ANDROID_OPENCV/3rdparty/libs/armeabi-v7a/liblibjpeg.a \
        $$ANDROID_OPENCV/3rdparty/libs/armeabi-v7a/liblibpng.a \
        $$ANDROID_OPENCV/3rdparty/libs/armeabi-v7a/liblibtiff.a \
        $$ANDROID_OPENCV/3rdparty/libs/armeabi-v7a/liblibjasper.a \
        $$ANDROID_OPENCV/3rdparty/libs/armeabi-v7a/libtbb.a

 LIBS +=$$OPENCVNATIVELIBS/libopencv_java.so

    QMAKE_CXXFLAGS -= -mfpu=vfp
    QMAKE_CXXFLAGS_RELEASE -= -mfpu=vfp
    QMAKE_CXXFLAGS += -mfpu=neon -ftree-vectorize -ftree-vectorizer-verbose=1 -mfloat-abi=softfp
    QMAKE_CXXFLAGS_RELEASE += -mfpu=neon -ftree-vectorize -ftree-vectorizer-verbose=1 -mfloat-abi=softfp
}
 ANDROID_PACKAGE_SOURCE_DIR=$$_PRO_FILE_PWD_/android

DISTFILES += \
    android/AndroidManifest.xml \
    android/res/values/libs.xml \
    android/build.gradle


 
  


你可能感兴趣的:(Opencv,嵌入式qt)