Index: liacs/mss/project/Makefile
===================================================================
--- liacs/mss/project/Makefile	(revision 8)
+++ liacs/mss/project/Makefile	(revision 8)
@@ -0,0 +1,8 @@
+CFLAGS=-g
+
+CFLAGS+= -I/usr/include/opencv  -lcxcore -lcv -lhighgui -lcvaux -lml
+
+
+all: colour-tracking
+	./colour-tracking 1
+
Index: liacs/mss/project/colour-tracking.c
===================================================================
--- liacs/mss/project/colour-tracking.c	(revision 8)
+++ liacs/mss/project/colour-tracking.c	(revision 8)
@@ -0,0 +1,152 @@
+/* OpenCV Hello world, with filtering of various filters 
+ * Based on http://home.iitk.ac.in/~swagatk/faq/opencv.html#Colar_Based_Tracking 
+ * Rick van der Zwet <info@rickvanderzwet.nl>
+ */
+
+#include <cv.h>
+#include <cxcore.h>
+#include <cvaux.h>
+#include <highgui.h>
+#include <stdio.h>
+
+
+int cvInitSystem(int argc, char *argv[]) {
+    // Don't care which camera to use. Use specified number elsewise
+    int cam_number = atoi(argv[1]) > 0 ? atoi(argv[1]) : -1;
+    CvCapture *capture = cvCaptureFromCAM(cam_number);
+    int width = cvGetCaptureProperty(capture, CV_CAP_PROP_FRAME_WIDTH);
+    int height = cvGetCaptureProperty(capture, CV_CAP_PROP_FRAME_HEIGHT);
+
+
+    uchar *routdata, *goutdata, *boutdata, *target;
+
+    
+    //Create a window
+    cvNamedWindow("RGB_Image", CV_WINDOW_AUTOSIZE);
+    cvMoveWindow("RGB_Image",0,0);
+    cvNamedWindow("R_Image", CV_WINDOW_AUTOSIZE);    
+    cvMoveWindow("R_Image",0,height);
+    cvNamedWindow("G_Image", CV_WINDOW_AUTOSIZE);    
+    cvMoveWindow("G_Image",width,0);
+    cvNamedWindow("B_Image", CV_WINDOW_AUTOSIZE);    
+    cvMoveWindow("B_Image",width,height);
+    cvNamedWindow("F_Image", CV_WINDOW_AUTOSIZE);
+
+
+    //Create Image Skeletons
+    IplImage *image   = NULL;
+    IplImage *output  = cvCreateImage( cvSize(width,height), 8, 3);
+    IplImage *boutput = cvCreateImage( cvSize(width,height), 8, 3);
+    IplImage *routput = cvCreateImage( cvSize(width,height), 8, 3);
+    IplImage *goutput = cvCreateImage( cvSize(width,height), 8, 3);
+    IplImage *filter  = cvCreateImage( cvSize(width,height), 8, 3);
+
+
+    // Some temp pointers
+    int j, k, m, n, p;
+    
+    // Video run starts here ...
+    while (1)
+    {                 
+        image = cvQueryFrame(capture);
+	
+	// We need some input before running any further
+	if (image == NULL) {
+	  printf("Ehm no input in the image\n");
+	  continue;
+	}
+
+        //This is needed for accessing pixel elements
+        int step = image->widthStep/sizeof(uchar);
+
+        cvCopy(image, output, NULL);
+        cvCopy(image, routput, NULL);
+        cvCopy(image, goutput, NULL);
+        cvCopy(image, boutput, NULL);
+	
+
+        routdata = (uchar *) routput->imageData;
+        goutdata = (uchar *) goutput->imageData;
+        boutdata = (uchar *) boutput->imageData;
+
+        k = 0, p = 0;
+        for( m = 0; m < image->height; m++) //row
+        {
+            for( n = 0; n < image->width; n++) //column
+            {
+		routdata[m*step+n*3+0] = 0; // clear blue part
+		routdata[m*step+n*3+1] = 0; // clear green part
+
+		goutdata[m*step+n*3+0] = 0; // clear blue part
+		goutdata[m*step+n*3+2] = 0; // clear red part
+
+		boutdata[m*step+n*3+1] = 0; // clear green part
+		boutdata[m*step+n*3+2] = 0; // clear red part
+            }
+        } 
+
+	// Clear filter for new use
+	cvSetZero(filter);
+
+        // Make it yellow
+        //cvOr( routput, goutput, filter, NULL);
+
+
+        int xmin = 0, xmax = 0;
+        int ymin = 0, ymax = 0;
+
+	// Find the 'very' green point and mark it's surroundings
+        for(m = 0; m < image->height; m++)
+        {
+            for(n = 0; n < image->width; n++)
+            {
+		// Make it stop processing all points, pick the ones with high value
+                if(goutdata[m*step+n*3+1] > 200)
+                {
+                    if(n < xmin)
+                        xmin = n;
+                    if(n > xmax)
+                        xmax = n;
+                    if(m < ymin)
+                        ymin = m;
+                    if(m > ymax)
+                        ymax = m;
+                }
+            }
+        }
+             
+        cvRectangle(output, cvPoint(xmin, ymin), cvPoint(xmax,ymax), CV_RGB(0,255,0),2, 8, 0);
+        cvCircle(filter, cvPoint((xmin+xmax)/2, (ymin+ymax)/2), 0, CV_RGB(255,0,0),2, 8, 0);
+                        
+
+
+
+        // Show all the images
+        cvShowImage("RGB_Image", output);
+        cvShowImage("R_Image", routput);
+        cvShowImage("B_Image", boutput);       
+        cvShowImage("G_Image", goutput);       
+        cvShowImage("F_Image", filter);       
+                    
+                
+        //wait for a key to press, Eeks! HACK to make it refresh properly
+        if (cvWaitKey(20) != -1) {
+		break;
+	}
+    } //for each frame ...
+
+
+    cvReleaseCapture(&capture);
+    cvDestroyWindow("RGB_Image");
+    cvDestroyWindow("R_Image");
+    cvDestroyWindow("G_Image");
+    cvDestroyWindow("B_Image");
+    cvDestroyWindow("F_Image");
+
+    return 0;
+
+}
+
+int main(int argc, char *argv[]) {
+   return cvInitSystem(argc, argv);
+}
