Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@
# 5) build the project "PACKAGE" to create an NSIS-installer (NSIS is required)


project(OpenTLD)
project(OpenTLD-OCL)

cmake_minimum_required(VERSION 2.6)

find_package(OpenCV REQUIRED)
find_package(OpenCL REQUIRED)

if(BUILD_QOPENTLD)
find_package(Qt4 REQUIRED)
Expand Down
3 changes: 2 additions & 1 deletion OpenTLDConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
find_package(OpenCV)

find_package(OpenCV)
find_package(OpenCL)
set(bin_dir "@PROJECT_BINARY_DIR@")
set(src_dir "@PROJECT_SOURCE_DIR@")

Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

This is a C++ implementation of OpenTLD that was originally published in MATLAB by Zdenek Kalal. OpenTLD is used for tracking objects in video streams. What makes this algorithm outstanding is that it does not make use of any training data. This implementation is based solely on open source libraries, meaning that you do not need any commercial products to compile or run it.

The easiest way to get started is to download the precompiled [binaries](https://github.com/gnebehay/OpenTLD/releases) that are available for Windows and Ubuntu 12.04.
GPU is a good accelerated compute resource for speed up Tracking speed, so I want to complete one OpenCL version for OpenTLD, I will begin today.

The easiest way to get started is to download the precompiled [binaries](https://github.com/gnebehay/OpenTLD/releases) that are available for Windows and Ubuntu 12.04.  
There is also a [PPA](https://launchpad.net/~opentld/+archive/ppa) available for Ubuntu 12.04. You just have to execute these commands:
```
sudo add-apt-repository ppa:opentld/ppa
Expand Down
11 changes: 7 additions & 4 deletions src/libopentld/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ include_directories(imacq
mftracker
tld
../3rdparty/cvblobs
${OpenCV_INCLUDE_DIRS})
link_directories(${OpenCV_LIB_DIR})
${OpenCV_INCLUDE_DIRS}
${OpenCL_INCLUDE_DIRS})
link_directories(${OpenCV_LIB_DIR}
${OpenCL_LIB_DIR})

add_library(libopentld
imacq/ImAcq.cpp
Expand Down Expand Up @@ -40,9 +42,10 @@ add_library(libopentld
tld/NormalizedPatch.h
tld/TLD.h
tld/TLDUtil.h
tld/VarianceFilter.h)
tld/VarianceFilter.h
tld/switch.h)

target_link_libraries(libopentld ${OpenCV_LIBS})
target_link_libraries(libopentld ${OpenCV_LIBS} ${OPENCL_LIBRARIES})

set_target_properties(libopentld PROPERTIES OUTPUT_NAME opentld)

8 changes: 6 additions & 2 deletions src/libopentld/imacq/ImAcq.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ static void msleep(int milliseconds)
ImAcq *imAcqAlloc()
{
ImAcq *imAcq = (ImAcq *)malloc(sizeof(ImAcq));
imAcq->method = IMACQ_CAM;
// imAcq->method = IMACQ_CAM;
imAcq->method = 2;
imAcq->currentFrame = 1;
imAcq->lastFrame = 0;
imAcq->camNo = 0;
Expand All @@ -52,6 +53,7 @@ ImAcq *imAcqAlloc()

void imAcqInit(ImAcq *imAcq)
{
// imAcq->method = 2;
if(imAcq->method == IMACQ_CAM)
{
imAcq->capture = cvCaptureFromCAM(imAcq->camNo);
Expand All @@ -64,7 +66,8 @@ void imAcqInit(ImAcq *imAcq)
}
else if(imAcq->method == IMACQ_VID)
{
imAcq->capture = cvCaptureFromAVI(imAcq->imgPath);
imAcq->capture = cvCaptureFromAVI(imAcq->imgPath);
//imAcq->capture = cvCaptureFromAVI("D:\\OpenTLD-master\\build\\bin\\Release\\IMG_5903.MOV");

if(imAcq->capture == NULL)
{
Expand Down Expand Up @@ -283,3 +286,4 @@ int imAcqVidGetNumberOfFrames(ImAcq *imAcq)
{
return ((int) cvGetCaptureProperty(imAcq->capture , CV_CAP_PROP_FRAME_COUNT));
}

Loading