Rose-Hulman Robotics Team

Changeset 229

Show
Ignore:
Timestamp:
10/12/08 16:32:25 (3 years ago)
Author:
spenceal
Message:

fixing segfault in mark_slopes

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

Legend:

Unmodified
Added
Removed
  • trunk/software/rb/vision/main.c

    r213 r229  
    8686        /* Mark slopes */ 
    8787        print_time("Marking slopes"); 
    88         //mark_slopes(out); // This currently segfaults 
     88        mark_slopes(out); // This currently segfaults 
    8989 
    9090        /* Mark straint path */ 
  • trunk/software/rb/vision/vision.c

    r213 r229  
    100100                } 
    101101        } 
    102         if (n == 0) return 0; 
     102        if ((double)n / (box.width * box.height) < 0.05) return 0; 
    103103        go_linear_regression(xss, xdim, ys,  n, 1, res, reg); 
    104104        double rval = res[1];  
     
    260260        CvPoint start, end; 
    261261        CvRect box = cvRect(1, 1, 500, 500); 
    262         for (box.x = 0; box.x < out->width; box.x += box.width) { 
    263                 for (box.y = 0; box.y < out->height; box.y += box.height) { 
     262        for (box.x = 0; box.x + box.width < out->width; box.x += box.width/2) { 
     263                for (box.y = 0; box.y + box.height < out->height; box.y += box.height/2) { 
    264264                        //printf("checking box (%d,%d)↔(%d-%d)\n", box.x, box.y, box.width, box.height); 
    265265                        slope = find_slope_in_box(out, box, &reg);