Android samples: Face Detection cannot be compiled

asked 2013-05-05 23:22:48 -0500

fuco gravatar image

updated 2013-05-08 02:30:48 -0500

Andrey Pavlenko gravatar image

I am trying OpenCV library (version 2.4.5). The Face detection sample for android is working on my device when installed as provided "example-face-detection.apk". But I cannot make it run from provided sources because of compiler error. The problem is in "DetectionBasedTracker_jni.cpp" at line:

((DetectionBasedTracker*)thiz)->getObjects(RectFaces);

The c++ compiler error:

Invalid arguments ' Candidates are: void getObjects(? &) '

After commenting the line, sample compiles well. But what is wrong with the argument?

DetectionBasedTracker declaration:

class DetectionBasedTracker
{
public:
    ...
    virtual void getObjects(std::vector<cv::Rect>& result) const;
    virtual void getObjects(std::vector<Object>& result) const;
    ...
}

RectFaces definition:

vector<Rect> RectFaces;
edit retag flag offensive close merge delete

Comments

Do you observe this using ndk-build or in eclipse?

Andrey Pavlenko gravatar imageAndrey Pavlenko ( 2013-05-08 02:31:24 -0500 )edit

I have the same error using eclipse.How to solve this using eclipse? I also get DetectionBasedTracker could not be resolved even when I comment that line.I set the ndk root variable using eclipse environment variables.

ToBeSafe gravatar imageToBeSafe ( 2013-06-18 03:27:38 -0500 )edit