2

I have a Bag Of Words dictionary created on my computer and saved to xml file. I'm creating an app for Android and I need to use it. Unfortunately according to Andrey Smorodov's answer it turns out that I can't use the OpenCV FileStorage class, for some reason. Do you have any idea what approach should I use? Can you give an example or reference? Also I'm going to use SVM, so will I have problem with svm.load("classifier.xml")? I'm using Android NDK but I don't mind if I should do this in Java.

5
  • Unfortunately I found out that I can't use the OpenCV FileStorage class, for some reason. What is that reason? Commented Feb 10, 2015 at 20:56
  • svm.load() should work. what does not work here, is opening an arbitrary Filestorage, and reading Mat's from that. (unless you outsource that to jni) Commented Feb 10, 2015 at 21:02
  • So you tell me that I can use FileStorage without problem if I use it in my native part? Commented Feb 10, 2015 at 21:05
  • haven't tried, but i guess, very much so. themain obstacle (in java) is just, that there are no overloaded operators like '>>' . but no prob in c++ ! Commented Feb 10, 2015 at 21:07
  • 1
    Ok, thank you! I'll try and will write here after that. Commented Feb 10, 2015 at 21:09

2 Answers 2

1

I was also having trouble with FileStorage in native code. I was getting a SIGABRT crash with no useful message. The solution for me was to add READ_EXTERNAL_STORAGE to the permissions in my AndroidManifest.xml. Now it works just fine.

Sign up to request clarification or add additional context in comments.

Comments

1

So I successfully used FileStorage in the native code. I read my files properly. Don't forget to add the READ_EXTERNAL_STORAGE permission in the manifest. (Like @Ken said)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.