Ask Your Question
0

'Tracker': undeclared identifier in (OpenCV with Extra Modules)

asked 2017-03-27 10:07:06 -0600

ibrahim.kaa gravatar image

I got opencv 3.2 (with extra modules) built successfully in Visual Studio (2015). I am trying to build a code that uses the tracking module and especially the TrackerKCF. However, the compiler cannot recognize this library as appears in errors.

I have added the following dependencies in Linker>Input>Additional Dependencies:

opencv_aruco320d.lib opencv_bgsegm320d.lib opencv_bioinspired320d.lib opencv_calib3d320d.lib opencv_ccalib320d.lib opencv_core320d.lib opencv_datasets320d.lib opencv_dnn320d.lib opencv_dpm320d.lib opencv_face320d.lib opencv_features2d320d.lib opencv_flann320d.lib opencv_fuzzy320d.lib opencv_hdf320d.lib opencv_highgui320d.lib opencv_imgcodecs320d.lib opencv_imgproc320d.lib opencv_line_descriptor320d.lib opencv_ml320d.lib opencv_objdetect320d.lib opencv_optflow320d.lib opencv_phase_unwrapping320d.lib opencv_photo320d.lib opencv_plot320d.lib opencv_reg320d.lib opencv_rgbd320d.lib opencv_saliency320d.lib opencv_shape320d.lib opencv_stereo320d.lib opencv_stitching320d.lib opencv_structured_light320d.lib opencv_superres320d.lib opencv_surface_matching320d.lib opencv_text320d.lib opencv_tracking320d.lib opencv_video320d.lib opencv_videoio320d.lib opencv_videostab320d.lib opencv_xfeatures2d320d.lib opencv_ximgproc320d.lib opencv_xobjdetect320d.lib opencv_xphoto320d.lib

Part of Code:

        delay_toDeleteinFrame.insert(delay_toDeleteinFrame.end(), 0);
        Rect a;
        a.x = a.y = a.height = a.width = 0;
        group_whenOcclusion.insert(group_whenOcclusion.end(), a);
        TrackerKCF::Params param;
        param.desc_pca = TrackerKCF::MODE::CN | TrackerKCF::MODE::GRAY;
        Ptr<TrackerKCF> tracker = TrackerKCF::createTracker(param);

        //Ptr<Tracker> tracker = Tracker::create("KCF");
        tracker_vector.insert(tracker_vector.end(), tracker);

Errors:

Error   C2653   'TrackerKCF': is not a class or namespace name
Error   C2065   'Tracker': undeclared identifier
Error   C2923   'cv::Ptr': 'TrackerKCF' is not a valid template type argument for parameter 'T'

What could I be missing here?

Thanks in advance

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2017-03-27 10:09:49 -0600

berak gravatar image

you probably only forgot to include the header:

#include "opencv2/tracking.hpp"
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-03-27 10:07:06 -0600

Seen: 1,475 times

Last updated: Mar 27 '17