Changeset 503

Show
Ignore:
Timestamp:
03/24/07 11:14:03 (3 years ago)
Author:
anthony_rowe
Message:

Fixed security-cam bug

Location:
trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/projects/security-cam/main.c

    r490 r503  
    55#include <cc3_frame_diff.h> 
    66 
     7// How many pixels should change in a frame to be seen as motion 
     8// Remember, the frame is downsampled to 16x16 
    79#define NUM_PIX_CHANGE_THRESH     10 
     10 
     11// How much the color of a single pixel should change to be detected  
    812#define PIX_CHANGE_THRESH         20 
    913 
     
    3741  //cc3_set_colorspace(CC3_COLORSPACE_YCRCB); 
    3842  cc3_camera_set_resolution (CC3_CAMERA_RESOLUTION_HIGH); 
     43  // Set camera to low-res for faster frame differencing 
     44  // cc3_camera_set_resolution (CC3_CAMERA_RESOLUTION_LOW); 
    3945  // cc3_pixbuf_set_subsample (CC3_SUBSAMPLE_NEAREST, 2, 2); 
    4046  cc3_timer_wait_ms (1000); 
     
    4854  cc3_led_set_state (1, true); 
    4955 
    50   cc3_camera_set_resolution (CC3_CAMERA_RESOLUTION_LOW); 
     56   
    5157 
    5258  fd_pkt.coi = 1; 
     
    145151      while (1); 
    146152    } 
     153    // Switch to full color for stored images 
     154    cc3_pixbuf_frame_set_coi (CC3_CHANNEL_ALL); 
     155    // Save the jpeg 
    147156    capture_current_jpeg (f); 
     157    // Switch back to a single COI for the frame diff 
     158    cc3_pixbuf_frame_set_coi (fd_pkt.coi); 
    148159 
    149160    fclose (f);