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

Комментарии • 43

  • @electrocode6256
    @electrocode6256  3 года назад +5

    Please like and share this video and subscribe to my channel.

  • @bachle4148
    @bachle4148 Год назад +1

    thanks so much !!! its useful for my final project

    • @swapnilmanerkar0818
      @swapnilmanerkar0818 Год назад +1

      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;

    • @bachle4148
      @bachle4148 Год назад

      @@swapnilmanerkar0818hey, could you let me know if you have fixed that error yet? reply to me if you need source code

    • @swapnilmanerkar0818
      @swapnilmanerkar0818 Год назад +1

      @@bachle4148 nope i didn't fix error....send me source code

    • @sarwatshah7628
      @sarwatshah7628 Год назад +1

      @@bachle4148can you please send me source code as well as im also doing this project

    • @sarwatshah7628
      @sarwatshah7628 Год назад +1

      @@bachle4148i need it

  • @onessanjerico7427
    @onessanjerico7427 3 месяца назад

    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

  • @davidlavoie5887
    @davidlavoie5887 2 года назад

    You Sir are a FREAKING GOD SENT

  • @erwinhergt
    @erwinhergt 2 года назад

    sir, why i cant tap finish, next, previous when importing the module

  • @gautamshenoy6170
    @gautamshenoy6170 2 года назад +1

    After creating the jnilibs folder... my cpp folder aint getting created ... its getting created as jnilibs

    • @TP-rn2gm
      @TP-rn2gm 2 года назад

      hey man, i have the same result as you, how you manage to fix that?

    • @hardishah3188
      @hardishah3188 Год назад

      did you get any solution

    • @gautamshenoy6170
      @gautamshenoy6170 Год назад

      @@hardishah3188 no 🙃

    • @hardishah3188
      @hardishah3188 Год назад

      @@gautamshenoy6170 wow. So project aise hi chhod diya?

  • @ithacks9494
    @ithacks9494 Год назад

    after creating folder of "jnilibs" it doesnot is in the form of "cpp".. its like res folder (visuals).. what is the solution of this?

  • @pentagram147
    @pentagram147 Год назад +1

    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!

  • @kaanbalkaya
    @kaanbalkaya Год назад

    thank you, it is very useful

  • @ywseo97
    @ywseo97 2 года назад +1

    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.

    • @TP-rn2gm
      @TP-rn2gm 2 года назад

      hey man, i have the same result as you, how you manage to fix that?

    • @MOMO-ih5vr
      @MOMO-ih5vr Год назад

      i cannot created the cpp-folder, did you solve this problem?

    • @MOMO-ih5vr
      @MOMO-ih5vr Год назад

      @@TP-rn2gm hey, did you fix the problem, i need help for this point !!,

    • @TP-rn2gm
      @TP-rn2gm Год назад +1

      @@MOMO-ih5vr i fixed it by using the same lib as the video

    • @MOMO-ih5vr
      @MOMO-ih5vr Год назад

      @@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!

  • @moyukhsarkar3394
    @moyukhsarkar3394 3 года назад +1

    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

    • @abhishekbhamare4002
      @abhishekbhamare4002 Год назад

      Bro same thing happening here

    • @MOMO-ih5vr
      @MOMO-ih5vr Год назад

      @@abhishekbhamare4002 i have the same problem, do you find the solution , please can you tell me ??

    • @abhishekbhamare4002
      @abhishekbhamare4002 Год назад

      @@MOMO-ih5vr try different android studio versions and open cv versions

  • @duyphuong9217
    @duyphuong9217 3 года назад +1

    a great channel ^^

  • @user-gj6ux9ix5k
    @user-gj6ux9ix5k 4 месяца назад

    How to dependency Aruco library?

  • @muhajirhajerin
    @muhajirhajerin 2 года назад

    i've try but some message like this "E/ion: ioctl c0044901 failed with code -1: Invalid argument"

  • @developerandroid7777
    @developerandroid7777 3 года назад

    Because of OpenCV Library (any version) the size of the app increases. Any solution to that?

  • @alexandruindricut7107
    @alexandruindricut7107 10 месяцев назад

    What version of Android Studio you have?

  • @varunpratapsingh046
    @varunpratapsingh046 Год назад

    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

    • @MOMO-ih5vr
      @MOMO-ih5vr Год назад

      did you fix the problem, i need help for this point !!,

    • @pentagram147
      @pentagram147 Год назад

      ​@@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!

  • @Program-withsagar2865
    @Program-withsagar2865 9 месяцев назад

    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

    • @Emirhan13178
      @Emirhan13178 8 месяцев назад

      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?

    • @rgonzalezmld
      @rgonzalezmld Месяц назад

      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.