Reaching CascadeClassfier XMLs from full Native C++ Android App [closed]

asked 2013-12-06 08:10:46 -0500

Salahi gravatar image

updated 2013-12-06 08:11:49 -0500

Hello all,

I'm trying to build Native C++ Android app but i am having difficulties to load, for example, lbpcascade_frontalface.xml file from cpp file.

I have examined the samples but what i want to do is, simply something like this;

/*

CascadeClassifier face_cascade;
face_cascade.load("lbpcascade_frontalface.xml");
while (1)
{
    std::vector<Rect> faces;
    face_cascade.detectMultiScale( image, faces, 1.1f, 4, CASCADE_FIND_BIGGEST_OBJECT,  Size(40, 40) );
}

*/

The problem here is the path of the XML File, what should it be? The XML file can be on Assets folder or anything else in the project.

Thanks in advance.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by sturkmen
close date 2020-08-16 18:54:51.022118

Comments

2

if you bundle the cascade xml with your app, it will be zipped inside your apk. the CascadeClassifier can't read from that, so you have to copy it to e.g. sdcard temporary to use it. look at the facedetection sample how to do that

berak gravatar imageberak ( 2013-12-06 09:41:16 -0500 )edit
1

Thank you mate. Actually i have looked at it before but i couldnt get the point and now i looked again and got it, i dont know why.

Salahi gravatar imageSalahi ( 2013-12-10 01:48:49 -0500 )edit

Did you find the answer????

alexx_m87 gravatar imagealexx_m87 ( 2014-05-23 09:37:19 -0500 )edit