Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

OpenCV for Android with Visual Studio

I'm trying to use OpenCV with the NVIDIA Tegra in my Project Tango dev kit. It runs Android, which I have no experience with, but I'm very familiar with OpenCV.

Fortunately, NVIDIA provides a program that downloads everything you need, including the OpenCV sdk and a Visual Studio plug-in. Since I use Visual Studio, that's what I started with.

I created a new project, copied over all the code and settings from the tutorial #1 in the sdk and tried to build it. It says "package org.opencv.android does not exist" along with a bunch of other packages that are all subsets of that. I notice that in the build output it says

1>       [echo] Resolving Dependencies for OpenCVAndroid...
1>  [dependency] Library dependencies:
1>  [dependency] No Libraries

I'm not sure if that's relevant. I am sure I'm not correctly linking to the library.

Unfortunately, I don't know enough about Android development to do an effective search. Using the OpenCV Manager makes most of the typical beginner advice aimed at other libraries irrelevant, and I don't know enough about how it's supposed to work to get those out of the search.

Things I have tried:

  1. Going into the Property Page for the project, Linker>General and adding the sdk/native/libs/<arch> folder, and then adding the .so file to the Linker>Input>Additional Dependencies like I would with a C++ .lib No change.
  2. Adding the path to the AndroidManifest.xml under a bunch of different tags I saw suggested. Few compiled, none worked.
  3. Adding the sdk/native/libs/<arch> folder and .so file to the Native Library Directories/Dependencies in the Ant Build portion of the property page.
  4. A Pre-Ant Event that copies the .so file from the sdk/native/libs/<arch> folder to <project>/libs/<arch>. No change. I didn't do anything to add that .so file to the project though, I'm not sure how it's supposed to be used.

I'm at the end of my ability to try and fix this myself, so I'm asking if any of you know what I'm doing wrong. Thanks for your help, and let me know if there's any more information you need.

OpenCV for Android with Visual Studio

I'm trying to use OpenCV with the NVIDIA Tegra in my Project Tango dev kit. It runs Android, which I have no experience with, but I'm very familiar with OpenCV.

Fortunately, NVIDIA provides a program that downloads everything you need, including the OpenCV sdk and a Visual Studio plug-in. Since I use Visual Studio, that's what I started with.

I created a new project, copied over all the code and settings from the tutorial #1 in the sdk and tried to build it. It says "package org.opencv.android does not exist" along with a bunch of other packages that are all subsets of that. I notice that in the build output it says

1>       [echo] Resolving Dependencies for OpenCVAndroid...
1>  [dependency] Library dependencies:
1>  [dependency] No Libraries

I'm not sure if that's relevant. I am sure I'm not correctly linking to the library.

Unfortunately, I don't know enough about Android development to do an effective search. Using the OpenCV Manager makes most of the typical beginner advice aimed at other libraries irrelevant, and I don't know enough about how it's supposed to work to get those out of the search.

Things I have tried:

  1. Going into the Property Page for the project, Linker>General and adding the sdk/native/libs/<arch> folder, and then adding the .so file to the Linker>Input>Additional Dependencies like I would with a C++ .lib No change.
  2. Adding the path to the AndroidManifest.xml under a bunch of different tags I saw suggested. Few compiled, none worked.
  3. Adding the sdk/native/libs/<arch> folder and .so file to the Native Library Directories/Dependencies in the Ant Build portion of the property page.
  4. A Pre-Ant Event that copies the .so file from the sdk/native/libs/<arch> folder to <project>/libs/<arch>. No change. I didn't do anything to add that .so file to the project though, I'm not sure how it's supposed to be used.

I'm at the end of my ability to try and fix this myself, so I'm asking if any of you know what I'm doing wrong. Thanks for your help, and let me know if there's any more information you need.

UPDATE: Here's the answer I got from NVIDIA's forums

you can add more java Source Directories:Project Properities>Ant Build>Java> Java Source Directories.

The java wrapper source code for opencv is at <your install="" path="">\OpenCV-2.4.8.2-Tegra-sdk\sdk\java\src.