我该如何解决OpenCv 4.1.2版中Imgproc的错误?

问题描述 投票:0回答:1

我在我的项目中的Imgproc中收到错误。我正在使用Android Studio版本3.5.3和OpenCv版本4.1.2。这是我的Gradle代码。我想在我的项目中使用Imgproc,但是当我编写Imgproc时出现错误

    compileSdkVersion 29
    buildToolsVersion "29.0.2"
    defaultConfig {
        applicationId "com.example.camscanner"
        minSdkVersion 17
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        } } }

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
    implementation project(path: ':scanlibrary')
}```

how i use Imgproc in my project
please Help.

android opencv opencv4android
1个回答
0
投票

您可以尝试JavaCPP-presets

build.gradle上添加一些依赖项:

dependencies {
    ...
    implementation group: 'org.bytedeco.javacpp-presets', name: 'opencv', version: '4.1.2-1.5.2'
    implementation group: 'org.bytedeco.javacpp-presets', name: 'opencv', version: '4.1.2-1.5.2', classifier: "android-arm"
    implementation group: 'org.bytedeco.javacpp-presets', name: 'opencv', version: '4.1.2-1.5.2', classifier: "android-arm64"
    implementation group: 'org.bytedeco.javacpp-presets', name: 'opencv', version: '4.1.2-1.5.2', classifier: "android-x86"
    implementation group: 'org.bytedeco.javacpp-presets', name: 'opencv', version: '4.1.2-1.5.2', classifier: "android-x86_64"
}

您可以使用org.bytedeco.javacpp.helper.opencv_imgprocorg.opencv.imgproc.Imgproc

Here,您会找到javadocs

© www.soinside.com 2019 - 2024. All rights reserved.