The construction of OPENTLD platform

Source: Internet
Author: User
Tags tld visual studio 2010

the construction of OPENTLD platform

This paper describes the construction of Opentld platform by means of text and graphics. Hardware platform: A computer with Windows 7/8/xp; software platform: Opentld, OpenCV, Visual Studio 2010.

1. Software download

Opentld:https://github.com/arthurv/opentld/tree/master

Opencv:http://opencv.org/downloads.html

After downloading as:


To OpenCV decompression: Double click = "Click Extract:



Then extract the Opentld, extract after decompression:


2. Setting of OPENCV User variables and system variables

computer = "attribute =" Advanced system settings:


Advanced = "Environment variables:


First set up user variables:


(Note: x86 on behalf of your computer is a 32-bit system, VC10 on behalf of your platform is the VS2010 version.) )


Then set the system variable:

(Note: x86 on behalf of your computer is a 32-bit system, VC10 on behalf of your platform is the VS2010 version.) )


3. Establishment of Visual Studio 2010 Project

Open software = "New Project:


Then press settings:


Click OK and then click Next:


Finally, follow the selection and finally click Finish:


4. Set OpenCV in VS

This is because we are using the OPENTLD to invoke the OpenCV library, and these three steps are important and cannot be omitted.

The first step is to click on the project Properties = "VC + + directiories=" Include directiories:

(Add the OpenCV include, as shown in the 3rd step)


Second Step Click project Properties = "VC + + directiories=" Library directiories:

(Add the OpenCV lib, as shown in the 3rd step)

Step three Click Project Properties (properties) = "linker=" input= "Additional Dependencies:

(Add the OpenCV lib, as shown in the 4th step)

It is important to note that the Lib loaded in the third step is not the same thing as the Lib loaded in the second step. The second step of loading the LIB is the path, and the third step is to load the contents of the path, as shown in the following: (It is important to note that the load at release is the underlined ones, i.e. Xxx.lib, if debug mode, load Xxxd.lib).


5. Copy opentld header file and source code to vs current working directory

Opentld header file:


Source code for OPENTLD:


Then load them into the current project:


6, modify the OPENTLD header file

Modify the #include< > in the four header files to include "":


In TLD.h we will find that Patchgenerator will make a mistake, such as:


This is because the original author does not add a header file that defines the Patchgenerator class, and we add that header file, such as:


7. Add Round function

Adding the round function is because there is no self-contained function in VS, and Opentld uses this function.

The first step: Add the following code to the TLD.h:

int round (float f);
As shown in the following:


The second step is to add the following code to TLD.cpp, with the following code:

int Tld::round (float f) {if ((int) f+0.5>f) return (int) F; else return (int) f + 1;}
As shown in the following:


8. Copy the VS project's four header files to the VS installation path

Complete the first 7 steps, after compiling we find that the header file is not found, as shown in:

The workaround is to copy the modified OPENTLD header file to the installation path of VS, such as:


9. Modification of Ceil error and floor error

After completing the 8th step believe that your project can be compiled, but there are many warning and several errors, the following in turn to solve these problems.

Warnings and error prompts after compilation are as follows:


The first step, ceil error Resolution: Error such as:


Workaround such as:


The second step, floor error resolution, errors such as:


Workaround such as:


10, the solution of the dynamic array allocation error

In the TLD::CLUSTERBB function, VS does not support this dynamic array allocation, so the following error occurs:


Workaround for example, comment out the method of allocating dynamic array in source code, add the following code:

float *l = new float [c-1]; Levelint **nodes = new int *[c-1];for (int i = 0; i < 2; i + +) nodes[i] = new int [C-1];int *belongs = new int [c];

Finally, do not forget to release the allocated dynamic memory, add the following code, add place is the function of the last, that is, return 1 before, such as:

delete [] L; L = null;for (int i = 0; i < 2; ++i) {delete [] nodes[i];nodes[i] = NULL;} Delete []nodes;nodes = Null;delete [] belongs;belongs = NULL;

Finally, the compilation succeeds. Done.

11. Demo Demo

First copy the Datasets folder and Parameters.yml under Opentld to the current project directory, such as:


Copy the video from datasets to David, where the David Test video and Parameters.yml are in the working directory of the current project.

Then modify the code in the main function, that is, how to get the code to read the David Test video, as shown in the following method:


Compile and run with the results such as:



Everything OK, Pro ~ Your platform set up well?



The construction of OPENTLD platform

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.