Changeset 15 for liacs


Ignore:
Timestamp:
Dec 1, 2009, 6:01:25 PM (15 years ago)
Author:
Rick van der Zwet
Message:

OpenCV 2.0 is better (from source). Secondly BLUR rocks to get rid of the noise

Location:
liacs/mss/project
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • liacs/mss/project/Makefile

    r8 r15  
    33CFLAGS+= -I/usr/include/opencv  -lcxcore -lcv -lhighgui -lcvaux -lml
    44
     5all: uinput
     6        sudo ./uinput
    57
    6 all: colour-tracking
     8tracking: colour-tracking
    79        ./colour-tracking 1
    810
  • liacs/mss/project/colour-tracking.c

    r14 r15  
    2727}
    2828
    29 int cvInitSystem(int argc, char *argv[]) {
     29int InitSystem(int argc, char *argv[]) {
    3030    // Don't care which camera to use. Use specified number elsewise
    3131    int cam_number = -1;
    3232    if (argc > 1)
    33         cam_number = atoi(argv[1]) > 0 ? atoi(argv[1]) : -1;
     33        cam_number = atoi(argv[1]);
    3434    printf("Using camera %i\n", cam_number);
    3535    CvCapture *capture = cvCaptureFromCAM(cam_number);
     
    8686        int step = image->widthStep/sizeof(uchar);
    8787
    88         cvCopy(image, output, NULL);
     88        //cvCopy(image, output, NULL);
     89        //Remove Noise from images
     90        cvSmooth(image,output,CV_BLUR, 3, 3, 3,3);
    8991        cvCopy(image, routput, NULL);
    9092        cvCopy(image, goutput, NULL);
     
    159161        // wait for any to press to quit
    160162        // Eeks! also HACK to make it refresh properly
    161         if (cvWaitKey(200) != -1) {
     163        if (cvWaitKey(20) != -1) {
    162164                break;
    163165        }
     
    177179
    178180// Get ourself into the highGUI main stuff
     181// Quick at 1.0.0, not needing in  2.0x anymore
    179182int main(int argc, char *argv[]) {
    180    return cvInitSystem(argc, argv);
     183   return InitSystem(argc, argv);
    181184}
Note: See TracChangeset for help on using the changeset viewer.