Changeset 159

Show
Ignore:
Timestamp:
03/04/06 15:15:57 (3 years ago)
Author:
anthony_rowe
Message:

Get Mean fix.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/cc3_ilp/cc3_color_info.c

    r158 r159  
    2121pkt->scratch_x=0; 
    2222pkt->scratch_y=0; 
     23pkt->scratch_pix=0; 
    2324 
    2425return 1; 
     
    3536        cc3_pixel_t cp; 
    3637        cc3_get_pixel( img, x, 0, &cp );         
     38        pkt->scratch_pix++; 
    3739        if(cc3_g_current_frame.coi==CC3_ALL ) {  
    3840                uint8_t i; 
     
    6769for(i=0; i<3; i++ ) 
    6870{ 
     71        pkt->mean.channel[i]=pkt->scratch_mean[i]/pkt->scratch_pix; 
    6972        pkt->deviation.channel[i]=((pkt->max.channel[i]-pkt->mean.channel[i])+ 
    7073                (pkt->mean.channel[i]-pkt->min.channel[i]))/2; 
  • trunk/lib/cc3_ilp/cc3_color_info.h

    r158 r159  
    1414    uint16_t scratch_x,scratch_y; 
    1515    uint32_t scratch_mean[3]; 
     16    uint32_t scratch_pix; 
    1617} cc3_color_info_pkt_t; 
    1718 
  • trunk/projects/cmucam2/cmucam2.c

    r158 r159  
    2626        POLL_MODE, 
    2727        LINE_MODE, 
     28        SEND_JPEG, 
    2829        VIRTUAL_WINDOW, 
    2930        DOWN_SAMPLE, 
     
    104105                else line_mode=0; 
    105106            } 
     107            break; 
     108        case SEND_JPEG: 
     109            if(n!=0 && n!=1) { error=1; break; } else print_ACK(); 
     110            //init_jpeg();  
     111 
     112 
    106113            break; 
    107114        case SEND_FRAME: 
     
    305312cmucam2_cmds[DOWN_SAMPLE]="DS";  
    306313cmucam2_cmds[LINE_MODE]="LM";  
     314cmucam2_cmds[SEND_JPEG]="SJ";  
    307315} 
    308316 
     
    380388 
    381389} 
    382  
    383