Git Product home page Git Product logo

opentracker's Introduction

What is OpenTracker?

OpenTracker is an open sourced repository for Visual Tracking. It's written in C++, high speed, easy to use, and easy to be implemented in embedded system.

- AND this is not only boring Codes, 
+ It also has Maths and Implement Notes!

If you don't exactly know what this means:

Don't worry, it will be explained fully in the Notes. All the maths details of the Not-that-easy algorithms are explaned fully from the very beginning. If you have headache of reading the papers(as most of us have), this is a good tutorial. (Check Notes(draft now)).

Or, if you have problems with the implementation of a complicate cutting-edge algorithms, check this! You will get something!

Attention! OpenTracker is NOT designed just for tracking human beings as the demo images, it can track everything, even some special points!

For Multiple Object Tracker, check: OpenMultiTracker.

2018/11/06 -- New features add CMake compile support for ECO tracker. (Thanks to ou-zhi-hui)

2018/09/19 -- New features Performance tested on VOT2017 dataset!

2018/09/13 -- New features CN feature added!

2018/08/30 -- New features Support Initialize by Object Detection using Darknet and track.

2018/08/27 -- New features Support ECO API.

2018/08/24 -- New features Now ECO runs "almost" real-time on Raspberry Pi 3!

2018/08/24 -- New features Support FFTW.

2018/08/13 -- New features Speed up by multi-thread.

2018/08/09 -- New features Now it supports Raspberry Pi 3, and speed up with NEON!

2018/08/08 -- New features Speed up with NEON, speed up from ~32FPS to ~42FPS on Jetson TX2 with scale one.

2018/08/06 -- New features Speed up with SSE, speed up from ~86FPS to ~102FPS(quicker than matlab version) with scale one.

2018/07/07 -- New features OpenTracker Implement Notes draft published! Check notes/OpenTrackerNotes.pdf. Complete version is comming!

2018/07/06 -- New features Now it supports Nvidia Jetson TX1/2!

2018/07/05 -- New features Now it supports macOS!

2018/06/28 -- New features Now it supports automatic initialization with Web camera using OpenPose!

Supported tracker (more in progressing):

Included Tracker
☑️ CSK
☑️ KCF
☑️ DSST
☑️ GOTURN
🔨 ECO

Supported Dataset (more in progressing):

Included Dataset Reference
☑️ VOT-2017 Web
☑️ TB-2015 Web
☑️ TLP Web
☑️ UAV123 Web

Supported Autodetection with Web Camera

Included Dataset Reference
☑️ OpenPose Web

Tested Operating Systems / Platform

Included OS / Platform
☑️ Ubuntu 16.04
☑️ macOS Sierra
☑️ NVIDIA Jetson TX1/2
☑️ Rasperberry PI 3
🔨 Windows10

Performance Analysis

"ECOHCMATLAB" is the original matlab full version ECO-HC.

"ECOHCMATLABHOGCN" is the matlab version ECO-HC without fDSST scale filter.

"ECOHCMATLABHOG" is the matlab version ECO-HC without fDSST scale filter and CN feature.

"ECOCPPHOGCN" is the c++ ECO tracker in OpenTracker without fDSST scale filter.

"ECOCPPHOG" is the c++ ECO tracker in OpenTracker without CN feature and fDSST scale filter.

"KCFCPP" is the c++ KCF tracker in OpenTracker.

"NCC" is a demo tracker in vot-toolkit.

The test is on dataset VOT2017, and parameters are set exactly the same as "VOT2016_HC_settings" in matlab version. This is just for proof of validation of c++ version code, thus the parameters are not tuned for VOT2017.

You can see from the plot that, full-featured "ECOHCMATLAB" has the highest performance, "ECOCPPHOGCN" has almost the same performance with "ECOHCMATLABHOGCN", and "ECOCPPHOG" quite similar to "ECOHCMATLABHOG". And "KCFCPP" perform even better than the HOG-only ECO version, so it seems that CN feature matters.

Speed-up(without CN feature)

Included Method(single thread) FPS(scale=1) FPS(scale=7)
☑️ Matlab ECO-HOG(Intel i9) ~73 ~45
☑️ no speed-up(Intel i9) ~86 ~36
☑️ SSE(Intel i9) ~260:cherries: ~95:cherries:
☑️ no speed-up(MacBook Air Intel i5) ~60 ~22
☑️ SSE(MacBook Air Intel i5) ~140:cherries: ~55:cherries:
☑️ no speed-up(Jestson TX2) ~32 ~10
☑️ NEON(Jetson TX2) ~60:cherries: ~34:cherries:
☑️ no speed-up(Raspberrypi) ~11 ~3
☑️ NEON(Raspberrypi) ~24:cherries: ~7.5
🔨 GPU 🔨 🔨

Speed Analysis(without CN feature)

Quick start


With quick start, you can have a quick first taste of this repository, without any panic. No need to install Caffe, CUDA etc. (But of course you have to install OpenCV 3.0 first).

OpenCV 3.0 Install on Ubuntu check this [Tutorial].

Quick Run ECO Tracker:

In eco/runecotracker.cc, make sure to choose the dataset Demo:

    string databaseType = databaseTypes[0];

Quick start -- Ubuntu

git clone https://github.com/rockkingjy/OpenTracker
cd OpenTracker/eco
make -j`nproc`
sudo make install
./runecotracker.bin

Quick start -- macOS

brew install tesseract
git clone https://github.com/rockkingjy/OpenTracker
cd OpenTracker/eco
make  -j`nproc`
sudo make install
./runecotracker.bin

Quick Run KCF and DSST Tracker:

In file kcf/runkcftracker.cc, make sure to choose the dataset Demo:

    string databaseType = databaseTypes[0];

Quick start -- Ubuntu

git clone https://github.com/rockkingjy/OpenTracker
cd OpenTracker/kcf
make 
./runkcftracker.bin

Quick start -- macOS

brew install tesseract
git clone https://github.com/rockkingjy/OpenTracker
cd OpenTracker/kcf
make
./runkcftracker.bin

Quick Run (almost) all the tracker:

git clone https://github.com/rockkingjy/OpenTracker
cd OpenTracker
make 
sudo make install
./trackerscompare.bin

Compile and Run


For the environment settings and detailed procedures (with all the packages from the very beginning), refer to: [My DeeplearningSettings].

The only extra-package is: Opencv3.x (already installed if you follow the environment settings above).

Of course, for trackers that use Deep features, you need to install [caffe] (maybe I will use Darknet with C in the future, I like Darknet 👄 ), and change the makefile according to your path. Compile of caffe refer to : [Install caffe by makefile].

If you want to autodetection the people with web camera, you need to install [OpenPose].

Parameters setting

If you want to use Openpose, in ./makefile, set OPENPOSE=1, else set OPENPOSE=0.

Change the datasets, in inputs/readdatasets.hpp, change the number of string databaseType = databaseTypes[1];

Change the path of datasets, in inputs/readdatasets.cc, change the path to your path of data.

To use web camera with openpose

By raising your two arms higher than your nose, it will atomatically detect the person and start the tracking programme.

Run to compare all the trackers at the same time

make all
sudo make install
./trackerscompare.bin

Run ECO

Compile without Caffe

If you don't want to compile with Caffe, that means you cannot use Deep features, set in eco/makefile: USE_CAFFE=0.

If you don't want to compile with CUDA, that means you cannot use Deep features, set in eco/makefile: USE_CUDA=0.

Compile with Caffe

If you want to compile with Caffe, set in makefile and eco/makefile: USE_CAFFE=1 USE_CUDA=1, and set the according caffe path of your system in eco/makefile:

CAFFE_PATH=<YOUR_CAFFE_PATH>

