Ask Your Question
0

How to claim KCF tracker in java

asked 2018-11-21 15:10:23 -0500

Mental gravatar image

In C++ we can claim tracker with : Ptr<tracker> tracker = TrackerKCF::create(); I have install contrib module. But I don't know how to claim tracker in Java. And I can't find any sample.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2018-11-22 00:11:18 -0500

berak gravatar image

updated 2018-11-22 00:25:48 -0500

https://docs.opencv.org/master/javado...

indeed, there are no java samples, but something like this should get you started:

import org.opencv.tracking.*;

Tracker tracker = TrackerKCF.create();

// then:
Rect2d roi = new Rect2d(11,12,100,100);
tracker.init(image, roi);

// later:
boolean ok = tracker.update(image, roi);
// if it returns false (object lost), you have to create a new Tracker, with a new ROI
edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2018-11-21 15:10:23 -0500

Seen: 141 times

Last updated: Nov 22 '18