Index: trunk/StereoVisionDisparity/DisparityMap.cpp
===================================================================
--- trunk/StereoVisionDisparity/DisparityMap.cpp	(revision 53)
+++ trunk/StereoVisionDisparity/DisparityMap.cpp	(revision 56)
@@ -144,4 +144,10 @@
 	THREAD_ALIVE = true;
 	start();
+
+	emit minimumDisparityChanged(this->min_disp);
+	emit numberOfDisparityChanged(this->num_disp);
+	emit SADWindowSizeChanged(this->sbm_SADWindowSize);
+	emit textureTresholdChanged(this->sbm_textureThreshold); 
+	emit uniquenessRatioChanged(this->sbm_uniquenessRatio);
 }
 
@@ -577,4 +583,54 @@
 }
 
+
+////////////////////////////////////////////////////////////////////////////////
+void DisparityMap::setMinimumDisparity(int minimum_disp)
+{
+	this->min_disp = minimum_disp;
+
+	emit minimumDisparityChanged(this->min_disp);
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+void DisparityMap::setNumberOfDisparity(int numberOfDisparity)
+{
+	// Must be a multiple of 16
+	this->num_disp = numberOfDisparity & ~15;
+	if (this->num_disp < 16)
+		this->num_disp = 16;
+
+	emit numberOfDisparityChanged(this->num_disp);
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+void DisparityMap::setSADWindowSize(int SADWindowSize)
+{
+	// Must be an odd number
+	this->sbm_SADWindowSize = SADWindowSize | 1;
+	
+	emit SADWindowSizeChanged(this->sbm_SADWindowSize);
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+void DisparityMap::setTextureTreshold(int textureTreshold)
+{
+	this->sbm_textureThreshold = textureTreshold;
+
+	emit textureTresholdChanged(this->sbm_textureThreshold); 
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+void DisparityMap::setUniquenessRatio(int uniquenessRatio)
+{
+	this->sbm_uniquenessRatio = uniquenessRatio;
+
+	emit uniquenessRatioChanged(this->sbm_uniquenessRatio);
+}
+
+
 ////////////////////////////////////////////////////////////////////////////////
 ///	CalcDisparityMap
@@ -640,4 +696,17 @@
 			Right_img_gray = Right_img_exp;
 		}
+
+		/*cv::namedWindow("Disparity trackbar", CV_WINDOW_NORMAL);
+		cv::createTrackbar("sbm_preFilterCap", "Disparity trackbar", &sbm_preFilterCap, 63);
+		cv::createTrackbar("sbm_preFilterSize", "Disparity trackbar", &sbm_preFilterSize, 250);
+		cv::createTrackbar("sbm_SADWindowSize", "Disparity trackbar", &sbm_SADWindowSize, 250);
+		cv::createTrackbar("min_disp", "Disparity trackbar", &min_disp, 250);
+		cv::createTrackbar("num_disp", "Disparity trackbar", &num_disp, 250);
+		cv::createTrackbar("sbm_textureThreshold", "Disparity trackbar", &sbm_textureThreshold, 250);
+		cv::createTrackbar("sbm_uniquenessRatio", "Disparity trackbar", &sbm_uniquenessRatio, 250);
+		cv::createTrackbar("sbm_speckleWindowSize", "Disparity trackbar", &sbm_speckleWindowSize, 250);
+		cv::createTrackbar("sbm_speckleRange", "Disparity trackbar", &sbm_speckleRange, 250);
+		this->sbm_SADWindowSize = (this->sbm_SADWindowSize % 2 > 0) ? this->sbm_SADWindowSize : this->sbm_SADWindowSize + 1;
+		this->num_disp = (this->num_disp % 16 == 0) ? this->num_disp : this->num_disp - (this->num_disp % 16);*/
 
 		// Configuration
@@ -666,5 +735,5 @@
 																	// the parameter to a positive value, it will be implicitly multiplied by 16. Normally, 1 or 2 is 
 																	// good enough.
-		
+
 		// Calculate the disparity image (16S = scaled by 16, must be divided by 16; 32F = original value)
 		sbm(Left_img_gray, Right_img_gray, Disp_map_exp, CV_16S);
@@ -701,5 +770,5 @@
 		sgbm.disp12MaxDiff = this->sgbm_disp12MaxDiff;				// Maximum allowed difference (in integer pixel units) in the left-right disparity check. Set it to 
 																	// a non-positive value to disable the check.
-		sgbm.fullDP = type == SGBM;							// Set it to true to run the full-scale two-pass dynamic programming algorithm. 
+		sgbm.fullDP = type == SGBM;									// Set it to true to run the full-scale two-pass dynamic programming algorithm. 
 																	// It will consume O(W*H*numDisparities) bytes, which is large for 640x480 stereo 
 																	// and huge for HD-size pictures.