Download a pretrained [VGG_CNN_M_2048.caffemodel (370 MB)], put it into folder: eco/model

If you could not download through the link above (especially for the people from Mainland China), check this [link] and download.

In eco/parameters.hpp, change the path to your path:

struct CnnParameters
{
	string proto = "<YOUR_PATH>/OpenTracker/eco/model/imagenet-vgg-m-2048.prototxt";
	string model = "<YOUR_PATH>/OpenTracker/eco/model/VGG_CNN_M_2048.caffemodel";
	string mean_file = "<YOUR_PATH>/OpenTracker/eco/model/VGG_mean.binaryproto";

Use CN feature

In eco/runecotracker.cc, change the path:

    parameters.useCnFeature = true;
    parameters.cn_features.fparams.tablename = "<YOUR_PATH>/OpenTracker/eco/look_tables/CNnorm.txt"

Speed-up with SIMD

If you are using Intel computer, in eco\makefile, set:

USE_SIMD=1

If you are using ARM like Jetson TX1/2, in eco\makefile, set:

USE_SIMD=2

If you are using ARM like Rasberrypi 3, in eco\makefile, set:

USE_SIMD=3

Speed-up with multi-thread

In eco\makefile, set:

USE_MULTI_THREAD=1

Speed-up with GPU (not yet implemented)

If you have a GPU, it can speed-up with gpu.

First don't forget to install Opencv with CUDA supported:

cmake -D OPENCV_EXTRA_MODULE_PATH=/media/elab/sdd/Amy/opencv_contrib/modules \
    -D CMAKE_BUILD_TYPE=RELEASE \
    -D CMAKE_INSTALL_PREFIX=/usr/local \
    -D CMAKE_BUILD_TYPE=RELEASE \
    -D CMAKE_INSTALL_PREFIX=/usr/local \
    -D WITH_CUDA=ON \
    -D ENABLE_FAST_MATH=1 \
    -D CUDA_FAST_MATH=1 \
    -D WITH_CUBLAS=1 \
    ..
make -j`nproc` 
sudo make install

in eco/makefile, set:

USE_CUDA=1

Datasets settings

Change the path of your test images in eco/runecotracker.cc.

Change the datasets, in eco/runecotracker.cc, change the number of string databaseType = databaseTypes[1];.

Show heatmap

If you want to show the heatmap of the tracking, in eco/parameters.cc, change to #define DEBUG 1.

Compile and Run:

cd eco
make -j`nproc`
./runecotracker.bin

Run Opencv trackers

Change the path of your test images in kcf/opencvtrackers.cc.

cd opencvtrackers
make 
./opencvtrackers.bin

Run KCF / DSST

Change the path of your test images in kcf/runkcftracker.cc.

cd kcf
make -j`nproc`
./runkcftracker.bin

Run GOTURN

Change the path of your test images in goturn/rungoturntracker.cc.

Pretrained model

You can download a pretrained [goturun_tracker.caffemodel (434 MB)], put it into folder: goturn/nets

cd goturn
make -j`nproc`
./rungoturntracker.bin

Run caffe classification for simple test

./classification.bin   /media/elab/sdd/caffe/models/bvlc_reference_caffenet/deploy.prototxt   /media/elab/sdd/caffe/models/bvlc_reference_caffenet/bvlc_reference_caffenet.caffemodel   /media/elab/sdd/caffe/data/ilsvrc12/imagenet_mean.binaryproto   /media/elab/sdd/caffe/data/ilsvrc12/synset_words.txt   /media/elab/sdd/caffe/examples/images/cat.jpg

Run all trackers

ATTENTION! Make sure that the parameter settings in makefile and eco/makefile are the same, else it will be errors!

How to use the API of the OpenTracker?

To use the API of the trackers is really simple, just two steps. Check example/readme.md.

References


(not complete, tell me if I forgot you)

GOTURN Tracker

Learning to Track at 100 FPS with Deep Regression Networks,
David Held, Sebastian Thrun, Silvio Savarese,
European Conference on Computer Vision (ECCV), 2016 (In press)

KCF Tracker

J. F. Henriques, R. Caseiro, P. Martins, J. Batista,
"High-Speed Tracking with Kernelized Correlation Filters", TPAMI 2015.

CSK Tracker

J. F. Henriques, R. Caseiro, P. Martins, J. Batista,
"Exploiting the Circulant Structure of Tracking-by-detection with Kernels", ECCV 2012.

ECO Tracker

Martin Danelljan, Goutam Bhat, Fahad Khan, Michael Felsberg.
ECO: Efficient Convolution Operators for Tracking.
In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2017.

C-COT Tracker

Martin Danelljan, Andreas Robinson, Fahad Khan, Michael Felsberg.
Beyond Correlation Filters: Learning Continuous Convolution Operators for Visual Tracking.
In Proceedings of the European Conference on Computer Vision (ECCV), 2016.
http://www.cvl.isy.liu.se/research/objrec/visualtracking/conttrack/index.html

SRDCF Tracker

Martin Danelljan, Gustav Häger, Fahad Khan, Michael Felsberg.
Learning Spatially Regularized Correlation Filters for Visual Tracking.
In Proceedings of the International Conference in Computer Vision (ICCV), 2015.
http://www.cvl.isy.liu.se/research/objrec/visualtracking/regvistrack/index.html

SRDCF-Deep Tracker

Martin Danelljan, Gustav Häger, Fahad Khan, Michael Felsberg.
Convolutional Features for Correlation Filter Based Visual Tracking.
ICCV workshop on the Visual Object Tracking (VOT) Challenge, 2015.
http://www.cvl.isy.liu.se/research/objrec/visualtracking/regvistrack/index.html

DSST Tracker

Martin Danelljan, Gustav Häger, Fahad Khan and Michael Felsberg.
Accurate Scale Estimation for Robust Visual Tracking.
In Proceedings of the British Machine Vision Conference (BMVC), 2014.
http://www.cvl.isy.liu.se/research/objrec/visualtracking/scalvistrack/index.html

Martin Danelljan, Gustav Häger, Fahad Khan, Michael Felsberg.
Discriminative Scale Space Tracking.
Transactions on Pattern Analysis and Machine Intelligence (TPAMI), 2017.
http://www.cvl.isy.liu.se/research/objrec/visualtracking/scalvistrack/index.html

HOG feature

N. Dalal and B. Triggs.
Histograms of oriented gradients for human detection.
In CVPR, 2005.

Color Names feature

J. van de Weijer, C. Schmid, J. J. Verbeek, and D. Larlus.
Learning color names for real-world applications.
TIP, 18(7):1512–1524, 2009.

OBT database

Y. Wu, J. Lim, and M.-H. Yang.
Online object tracking: A benchmark.
TPAMI 37(9), 1834-1848 (2015).
https://sites.google.com/site/trackerbenchmark/benchmarks/v10

Y. Wu, J. Lim, and M.-H. Yang.
Object tracking benchmark.
In CVPR, 2013.

VOT database

http://votchallenge.net/

Some code references

KCF: joaofaro/KCFcpp.

DSST: liliumao/KCF-DSST, the max_scale_factor and min_scale_factor is set to 10 and 0.1 in case of divergence error (Tested on UAV123 dataset when the object is quite small, ex.uav2/3/4...).

GOTURN: davheld/GOTURN.

ECO: martin-danelljan/ECO.

opentracker's People

Contributors

103yiran avatar rockkingjy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

opentracker's Issues

Crash in eco in non-deep mode when USE_MULTI_THREAD in use

threaded

SIGABRT.

terminate called after throwing an instance of 'cv::Exception'
what(): OpenCV(4.0.0) /opt/opencv/400/src/opencv-4.0.0/modules/core/src/arithm.cpp:663: error: (-209:Sizes of input arguments do not match) The operation is neither 'array op array' (where arrays have the same size and the same number of channels), nor 'array op scalar', nor 'scalar op array' in function 'arithm_op'

segmentation fault when running eco tracker

Hello

Thanks for your great library.

I've just compiled and run both KCF and DSST tracker successfully. I expected DSST to be faster than KCF as it uses MOSSE tracker but results show that KCF is faster!

Anyway

I tried to run ECO but it gives me segmentation fault (core dumped):

1 205 151 17 50 
../sequences/Crossing/img/0001.jpg
max_score_threshhold: 0.100000
0:0.970590; 1:0.980296; 2:0.990099; 3:1.000000; 4:1.010000; 5:1.020100; 6:1.030301; 
Segmentation fault (core dumped)

How opentracker calls openpose To use web camera?thanks

openpose:
cd build/
sudo make install
OpenTracker:
CMakeLists.txt:
find_package(OpenPose REQUIRED)

include_directories(${OpenPose_INCLUDE_DIRS})

add_executable(example.bin example.cpp)

target_link_libraries(example.bin ${OpenPose_LIBS})
./makefile set
OPENPOSE=1

Opentracker set trackerscompaere.cpp

#include "kcf/kcftracker.hpp"
#include "eco/eco.hpp"
#include "eco/parameters.hpp"

#ifdef USE_CAFFE
#include "goturn/network/regressor.h"
#include "goturn/tracker/tracker.h"
#endif

#include "inputs/readdatasets.hpp"
#include "inputs/readvideo.hpp"
#include "inputs/openpose.hpp"

#include <gflags/gflags.h>
#include <glog/logging.h>

#include <opencv2/opencv.hpp>
#include <opencv2/tracking.hpp>
#include <opencv2/core/ocl.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>

#include
#include
#include

using namespace cv;
using namespace std;

// Convert to string
int main(int argc, char **argv)
{

// Read using openpose============================================
cv::Rect2f bboxGroundtruth;
cv::Mat frame, frameDraw;

OpenPose openpose;
openpose.IniRead(bboxGroundtruth);
VideoCapture capture("rtsp://admin:[email protected]//Streaming/Channels/1"); // open the default camera
if (!capture.isOpened()) // check if we succeeded
    return -1;
capture.set(CV_CAP_PROP_FRAME_WIDTH, 1280);
capture.set(CV_CAP_PROP_FRAME_HEIGHT, 720);
capture >> frame;
frame.copyTo(frameDraw);
rectangle(frameDraw, bboxGroundtruth, Scalar(0, 0, 0), 2, 1);
imshow("Tracking", frameDraw);


// Read from Video and choose a bbox===============================
//::google::InitGoogleLogging(argv[0]);
/*cv::Rect2f bboxGroundtruth;
cv::Mat frame, frameDraw;
cv::VideoCapture capture;
capture.open("sequences/oneperson.mp4");
if (!capture.isOpened())
{
    std::cout << "Capture device failed to open!" << std::endl;
    return -1;
}
capture >> frameDraw;
frameDraw.copyTo(frame);

std::string window_name = "OpenTracker";
cv::namedWindow(window_name);
ReadVideo readvideo;
readvideo.IniRead(bboxGroundtruth, frameDraw, window_name, capture);
*/
// Read from the datasets==========================================

// ::google::InitGoogleLogging(argv[0]);
/* cv::Rect2f bboxGroundtruth;
cv::Mat frame, frameDraw;
ReadDatasets readdatasets;
readdatasets.IniRead(bboxGroundtruth, frame);
frame.copyTo(frameDraw);
readdatasets.DrawGroundTruth(bboxGroundtruth, frameDraw);
*/
// Init the trackers=================================================
// Create Opencv tracker:
string trackerTypes[6] = {"BOOSTING", "MIL", "KCF", "TLD", "MEDIANFLOW", "GOTURN"};
string trackerType = trackerTypes[2];
Ptrcv::Tracker opencvtracker;
if (trackerType == "BOOSTING")
opencvtracker = cv::TrackerBoosting::create();
if (trackerType == "MIL")
opencvtracker = cv::TrackerMIL::create();
if (trackerType == "KCF")
opencvtracker = cv::TrackerKCF::create();
if (trackerType == "TLD")
opencvtracker = cv::TrackerTLD::create();
if (trackerType == "MEDIANFLOW")
opencvtracker = cv::TrackerMedianFlow::create();
if (trackerType == "GOTURN")
opencvtracker = cv::TrackerGOTURN::create();
Rect2d opencvbbox((int)bboxGroundtruth.x, (int)bboxGroundtruth.y, (int)bboxGroundtruth.width, (int)bboxGroundtruth.height);
opencvtracker->init(frame, opencvbbox);

// Create KCFTracker:
bool HOG = true, FIXEDWINDOW = true, MULTISCALE = true, LAB = true, DSST = false; //LAB color space features
kcf::KCFTracker kcftracker(HOG, FIXEDWINDOW, MULTISCALE, LAB, DSST);
Rect2d kcfbbox((int)bboxGroundtruth.x, (int)bboxGroundtruth.y, (int)bboxGroundtruth.width, (int)bboxGroundtruth.height);
kcftracker.init(frame, kcfbbox);

// Create DSSTTracker:
DSST = true;
kcf::KCFTracker dssttracker(HOG, FIXEDWINDOW, MULTISCALE, LAB, DSST);
Rect2d dsstbbox((int)bboxGroundtruth.x, (int)bboxGroundtruth.y, (int)bboxGroundtruth.width, (int)bboxGroundtruth.height);
dssttracker.init(frame, dsstbbox);

#ifdef USE_CAFFE
// Create GOTURN tracker:
const string model_file = "goturn/nets/deploy.prototxt";
const string pretrain_file = "goturn/nets/goturun_tracker.caffemodel";
int gpu_id = 0;
Regressor regressor(model_file, pretrain_file, gpu_id, false);
goturn::Tracker goturntracker(false);
cv::Rect goturnbbox(bboxGroundtruth.x, bboxGroundtruth.y, bboxGroundtruth.width, bboxGroundtruth.height);
BoundingBox bbox_gt;
BoundingBox bbox_estimate_uncentered;
bbox_gt.getRect(goturnbbox);
goturntracker.Init(frame, bbox_gt, &regressor);
#endif

// Create ECO trakcer;
eco::ECO ecotracker;
Rect2f ecobbox(bboxGroundtruth.x, bboxGroundtruth.y, bboxGroundtruth.width, bboxGroundtruth.height);
eco::EcoParameters parameters;
//parameters.max_score_threshhold = 0.1;
// when use cn feature:
parameters.useCnFeature = false;
parameters.cn_features.fparams.tablename = "/usr/local/include/opentracker/eco/look_tables/CNnorm.txt";
ecotracker.init(frame, ecobbox, parameters);

while (frame.data)
{
    frame.copyTo(frameDraw);

    //Opencv=====================
    double timercv = (double)getTickCount();
    bool okopencv = opencvtracker->update(frame, opencvbbox);
    float fpscv = getTickFrequency() / ((double)getTickCount() - timercv);
    if (okopencv)
    {
        rectangle(frameDraw, opencvbbox, Scalar(255, 0, 0), 2, 1);
    }
    else
    {
        putText(frameDraw, "Opencv tracking failure detected", cv::Point(10, 50), FONT_HERSHEY_SIMPLEX, 0.75, Scalar(255, 0, 0), 2);
    }

    //KCF=========================
    double timerkcf = (double)getTickCount();
    bool okkcf = kcftracker.update(frame, kcfbbox);
    float fpskcf = getTickFrequency() / ((double)getTickCount() - timerkcf);
    if (okkcf)
    {
        rectangle(frameDraw, kcfbbox, Scalar(0, 255, 0), 2, 1);
    }
    else
    {
        putText(frameDraw, "Kcf tracking failure detected", cv::Point(10, 80), FONT_HERSHEY_SIMPLEX,
                0.75, Scalar(0, 255, 0), 2);
    }

    //DSST========================
    double timerdsst = (double)getTickCount();
    bool okdsst = dssttracker.update(frame, dsstbbox);
    float fpsdsst = getTickFrequency() / ((double)getTickCount() - timerdsst);
    if (okdsst)
    {
        rectangle(frameDraw, dsstbbox, Scalar(0, 0, 255), 2, 1);
    }
    else
    {
        putText(frameDraw, "DSST tracking failure detected", cv::Point(10, 110), FONT_HERSHEY_SIMPLEX,
                0.75, Scalar(0, 0, 255), 2);
    }

#ifdef USE_CAFFE
//GOTURN=====================
double timergoturn = (double)getTickCount();
goturntracker.Track(frame, &regressor, &bbox_estimate_uncentered);
bbox_estimate_uncentered.putRect(goturnbbox);
float fpsgoturn = getTickFrequency() / ((double)getTickCount() - timergoturn);
rectangle(frameDraw, goturnbbox, Scalar(255, 255, 0), 2, 1);
#endif

    //ECO========================
    double timeeco = (double)getTickCount();
    bool okeco = ecotracker.update(frame, ecobbox);
    float fpseco = getTickFrequency() / ((double)getTickCount() - timeeco);
    if (okeco)
    {
        rectangle(frameDraw, ecobbox, Scalar(255, 0, 255), 2, 1);
    }
    else
    {
        putText(frameDraw, "ECO tracking failure detected", cv::Point(10, 140), FONT_HERSHEY_SIMPLEX,
                0.75, Scalar(255, 0, 255), 2);
    }

    // Draw ground truth box===========================================
    //readdatasets.DrawGroundTruth(bboxGroundtruth, frameDraw);

    // Display FPS on frameDraw
    ostringstream os;
    os << float(fpseco);
    putText(frameDraw, "FPS: " + os.str(), Point(100, 30), FONT_HERSHEY_SIMPLEX,
            0.75, Scalar(255, 0, 255), 2);

    // Draw the label of trackers
    putText(frameDraw, "Opencv ", cv::Point(frameDraw.cols - 180, 50), FONT_HERSHEY_SIMPLEX, 0.75, Scalar(255, 0, 0), 2);
    line(frameDraw, cv::Point(frameDraw.cols - 100, 50), cv::Point(frameDraw.cols - 10, 50), Scalar(255, 0, 0), 2, 1);
    putText(frameDraw, "KCF ", cv::Point(frameDraw.cols - 180, 75), FONT_HERSHEY_SIMPLEX, 0.75, Scalar(0, 255, 0), 2);
    line(frameDraw, cv::Point(frameDraw.cols - 100, 75), cv::Point(frameDraw.cols - 10, 75), Scalar(0, 255, 0), 2, 1);
    putText(frameDraw, "DSST ", cv::Point(frameDraw.cols - 180, 100), FONT_HERSHEY_SIMPLEX, 0.75, Scalar(0, 0, 255), 2);
    line(frameDraw, cv::Point(frameDraw.cols - 100, 100), cv::Point(frameDraw.cols - 10, 100), Scalar(0, 0, 255), 2, 1);
    putText(frameDraw, "ECO ", cv::Point(frameDraw.cols - 180, 125), FONT_HERSHEY_SIMPLEX, 0.75, Scalar(255, 0, 255), 2);
    line(frameDraw, cv::Point(frameDraw.cols - 100, 125), cv::Point(frameDraw.cols - 10, 125), Scalar(255, 0, 255), 2, 1);

#ifdef USE_CAFFE
putText(frameDraw, "GOTURN ", cv::Point(frameDraw.cols - 180, 150), FONT_HERSHEY_SIMPLEX, 0.75, Scalar(255, 255, 0), 2);
line(frameDraw, cv::Point(frameDraw.cols - 100, 150), cv::Point(frameDraw.cols - 10, 150), Scalar(255, 255, 0), 2, 1);
#endif
// Display frameDraw.=========================================================
//cvNamedWindow("Tracking", CV_WINDOW_NORMAL);
imshow("OpenTracker", frameDraw);

    int c = cvWaitKey(1);
    if (c != -1)
        c = c % 256;
    if (c == 27)
    {
        cvDestroyWindow("OpenTracker");
        return 0;
    }
    waitKey(1);

    // Read the next frame

/* Read from dataset /
// readdatasets.ReadNextFrame(bboxGroundtruth, frame);
/
Read from video and choose a bbox /
/
capture >> frame;
if (frame.empty())
return false;*/

}

#ifdef USE_MULTI_THREAD
void *status;
int rc = pthread_join(ecotracker.thread_train_, &status);
if (rc)
{
cout << "Error:unable to join," << rc << std::endl;
exit(-1);
}
#endif
cvDestroyWindow("OpenTracker");
return 0;
}

problem with eco demo

I have run the runecotracker.bin file and I got this problem.
Thank you

./runecotracker.bin
1 205 151 17 50
../sequences/Crossing/img/0001.jpg
max_score_threshhold: 0.100000
0:0.970590; 1:0.980296; 2:0.990099; 3:1.000000; 4:1.010000; 5:1.020100; 6:1.030301;
Frame:1 FPS:42.6117
iou:0.794821
Frame:2 FPS:42.8933
iou:0.600735
Frame:3 FPS:37.0575
iou:0.497778
Frame:4 FPS:49.8684
iou:0.408577
Frame:5 FPS:49.5856
iou:0.18273
Frame:6 FPS:41.2645
iou:0.180562
Frame:7 FPS:50.1363
iou:0.138218
Frame:8 FPS:50.0072
iou:0.096313
Frame:9 FPS:50.7554
iou:0.0511876
Frame:10 FPS:52.3677
iou:0.0328268
Frame:11 FPS:53.3204
iou:0
Frame:12 FPS:41.1977
iou:0
Frame:13 FPS:49.8217
iou:0
Frame:14 FPS:48.8826
iou:0
Frame:15 FPS:51.5841
iou:0
Frame:16 FPS:51.8498
iou:0
Frame:17 FPS:49.1461
iou:0
Frame:18 FPS:38.9096
iou:0
Frame:19 FPS:50.4327
iou:0
Frame:20 FPS:48.5839
iou:0
Frame:21 FPS:47.9093
iou:0
Frame:22 FPS:47.3173
iou:0
Frame:23 FPS:47.4009
iou:0
Frame:24 FPS:39.0175
iou:0
Frame:25 FPS:46.4634
iou:0
Frame:26 FPS:48.1754
iou:0
Frame:27 FPS:45.9872
iou:0
Frame:28 FPS:45.7628
iou:0
Frame:29 FPS:45.2781
iou:0

**terminate called after throwing an instance of 'cv::Exception'

what(): OpenCV(3.4.4) /home/ahmad/opencv/modules/core/src/matrix.cpp:433: error: (-215:Assertion failed) 0 <= _colRange.start && _colRange.start <= _colRange.end && _colRange.end <= m.cols in function 'Mat'**

eco runecotracker.bin cannot run

After I success to make the runecontracker.bin, I cannot run the bin and show the error below.
How can I resolve this problem. Thank you.
image

in the darknet:https://github.com/rockkingjy/darknet

when run with OpenTracker in the darknet ,it has 0o response, no error.
xxx@xxx-System-Product-Name:/disk_a/darknet$ ./darknet detector tracking cfg/coco.data cfg/yolov3.cfg weights/yolov3.weights rtsp://admin:[email protected]//Streaming/Channels/1
xxx@xxx-System-Product-Name:
/disk_a/darknet$
I also try this ,but it have no response,no error:
xxx@xxx-System-Product-Name:-System-Product-Name:/disk_a/darknet$ ./darknet detector tracking cfg/coco.data cfg/yolov3.cfg weights/yolov3.weights
xxx@xxx-System-Product-Name:-
/disk_a/darknet$
So what can I do for darknet to connect to opentracker?

eco tracker error

I tried Quick Run ECO Tracker --ubuntu, but I get an error like the one below and it will end on the way.

terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc

or

OpenCV Error: Assertion failed (0 <= _colRange.start && _colRange.start <= _colRange.end && _colRange.end <= m.cols) in Mat, file /home/satlab/opencv-3.3.1/modules/core/src/matrix.cpp, line 501
terminate called after throwing an instance of 'cv::Exception'
what(): /home/satlab/opencv-3.3.1/modules/core/src/matrix.cpp:501: error: (-215) 0 <= _colRange.start && _colRange.start <= _colRange.end && _colRange.end <= m.cols in function Mat

question about sample_update.cc

in function update_sample_space_model in case "if memory is full", I got confused about the prior weights renormalization step. why the loop is controlled by i < prior_weights_[i] instead of i < prior_weights_.size().
I cant see the meaning of the former one. I am looking forward to your reply:)

