Skip to content

Commit

Permalink
Version 0.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
huifang committed Feb 10, 2018
1 parent 4713507 commit fe046b5
Show file tree
Hide file tree
Showing 21 changed files with 14,238 additions and 69 deletions.
1 change: 1 addition & 0 deletions OpenTLDConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ set(OPENTLD_INCLUDE_DIRS
${src_dir}/src/libopentld/tld
${src_dir}/src/libopentld/mftracker
${src_dir}/src/libopentld/imacq
${src_dir}/src/opentld/main/json
${src_dir}/src/opentld/main)
INCLUDE_DIRECTORIES(${OPENTLD_INCLUDE_DIRS})

Expand Down
71 changes: 18 additions & 53 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,72 +1,36 @@
# Introduction
# ObjectTracker

This is a fork of the [C++ implementation of OpenTLD](https://github.com/gnebehay/OpenTLD) called TrackTLD.
OpenTLD was originally proposed in [1] and implemented by Georg Nebehay in C++.

This fork uses C++ implementations of correlation filter based trackers as short-term trackers. Both short-term trackers are modified variants of the visual trackers proposed in [2,3].
The short-term trackers are extended with target loss detection capabilities as in [4] and use the C++ implementation [5] of the FHOG features proposed in [6]. More implementation details of the short-term trackers can be found [here](src/3rdparty/cf_tracking/README.md). The detection cascade is only used to suggest possible target locations to the short-term trackers for redetection purposes. It cannot reinitialize the short-term trackers. The short-term trackers decide whether a suggested patch actually contains the target.
The short-term trackers are extended with target loss detection capabilities as in [4] and use the C++ implementation [5] of the FHOG features proposed in [6]. The detection cascade is only used to suggest possible target locations to the short-term trackers for redetection purposes. It cannot reinitialize the short-term trackers. The short-term trackers decide whether a suggested patch actually contains the target.

The system starts with the KCFcpp as default short-term tracker.

# Usage
If you have a webcam attached to your RK3399 or 96board, you can simply execute cftld in order to try it out.
If you have a webcam attached to your ROCK960, you can simply execute cftld in order to
try it out.

Press 'r' key, drag the mouse to draw the box to be tracked target. And press the Enter key to start tracking.

### Keyboard shortcuts
* `r` select a target
* `q` quit
* `l` toggle learning
* `a` toggle alternating mode (if true, detector is switched off when tracker is available)

### Command line options
#### Synopsis
`cftld [option arguments] [arguments]`

#### option arguments
* `-x Use DSSTcpp instead of KCFcpp as short-term tracker. KCFcpp is the default short-term tracker.`
* `[-a <startFrameNumber>]` video starts at the frameNumber _startFrameNumber_
* `[-b <x,y,w,h>]` Initial bounding box
* `[-d <device>]` select input device: _device_=(IMGS|CAM|VID|STREAM)
_IMGS_: capture from images
_CAM_: capture from connected camera
_VID_: capture from a video
_STREAM_: capture from RTSP stream
* `[-f]` shows foreground
* `[-i <path>]` _path_ to the images or to the video.
* `[-j <number>]` show trajectory for the last _number_ frames
* `[-h]` shows help
* `[-n <number>]` Specifies the video device to use (defaults to 0). Useful to select a different camera when multiple cameras are connected.
* `[-p path]` prints results into the file _path_
* `[-s]` if set, user can select initial bounding box
* `[-t <theta>]` threshold for determining positive results
* `[-z <lastFrameNumber>]` video ends at the frameNumber _lastFrameNumber_.
If _lastFrameNumber_ is 0 or the option argument isn't specified means
all frames are taken.

#### Arguments
`[CONFIG_FILE]` path to config file

### Config files
Refer to the sample folder to see usage and config file examples.

# Build
### Dependencies
* C++11
* OpenCV 3.x
* CMake
* libconfig++ (provided)
* ARM NEON -capable CPU

### Ubuntu 16.04
* Install OpenCV 3.x and CMake.
* Configure and compile:
```
mkdir <top-dir>/build
cd <top-dir>/build
cmake ../
make -j 4
```
### Documents
* [Installation instructions](installation.md)
* [Accuracy test instructions](accuracy_test_instruction.md)
* [Performance Report PDF](performance_report_objecttraker.pdf)

# Release History

### Version 0.1.3 - 2018-02-05
* Add script to test accuracy.
* Add 2xA72 and 4xA53 performance data.

### Performance Report
* [Performance Report PDF](performance_report.pdf)

# Commercial Use (US)
The code using linear correlation filters may be affected by a US patent. If you want to use this code commercially in the US please refer to http://www.cs.colostate.edu/~vision/ocof_toolset_2012/index.php for possible patent claims.
Expand Down Expand Up @@ -127,3 +91,4 @@ author = "Felzenszwalb, P. F. and Girshick, R. B. and McAllester, D. and Ramanan
journal = "IEEE Transactions on Pattern Analysis and Machine Intelligence",
year = "2010", volume = "32", number = "9", pages = "1627--1645"}
```

38 changes: 38 additions & 0 deletions accuracy_test_instruction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Accuracy test instructions

## Install dependencies

* Install OpenCV library for Python
```
sudo cp /usr/local/AID/opencv3.3.0/lib/python2.7/dist-packages/cv2.so /usr/local/lib/python2.7/dist-packages/cv2.so
```

* Install Matplotlib for Python
```
sudo apt-get install python-matplotlib
```

## Get the average fps value
Get the average fps value per 100 frames by using the "avfps" value in the window.

## Run accuracy test script

```
cp ~/ObjectTracker/build/bin/cftld ~/ObjectTracker/sample/benchmark
cd ~/ObjectTracker/sample/benchmark
wget -c ftp.openailab.net/dataset/ObjectTracker_Benchmark/test.tar --ftp-user=*** --ftp-password=*** --no-passive-ftp
tar -xvf test.tar
python cfg_gen.py
sh RunTracker.sh
python calc.py
```
You may need to contact <[email protected]> to access the dataset.

## Add your own images to test dataset
```
1) save your images to ObjectTracker/sample/benchmark/test/[folder name]/img.
2) save the grountruth_rect.txt to ObjectTracker/sample/benchmark/test/[folder name].
3) run cfg_gen.py to generate the configuration file and RunTracker.sh.
4) run RunTracker.sh to start testing.
5) run calc.py to get the result.
```
85 changes: 85 additions & 0 deletions installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Installation

## Install dependencies

* Install CMake:
Skip this step if OpenCV3.3 has been installed
```
sudo apt-get install cmake
```

* Download OpenCV3.3
```
wget https://github.com/opencv/opencv/archive/3.3.0.zip --no-check-certificate
unzip 3.3.0.zip
```

* Download "gen-pkg-config-pc"
```
wget ftp://ftp.openailab.net/tools/script/gen-pkg-config-pc.sh
chmod +x ./gen-pkg-config-pc.sh
```

* Install OpenCV3.3
```
cd opencv-3.3.0
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local/AID/opencv3.3.0 ..
sudo make install
```

* Configure The Libraries
```
sudo ~/gen-pkg-config-pc.sh /usr/local/AID
```

## ObjectTracker Compile

```
cd ObjectTracker
mkdir build
cd build
cmake ..
make
```

## Camera live demo
* Please ensure camera is connected

```
cd ObejectTracker/build/bin
./cftld
```

## Command line options
### Synopsis
`bin/cftld [option arguments] [Arguments]`

### option arguments
* `[-x]` Use DSSTcpp instead of KCFcpp as short-term tracker. KCFcpp is the default short-term tracker.
* `[-a <startFrameNumber>]` Video starts at the _startFrameNumber_.
* `[-b <x,y,w,h>]` Initial bounding box.
* `[-d <device>]` Selects input device: _device_=(_IMGS_|_CAM_|_VID_|_STREAM_)
_IMGS_: Capture from images.
_CAM_: Capture from connected camera.
_VID_: Capture from a video.
_STREAM_: Capture from RTSP stream.
* `[-f]` Shows foreground.
* `[-i <path>]` _path_ to the images or to the video.
* `[-j <number>]` Shows trajectory for the last _number_ frames.
* `[-h]` Shows help.
* `[-n <number>]` Specifies the video device to use (defaults to 0). Useful to select a different camera when multiple cameras are connected.
* `[-p path]` Prints results into the file _path_.
* `[-s]` If set, user can select initial bounding box.
* `[-t <theta>]` Threshold for determining positive results.
* `[-z <lastFrameNumber>]` Video ends at the _lastFrameNumber_.
If _lastFrameNumber_ is 0 or the option argument isn't specified means
all frames are taken.

### Arguments
`[CONFIG_FILE]` path to config file

## Config files
Refer to the sample folder to see usage and config file examples.

Binary file removed performance_report.pdf
Binary file not shown.
Binary file added performance_report_objecttraker.pdf
Binary file not shown.
Loading

0 comments on commit fe046b5

Please sign in to comment.