Ask Your Question
0

switch KCF mode with python binding?

asked 2016-12-08 06:50:57 -0600

sohussain gravatar image

I'm using the python bindings to track vehicles using the KCF tracker. [python 2.7, OpenCV 3.1]

I instantiate my tracker like this:

tracker = cv2.Tracker_create("KCF")

How do I specify the MODE parameter for the KCFTrackerclass as shown in the documentation for this class http://docs.opencv.org/trunk/d2/dff/c....

Specifically I want to use the CN color names mode.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2016-12-08 07:23:49 -0600

berak gravatar image

unfortunately, this is not possible at all from python (since you have to use the generic Tracker class).

edit flag offensive delete link more

Comments

aww :( any chance you could point me towards resources that enable me to write a custom wrapper for it? based on what i read opencv uses its own python binding creation pipeline

sohussain gravatar imagesohussain ( 2016-12-08 07:32:44 -0600 )edit

hmm, maybe try to add something like this to tracking/tracker.hpp:

CV_EXPORTS_W Ptr<Tracker> createKCF() { 
     /* create a Ptr<TrackerKCF> with correct params, and return that*/  
}

(and re-run cmake && make && make install)

http://docs.opencv.org/trunk/df/da2/t...

berak gravatar imageberak ( 2016-12-08 07:43:00 -0600 )edit
1

alright I'll try doing it and update here later, I'll mark this answered for now, thx

sohussain gravatar imagesohussain ( 2016-12-08 07:55:47 -0600 )edit

yea, please tell the outcome, really curious ;)

berak gravatar imageberak ( 2016-12-08 08:07:37 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2016-12-08 06:50:57 -0600

Seen: 489 times

Last updated: Dec 08 '16