changeset 445:f0ce17ea9273

merge done with Sohail s code
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Fri, 31 Jan 2014 00:10:31 -0500
parents 4a62c3b1eb3a (diff) ea907ae19d8c (current diff)
children a65a14c90834
files
diffstat 3 files changed, 44 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/python/indicators.py	Thu Jan 30 16:35:17 2014 -0500
+++ b/python/indicators.py	Fri Jan 31 00:10:31 2014 -0500
@@ -97,7 +97,7 @@
         return values
 
 
-def distanceForLCSS(x, y): # lambda x,y:abs(x-y)
+def l1Distance(x, y): # lambda x,y:abs(x-y)
     if x == None or y == None:
         return float('inf')
     else:
@@ -107,8 +107,8 @@
 
 class LCSS(utilsLCSS):
     '''Adapted LCSS class for indicators, same pattern'''
-    def __init__(self, threshold, delta = float('inf'), minLength = 0, aligned = False, lengthFunc = min):
-        utilsLCSS.__init__(self, lambda x,y: (distanceForLCSS(x,y) <= threshold), delta, aligned, lengthFunc)
+    def __init__(self, similarityFunc, delta = float('inf'), minLength = 0, aligned = False, lengthFunc = min):
+        utilsLCSS.__init__(self, similarityFunc, delta, aligned, lengthFunc)
         self.minLength = minLength
 
     def checkIndicator(self, indicator):
--- a/scripts/compute-homography.py	Thu Jan 30 16:35:17 2014 -0500
+++ b/scripts/compute-homography.py	Fri Jan 31 00:10:31 2014 -0500
@@ -85,11 +85,11 @@
     print('Click on {0} points in the video frame'.format(nPoints))
     plt.figure()
     plt.imshow(videoImg)
-    videoPts = np.array(plt.ginput(nPoints))
+    videoPts = np.array(plt.ginput(nPoints, timeout=3000))
     print('Click on {0} points in the world image'.format(nPoints))
     plt.figure()
     plt.imshow(worldImg)
-    worldPts = unitsPerPixel*np.array(plt.ginput(nPoints))
+    worldPts = unitsPerPixel*np.array(plt.ginput(nPoints, timeout=3000))
     plt.close('all')
     homography, mask = cv2.findHomography(videoPts, worldPts)
     # save the points in file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/scripts/setup-tracking.sh	Fri Jan 31 00:10:31 2014 -0500
@@ -0,0 +1,39 @@
+version="$(wget -q -O - http://sourceforge.net/projects/opencvlibrary/files/opencv-unix | egrep -m1 -o '\"[0-9](\.[0-9])+' | cut -c2-)"
+echo "Removing any pre-installed ffmpeg and x264"
+sudo apt-get -qq remove ffmpeg x264 libx264-dev
+echo "Installing Dependencies"
+sudo apt-get -qq install libopencv-dev build-essential checkinstall cmake pkg-config yasm libtiff4-dev libjpeg-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libxine-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev python-dev python-numpy libtbb-dev libqt4-dev libgtk2.0-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils ffmpeg
+sudo apt-get -qq install libavfilter-dev libboost-dev libboost-program-options-dev libboost-graph-dev python-setuptools python-dev libcppunit-dev sqlite3 libsqlite3-dev cmake-qt-gui libboost-all-dev
+sudo easy_install -U mercurial
+echo "Installing OpenCV" $version
+cd
+mkdir OpenCV
+cd OpenCV
+echo "Downloading OpenCV" $version
+wget -O OpenCV-$version.tar.gz http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/$version/opencv-"$version".tar.gz/download
+echo "Installing OpenCV" $version
+tar -xvf OpenCV-$version.tar.gz
+cd opencv-$version
+mkdir release
+cd release
+cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
+make
+sudo make install
+echo "OpenCV" $version "ready to be used"
+
+echo "Installing Traffic Intelligence..."
+cd
+mkdir Research
+cd Research
+mkdir Code
+cd Code
+hg clone https://Nicolas@bitbucket.org/trajectories/trajectorymanagementandanalysis
+hg clone https://Nicolas@bitbucket.org/Nicolas/trafficintelligence
+cd trajectorymanagementandanalysis/trunk/src/TrajectoryManagementAndAnalysis/
+cmake .
+make TrajectoryManagementAndAnalysis
+cd
+cd trafficintelligence/c/
+make feature-based-tracking
+cd
+