please tell me,
How do I add the opencv android kotlin library? If you can in detail how and where to throw files along the path to folders and connect, and then only the explorer (root is available) and CodeAssist on the phone
How to use opencv android kotlin to use the image template function (search for images on the android screen using a template)? at least links
CodePudding user response:
For
- In settings.gradle add something like after downloading the android sdk and installing it.
def opencvsdk='C:\\opencv-4.5.5-android-sdk\\OpenCV-android-sdk\\sdk'
include ':opencv'
project(':opencv').projectDir = new File(opencvsdk '/sdk')
Then in your App build.gradle
implementation project(':opencv')
- There are some samples in the sdk to get you going but not using the template search.
CodePudding user response:
To add the OpenCV Library to your Android Studio (Kotlin) project just follow these steps:
- Download the Android SDK by clicking on the link, then going in the latest version and selecting the android-sdk file.
- Head over to your Android Studio, open/start a project and load the module downloaded locally by going in File->New->Import Module.
- In your
build.grade (app)
file, add the following dependency.
implementation project(":opencv")
In the same file, add
android { packagingOptions {
pickFirst 'lib/arm64-v8a/libc _shared.so' pickFirst 'lib/x86/libc _shared.so' pickFirst 'lib/x86_64/libc _shared.so' pickFirst 'lib/armeabi-v7a/libc _shared.so'
} }
You can use OpenCV now!
Here are some links which may kickstart and help you to get a better idea in implementing your image template