Ask Your Question
0

How to run GOTURN on windows +VS2015+opencv3.2+opencv_cotrib3.2 [closed]

asked 2018-01-03 05:00:45 -0600

Clitost gravatar image

updated 2018-01-04 04:10:39 -0600

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...&gt;in="" cv::gtr::initimpl,file="" gtrtracker.cpp,line="" 117&lt;="" p="">

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by LBerger
close date 2018-01-04 13:24:19.438587

Comments

Can you give an error message ?

LBerger gravatar imageLBerger ( 2018-01-03 05:33:11 -0600 )edit

0x000007FEFD4EA06D (located in opencvtest.exe) has an unprocessed exception: Microsoft C++ exception: cv:: Exception, located at 0x00000000001EEEE0 of memory location.

Clitost gravatar imageClitost ( 2018-01-03 07:10:16 -0600 )edit

run KCF successfully

Clitost gravatar imageClitost ( 2018-01-03 07:10:57 -0600 )edit

Can you give source code? Update to opencv 3.4 is good idea. Looking for bug in opencv 3.2 it was yesterday

LBerger gravatar imageLBerger ( 2018-01-03 07:19:23 -0600 )edit

OK,Thanks。3.4 can run goturn without pre trained caffemodel?

Clitost gravatar imageClitost ( 2018-01-03 07:28:46 -0600 )edit

Try using this post copy goturn.prototxt and goturn.caffemodel in same folder than yourproject.sln

LBerger gravatar imageLBerger ( 2018-01-03 07:51:15 -0600 )edit
1

@Clitost, no. you need the caffemodel for any opencv version

berak gravatar imageberak ( 2018-01-03 07:52:37 -0600 )edit

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.

Clitost gravatar imageClitost ( 2018-01-03 08:41:30 -0600 )edit
1

You must unzip files and concat files

LBerger gravatar imageLBerger ( 2018-01-03 08:43:51 -0600 )edit

It doesnot work.Do I need to install Caffe on Windows?

Clitost gravatar imageClitost ( 2018-01-04 02:25:08 -0600 )edit

1 answer

Sort by » oldest newest most voted
0

answered 2018-01-04 04:34:34 -0600

Clitost gravatar image

Thanks,when I put goturn.protext and goturn.caffemodel in same folder than myproject.sln,the above problem is solved.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2018-01-03 05:00:45 -0600

Seen: 614 times

Last updated: Jan 04 '18