====== How To Run Tracking Code ====== Download zip file with example files: {{:documentation:tracking.zip|Tracking}} There are two parts to running the code: the SIFT feature / match calculation and the Matlab outlier / moving object calculation. The user starts with a directory of sequential aerial images and runs the SIFT algorithm, which produces match files (and a listing of those match files). The listing of those match files is fed to the Matlab script which calculates which matches are bad. Tools needed: * [[http://www.python.org/download/ | Python]] * Matlab ===== Preparing images ===== Images should be in **.pgm** format. You could use a batch image converter, such as Image Converter .EXE - [[http://www.stintercorp.com/ic.php|Download Link]]. ===== Running SIFT and listing match files ===== You will start with a sequence of images in the directory named "images" and another directory named "EXE", which will contain the SIFT code - the executables and the cygwin libraries First, you will need to generate batch calls to the SIFT code to extract the features and matches. This is done using this python script: [[batch generator.py]] (click for source code). The script should be located in the same directory as the images directory and the "EXE" directory. The script will produce 3 files: - **extractfeatures.bat**: When run, will call **features.exe** from the "EXE" directory for each image file in **images** and will place the corresponding feature file in **FEATURES** - **computematches.bat**: When run, will call **match.exe** from the "EXE" directory for each image pair (specify frame separation in the python script) and the resulting file will be placed in *MATCHES* - **matlabinputfile.txt**: This is an input file for the matlab script, it is just a listing of all the matches in the **MATCHES** directory The script will also create the directories called **FEATURES** and **MATCHES**, if they don't exist Then, you will need to run **extractfeatures.bat** and **computematches.bat** to produce the features from images and matches from features ===== Running Matlab ===== There is only one script: [[GenerateHoughClusters.m]] (click for source code). The input parameter, "list_of_matches" is just a pointer to the file containing a list of all the matches between image pairs - it's titled **matlabinputfile.txt** in the previous step, so you would run the script like this: //GenerateHoughClusters('matlabinputfile.txt')// The catch is that matlab needs to be pointed to the directory in which the match files listed in the input file are. Thus, to run the script, I would move **matlabinputfile.txt** into the directory named **MATCHES**, navigate with Matlab to that directory, and then run the script. After the script is run and completes, it will produce a plot of the results that can be exported as an image file.