Changeset 417
- Timestamp:
- 02/17/07 17:21:57 (2 years ago)
- Files:
-
- trunk/lib/cc3-ilp/cc3_color_track.c (modified) (8 diffs)
- trunk/lib/cc3-ilp/cc3_color_track.h (modified) (1 diff)
- trunk/projects/cmucam2/cmucam2.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/cc3-ilp/cc3_color_track.c
r399 r417 67 67 68 68 if (cc3_g_pixbuf_frame.coi == CC3_CHANNEL_ALL) { 69 if (pixel[0] >= pkt->lower_bound.channel[0]69 if (pixel[0] >= pkt->lower_bound.channel[0] 70 70 && pixel[0] <= pkt->upper_bound.channel[0] 71 71 && pixel[1] >= pkt->lower_bound.channel[1] … … 74 74 && pixel[2] <= pkt->upper_bound.channel[2]) 75 75 pixel_good = 1; 76 77 pixel += 3;76 77 pixel += 3; 78 78 } 79 79 else { … … 87 87 } 88 88 89 if(pkt->track_invert==1) pixel_good=!pixel_good; 89 90 if (pixel_good) { 90 91 pkt->num_pixels++; … … 156 157 { 157 158 uint32_t x, y; 159 uint8_t seq_count; 158 160 159 161 for (x = 0; x < MAX_BINARY_WIDTH; x++) … … 161 163 162 164 for (y = pkt->scratch_y; y < (pkt->scratch_y + img->height); y++) 165 { 166 seq_count=0; 163 167 for (x = 0; x < img->width; x++) { 164 168 bool pixel_good = 0; … … 183 187 } 184 188 189 if(pkt->track_invert==1) pixel_good=!pixel_good; 185 190 /* pkt->binary_scanline[0]=0x01020304; 186 191 pkt->binary_scanline[1]=0x05060708; … … 188 193 pkt->binary_scanline[3]=0x0D0E0F10; 189 194 pkt->binary_scanline[4]=0x11121314; 190 */ if (pixel_good) { 195 */ 196 if(pixel_good) 197 { 198 if( seq_count<255) seq_count++; 199 } else seq_count=0; 200 201 if (pixel_good && seq_count>pkt->noise_filter) { 191 202 uint8_t block, offset; 192 203 block = x / 8; … … 207 218 } 208 219 } 209 220 } 210 221 pkt->scratch_y = y; 211 222 trunk/lib/cc3-ilp/cc3_color_track.h
r302 r417 34 34 uint32_t int_density; 35 35 uint8_t noise_filter; 36 bool track_invert; 36 37 uint8_t binary_scanline[MAX_BINARY_WIDTH]; 37 38 cc3_pixel_t upper_bound; trunk/projects/cmucam2/cmucam2.c
r416 r417 51 51 GET_WINDOW, 52 52 LED_0, 53 NOISE_FILTER, 53 54 TRACK_INVERT, 54 55 CMUCAM2_CMD_END // Must be last entry so array sizes are correct … … 87 88 line_mode = false; 88 89 t_pkt.track_invert = false; 90 t_pkt.noise_filter = 0; 89 91 t_pkt.lower_bound.channel[0] = 16; 90 92 t_pkt.upper_bound.channel[0] = 240; … … 204 206 t_pkt.track_invert=1; 205 207 break; 206 208 209 case NOISE_FILTER: 210 if (n != 1 ) { 211 error = true; 212 break; 213 } 214 else 215 print_ACK (); 216 t_pkt.noise_filter=arg_list[0]; 217 break; 207 218 208 219 case LINE_MODE: … … 661 672 cmucam2_cmds[TRACK_WINDOW] = "TW"; 662 673 cmucam2_cmds[GET_WINDOW] = "GW"; 674 cmucam2_cmds[NOISE_FILTER] = "NF"; 663 675 cmucam2_cmds[GET_TRACK] = "GT"; 664 676 cmucam2_cmds[LED_0] = "L0";
