How to run GOTURN on windows +VS2015+opencv3.2+opencv_cotrib3.2 [closed]
I used cmake to build opencv3.2+opencv_contrib3.2 on VS2015 windows.I can run KCF well,but failed to goturn.When I follow the question http://answers.opencv.org/question/12... ,I can not success.If I want to run goturn, what I need to do?
code:
#include <opencv2/core/utility.hpp>
#include <opencv2/tracking.hpp>
#include <opencv2/videoio.hpp>
#include <opencv2/highgui.hpp>
#include <iostream>
#include <cstring>
using namespace std;
using namespace cv;
int main() {
Rect2d roi;
Mat frame;
Ptr<Tracker> tracker = Tracker::create("GOTURN");
std::string video = "E:\\test1.mp4";
VideoCapture cap(video);
cap >> frame;
roi = selectROI("tracker", frame);
if (roi.width == 0 || roi.height == 0)
return 0;
tracker->init(frame, roi);
printf("Start the tracking process\n");
for (;; ) {
cap >> frame;
if (frame.rows == 0 || frame.cols == 0)
break;
tracker->update(frame, roi);
rectangle(frame, roi, Scalar(255, 0, 0), 2, 1);
imshow("tracker", frame);
if (waitKey(1) == 27)
break;
}
return 0;
}
error is:OpenCV Error:Unspecified error <failed:fs.is_open().can not="" open="" "goturn.prototext"="">in cv::dnn::ReadProtoFromTxetFile,file D:\opencv3.2\opencv_contrib-3.2.0\modules\dnn\src\caffe\caffe_io.cpp,line 1077 D:\opencv3.2\opencv_contrib-3.2.0\modules\dnn\src\caffe\caffe_io.cpp,line 1077:error:<-2>FAILED:fs.is_open().Can not open "goturn.prototext">in cv::dnn::ReadProtoFromTxetFile OpenCV Error :Unspecified error<goturn network="" loading="" error...>in="" cv::gtr::initimpl,file="" gtrtracker.cpp,line="" 117<="" p="">
Can you give an error message ?
0x000007FEFD4EA06D (located in opencvtest.exe) has an unprocessed exception: Microsoft C++ exception: cv:: Exception, located at 0x00000000001EEEE0 of memory location.
run KCF successfully
Can you give source code? Update to opencv 3.4 is good idea. Looking for bug in opencv 3.2 it was yesterday
OK,Thanks。3.4 can run goturn without pre trained caffemodel?
Try using this post copy goturn.prototxt and goturn.caffemodel in same folder than yourproject.sln
@Clitost, no. you need the caffemodel for any opencv version
I put the goturn.caffemodel.zip.001 --- goturn.caffemodel.zip.004 and goturn.prototxt on opencv3.2\opencv_contrib-3.2.0\modules\tracking\src。Then,cmake opencv and contrib.But it does not work.
You must unzip files and concat files
It doesnot work.Do I need to install Caffe on Windows?