Rose-Hulman Robotics Team

Changeset 475

Show
Ignore:
Timestamp:
03/26/09 06:07:08 (3 years ago)
Author:
spenceal
Message:

some cleanup

Location:
trunk/software/rb/vision
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/software/rb/vision/classify.cpp

    r474 r475  
    7272 
    7373        /* Blur */ 
    74         cvSmooth(input_img, input_img, CV_BLUR, 11, 11, 0, 0); 
     74        cvSmooth(input_img, input_img, CV_BLUR, 3, 3, 0, 0); 
    7575 
    7676        /* Convert to HSV */ 
     
    108108        fprintf(stderr, "Training DTree\n"); 
    109109 
    110         float priors[] = { 
    111                 10, // GRASS    //  
    112                 5, // OBSTICLE // .2 == no lines, no obst (black) 
    113                 1  // line   // .2 == no effect 
    114         }; 
     110        float priors[] = {20, 5, 2, 1}; // grass, obsticle, line, ignore 
    115111 
    116112        CvMat* var_type = cvCreateMat(input->cols+1, 1, CV_8U); 
  • trunk/software/rb/vision/classify.h

    r474 r475  
    1212        RB_OBSTICLE, 
    1313        RB_LINE, 
     14        RB_IGNORE  , 
    1415        RB_NUM_CLASSES 
    1516} rb_classes_t; 
     
    1819        {{0*255, 0*255, 1*255, 0}}, // Red     
    1920        {{1*255, 1*255, 1*255, 0}}, // White   
     21        {{0*255, 0*255, 0*255, 0}}  // Black   
    2022}; 
    21 //typedef enum rb_classes_t { 
    22 //      RB_SKY     , 
    23 //      RB_GRASS   , 
    24 //      RB_LINE    , 
    25 //      RB_OBSTICLE, 
    26 //      RB_PATH    , 
    27 //      RB_IGNORE  , 
    28 //      RB_NUM_CLASSES 
    29 //} rb_classes_t; 
    30 //const static CvScalar class_colors[] = { 
    31 //      {{0*255, 0*255, 1*255, 0}}, // Blue    
    32 //      {{0*255, 1*255, 0*255, 0}}, // Green   
    33 //      {{1*255, 1*255, 1*255, 0}}, // White   
    34 //      {{1*255, 0*255, 0*255, 0}}, // Red     
    35 //      {{1*255, 0*255, 1*255, 0}}, // Purple  
    36 //      {{0*255, 0*255, 0*255, 0}}  // Black   
    37 //}; 
    3823 
    3924/** 
  • trunk/software/rb/vision/vision.c

    r474 r475  
    7878        /* Smooth image */ 
    7979        print_time("Smoothing"); 
    80         cvSmooth(img, img, CV_BLUR, 11, 11, 0, 0); 
     80        cvSmooth(img, img, CV_BLUR, 3, 3, 0, 0); 
    8181 
    8282        /* Convert image to HSV */ 
     
    118118CvSeq *get_points(CvMat *classes) 
    119119{ 
    120         //int test_data[][3] = { 
    121         //      {RB_SKY,100,100}, {RB_GRASS,200,100}, {RB_OBSTICLE,300,100}, 
    122         //      {RB_SKY,100,200}, {RB_GRASS,200,200}, {RB_OBSTICLE,300,200}, 
    123         //      {RB_SKY,100,300}, {RB_GRASS,200,300}, {RB_OBSTICLE,300,300}, 
    124         //}; 
    125  
    126120        CvMemStorage *storage = cvCreateMemStorage(0); 
    127121        CvSeq *seq = cvCreateSeq(CV_32SC3,      // sequence of 3 tuples? (scalars?)