y

Hello, thank you very much, but I want to know how to train the model. Is the picture with label used during the training?Looking forward to your reply.

Quick Run ECO Tracker-- Ubuntu

Sorry to bother you~When i run "make -j" with the quick start run ECO tracker. I got a error, my platform is Ubuntu14.04 and opencv3.1.0.

image

Question about the function subPixelPeak()

I'm studying your codes these days. In KCF or DSST(kcftracker.cpp), I wonder what's the use of the function subPixelPeak()?
And why use
p.x += subPixelPeak(res.at<float>(pi.y, pi.x - 1), peak_value, res.at<float>(pi.y, pi.x + 1));
to change the location p?
Thanks a lot!

one problem when do the Quick Run ECO Tracker

my platform is Jetson TX1, ubuntu 16.04
after making changes as the guide, and cd OpenTracker/eco
make
my problem is as following:
g++ -c -o ffttools.o ffttools.cc -g -Wall pkg-config --cflags opencv -lstdc++ -lm -std=c++0x -O3 -fPIC -DUSE_SIMD -msse4 -DUSE_MULTI_THREAD -isystem ../googletest/include
g++: error: unrecognized command line option ‘-msse4’
makefile:110: recipe for target 'ffttools.o' failed
make: *** [ffttools.o] Error 1

