clandmark icon indicating copy to clipboard operation
clandmark copied to clipboard

Using clandmark in Android app with native c++

Open ithmz opened this issue 7 years ago • 6 comments

I want to use clandmark lib in my Android app but using native c++; Should I include all the *.h and *.cpp files in the libclandmark folder? Is the RapidXML is necessary? I have my own face detector so I don't need the OpenCV haar cascade, how do I remove them?

Thank you

ithmz avatar Jul 12 '18 06:07 ithmz

Hi @tsangz189,

yep RapidXML is necessary, as models are stored in XML files. OpenCV is not needed at all, it is used just in examples. I think you might get inspired in the CMakeLists.txt files, there you see what header and source files are needed where.

I am not very familiar with Android app development. But if it supports native c++, you might even use the CLandmark in the form of dynamically linked precompiled library?

uricamic avatar Jul 13 '18 05:07 uricamic

When built successfully, I have two static lib (libclandmark & libflandmark). Should I import both of them?

ithmz avatar Jul 13 '18 06:07 ithmz

Yep, both are required. You can also build them dynamically, just change BUILD_SHARED_LIBS CMake settings.

uricamic avatar Jul 13 '18 06:07 uricamic

I tried to build the lib using android ndk. An error apprears: 'clandmark::CDAGMaxSumSolver' must explicitly initialize the base class 'clandmark::CMaxSumSolver' which does not have a default constructor?

ithmz avatar Jul 13 '18 07:07 ithmz

Hmm, looks like some construct are not supported by the compiler anymore... I will try to look at this over weekend.

In the meanwhile, you might try to write a simple workaround for now, by creating that empty constructor which is missing.

uricamic avatar Jul 13 '18 07:07 uricamic

Yes, it's very weird. I can build and run using Cmake, but with ndk-build of Android, it shows that error. Thank you for your time

ithmz avatar Jul 13 '18 07:07 ithmz