changeset 16:ff1702b723f3

limited loaded files to 10000 frames so that testing is easier. Great on classical, rubbish on rock and pop
author Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk>
date Fri, 25 Nov 2011 16:51:33 +0000
parents 67ed2c7320ba
children ffb563f6e4cd
files src/TimeWarp.cpp src/testApp.cpp src/testApp.h src/timeWarp.cpp
diffstat 4 files changed, 21 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/TimeWarp.cpp	Wed Nov 23 22:41:56 2011 +0000
+++ b/src/TimeWarp.cpp	Fri Nov 25 16:51:33 2011 +0000
@@ -36,7 +36,7 @@
 	//diagonalPenalty = 1;//favours diagonal over other paths 
 	//diagonalPenalty = 2;//penalises diagonal so all path gradients equal weighting
 	
-	useDotProduct = false;//true - dot, false , Euclidean dist
+	useDotProduct = false;////true - dot, falseo: Euclidean dist
 }	
 
 // destructor
@@ -612,7 +612,6 @@
 	if (pickMinimumFlag){
 		endIndex = getMinimumIndexOfColumnFromMatrix((int)(*alignmentMatrix).size()-1, alignmentMatrix);
 		//i.e. get index of minimum in the last column
-		
 	}
 		v.push_back(endIndex);//and the y size
 	printf("CALUCLATE MINIMUM PUSHED BACK %i\n", endIndex);
--- a/src/testApp.cpp	Wed Nov 23 22:41:56 2011 +0000
+++ b/src/testApp.cpp	Fri Nov 25 16:51:33 2011 +0000
@@ -43,6 +43,8 @@
 
 void testApp::setup(){
 
+	doCausalAlignment = true;
+	
 	ofBackground(255,255,255);
 
 	// 2 output channels,
@@ -154,18 +156,19 @@
 	
 	dontDoJunkAlignment();
 
-	calculateForwardsAlignment();
-	
-	doPathBugCheck();
-		
-	tw.copyForwardsPathToBackwardsPath();
+	if (doCausalAlignment)
+		calculateCausalAlignment();
+	else{
+			//tw.calculateAlignmentMatrix(tw.firstChromaEnergyMatrix, tw.secondChromaEnergyMatrix, &tw.alignmentMeasureMatrix);	
+			tw.calculateAlignmentMatrix(tw.chromaMatrix, tw.secondMatrix, &tw.alignmentMeasureMatrix);	
+			tw.calculateMinimumAlignmentPath(&tw.alignmentMeasureMatrix, &tw.backwardsAlignmentPath, false);
+	}
 	
 	backwardsAlignmentIndex = tw.backwardsAlignmentPath[0].size()-1;
 	printf("index size is %i\n", backwardsAlignmentIndex);
 
 	
-//		tw.calculateAlignmentMatrix(tw.firstChromaEnergyMatrix, tw.secondChromaEnergyMatrix, &tw.alignmentMeasureMatrix);								
-//		tw.calculateMinimumAlignmentPath(&tw.alignmentMeasureMatrix, &tw.backwardsAlignmentPath, false);
+
 
 	setConversionRatio();
 	
@@ -181,6 +184,12 @@
 }
 
 
+void testApp::calculateCausalAlignment(){
+	calculateForwardsAlignment();
+	doPathBugCheck();
+	tw.copyForwardsPathToBackwardsPath();
+}
+
 
 void testApp::setConversionRatio(){
 	conversionFactor = (int) round(tw.firstEnergyVector.size() / tw.chromaMatrix.size());
@@ -232,7 +241,7 @@
 	
 	tw.forwardsAlignmentPath.clear();
 	//causal part
-	int hopsize = 400;
+	int hopsize = 200;
 	int frameSize = 800;
 	int startFrameY = 0;
 	int startFrameX = 0;
--- a/src/testApp.h	Wed Nov 23 22:41:56 2011 +0000
+++ b/src/testApp.h	Fri Nov 25 16:51:33 2011 +0000
@@ -209,6 +209,8 @@
 	float conversionFactor;
 	
 	void dontDoJunkAlignment();
+	void calculateCausalAlignment();
+	bool doCausalAlignment;
 };
 
 #endif
--- a/src/timeWarp.cpp	Wed Nov 23 22:41:56 2011 +0000
+++ b/src/timeWarp.cpp	Fri Nov 25 16:51:33 2011 +0000
@@ -36,7 +36,7 @@
 	//diagonalPenalty = 1;//favours diagonal over other paths 
 	//diagonalPenalty = 2;//penalises diagonal so all path gradients equal weighting
 	
-	useDotProduct = false;//true - dot, false , Euclidean dist
+	useDotProduct = false;////true - dot, falseo: Euclidean dist
 }	
 
 // destructor
@@ -612,7 +612,6 @@
 	if (pickMinimumFlag){
 		endIndex = getMinimumIndexOfColumnFromMatrix((int)(*alignmentMatrix).size()-1, alignmentMatrix);
 		//i.e. get index of minimum in the last column
-		
 	}
 		v.push_back(endIndex);//and the y size
 	printf("CALUCLATE MINIMUM PUSHED BACK %i\n", endIndex);