How to import openCV samples into Android Studio - android

Just as the title says. I tried "Import Project" then selected this file:
C:...\OpenCV-2.4.10-android-sdk\samples\tutorial-1-camerapreview
Then selected this folder as the location for the full copy of the project:
C:...\AndroidStudioProjects\tutorial-1-camerapreview4
I then get the following warnings:
Project OpenCV Tutorial 1 - Camera Preview:C:\Users\Michael\OpenCV-2.4.10-android-sdk\samples\tutorial-1-camerapreview\project.properties:
Library reference ....\sdk\java could not be found
Path is C:\Users\Michael\OpenCV-2.4.10-android-sdk\samples\tutorial-1-camerapreview....\sdk\java which resolves to C:\Users\Michael\OpenCV-2.4.10-android-sdk\sdk\java
Can anyone help please? searches for answers so far have not been fruitful.

From the existing project where you have configured to include OpenCV module, use "Import Module" to import opencv samples.

Related

Importing an OpenCV project into Eclipse

I have imported OpenCV and am able to run all the sample codes. I have to now work on an already built app. How do I import this project? This app uses OpenCV.
EDIT: I am a beginner to opencv for android. The OpenCV tutorials tell me how to create a new project, not how to import it.
If the project is already from another eclipse and the versions are compatible, you can move the project folder into the workspace folder on the file system, copy/paste into the project explorer (Java Perspective) or use the 'Import > File System' function.
If the project is a bunch of raw project files, you can use the 'File > Import..' function in eclipse, choose '..Existing Project..'
Then you should be all set.
If you're starting anew with just .java files and android xml etc. You'll then need to include the the OpenCV project in the workspace and add the project to your app's project, as listed here from OpenCV's documentation of "Using the Android Binary Packages":
"Do the right mouse click on your app in Package Explorer, go to Properties ‣ Android ‣ Library ‣ Add "
Here's the link for that:
http://docs.opencv.org/doc/tutorials/introduction/android_binary_package/android_binary_package.html
import it to the workspace.AS usually you import any other project.If there is any error share the error.I think this is the correct way.

Android with OpenCV

I'm trying to use opencv for android on my image processing application. I configured opencv library and it works well with the sample projects. When I try to run my own project using opencv, I get "Android Library Projects cannot be Launched". I have checked the Project properties ,is Library is checked for my project for the openCV library,Cleaning the project does not help either.
Please help me.
The steps to configure OpenCV4Android library for your projects:
Import the OpenCV library project to your workspace.
Go to OpenCV library project->Properties->Android.
Mark the "isLibrary" checked if it is not.
Go to YourProject->Properties->Android. In Library Section click on add. select OpenCV Library from the list.
Do your necessary codes in your project and compile it.
If you need more details, You can get from here. Remember, your project should not be marked as library project. So don't mark the isLibrary checked in your project properties.
Thanks.

opencv library project sowing many errors

After importing opencv-android-sdk library project into workspace, it shows so many errors.
I tried following tutorial
http://docs.opencv.org/doc/tutorials/introduction/android_binary_package/dev_with_OCV_on_Android.html
But i am not getting
....\sdk\java
under Library section as picture showing in step 2 in tutorial.
(Sorry I am allowed to post image here.)
Is there any problem with my java.
I am using Ubuntu 13.04 with Eclipse Version: 3.8.1 and OpenCV-2.4.6-android-sdk
Check your project build properties, change the OpenCV import path to the correct one (make sure the path of opencv relative to your application matches what you place in import path).

ZXing-2.1 - Missing libraries

EDIT ::: For people who may be searching for a solution, Here it is.. (using ZXing 2.1)
Follow the steps below :::
First you have to import the existing code into your workspace
File -> import -> android -> existing android code into workspace
Browse to the unzipped folder of ZXing 2.1
You will have two projects in the list. Select both and click OK.
They will be imported into your workspace and you will have errors.
For the first Project (CaptureActivity in my case), you have to add the core.jar file present in ZXing2.1\zxing2.1\core
For the second project (ZXingTestActivity in my case), you have to add the core.jar file present in ZXing2.1\zxing2.1\core and android-integration.jar present in ZXing2.1\zxing2.1\android-integration
That's it.. You are done...
Hope this helps...
I have an application where we use ZXing. I have to update the library to the latest one. So I downloaded the code from ZXing-2.1.zip from here. When I try to compile I get errors in the import statements.
import com.google.zxing.BarcodeFormat;
import com.google.zxing.DecodeHintType;
import com.google.zxing.Result;
I couldn't find these libraries anywhere in the zip that I have downloaded. Can someone please guide me on how this is done? What am I doing wrong?
If you have a step by step tutorial, please do link them.
The classes are found in core.jar. You build this from the source code you downloaded.
I suggest you use the latest code from Subversion actually. If you do that, here's how you can get a pre-compiled JAR, or build one yourself: https://code.google.com/p/zxing/wiki/GettingStarted
(We are releasing 2.2 in a week or two by the way.)
Or if you want to build 2.1, see this previous documentation: https://code.google.com/p/zxing/source/browse/wiki/GettingStarted.wiki?spec=svn2659&r=2659
Extract zip
Right click on project-> properties-> Java Build Path-> Libraries-> Add External Jars-> select the jar file where it is in your Pc-> click ok.

opencv - face detection on android

Im trying to use face dection code of opencv on android
but there are some problems even i clean the project like the others said.
here is the description on the eclipse
The project cannot be built until build path errors are
resolved OpenCV Sample - color-blob-detection Unknown Java Problem
The container 'Android Dependencies' references non existing library
'C:\OpenCV-2.4.3-android-sdk\sdk\java\bin\opencv library -
2.4.3.jar' OpenCV Sample - color-blob-detection Build path Build Path Problem
Its mostly a problem with the path.
Have you checked the path correctly? (Jones suggestion should work for you)
If its correctly set... I would ask you to check the make file in JNI folder and use this full path, and also check the build path -> C++ -> GNU C++ -> add this path (if not already added).
Then you should be able to get this to work.
There isn't any .jar to import.
If you follow openCV tutorial (http://docs.opencv.org/doc/tutorials/introduction/android_binary_package/O4A_SDK.html)
and import all Samples and Library you should be sure that Library project can be built without error.
In my case I have just set the Android Target at the current release 5.1.1.
To do that, right click on project "OpenCV Library - 2.4.11"->Properties->Android->Select Android 5.1.1->Apply

Categories

Resources