Ask Your Question

IZ73's profile - activity

2016-03-28 10:53:31 -0600 received badge  Famous Question (source)
2014-11-14 11:40:15 -0600 received badge  Notable Question (source)
2014-06-24 13:55:55 -0600 received badge  Popular Question (source)
2014-01-18 17:14:42 -0600 asked a question How do I debug native code of samples on Android in Eclipse?

I am using Eclipse and trying to step through the native portions of the NDK OpenCV 2.4.8 samples, e.g. "T2 - Mixed Processing". I can both Run as Android App and Debug as Android App, and in the latter case I hit breakpoints in the Java parts (e.g. Tutorial2Activity.java) but not in the C++ parts (e.g. jni_part.cpp). I tried Debug as Android Native Application but nothing happened and I saw no new messages in LogCat.

What do I need to do to be able to hit the C++ breakpoints?

Thank you

2014-01-12 12:56:25 -0600 asked a question Looking for samples to help port C++ OpenCV project to Android

I am was given a C++ OpenCV based program (currently running on Ubuntu) that I am trying to port to Android 4.3

I've installed and ran OpenCV samples, but now am looking for sample code to help me move forward with the port. I have some Android Java dev experience, close to 0 OpenCV experience and have never ported native code to Android, so I guess I am a beginner.

The program loads an image (from file on disk is enough for now, although eventually it needs to work with the camera), then iteratively calculates a mask that gets displayed after each iteration. Inside the mask calculation OpenCV class Mat_<uchar> is used. So main.cpp looks like this (showing mostly the OpenCV dependencies):

int main(int argc, char** argv)
{
    const char * inFN=argv[1];  // path to image file on disk
    //...   
    cvNamedWindow(...);
    cvInitFont(...);

    for (/* iterate until some exit condition is satisfied */)
    {
            filterMask = cvCreateImage(cvSize(img->width, img->height), IPL_DEPTH_8U, 1);
            // img is input image
            process(img, filterMask);   // compute mask 
            cvShowImage("mask", filterMask);    
    }

    cvReleaseImage(&filterMask);
    cvDestroyWindow("mask");
}

So looks like I will need to replace main() in the ported project with a function that performs these operations. But one question is, whether I need to modify the various cv functions shown above with something that will work on Android.

Which of the OpenCV Android samples are closest to what I need to do? Do you know of any other sample code pieces with similar functionality?

2014-01-12 11:56:26 -0600 commented answer What Android 4.1.3 or newer device did you use to test OpenCV 2.4.7?

It worked after I updated the manager. Thanks!

2014-01-07 17:04:44 -0600 commented answer What Android 4.1.3 or newer device did you use to test OpenCV 2.4.7?

I just downloaded 2.4.8, loaded it into Eclipse, changed Project Build Target to Android 4.3 (not Google APIs 4.3 -- not sure what the difference is) in all the projects (Library, Samples, Tutorials) and tried running it on my S4. Specifically, tried 15-puzzle and face detection. Same result as before: black screen, although I can access the individual sample menus. I am not seeing anything suspicious in logcat or in console output. Any suggestions on how to figure out why it's not working? Thx

2013-12-27 12:28:30 -0600 commented answer What Android 4.1.3 or newer device did you use to test OpenCV 2.4.7?

Alexander, do you happen to know what was the cause of the problem described in my previous posting (http://answers.opencv.org/question/25820/trying-to-run-opencv-samples-on-samsung-galaxy-s4/)? Thx!

2013-12-26 12:42:43 -0600 asked a question What Android 4.1.3 or newer device did you use to test OpenCV 2.4.7?

I was hoping to use my new Samsung Galaxy S4 I got from Verizon (running Android 4.3) to test the latest OpenCV. Unfortunately, after discovering this problem, I probably need to use a different device with a different version of Android. So this question is a survey of sorts: if you were able to run OpenCV 2.4.7 on a device running Android 4.1.3 or newer, what device did you use? Thx

2013-12-23 14:18:34 -0600 asked a question Trying to run OpenCV samples on Samsung Galaxy S4: dark screen

I am trying to run OpenCV samples from Eclipse on a brand new Samsung Galaxy S4. I tried a couple of them: 15-puzzle, face detection and image manipulation, and in all cases the behavior is the same: the app seems to be running, since I get each sample's menu, but the screen is dark. Did not see any error messages in logcat or console when I launched them. Do I need to change certain settings of the project and/or on the device?

Thanks

UPDATE: Just tried image manipulation on S3 (Android 4.1.3) and it seems to be working fine, or at least it's not giving me the dark screen. So does look like some sort of problem with the S4 device and/or with Android 4.3.

2013-12-23 14:14:44 -0600 received badge  Scholar (source)
2013-12-15 16:52:19 -0600 received badge  Editor (source)
2013-12-15 16:38:31 -0600 asked a question Can't build OpenCV library and samples for Android: OpenCVEngineInterface and org.opencv.R

I have a bit of experience with Android development using Java. Now I want to try porting some C/C++ code that uses OpenCV to Android. First, I tried to build the OpenCV lib and samples for Android using Eclipse on a Win-7 64-bit machine.

I've installed Java 7 JDK, Cygwin, Eclipse, NDK and CDK (or at least I think I have). When I try building the project, I get these 2 errors:

  1. The import org.opencv.R cannot be resolved
  2. The import org.opencv.engine.OpenCVEngineInterface cannot be resolved

I noticed that there is a OpenCVEngineInterface.aidl file that is supposed to get converted to .java but I don't think it's happening

Also, when I try to do Android Tools -> Fix Project Properties, nothing happens: no window is opened etc. Maybe my dev environment is not set up correctly?

What should I do to get these resolved and to build the project?

Also, I do not currently have an actual Android device to test the code on. Can I run the samples in the emulator?

Thank you!

UPDATE: When I select Project -> Clean -> Clean all projects a window pops up with the message Cleaning all projects has encountered an error and Errors occurred during the build. Errors running builder 'Android Package Builder' on project 'OpenCV Library - 2.4.7.1'. Resource '/OpenCV Library - 2.4.7.1/bin' does not exist. Resource '/OpenCV Library - 2.4.7.1/bin' does not exist.

I created bin in my workspace\OpenCV Library - 2.4.7.1 but that did not help. After I proceed with the rebuild, I get this message in COnsole:

`07:20:13 * Auto Build of configuration Default for project OpenCV Tutorial 2 - Mixed Processing * "\ndk-build.cmd" Android NDK: WARNING:jni/Android.mk:mixed_sample: non-system libraries in linker flags: -lopencv_java
Android NDK: This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES
Android NDK: or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the
Android NDK: current module
[armeabi-v7a] Install : libmixed_sample.so => libs/armeabi-v7a/libmixed_sample.so

07:20:13 Build Finished (took 228ms)`