Adding OpenCV 4 Library To Android Studio
HTML-код
- Опубликовано: 8 сен 2024
- In this video, I will add OpenCV 4 library to android studio and run basic code to check if it is working properly.
Process:
1. Download OpenCV 4 latest version.
Link: opencv.org/rel...
2. Create a new project in android studio.
3. Extract the zip file.
It will take some time.
4. Import Module.
You have to select SDK for OpenCV 4.
Change the name to OpenCV4.
Press finish.
It will take time to process it.
Now to solve this error remove this line and then sync the project.
5. GO to file/ Project structure/ Dependencies.
Select app.
press on +.
Here select OpenCV4.
Apply
6. Change SDK version.
Sync
7. Last and most important part add jni library.
path: opencv-4.5.3-android-sdk\OpenCV-android-sdk\sdk
ative\libs
Copy all files.
Create a jni folder and name it jnilibs.
"jnilibs" should not be changed to other names.
This will create a cpp folder.
Now paste all 4 files in that "jnilibs" folder.
path: OpenCVProject\app\src\main\jnilibs
Please like and share this video and subscribe to my channel.
thanks so much !!! its useful for my final project
Does it intergate successful ? Coz I'm getting this error when i try to run it -
error: package org.opencv.engine does not exist
import org.opencv.engine.OpenCVEngineInterface;
@@swapnilmanerkar0818hey, could you let me know if you have fixed that error yet? reply to me if you need source code
@@bachle4148 nope i didn't fix error....send me source code
@@bachle4148can you please send me source code as well as im also doing this project
@@bachle4148i need it
Hello sir, before you run your code, should I plug in my phone to my computer (minutes=13:29)? If yes, does it mean that every time I update the code, it must remain connected to my phone? Or only when I upload the new code?
Hope you answer my chat sir
You Sir are a FREAKING GOD SENT
sir, why i cant tap finish, next, previous when importing the module
After creating the jnilibs folder... my cpp folder aint getting created ... its getting created as jnilibs
hey man, i have the same result as you, how you manage to fix that?
did you get any solution
@@hardishah3188 no 🙃
@@gautamshenoy6170 wow. So project aise hi chhod diya?
after creating folder of "jnilibs" it doesnot is in the form of "cpp".. its like res folder (visuals).. what is the solution of this?
This method is way complicated instead of importing the whole dir as module why don't you guys just pull out the necessary libs in your app module and comfigure the path into the dependencies!
thank you, it is very useful
around 10:34 what if I get jniLibs folder instead of cpp folder even though I followed your instructions same which I made jnilibs folder.
hey man, i have the same result as you, how you manage to fix that?
i cannot created the cpp-folder, did you solve this problem?
@@TP-rn2gm hey, did you fix the problem, i need help for this point !!,
@@MOMO-ih5vr i fixed it by using the same lib as the video
@@TP-rn2gm Was this a problem you had before? The lib version you used is different from the one in the video, now use the same version like in the video on the line? Thanks!
when installing the app in the phone it shows "Opencv manager package was not found try to install" and when i click to install it remain open to playstore but nothing happen
Bro same thing happening here
@@abhishekbhamare4002 i have the same problem, do you find the solution , please can you tell me ??
@@MOMO-ih5vr try different android studio versions and open cv versions
a great channel ^^
How to dependency Aruco library?
i've try but some message like this "E/ion: ioctl c0044901 failed with code -1: Invalid argument"
Because of OpenCV Library (any version) the size of the app increases. Any solution to that?
What version of Android Studio you have?
followed as you said But CPP folder is not creating, any help ?
Last and most important part add jni library.
path: opencv-4.5.3-android-sdk\OpenCV-android-sdk\sdk
ative\libs
Copy all files.
Create a jni folder and name it jnilibs.
"jnilibs" should not be changed to other names.
This will create a cpp folder.
Now paste all 4 files in that "jnilibs" folder.
path: OpenCVProject\app\src\main\jnilib
did you fix the problem, i need help for this point !!,
@@MOMO-ih5vrThis method is way complicated instead of importing the whole dir as module why don't you guys just pull out the necessary libs in your app module and comfigure the path into the dependencies!
New problem in openCV implementation openCV 4.8.0 with android giraffe version is Plugin [id: 'com.android.application', version: '8.1.0', apply: false] was not found in any of the following sources
I think you can solve this with starting a project with classic buildgrade, creating a project with kotlin makes these problem. Can you provide me fix if you've integrated opencv?
I have the specific solution for the problem, but I also have another solution to do it exactly as shown in the video. If anyone wants to know more, just let me know.