Ask Your Question

alexiosk's profile - activity

2019-11-26 15:38:17 -0600 received badge  Popular Question (source)
2019-04-01 10:41:12 -0600 received badge  Popular Question (source)
2018-08-07 07:20:57 -0600 received badge  Nice Question (source)
2015-11-02 22:12:29 -0600 received badge  Student (source)
2015-11-02 12:54:11 -0600 asked a question Tutorial for OpenCV' Deep Learning Module for Android

Hi guys,

I prepared a tutorial on how to build an Android app that runs the OpenCV's DNN module. It is for demonstration/educational purposes. Basically it is OpenCV's tutorial on DNN (http://docs.opencv.org/master/d5/de7/...).

Alternatively, you can import the project to you Android Studio and modify accordingly your file paths.

Here is the source code and tutorial: https://github.com/alexkarargyris/Caf...

Best, Alex

2015-10-26 10:17:29 -0600 received badge  Editor (source)
2015-10-26 10:16:42 -0600 asked a question Cannot open file through JNI

I have copied a txt file in my device's sdcard. In the Java side of my Android app (i.e. MainActivity.java) I can open the file through this code:

    StringBuilder text = new StringBuilder();
    try {
        File sdcard = Environment.getExternalStorageDirectory();
        File file = new File(sdcard,"/android-opencv/file.txt");

        BufferedReader br = new BufferedReader(new FileReader(file));
        String line;
        while ((line = br.readLine()) != null) {
            text.append(line);
            text.append('\n');
        }
    }
    catch (IOException e) {
        e.printStackTrace();

    }

In my cpp file I try to open the same file doing the following:

  FILE* file = fopen("/storage/emulated/0/android-opencv/file.txt","r+");
  if (file != NULL)
        return env->NewStringUTF("Opened file");
  else
        return env->NewStringUTF("Error!");

I have added reading permissions in the AndroidManifest.xml:

    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

and I have checked the file path of the external storage directory that it is "/storage/emulated/0/"

Any ideas why this might be happening?

2015-10-24 08:48:49 -0600 received badge  Enthusiast
2015-10-22 19:20:45 -0600 received badge  Scholar (source)
2015-10-22 19:20:33 -0600 received badge  Supporter (source)
2015-10-21 11:11:25 -0600 asked a question How to run "build_sdk.py" for Android SDK

I have cloned OpenCV (git clone git://code.opencv.org/opencv.git). Following the instructions on http://code.opencv.org/projects/openc... I built the libraries and modules. Now how can I run "build_sdk.py" in "opencv3/platforms/android/build_sdk.py" to create the SDK? Runnning "python build_sdk.py" requires the following arguments:

usage: build_sdk.py [-h] [--ndk_path NDK_PATH] [--sdk_path SDK_PATH] [--sign_with SIGN_WITH] [--build_doc] [--no_ccache] [--extra_pack EXTRA_PACK] work_dir opencv_dir

Are the any examples on how to use this script?

2015-10-12 10:43:45 -0600 asked a question OpenCV Android and Deep Learning Module

I am developing an Android app and I would like to call the deep learning module (http://docs.opencv.org/master/d5/de7/...) .Is it possible? More importantly are all functions of OpenCV exposed to OpenCV Android?