Install opencv_contrib Tracking package
Hey there I simply want to use the tracking package of the opencv3 contrib package in my ros kinetic.
I figured already out that in particular the tracking package is not contained in one of the following:
[STATUS]OpenCV_LIBRARIES [STATUS]opencv_calib3dopencv_coreopencv_features2dopencv_flannopencv_highguiopencv_imgcodecsopencv_imgprocopencv_mlopencv_objdetectopencv_photoopencv_shapeopencv_stitchingopencv_superresopencv_videoopencv_videoioopencv_videostabopencv_vizopencv_arucoopencv_bgsegmopencv_bioinspiredopencv_ccalibopencv_cvvopencv_datasetsopencv_dpmopencv_faceopencv_fuzzyopencv_hdfopencv_line_descriptoropencv_optflowopencv_phase_unwrappingopencv_plotopencv_regopencv_rgbdopencv_saliencyopencv_stereoopencv_structured_lightopencv_surface_matchingopencv_textopencv_xfeatures2dopencv_ximgprocopencv_xobjdetectopencv_xphoto [STATUS]OpenCV_LIB_COMPONENTS [STATUS]opencv_calib3dopencv_coreopencv_features2dopencv_flannopencv_highguiopencv_imgcodecsopencv_imgprocopencv_mlopencv_objdetectopencv_photoopencv_shapeopencv_stitchingopencv_superresopencv_videoopencv_videoioopencv_videostabopencv_vizopencv_arucoopencv_bgsegmopencv_bioinspiredopencv_ccalibopencv_cvvopencv_datasetsopencv_dpmopencv_faceopencv_fuzzyopencv_hdfopencv_line_descriptoropencv_optflowopencv_phase_unwrappingopencv_plotopencv_regopencv_rgbdopencv_saliencyopencv_stereoopencv_structured_lightopencv_surface_matchingopencv_textopencv_xfeatures2dopencv_ximgprocopencv_xobjdetectopencv_xphoto [STATUS]OpenCV_INCLUDE_DIRS [STATUS]/opt/ros/kinetic/include/opencv-3.2.0-dev/opt/ros/kinetic/include/opencv-3.2.0-dev/opencv
So I guess I have to install the tracking package myself but how do I do that?
I have installed sudo apt-get install ros-kinetic-opencv*
Well actually my main problem is: That I have the following code (tracker.cpp):
#include <opencv2/opencv.hpp>
// selectROI is part of tracking API
#include <opencv2/tracking.hpp>
using namespace std;
using namespace cv;
int main (int argc, char **arv)
{
// Read image
Mat im = imread("image.jpg");
// Select ROI
Rect2d r = selectROI(im);
// Crop image
Mat imCrop = im(r);
// Display Cropped Image
imshow("Image", imCrop);
waitKey(0);
return 0;
}
And when I run:
g++ -M tracker.cpp
I even get:
....
/usr/local/include/opencv2/tracking.hpp \
/usr/local/include/opencv2/tracking/tracker.hpp \
/usr/local/include/opencv2/tracking/feature.hpp \
/usr/local/include/opencv2/tracking/onlineMIL.hpp \
/usr/local/include/opencv2/tracking/onlineBoosting.hpp \
/usr/local/include/opencv2/tracking/tldDataset.hpp
Building my package leads to the following error:
error: ‘selectROI’ was not declared in this scope
Rect2d r = selectROI(im);