# OCV 4.5.3 tracking.hpp where is TrackerKCF

**URL:** <https://forum.opencv.org/t/ocv-4-5-3-tracking-hpp-where-is-trackerkcf/6341>\
**Category:** C++\
**Created:** [November 21, 2021, 7:39pm UTC](https://forum.opencv.org/t/ocv-4-5-3-tracking-hpp-where-is-trackerkcf/6341 "2021-11-21T19:39:57Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![ehardin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/ehardin/32/2541_2.png) [@ehardin](https://forum.opencv.org/u/ehardin)\
**Post date:** [November 21, 2021, 7:39pm UTC](https://forum.opencv.org/t/ocv-4-5-3-tracking-hpp-where-is-trackerkcf/6341/1 "2021-11-21T19:39:57Z")

</div>

OpenCV 4.5.3, C++, Visual Studio 2017, MFC, Windows 10

Trying to create a TrackerKCF:

In the VS project’s Additional Dependencies I have entered  
`opencv_tracking453.lib`

In the header:

```auto
#include <opencv2/video/tracking.hpp>
#include <opencv2/core/ocl.hpp>
#include <opencv2/core/utility.hpp>

```

In the code:  
`Ptr<Tracker> OCVtracker = TrackerKCF::create();`

This line gave me an error  
Error C2653 ‘TrackerKCF’: is not a class or namespace name

Just to try I entered instead:  
`Ptr<Tracker> OCVtracker = TrackerGOTURN::create();`  
and that worked. So I went to the tracking.hpp and see that the only tracker classes are for GOTURN, MIL, and DaSiamRPN .

What happened to TrackerKCF?

Ed

---

<div class="post-metadata">

**Author:** ![berak](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@berak](https://forum.opencv.org/u/berak)\
**Post date:** [November 21, 2021, 7:56pm UTC](https://forum.opencv.org/t/ocv-4-5-3-tracking-hpp-where-is-trackerkcf/6341/2 "2021-11-21T19:56:57Z")

</div>

what did you install, and how ?

to access `TrackerKCF` you’d need to build from src [with contrib modules](https://github.com/opencv/opencv_contrib)

---

<div class="post-metadata">

**Author:** ![ehardin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/ehardin/32/2541_2.png) [@ehardin](https://forum.opencv.org/u/ehardin)\
**Post date:** [November 21, 2021, 8:21pm UTC](https://forum.opencv.org/t/ocv-4-5-3-tracking-hpp-where-is-trackerkcf/6341/3 "2021-11-21T20:21:27Z")

</div>

Ahhh. Maybe that is it. Yes I built with Cmake and compiled with VS 2017 but I need to revisit that CMake to see if I included the contrib modules.

Thanks for this headsup. I’ll check it out.

Ed

---

<div class="post-metadata">

**Author:** ![ehardin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/ehardin/32/2541_2.png) [@ehardin](https://forum.opencv.org/u/ehardin)\
**Post date:** [November 21, 2021, 8:49pm UTC](https://forum.opencv.org/t/ocv-4-5-3-tracking-hpp-where-is-trackerkcf/6341/4 "2021-11-21T20:49:58Z")

</div>

I can’t find the contrib modules anywhere. As far as CMake is concerned I have all of the boxes checked for BUILD\_opencv\_ except for the \_world and a couple of the \_js… Trying to set the OPENCV\_EXTRA\_MODULES\_PATH I can’t find any module that would insinuate contrib or tracking for that matter.

Do you happen to know if they changed the name of the contrib module to something else? I looked at the 3rdparty directory but, again, nothing jumped out.

Any ideas?

Ed

---

<div class="post-metadata">

**Author:** ![ehardin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/ehardin/32/2541_2.png) [@ehardin](https://forum.opencv.org/u/ehardin)\
**Post date:** [November 21, 2021, 8:55pm UTC](https://forum.opencv.org/t/ocv-4-5-3-tracking-hpp-where-is-trackerkcf/6341/5 "2021-11-21T20:55:51Z")

</div>

Never mind…I found in the readme.md file

> Additional OpenCV functionality: [https://github.com/opencv/opencv\_contrib](https://github.com/opencv/opencv_contrib)

I’ll follow that lead.

Ed

---

<div class="post-metadata">

**Author:** ![berak](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@berak](https://forum.opencv.org/u/berak)\
**Post date:** [November 21, 2021, 9:03pm UTC](https://forum.opencv.org/t/ocv-4-5-3-tracking-hpp-where-is-trackerkcf/6341/6 "2021-11-21T21:03:05Z")

</div>

yea beat me …  
there’s a tracking module in contrib, and you need that for the KCF

you probably missed, that it’s [another repo to dowload from github](https://github.com/opencv/opencv_contrib#readme)

just make sure, you got **exactly** the same version for both repos  
(default download for contrib will be “master”, and your main seems 4.5.3)

---

<div class="post-metadata">

**Author:** ![ehardin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/ehardin/32/2541_2.png) [@ehardin](https://forum.opencv.org/u/ehardin)\
**Post date:** [November 21, 2021, 9:26pm UTC](https://forum.opencv.org/t/ocv-4-5-3-tracking-hpp-where-is-trackerkcf/6341/7 "2021-11-21T21:26:30Z")

</div>

I’ve downloaded the opencv\_contrib-4.x.zip file, unzipped it, pointed to the

> `opencv_contrib>/modules`

for the OPENCV\_EXTRA\_MODULES\_PATH and configured and generated in CMake. I’m recompiling in VS 2017 as we speak.

I had done a rapid transition from OCV 2.4 to 4.5 and never caught the fact that they made contrib a separate download. I’m pretty sure this will solve my problem.

Thanks a million for the headsup.

Ed

---

<div class="post-metadata">

**Author:** ![berak](https://avatars.discourse-cdn.com/v4/letter/b/85f322/32.png) [@berak](https://forum.opencv.org/u/berak)\
**Post date:** [November 21, 2021, 9:42pm UTC](https://forum.opencv.org/t/ocv-4-5-3-tracking-hpp-where-is-trackerkcf/6341/8 "2021-11-21T21:42:38Z")

</div>

for smooth transition, and since you’re building from scratch anyway,  
update your main opencv repo to 4.x, too  
(also clean cmake artefacts / build folder!)

---

<div class="post-metadata">

**Author:** ![ehardin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/ehardin/32/2541_2.png) [@ehardin](https://forum.opencv.org/u/ehardin)\
**Post date:** [November 21, 2021, 10:13pm UTC](https://forum.opencv.org/t/ocv-4-5-3-tracking-hpp-where-is-trackerkcf/6341/9 "2021-11-21T22:13:22Z")

</div>

Well, my main OpenCV is currently 4.5.3. Are you saying go ahead and get 4.5.4?

I guess that I could but I’m always just trying to put out one fire or another and am paranoid about stopping to polish things while I am running around. Maybe soon 😉

Ed