really hope to get your help

多分辨率特征融合

您好,请问一下为什么将特征从离散域转化到连续域之后,就解决了多分辨率特征融合的问题呢?给离散特征插值并不改变特征的分辨率吧?

I always get "Did not receive response" error

Testing TraX protocol support for tracker eco.
TraX support detected.
Experiment baseline
Tracker eco
Sequence bag
Sequence ball1
Repetition 1
Tracker execution interrupted: Did not receive response.
错误使用 traxclient
Did not receive response.

出错 tracker_run (line 78)
data = traxclient(tracker.command, callback, ...

出错 experiment_supervised (line 71)
data = tracker_run(tracker, @callback, data);

出错 tracker_evaluate (line 57)
[files, metadata] = experiment_function(tracker, sequence, directory, parameters, scan);

出错 workspace_evaluate>execute_iterator (line 128)
tracker_evaluate(event.tracker, event.sequence, event.experiment);

出错 iterate (line 65)
context = iterator(event, context);

出错 workspace_evaluate (line 93)
context = iterate(experiments, trackers, sequences, 'iterator', iterator, 'context', context);

出错 run_experiments (line 10)
workspace_evaluate(tracker, sequences, experiments);

I look at the code,but I didn't see anything wrong。
Looking forward to your reply

After closing KCF tracker , the memory didn't release completely.

I found even if i closed KCF tracking, RAM usage dropped,but didn't release completely(according to the tracker_box, maybe 2% or higher).
Such as, I run the tracker in a child thread, and the main thread just loops(do nothing) after the child thread closed.
What causes this problem?

我发现了两个ECO在安卓手机上的BUG,并已经把它们解决了

1.gradient.cpp中的gradHist函数中指针的索引有的时候会出现异常值,我也不清楚原因,这是个随机性BUG,并且处理器越好的手机,发生这个BUG的可能性越大,(难道是处理速度太快了,指针调用没跟上?)。我对所有需要用索引的地方(比如H0[O0[y]+1]+=ms[1]*M0[y];)都对他们的索引进行检查(比如检查O0[y]和y的值),如果出现异常直接continue,这个BUG就没有再出现过了。
2.在ffttools.cpp中的magnitude函数,在cv::split(img, planes);时有的时候会出现分解不出结果的情况(planes.size()=0;但是分解前channel=2),这个问题也是概率出现,不知道是不是因为输入变量加了const导致的。我在函数开始时建了一个Mat,然后把img给copyTo过去,再用这个新的Mat进行分解,这个BUG就没有再出现过了。(我用的OPENCV版本是3.4.0)

以上是我在安卓上发现的BUG,不知道你在别的平台有没有遇到过。

retracking

A target tracking failure, re-tracking for another target, how to operate? reset Just correct the previous target

Support Opencv4

HI rockkingjy

since Opencv4 , "A lot of C API from OpenCV 1.x has been removed."
so when I use openvino r4, the opencv has no 1.x header.
fhog.hpp:123:26: error: \u2018IplImage\u2019 does not name a type int getFeatureMaps(const IplImage *image, const int k,
is any plan to update the code?

win10 "flip" problem

Hi, there is a problem with flip function(ffttools.hpp-->rot90-->flip).
0x00007FFCE766A388 处(位于 eco_demo.exe 中)引发的异常: Microsoft C++ 异常: ipp::IwException,位于内存位置 0x000000474BE7E5B4 处
Do you have some idea with it? thank you!

crash during update intial bounding box

Hi:

Thanks for your update ECO, that is amazing work! but init function crashes when I try to reset initial bounding box (when I drop a current tracking and initialize a new tracking), do you have any alternative way?

best regards

为什么我在安卓手机上用NEON优化后的程序,比没优化前的程序还慢

你好,又是我...

前段时间我还用不了NEON优化,但是看了你做的bug修复后,发现是我更改了HOG的cellsize导致特征大小与初始化时不同,失败。修改后就能用了。

我是在SSE.hpp中#define USE_NEON和feature_extractor.hpp中#define USE_SIMD,编译器设置
-DUSE_SIMD -DUSE_NEON -ffast-math -flto -mfpu=neon 来运行NEON优化的。但是运行中出现了问题。

首先,在速度上,优化后提取一次特征用时40ms以上,没优化前20ms左右;(单尺度,骁龙660)
其次,在正确性上,优化后得到的pos点是不正确的,一直飘。

我看了HOG特征中的数据,看着是挺正常的,大小和channel也都正常,是不是我这样的设置方式不太妥?
另外速度居然还没有优化前快,难道是CPU已经到极限了?

slowly when testing ECO

When I was testing ECO, there was almost no delay, but the frame rate was only about 30.
My computer is intel-i5, system linux-CentOS7

RK3288

Hi rockkingjy,
I make the project in RK3288, I set SIMD=3,When I make -j nproc, it show Segmentation fault ,how it can hannpen? Thanks!!!!!!!

yours sincerely

there is a error when run ecotracker.bin

[~/share/tracking/OpenTracker/eco]$ ./runecotracker.bin [master]
1 205 151 17 50
../sequences/Crossing/img/0001.jpg
max_score_threshhold: 0.100000
0:0.970590; 1:0.980296; 2:0.990099; 3:1.000000; 4:1.010000; 5:1.020100; 6:1.030301;
Frame:1 FPS:50.8075
iou:0.794821
Frame:2 FPS:57.7728
iou:0.600735
Frame:3 FPS:63.9741
iou:0.497778
Frame:4 FPS:63.936
iou:0.408577
Frame:5 FPS:63.9623
iou:0.18273
Frame:6 FPS:63.0413
iou:0.180562
Frame:7 FPS:62.6116
iou:0.138218
Frame:8 FPS:62.6241
iou:0.096313
Frame:9 FPS:59.5788
iou:0.0511876
Frame:10 FPS:62.3493
iou:0.0328268
Frame:11 FPS:58.1977
iou:0
Frame:12 FPS:57.9719
iou:0
Frame:13 FPS:58.1826
iou:0
Frame:14 FPS:57.7413
iou:0
Frame:15 FPS:58.1107
iou:0
Frame:16 FPS:59.2547
iou:0
Frame:17 FPS:55.4815
iou:0
Frame:18 FPS:55.1005
iou:0
Frame:19 FPS:55.2519
iou:0
Frame:20 FPS:54.2799
iou:0
Frame:21 FPS:53.277
iou:0
Frame:22 FPS:54.8815
iou:0
Frame:23 FPS:51.8867
iou:0
Frame:24 FPS:53.6728
iou:0
Frame:25 FPS:54.2151
iou:0
Frame:26 FPS:53.7847
iou:0
Frame:27 FPS:52.5177
iou:0
Frame:28 FPS:51.9536
iou:0
Frame:29 FPS:51.0908
iou:0
runecotracker.bin: sample_update.cc:284: void eco::SampleUpdate::update_distance_matrix(cv::Mat&, float, int, int, float, float): Assertion `0 && "error: alpha1 or alpha2 equals 0"' failed.
[1] 22526 abort (core dumped) ./runecotracker.bin

when I "make all " ,there are some errors

inputs/openpose.cc:412:113: error: cannot convert ‘fLS::clstring {aka std::__cxx11::basic_string}’ to ‘int’ for argument ‘6’ to ‘std::pair<op::ProducerType, std::__cxx11::basic_string > op::flagsToProducer(const string&, const string&, const string&, int, bool, int)’
(unsigned int)FLAGS_3d_views, FLAGS_flir_camera_index);
^
inputs/openpose.cc:436:13: error: ‘op::Wrapper {aka op::WrapperT<std::vectorop::Datum >}’ is not a template
op::Wrapper<std::vector> opWrapper;
^
inputs/openpose.cc:444:19: error: ‘op::Wrapper {aka class op::WrapperT<std::vectorop::Datum >}’ has no member named ‘setWorkerOutput’
opWrapper.setWorkerOutput(wUserOutput, workerOutputOnNewThread);
^
inputs/openpose.cc:472:52: error: no matching function for call to ‘op::WrapperStructInput::WrapperStructInput()’
FLAGS_frame_rotate, FLAGS_frames_repeat};
^

ECO::init is time consuming

Compared with ECO::update, ECO::init takes too much time to run. It will make retracking( Using ECO::init multiple times to change targets) become very hard.

I want to use OpenTracker in ROS(Robot Operating System)

I want to use eco tracker with ros, but I need to rewrite makefile to CmakeLists.
Because I am a C ++ beginner I could not rewrite successfully, the effective speed fell to half. Please let me know if you know how to rewrite.

Do not support in Nvidia Jestson Xavier?

I can build the project. But when I try to run it. It's does not work and print that"Segmentation fault (core dumped)".
Thanks for any help.

nvidia@jetson:~$ pkg-config --modversion opencv
3.3.1
nvidia@jetson:~/Downloads/OpenTracker/eco$ gedit makefile
Set the SIMD to 2.
nvidia@jetson:~/Downloads/OpenTracker/eco$ make -jnproc
g++ -c -o ffttools.o ffttools.cc -g -Wall pkg-config --cflags opencv -lstdc++ -lm -std=c++0x -O3 -fPIC -DUSE_SIMD -DUSE_NEON -ffast-math -flto -march=armv8-a+crypto -mcpu=cortex-a57+crypto -DUSE_MULTI_THREAD
g++ -c -o fhog.o fhog.cc -g -Wall pkg-config --cflags opencv -lstdc++ -lm -std=c++0x -O3 -fPIC -DUSE_SIMD -DUSE_NEON -ffast-math -flto -march=armv8-a+crypto -mcpu=cortex-a57+crypto -DUSE_MULTI_THREAD
g++ -c -o interpolator.o interpolator.cc -g -Wall pkg-config --cflags opencv -lstdc++ -lm -std=c++0x -O3 -fPIC -DUSE_SIMD -DUSE_NEON -ffast-math -flto -march=armv8-a+crypto -mcpu=cortex-a57+crypto -DUSE_MULTI_THREAD
g++ -c -o optimize_scores.o optimize_scores.cc -g -Wall pkg-config --cflags opencv -lstdc++ -lm -std=c++0x -O3 -fPIC -DUSE_SIMD -DUSE_NEON -ffast-math -flto -march=armv8-a+crypto -mcpu=cortex-a57+crypto -DUSE_MULTI_THREAD
g++ -c -o scale_filter.o scale_filter.cc -g -Wall pkg-config --cflags opencv -lstdc++ -lm -std=c++0x -O3 -fPIC -DUSE_SIMD -DUSE_NEON -ffast-math -flto -march=armv8-a+crypto -mcpu=cortex-a57+crypto -DUSE_MULTI_THREAD
g++ -c -o regularization_filter.o regularization_filter.cc -g -Wall pkg-config --cflags opencv -lstdc++ -lm -std=c++0x -O3 -fPIC -DUSE_SIMD -DUSE_NEON -ffast-math -flto -march=armv8-a+crypto -mcpu=cortex-a57+crypto -DUSE_MULTI_THREAD
g++ -c -o feature_extractor.o feature_extractor.cc -g -Wall pkg-config --cflags opencv -lstdc++ -lm -std=c++0x -O3 -fPIC -DUSE_SIMD -DUSE_NEON -ffast-math -flto -march=armv8-a+crypto -mcpu=cortex-a57+crypto -DUSE_MULTI_THREAD
g++ -c -o feature_operator.o feature_operator.cc -g -Wall pkg-config --cflags opencv -lstdc++ -lm -std=c++0x -O3 -fPIC -DUSE_SIMD -DUSE_NEON -ffast-math -flto -march=armv8-a+crypto -mcpu=cortex-a57+crypto -DUSE_MULTI_THREAD
g++ -c -o training.o training.cc -g -Wall pkg-config --cflags opencv -lstdc++ -lm -std=c++0x -O3 -fPIC -DUSE_SIMD -DUSE_NEON -ffast-math -flto -march=armv8-a+crypto -mcpu=cortex-a57+crypto -DUSE_MULTI_THREAD
In file included from ffttools.hpp:40:0,
from feature_operator.hpp:8,
from feature_operator.cc:1:
debug.hpp: In function ‘void eco::timerExampleCV()’:
debug.hpp:42:8: warning: variable ‘timedft’ set but not used [-Wunused-but-set-variable]
float timedft = 0;
^~~~~~~
In file included from ffttools.hpp:40:0,
from feature_extractor.hpp:14,
from feature_extractor.cc:1:
debug.hpp: In function ‘void eco::timerExampleCV()’:
debug.hpp:42:8: warning: variable ‘timedft’ set but not used [-Wunused-but-set-variable]
float timedft = 0;
^~~~~~~
In file included from ffttools.hpp:40:0,
from scale_filter.hpp:5,
from scale_filter.cc:1:
debug.hpp: In function ‘void eco::timerExampleCV()’:
debug.hpp:42:8: warning: variable ‘timedft’ set but not used [-Wunused-but-set-variable]
float timedft = 0;
^~~~~~~
debug.hpp: In function ‘void eco::absTest()’:
debug.hpp:596:8: warning: variable ‘abs’ set but not used [-Wunused-but-set-variable]
float abs = std::abs(1.23f);
^~~
debug.hpp: In function ‘void eco::accumulateTest()’:
debug.hpp:609:8: warning: variable ‘sum’ set but not used [-Wunused-but-set-variable]
float sum = std::accumulate(v.begin(), v.end(), 0);
^~~
debug.hpp: In function ‘void eco::absTest()’:
debug.hpp:596:8: warning: variable ‘abs’ set but not used [-Wunused-but-set-variable]
float abs = std::abs(1.23f);
^~~
debug.hpp: In function ‘void eco::accumulateTest()’:
debug.hpp:609:8: warning: variable ‘sum’ set but not used [-Wunused-but-set-variable]
float sum = std::accumulate(v.begin(), v.end(), 0);
^~~
debug.hpp: In function ‘void eco::absTest()’:
debug.hpp:596:8: warning: variable ‘abs’ set but not used [-Wunused-but-set-variable]
float abs = std::abs(1.23f);
^~~
debug.hpp: In function ‘void eco::accumulateTest()’:
debug.hpp:609:8: warning: variable ‘sum’ set but not used [-Wunused-but-set-variable]
float sum = std::accumulate(v.begin(), v.end(), 0);
^~~
In file included from interpolator.hpp:6:0,
from interpolator.cc:1:
debug.hpp: In function ‘void eco::timerExampleCV()’:
debug.hpp:42:8: warning: variable ‘timedft’ set but not used [-Wunused-but-set-variable]
float timedft = 0;
^~~~~~~
debug.hpp: In function ‘void eco::absTest()’:
debug.hpp:596:8: warning: variable ‘abs’ set but not used [-Wunused-but-set-variable]
float abs = std::abs(1.23f);
^~~
debug.hpp: In function ‘void eco::accumulateTest()’:
debug.hpp:609:8: warning: variable ‘sum’ set but not used [-Wunused-but-set-variable]
float sum = std::accumulate(v.begin(), v.end(), 0);
^~~
In file included from ffttools.hpp:40:0,
from optimize_scores.hpp:7,
from optimize_scores.cc:1:
debug.hpp: In function ‘void eco::timerExampleCV()’:
debug.hpp:42:8: warning: variable ‘timedft’ set but not used [-Wunused-but-set-variable]
float timedft = 0;
^~~~~~~
In file included from ffttools.hpp:40:0,
from ffttools.cc:2:
debug.hpp: In function ‘void eco::timerExampleCV()’:
debug.hpp:42:8: warning: variable ‘timedft’ set but not used [-Wunused-but-set-variable]
float timedft = 0;
^~~~~~~
debug.hpp: In function ‘void eco::absTest()’:
debug.hpp:596:8: warning: variable ‘abs’ set but not used [-Wunused-but-set-variable]
float abs = std::abs(1.23f);
^~~
debug.hpp: In function ‘void eco::accumulateTest()’:
debug.hpp:609:8: warning: variable ‘sum’ set but not used [-Wunused-but-set-variable]
float sum = std::accumulate(v.begin(), v.end(), 0);
^~~
debug.hpp: In function ‘void eco::absTest()’:
debug.hpp:596:8: warning: variable ‘abs’ set but not used [-Wunused-but-set-variable]
float abs = std::abs(1.23f);
^~~
debug.hpp: In function ‘void eco::accumulateTest()’:
debug.hpp:609:8: warning: variable ‘sum’ set but not used [-Wunused-but-set-variable]
float sum = std::accumulate(v.begin(), v.end(), 0);
^~~
In file included from ffttools.hpp:40:0,
from regularization_filter.hpp:8,
from regularization_filter.cc:1:
debug.hpp: In function ‘void eco::timerExampleCV()’:
debug.hpp:42:8: warning: variable ‘timedft’ set but not used [-Wunused-but-set-variable]
float timedft = 0;
^~~~~~~
debug.hpp: In function ‘void eco::absTest()’:
debug.hpp:596:8: warning: variable ‘abs’ set but not used [-Wunused-but-set-variable]
float abs = std::abs(1.23f);
^~~
debug.hpp: In function ‘void eco::accumulateTest()’:
debug.hpp:609:8: warning: variable ‘sum’ set but not used [-Wunused-but-set-variable]
float sum = std::accumulate(v.begin(), v.end(), 0);
^~~
g++ -c -o sample_update.o sample_update.cc -g -Wall pkg-config --cflags opencv -lstdc++ -lm -std=c++0x -O3 -fPIC -DUSE_SIMD -DUSE_NEON -ffast-math -flto -march=armv8-a+crypto -mcpu=cortex-a57+crypto -DUSE_MULTI_THREAD
g++ -c -o eco.o eco.cc -g -Wall pkg-config --cflags opencv -lstdc++ -lm -std=c++0x -O3 -fPIC -DUSE_SIMD -DUSE_NEON -ffast-math -flto -march=armv8-a+crypto -mcpu=cortex-a57+crypto -DUSE_MULTI_THREAD
g++ -c -o metrics.o metrics.cc -g -Wall pkg-config --cflags opencv -lstdc++ -lm -std=c++0x -O3 -fPIC -DUSE_SIMD -DUSE_NEON -ffast-math -flto -march=armv8-a+crypto -mcpu=cortex-a57+crypto -DUSE_MULTI_THREAD
g++ -c -o gradient.o gradient.cpp -g -Wall pkg-config --cflags opencv -lstdc++ -lm -std=c++0x -O3 -fPIC -DUSE_SIMD -DUSE_NEON -ffast-math -flto -march=armv8-a+crypto -mcpu=cortex-a57+crypto -DUSE_MULTI_THREAD
g++ -c -o runecotracker.o runecotracker.cc -g -Wall pkg-config --cflags opencv -lstdc++ -lm -std=c++0x -O3 -fPIC -DUSE_SIMD -DUSE_NEON -ffast-math -flto -march=armv8-a+crypto -mcpu=cortex-a57+crypto -DUSE_MULTI_THREAD
In file included from ffttools.hpp:40:0,
from training.hpp:12,
from training.cc:1:
debug.hpp: In function ‘void eco::timerExampleCV()’:
debug.hpp:42:8: warning: variable ‘timedft’ set but not used [-Wunused-but-set-variable]
float timedft = 0;
^~~~~~~
debug.hpp: In function ‘void eco::absTest()’:
debug.hpp:596:8: warning: variable ‘abs’ set but not used [-Wunused-but-set-variable]
float abs = std::abs(1.23f);
^~~
debug.hpp: In function ‘void eco::accumulateTest()’:
debug.hpp:609:8: warning: variable ‘sum’ set but not used [-Wunused-but-set-variable]
float sum = std::accumulate(v.begin(), v.end(), 0);
^~~
gradient.cpp: In function ‘void gradMag(float*, float*, float*, int, int, int, bool)’:
gradient.cpp:78:9: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
if( c==0 ) continue; _m = CMPGT( _M2[y1], _M2[y] );
^~
gradient.cpp:78:30: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
if( c==0 ) continue; _m = CMPGT( _M2[y1], _M2[y] );
^~
gradient.cpp: In function ‘void gradMagNorm(float*, float*, int, int, float)’:
gradient.cpp:111:3: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
if(sse) i*=4; for(; i<n; i++) M[i] /= (S[i] + norm);
^~
gradient.cpp:111:17: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
if(sse) i*=4; for(; i<n; i++) M[i] /= (S[i] + norm);
^~~
metrics.cc: In member function ‘float Metrics::auc()’:
metrics.cc:42:1: warning: no return statement in function returning non-void [-Wreturn-type]
}
^
In file included from ffttools.hpp:40:0,
from sample_update.hpp:10,
from sample_update.cc:1:
debug.hpp: In function ‘void eco::timerExampleCV()’:
debug.hpp:42:8: warning: variable ‘timedft’ set but not used [-Wunused-but-set-variable]
float timedft = 0;
^~~~~~~
debug.hpp: In function ‘void eco::absTest()’:
debug.hpp:596:8: warning: variable ‘abs’ set but not used [-Wunused-but-set-variable]
float abs = std::abs(1.23f);
^~~
debug.hpp: In function ‘void eco::accumulateTest()’:
debug.hpp:609:8: warning: variable ‘sum’ set but not used [-Wunused-but-set-variable]
float sum = std::accumulate(v.begin(), v.end(), 0);
^~~
In file included from interpolator.hpp:6:0,
from eco.hpp:27,
from eco.cc:1:
debug.hpp: In function ‘void eco::timerExampleCV()’:
debug.hpp:42:8: warning: variable ‘timedft’ set but not used [-Wunused-but-set-variable]
float timedft = 0;
^~~~~~~
debug.hpp: In function ‘void eco::absTest()’:
debug.hpp:596:8: warning: variable ‘abs’ set but not used [-Wunused-but-set-variable]
float abs = std::abs(1.23f);
^~~
debug.hpp: In function ‘void eco::accumulateTest()’:
debug.hpp:609:8: warning: variable ‘sum’ set but not used [-Wunused-but-set-variable]
float sum = std::accumulate(v.begin(), v.end(), 0);
^~~
eco.cc: In member function ‘void eco::ECO::init(cv::Mat&, const Rect2f&, const eco::EcoParameters&)’:
eco.cc:9:8: warning: variable ‘fpseco’ set but not used [-Wunused-but-set-variable]
float fpseco = 0;
^~~~~~
In file included from interpolator.hpp:6:0,
from eco.hpp:27,
from runecotracker.cc:7:
debug.hpp: In function ‘void eco::timerExampleCV()’:
debug.hpp:42:8: warning: variable ‘timedft’ set but not used [-Wunused-but-set-variable]
float timedft = 0;
^~~~~~~
debug.hpp: In function ‘void eco::absTest()’:
debug.hpp:596:8: warning: variable ‘abs’ set but not used [-Wunused-but-set-variable]
float abs = std::abs(1.23f);
^~~
debug.hpp: In function ‘void eco::accumulateTest()’:
debug.hpp:609:8: warning: variable ‘sum’ set but not used [-Wunused-but-set-variable]
float sum = std::accumulate(v.begin(), v.end(), 0);
^~~
gcc -o runecotracker.bin ffttools.o fhog.o interpolator.o optimize_scores.o scale_filter.o regularization_filter.o feature_extractor.o feature_operator.o training.o sample_update.o eco.o metrics.o gradient.o runecotracker.o pkg-config --libs opencv -lstdc++ -lm -pthread
gcc pkg-config --libs opencv -lstdc++ -lm -pthread -shared -o libecotracker.so ffttools.o fhog.o interpolator.o optimize_scores.o scale_filter.o regularization_filter.o feature_extractor.o feature_operator.o training.o sample_update.o eco.o metrics.o gradient.o
nvidia@jetson:~/Downloads/OpenTracker/eco$ sudo make install
[sudo] password for nvidia:
mkdir -p /usr/local/include/opentracker
mkdir -p /usr/local/include/opentracker/eco
mkdir -p /usr/local/include/opentracker/eco/look_tables
cp libecotracker.so /usr/local/lib
cp *.hpp /usr/local/include/opentracker/eco
cp *.h /usr/local/include/opentracker/eco
cp -a look_tables/. /usr/local/include/opentracker/eco/look_tables
nvidia@jetson:~/Downloads/OpenTracker/eco$ ./runecotracker.bin
Segmentation fault (core dumped)

speed to test

hi, i write the cmakelist to replace makefile to compile, but code and configuration is not changed,the result are as follows:

cmakelist Frames:119 AvgPrecision:1 AvgIou:0.669755 SuccessRate:0.957983 IniFps:2.47154 AvgFps:100.776
makefile Frames:119 AvgPrecision:1 AvgIou:0.715986 SuccessRate:1 IniFps:2.35872 AvgFps:44.9528
hardware model name : Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz

the speed is more faster,but IOU is decline,do you know what reasons for this result?

FFTW slows down the algorithm!

Hello

I've tested your dft function which can use FFTW. OpenCV takes 39ms to calculate dft of my image. But FFTW takes 180-190ms! Let me say that I just measured the fftw_execute(p) part so that matrix allocations won't be considered in calculation time.
Could you please help? I expected FFTW to be faster than OpenCV's implementation

我发现了两个ECO在安卓手机上的BUG

我已经使用了最新版本的程序,但是依旧会出现那两个BUG。
1.gradient.cpp中的gradHist函数中指针的索引有的时候会出现异常值。
报错内容:
(_Z8gradHistPfS_S_iiiiib+1225)
(_Z4fhogPfS_S_iiiiif+106)
(_ZN3eco16FeatureExtractor21get_hog_features_simdESt6vectorIN2cv3MatESaIS3_EEb+400)
(_ZN3eco16FeatureExtractor9extractorEN2cv3MatENS1_6Point_IfEESt6vectorIfSaIfEERKNS_13EcoParametersERKb+1422)
(_ZN3eco3ECO6updateERKN2cv3MatERNS1_5Rect_IfEE+1218)
可以大致看出报错函数是gradHist。报错的代码大致意思是内存操作出现问题,这个BUG我只能加判断指针地址是否为正(O0[y]的值有时为负),如果为正才赋值。我这样做后BUG不再出现,似乎对结果也没有影响,但是对效率有较大影响。所以我想找一个能够治本的方法,暂时还没找到。
这个BUG一般在运行后几秒出现,有较小几率运行十几分钟也不出现。
2.在ffttools.cpp中的magnitude函数,在cv::split(img, planes);时有的时候会出现分解不了的情况(这个函数只在regularization_filter中调用了,出现这个BUG的时候reg_window_dft.channels()=1,planes.size()=0,应该是前面的步骤还有其他错误)。
报错内容:
(_ZNK2cv11_InputArray4typeEi+293)
(_ZN2cv9magnitudeERKNS_11_InputArrayES2_RKNS_12_OutputArrayE+30)
(_ZN3eco25get_regularization_filterEN2cv5Size_IiEENS1_IfEERKNS_13EcoParametersE+1142)
(_ZN3eco3ECO4initERN2cv3MatERKNS1_5Rect_IfEERKNS_13EcoParametersE+3588)
可以看出是magnitude函数的输入数组有问题。报错的代码大致意思也是内存操作出现问题(安卓对C的调试似乎很不友好,报错代码总是不明不白)。这个问题很少出现,是什么造成的还不清楚。

questions about feature_extractor.cc

In the line 230 of file feature_extractor.cc, it is sure that row and column are represented by i and j respectively, but the right of the "=" is ims.at(j, i), which show the position of a pixel, if h != w, it will be wrong!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.