Meanshift is not an option in android native development.

asked 2016-07-05 11:07:42 -0500

Covvr gravatar image

I'm trying to develop an app that uses meanshift to track an object. I got the code working in python and decided to integrate it into the android app instead of sending the data to a server for processing. I set up the ndk and imported opencv into the project. Everything worked fine until I got to the meanshift. Meanshift does not show up as an option in the IDE even though the documentation lists it as present. Camshift also doesn't show up. Strangely, however, pyrMeanShiftFiltering does show up as an option, but that's not what I'm looking for. Also, in the activity Video.MeanShift() works, but I'd prefer to stay in the native library rather than doing any big calculations in java for the sake of speed. Any help would be greatly appreciated.

image description

edit retag flag offensive close merge delete


berak gravatar imageberak ( 2016-07-05 11:29:08 -0500 )edit

Yes, but is there any way to use those in c++ for android instead of in java?

Covvr gravatar imageCovvr ( 2016-07-05 11:32:11 -0500 )edit

not sure, if i understand your problem, now.

from c++, imho, you can use anything you want, you're not restricted to use, what's in the java bindings

berak gravatar imageberak ( 2016-07-05 11:41:17 -0500 )edit

That's the problem. It doesn't register meanShift() as a valid function as documented here

Covvr gravatar imageCovvr ( 2016-07-05 12:51:22 -0500 )edit

Turns out that this line was missing from my header file. Oops! #include <opencv2/video.hpp>

Covvr gravatar imageCovvr ( 2016-07-05 16:52:50 -0500 )edit