Abstract:
An image storage apparatus comprises an image capture unit configured to sequentially capture images of a subject, a storage unit including storage areas to store the images of the subject captured by the image capture unit, a storage controller configured to overwrite a storage area which is permitted to be overwritten with an image of the subject captured by the image capture unit, a life setting unit configured to set a life of the storage area which is overwritten by the storage controller, a life controller configured to change gradually the life of the storage area set by the life setting unit, a determination unit configured to determine whether the life of the storage area changed by the life controller expires or not, and a permission unit configured to permit to overwrite a storage area when the determination unit determines that the life of the storage area expires.

Description:
CROSS-REFERENCE TO RELATED APPLICATIONS 
       [0001]    This application is based upon and claims the benefit of priority from prior Japanese Patent Application No. 2007-074224, filed Mar. 22, 2007, the entire contents of which are incorporated herein by reference. 
       BACKGROUND OF THE INVENTION 
       [0002]    1. Field of the Invention 
         [0003]    The present invention relates to an image storage apparatus and an image storage method for use with a digital camera having a continuous-shooting function. 
         [0004]    2. Description of the Related Art 
         [0005]    Heretofore, an image capture apparatus has been proposed which is adapted to record images continuously captured in past times. Such an apparatus sequentially stores images captured at a predetermined frame rate into a buffer memory. When any trigger is occurred, a plurality of frames of image date stored in the buffer memory are all read from the buffer memory and then recorded into an image memory. Thereby, images captured in past time, earlier than the occurrence of the trigger, can be recorded in the image memory. 
         [0006]    The buffer memory includes a first buffer and a second buffer. In storing image data into the buffer memory, newly captured image data is sequentially stored into the first buffer. When the first buffer is filled up, one out of the oldest images is copied into the second buffer and the copied oldest image is erased from the first buffer. Thereby, limited capacity of the buffer memory is allowed to store even an image captured in less recent past time. When the second buffer is also filled up, the oldest images are sequentially erased from the second buffer. 
         [0007]    Conventionally, a storage area for newer images in the first buffer is secured by means of thinning out image data stored in the first buffer and copying image data from the first buffer into the second buffer. That is, the process of copying image data is indispensable, which might increase the processing burden on the CPU or delay other processing. 
       BRIEF SUMMARY OF THE INVENTION 
       [0008]    It is an object of the present invention to provide an image storage apparatus and an image storage method capable of recording image data of even less recent past without a process of copying the image data. 
         [0009]    According to an embodiment of the present invention, an image storage apparatus comprises: 
         [0010]    an image capture unit configured to sequentially capture images of a subject; 
         [0011]    a storage unit including storage areas to store the images of the subject captured by the image capture unit; 
         [0012]    a storage controller configured to overwrite a storage area which is permitted to be overwritten with an image of the subject captured by the image capture unit; 
         [0013]    a life setting unit configured to set a life of the storage area which is overwritten by the storage controller; 
         [0014]    a life controller configured to change gradually the life of the storage area set by the life setting unit; 
         [0015]    a determination unit configured to determine whether the life of the storage area changed by the life controller expires or not; and 
         [0016]    a permission unit configured to permit to overwrite a storage area when the determination unit determines that the life of the storage area expires. 
         [0017]    According to another embodiment of the present invention, an image storage method for an image storage apparatus comprising an image capture unit configured to sequentially capture images of a subject and a storage unit including storage areas to store the images of the subject captured by the image capture unit, the method comprises: 
         [0018]    a storage control step for overwriting a storage area which is permitted to be overwritten with an image of the subject captured by the image capture unit; 
         [0019]    a life setting step for setting a life of the storage area which is overwritten by the storage control step; 
         [0020]    a life control step for changing gradually the life of the storage area which is set by the life setting step; 
         [0021]    a determination step for determining whether the life of the storage area changed by the life control step expires or not; and 
         [0022]    a permission step for permitting to overwrite a storage area when the determination step determines that the life of the storage area expires. 
         [0023]    According to a still another embodiment of the present invention, a computer readable storage medium stores an image storage control program for functioning a computer as following means, the computer being included in an image storage apparatus comprising an image capture unit configured to sequentially capture images of a subject and a storage unit including storage areas to store the images of the subject captured by the image capture unit: 
         [0024]    storage control means for overwriting a storage area which is permitted to be overwritten with an image of the subject captured by the image capture unit; 
         [0025]    life setting means for setting a life of the storage area which is overwritten by the storage control means; 
         [0026]    life control means for changing gradually the life of the storage area which is set by the life setting means; 
         [0027]    determination means for determining whether the life of the storage area changed by the life control means expires or not; and 
         [0028]    permission means for permitting to overwrite a storage area when the determination means determines that the life of the storage area expires. 
     
    
     
       BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWING 
         [0029]    The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the present invention and, together with the general description given above and the detailed description of the embodiments given below, serve to explain the principles of the present invention in which: 
           [0030]      FIG. 1  is a block diagram of a digital camera according to an embodiment of the present invention; 
           [0031]      FIG. 2  is a state transition diagram of frame buffers according to a first embodiment; 
           [0032]      FIG. 3  is a flowchart illustrating process procedure of the first embodiment; 
           [0033]      FIG. 4  is a flowchart illustrating process procedure of searching-for and writing-in an empty buffer according to the first embodiment; 
           [0034]      FIG. 5  is a flowchart illustrating process procedure of a second embodiment; 
           [0035]      FIGS. 6 and 7  form a state transition diagram of frame buffers in the second embodiment; 
           [0036]      FIG. 8  is a flowchart illustrating process procedure of searching-for and writing-in an empty buffer according to the second embodiment; 
           [0037]      FIG. 9  is a flowchart illustrating process procedure of a third embodiment; 
           [0038]      FIG. 10  is a state transition diagram of frame buffers in the third embodiment; and 
           [0039]      FIG. 11  is a flowchart illustrating process procedure of searching-for and writing-in an empty buffer according to the third embodiment. 
       
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
       [0040]    The embodiments of the present invention will be described hereinafter with reference to the accompanying drawings. 
       First Embodiment 
       [0041]      FIG. 1  is a block diagram of a digital camera  1 , which is common to embodiments of the present invention. The digital camera  1  has a still image capture function and a continuous-shooting (moving image capture) function. The digital camera  1  is equipped with a CCD  2  and a DSP/CPU  3 . A photo detector of the CCD  2  is equipped with a primary-color filter with Bayer pattern. The DSP/CPU  3  has various digital signal processing functions including compression and decompression of image data. The DSP/CPU  3  is implemented in the form of a one-chip microcomputer, which controls components of the digital camera  1 . 
         [0042]    Connected to the DSP/CPU  3  is a timing generator (TG)  4  to drive the CCD  2  at a predetermined frame rate. Also connected to the TG  4  is a unit circuit  5  which receives an analog image signal corresponding to an optical image of a subject output from the CCD  2 . The unit circuit  5  includes a correlation double sampling (CDS) circuit to reduce driving noise of the CCD  2  contained in the image signal output from the CCD  2 , an automatic gain control (AGC) circuit to control the gain of the noise-reduced signal, and an analog-to-digital (A/D) converter which converts the signal subjected to the gain-control into a digital signal. Thus, the unit circuit  5  converts the analog image signal output from the CCD  2  into a digital image signal and sends the resulting digital Bayer data to the DSP/CPU  3 . 
         [0043]    A display unit  6  and a key entry unit  7  are connected to the DSP/CPU  3 . Also a buffer memory (DRAM)  11 , a ROM  12 , a storage memory  13 , and an input/output interface  14  are connected to the DSP/CPU  3  via an address/data bus  10 . The buffer memory  11  is used as a buffer to temporarily store Bayer data and the like, and is also used as a working memory of the DSP/CPU  3 . 
         [0044]    The DSP/CPU  3  performs a pedestal clamp process on the Bayer data from the unit circuit  5 , converts the Bayer data into RGB data and then further converts the RGB data into a brightness (Y) signal and color difference (UV) signals. A frame of YUV data converted by the DSP/CPU  3  is stored into the buffer memory  11 . The frame of YUV data stored in the buffer memory  11  is sent to the display unit  6 , where the YUV data is converted into a video signal and displayed as a through image. 
         [0045]    In the still image capture mode, upon detection of an operation of the shutter key by the user, a still image capture process is started by switching the CCD  2  and the unit circuit  5  to the driving mode and the drive timing adapted for still image capture, which are different from a driving mode and drive timing for though-image capture. By the still image capture process, one frame of YUV data stored in the buffer memory  11  is subjected to data compression such as JPEG compression or the like and coded in the DSP/CPU  3 , and then formed into a file format within the buffer memory  11 . The file of YUV data is then stored in the storage memory  13  as still image data (still image file) through the address/data bus  10 . 
         [0046]    In the normal continuous shooting (moving image capture) mode, upon detection of a first operation of the shutter key by the user to command the commencement of continuous shooting, a continuous shooting process is started whereby multiple frames of YUV data are stored into the buffer memory  11  until a second operation of the shutter key is made by the user to command termination of the continuous shooting. In the past capture mode, setting of the mode is accompanied by a start of a continuous shooting (moving image capture) process, whereby multiple frames of YUV data are stored into the buffer memory  11  until the user operates the shutter key to give a command to terminate the continuous shooting. 
         [0047]    The multiple frames of YUV data stored in the buffer memory  11  are sequentially transmitted to the DSP/CPU  3  where the YUV data is compressed using JPEG compression or the like (in the case of moving image capture, a predetermined MPEG codec is used) and then coded. The compressed and coded YUV data is converted into frame data through the buffer memory  11  and the address data bus  10 , and then written into the storage memory  13  with a file name. To reproduce a still image or continuously captured images (a moving image), the DSP/CPU  3  decompresses data of the still image or continuously captured images (moving image) read from the storage memory  13  and expands the data into the image data working area within the buffer memory  11  as a still image or a frame data of the continuously captured images (moving image). 
         [0048]    The display unit  6  includes a color LCD and associated driving circuitry. The display unit  6  displays an image of a subject captured by the CCD  2  as a through image in a wait state for shooting, and when reproducing a stored image, displays the stored image read from the storage memory  13  and subjected to decompression. The key entry unit  7  includes a plurality of operating keys, such as a shutter key, a mode setting key and a power key, and outputs a key entry signal corresponding to a key operated by the user to the DSP/CPU  3 . The shutter key also functions as a continuous-shooting initiation/termination button in a continuous shooting mode, and functions as a continuous shooting termination button in the past capture mode. 
         [0049]    The ROM  12  stores program AE data which constitutes a program chart representing combinations of shutter speeds and aperture values (F) corresponding to proper exposure values (EV) for still image capture, continuous image capture, and through image capture. The ROM  12  also stores an EV table. A charge storage time set by the DSP/CPU  3  based on a shutter speed, which is set in accordance with the program chart, is given in the form of a shutter pulse to the CCD  2  through the TG  4 . The CCD  2  operates accordingly to control the charge storage time, i.e., exposure time. Thus, the CCD  2  functions as an electronic shutter. Furthermore, the ROM  12  stores programs indicated by flowcharts to be described later as well as various programs required to provide functions as a digital camera. 
         [0050]    The digital camera  1  is equipped with the input/output interface  14 , which allows for connection to external equipment such as a printer, a personal computer, a TV receiver, etc. 
         [0051]    The buffer memory  11  is provided with twelve frame buffers indexed from  1  through  12 . The frame buffers are storage areas to respectively store frames of image data which are produced at a frame rate of 4 f/s (frames per second) in the past capture mode. 
         [0052]    Next, the operation in the present embodiment according to the above configuration will be described with reference to a flowchart illustrated in  FIG. 3 . 
         [0053]    The symbols shown in the flowchart represents the following items: 
         [0054]    N_BUFFER: the number of frame buffers; 
         [0055]    In this embodiment, N_BUFFER is set to 12, that is, the number of provided frame buffers is twelve as mentioned above. 
         [0056]    LIFE[I]: “frame life” of frame buffer indexed by I; 
         [0057]    LIFE[I] indicates a numeral corresponding to a until it is determined that the frame buffer indexed by I is empty. The value of LIFE[I] ranges from 19 to 0. When the value of LIFE[I] becomes zero, the frame buffer indexed by I is considered to be “empty.” 
         [0058]    EMPTY: index of “empty” frame buffer; 
         [0059]    The value of EMPTY indicates an index of a frame buffer considered to be empty. That is, when LIFE[I] is zero and the frame buffer I is considered to be empty, the value of EMPTY is set to I. Therefore, the value of EMPTY takes one of 1 through 12. 
         [0060]    N_STAMP: the number of initial values of “life”; 
         [0061]    The value of N_STAMP indicates how many types of initial life the frame buffers can take. In the present embodiment, the value of N_STAMP is fixed to 4. 
         [0062]    STAMP[STP_NUM]: initial life of frame buffer; 
         [0063]    STAMP[STP_NUM] indicates an initial life to be set for a frame buffer. STAMP[STP_NUM] repeatedly takes 19, 7, 11, 7, and so on. STAMP[ 1 ] is 19, when the value of STP_NUM is 1 (first type of initial life). Also, STAMP[ 2 ]=7 (second type of initial life), STAMP[ 3 ]=11 (third type of initial life) and STAMP[ 4 ]=7 (fourth type of initial life). 
         [0064]    STP_NUM: index of initial life type; 
         [0065]    Since the value of N_STAMP is fixed to 4 in the present embodiment, STP_NUM ranges from 1 to 4. 
         [0066]    When the mode setting key in the key entry unit  7  is operated to set the past capture mode, the DSP/CPU  3  controls the TG  4  to drive the CCD  2  at a frame rate of 4 f/s and carries out processing as indicated in the flowchart in accordance with the above program. Steps S 101  to S 104  represent parameter initialization processing, steps S 108  to S 111  represent life setting processing, and steps S 113  to S 116  represent life update processing. 
         [0067]    That is, to perform the parameter initialization processing in steps S 101  to S 104 , the counter I is initialized to 1 (step S 101 ). Next, it is determined whether or not the value of the counter I is equal to or less than N_BUFFER (=12, in the present embodiment) (step S 102 ). If I≦N_BUFFER (“YES” in step S 102 ), then LIFE[I] of the frame buffer I, where I is indicated by the value of the counter I, is set to the initial value of zero (step S 103 ). Subsequently, the counter I is incremented by one (step S 104 ) and the processing from step S 102  is repeated. In this embodiment, therefore, steps S 102  to S 104  are repeated twelve times with the result that the lives of the frame buffers indexed by 1 through 12 shown in  FIG. 2  are all set to zero. 
         [0068]    When the counter I reaches 13, the determination result of “I≦N_Buffer” in step S 102  becomes “NO” and thus the flow goes from step S 102  to step S 105 . The index STP_NUM of the initial life type is initialized to 1 (step S 105 ). Next, empty frame searching and overwriting processing is carried out (step S 106 ). 
         [0069]    The processing in step S 106  is carried out in accordance with a flowchart shown in  FIG. 4 . The  12  frame buffers are searched for an empty frame buffer for which LIFE[I] is set to zero (step S 11 ). The index of the found out empty frame buffer (any of 1 through 12) is stored into a register of EMPTY (step S 12 ). When a plurality of frame buffers considered being empty are found out in step S 11 , one of the plurality of frame buffers is selected and the index of the selected buffer is stored into the register of EMPTY in step S 12 . The empty frame buffer is overwritten with a frame of image data captured by the CCD  2  and time information indicating a time of capture (step S 13 ). 
         [0070]    Thus, in the case where the life of the frame buffer indexed by 1 is set to zero as shown in storage state A of  FIG. 2 , 1 is stored in EMPTY. A captured image is transferred to a frame buffer indexed by EMPTY (in this case, 1) and the buffer is overwritten with the transferred image and associated time information. 
         [0071]    In step S 107  of the flowchart of  FIG. 3 , completion of overwriting one frame of image data and associated time information in accordance with the flowchart of  FIG. 4  is waited. In the present embodiment, when the past capture mode is being set, the DSP/CPU  3  controls the TG  4  to drive the CCD  2  at the frame rate of 4 f/s as described above. Therefore, a waiting time of ¼ second is required to transfer the image to the frame buffer indexed by EMPTY and to overwrite the buffer with the transferred image. When the overwrite is completed, the flow goes from step S 107  to S 108  to initiate the life setting processing. 
         [0072]    To set the lives of the frame buffers, first, the life of the frame buffer LIFE[EMPTY] indicated by the value of EMPTY is set with the initial life STAMP[STP_NUM] of frame buffer which is indicated by the index STP_NUM of the type of the initial life (step S 108 ). Since the life type index STP_NUM is set to 1 in step S 105  (STP_NUM=1), the initial life STAMP[STP_NUM] is STAMP[ 1 ]. The first of four types of initial lives (19, 7, 11 and 7) is 19, therefore STAMP[ 1 ]=19. Accordingly, LIFE[ 1 ] of the frame buffer indexed by 1 is set to 19 as shown in storage state B of  FIG. 2 , in step S 108 . 
         [0073]    Next, the index STP_NUM of the initial life type is incremented by one (step S 109 ). It is determined whether or not the incremented index STP_NUM has reached the number of initial life types N_STAMP (=4, in the present embodiment) (step S 110 ). If No, the flow goes to step S 112  without performing step S 111 . If Yes, the index of the initial life type STP_NUM is initialized to 1 (step S 111 ) and then the flow goes to step S 112 . 
         [0074]    Thus, the index STP_NUM changes from 1 through N_STAMP, i.e., from 1 through 4. In the case in which the processing of S 108  has been repeatedly executed, the initial life STAMP[STP_NUM] of the (empty) frame buffer, which stores new image, is set as follows: STAMP[ 1 ]=19 when the index of the initial life type STP_NUM is set to 1; STAMP[ 2 ]=7 when STP_NUM is set to 2; STAMP[ 3 ]=11 when STP_NUM is set to 3; and STAMP[ 4 ]=7 when STP_NUM is set to 4. 
         [0075]    Therefore, in the case where the life of the frame buffer indexed by 1 is zero and the frame buffer indexed by 1 is considered to be empty (EMPTY=1) as shown in the storage state A of  FIG. 2 , when STP_NUM is 1, the processing in step S 108  leads to LIFE[ 1 ]=STAMP[STP_NUM]=STAMP[ 1 ]=19. Accordingly, the life of the frame buffer indexed by 1 is set to 19, which is the value of STAMP[ 1 ], as shown in the storage state B of  FIG. 2 . 
         [0076]    In the case where the life of the frame buffer indexed by 6 is zero (EMPTY=6) as shown in the storage state B of  FIG. 2 , when STP_NUM is 2, the processing in step S 108  results in LIFE[ 6 ]=STAMP[STP_NUM]=STAMP[ 2 ]=7. Accordingly, the life of the frame buffer indexed by 6 is set to 7, which is the value of STAMP[ 2 ], as shown in the storage state C of  FIG. 2 . 
         [0077]    As shown in the storage state C of  FIG. 2 , in the case where the life of the frame buffer indexed by 4 is zero (EMPTY=4), when STP_NUM=3, the processing of step S 108  results in LIFE[ 4 ]=STAMP[STP_NUM]=STAMP[ 3 ]=11. Thus, as shown in the storage state D of  FIG. 2 , the life of the frame buffer  4  comes to be 11, which is the value of STAMP[ 3 ]. 
         [0078]    As shown in the storage state D of  FIG. 2 , in the case where the life of the frame buffer indexed by 8 is zero (EMPTY=8), when STP_NUM=4, the processing of step S 108  results in LIFE[ 8 ]=STAMP[STP_NUM]=STAMP[ 4 ]=7. Thus, as shown in the storage state E of  FIG. 2 , the life of the frame buffer  8  is set to 7, which is the value of STAMP[ 4 ]. 
         [0079]    In step S 112  subsequent to step S 110  or step S 111 , the counter I is initialized to 1 and the life update processing in steps S 113  to S 116  is executed. In the life update processing, it is firstly determined whether or not the value of the counter I is equal to or less than N_BUFFER (=12, in the present embodiment) (step S 113 ). If I≦N_BUFFER (“YES” in step S 113 ), then it is determined whether LIFE[I] of the frame buffer I indicated by the value of the counter I is non-zero (step S 114 ). When the life of the frame buffer I is zero (“NO” in step S 114 ), the flow goes to step S 116  without performing step S 115 . 
         [0080]    When the life of the frame buffer I (LIFE[I]) is non-zero (“YES” in step S 114 ), then LIFE[I] is decremented by one (step S 115 ). Next, the counter I is incremented (step S 116 ), and the flow is repeatedly executed from step S 113 . In the present embodiment, therefore, steps S 113  to S 116  are repeated twelve times in succession with the result that the life of each frame buffer having non-zero value is decremented by one. 
         [0081]    When the counter I reaches 13, the determination result of step S 113  becomes “NO” and consequently the flow goes from step S 113  to S 117 , where it is determined whether or not a command is given to terminate image capture (step S 117 ). In the absence of such a command (“NO” in step S 117 ), the flow returns to step S 106 . Thus, the life setting processing in steps S 108  to S 111  and the life update processing in steps S 113  to S 116  are repeated until a command is given to terminate image capture. 
         [0082]    By repeating the life setting processing in steps S 108  to S 111 , empty buffers are overwritten with recent images and initial lives of the empty buffers are set, as described above. By repeating the life update processing in steps S 113  to S 116 , the life of the frame buffer indexed by 2 in  FIG. 2  is decremented from 4 through 3, 2 and 1 to zero, for example. 
         [0083]    When the shutter key is operated to give a command to terminate image capture, the processing according to the above flowcharts is terminated. Accordingly, when a command is given to terminate image capture in the storage state E of  FIG. 2 , for example, the processing is terminated in a state where the twelve frame buffers have been respectively storing images and associated time information. That is, since the process carried out in step S 13  of  FIG. 4  is an overwrite process; an image is stored in the frame buffer  2  having the life of zero. A total of twelve images and associated time information are respectively stored in all of the twelve frame buffers including the frame buffer indexed by 2. 
         [0084]    In the present embodiment, image capture is carried out at a frame rate of 4 fps and the number of frame buffers is 12. Therefore, if older images were sequentially erased and newer images were sequentially stored, only past images captured up to three seconds before could be stored. According to the present embodiment, however, the decrement of life and overwrite are repeatedly executed at every ¼ second from maximal initial life of 19 to zero; therefore, past images captured up to 4.75 seconds before can be stored. 
         [0085]    Consequently, according to the present embodiment, it is possible to store even image data captured less recent past, without a process of copying image data. 
         [0086]    Moreover, the straightforward process of decrementing the life set up for each frame buffer allows even image data of the less recent past to be stored with no need to copy the image data. 
         [0087]    Decrementing a life of a frame buffer allows determining that, when the life reaches zero, image data in the corresponding buffer can be overwritten. Therefore, unlike a third embodiment to be described later, there is no need to use overwrite permission flags and to set up storage areas for the overwrite permission flags. Thus, even image data of the less recent past can be stored with straightforward processing and memory configuration. 
         [0088]    Note that the time sequence of stored images is irrelevant to order of the indexes of the frame buffers. Therefore, to finally record continuously-captured image data (a moving image) consisting of the frames of image data stored in the frame buffers into the storage memory  13  with a file name appended, the frames of image data may be arranged and recorded in order of time based on time information stored for the respective frames. In such a case, it is also possible to read images only from frame buffers having lives more than a given value except a frame buffer having a life of zero to produce continuously-captured image data. 
         [0089]    However, it is also possible to record the frames of image data into the storage memory  13  without aligning the frames in order of time. When reproducing the frames of image data, the frames of image data may be read out from the storage memory  13  in order of time based on time information stored together. 
         [0090]    In the present embodiment, when the mode setting key in the key entry unit  7  is operated to set the past capture mode, the processing is initiated with step S 101  and completed when a command is given to terminate the image capture (“YES” in step S 117 ). However, it is also possible to initiate the processing in response to half-depression of the shutter key and terminate the processing in response to full depression of the shutter key. 
       Second Embodiment 
       [0091]      FIG. 5  is a flowchart illustrating process procedure of a second embodiment of the present invention. The symbols used in this flowchart are equivalent to those in the flowchart of the first embodiment shown in  FIG. 3 . The parameter initialization processing of steps S 201  to S 204  is identical to the processing of steps S 101  to S 104  in the first embodiment. Thus, the frame buffers indexed by 1 through 12 in  FIG. 6  are all initialized to zero. 
         [0092]    When the value of the counter I reaches 13, the determination of whether or not “I≦N BUFFER” in step S 202  results in “NO” and consequently the flow goes from step S 202  to step S 205  to start an empty frame entry timer. The empty frame entry timer is a timer which repeats timeout and reset at regular intervals set by the user with the key entry unit  7 . 
         [0093]    Next, the index STP_NUM of the initial life type is initialized to 1 (step S 206 ), and then empty frame searching and overwriting processing is carried out (step S 207 ). 
         [0094]    The processing in step S 207  is carried out in accordance with a flowchart shown in  FIG. 8 . It is determined whether or not a timeout has occurred and a specified time for the empty frame entry timer has elapsed. When the specified time has not elapsed, the determination result of step S 21  becomes “NO”. In this case, the flow goes to step S 24  without performing steps S 22  and S 23 . 
         [0095]    When the specified time is reached (“YES” in step S 21 ), a search is made for a frame buffer having a life which is not greater than 3 except a frame buffer having a life of zero (step S 22 ). Therefore, when step S 22  is carried out in the storage state A of  FIG. 6 , as indicated by circled numbers, the frame buffer indexed by 4 whose life is 2, the frame buffer indexed by 6 whose life is 1 and the frame buffer indexed by 8 whose life is 3 will be found out. Furthermore, the lives of these frame buffers are set to zero (step S 23 ). As a result, the lives of the frame buffers indexed by 4, 6 and 8 are set to zero as shown in the storage state B of  FIG. 6 . 
         [0096]    In step S 24  subsequent to step S 21  or step S 23 , a search is made for an empty frame buffer for which LIFE[I] is set to zero (step S 24 ). The index of the found out empty frame buffer (indexed by any one of 1, 4, 6 and 8, in the above example) is stored into a register of EMPTY (step S 25 ). Then, the empty frame buffer is overwritten with an image captured by the CCD  2  and time information indicating a time of capture (step S 26 ). 
         [0097]    Thus, when the lives of the frame buffers indexed by 1, 4, 6 and 8 are set to zero as shown in the storage state B of  FIG. 6 , EMPTY stores the index of 1, for example. A frame of image data is transferred to a frame buffer indexed by EMPTY and the buffer is overwritten with the transferred image data and associated time information. In addition, the empty frame entry timer is reset and then started (step S 27 ). 
         [0098]    In step S 208  of the flowchart of  FIG. 5 , completion of overwriting one frame of image data and associated time information in accordance with the flowchart of  FIG. 8  is waited. As described above, this embodiment is configured such that, when the past capture mode is set, the DSP/CPU  3  controls the TG  4  to drive the CCD  2  at a frame rate of 4 f/s. Therefore, a waiting time of ¼ second is required to transfer the image to the frame buffer indexed by EMPTY and to overwrite the buffer with the transferred image. When the image is fully written into the buffer, the flow goes from step S 208  to S 209  to initiate the life setting processing. 
         [0099]    This life setting processing is identical to the processing in steps S 108  to S 111  in the flowchart of  FIG. 3 . That is, first, the life of the frame buffer (LIFE[EMPTY]) indicated by value of EMPTY is set with the initial life STAMP[STP_NUM] of frame buffer which is indicated by the index STP_NUM of the initial life type (step S 209 ). Since the life type index STP_NUM is set to 1 (STP_NUM=1) as in step S 206 , the life initial life STAMP[STP_NUM] is STAMP[ 1 ]. The first of the four types of initial lives (19, 7, 11 and 7) is 19, and thus STAMP[ 1 ]=19. Therefore, in step S 209 , LIFE[ 1 ] of the frame buffer indexed by 1 is set to 19 as shown in the storage state C of  FIG. 6 . 
         [0100]    Next, the index of the initial life type STP_NUM is incremented (step S 210 ) and it is then determined whether or not the incremented index STP_NUM has reached the number of the types of initial lives N_STAMP (=4, in the present embodiment) (step S 211 ). If No, the flow goes to step S 213  without performing step S 212 . If Yes, the index STP_NUM is initialized to 1 (step S 212 ) and then the flow goes to step S 213 . 
         [0101]    Thus, the index STP_NUM changes from 1 through N_STAMP, i.e., from 1 through 4. In the case in which the processing of S 209  has been repeatedly executed, the initial life STAMP[STP_NUM] of the (empty) frame buffer, which stores new image, is set as follows: STAMP[ 1 ]=19 when the index of the initial life type STP_NUM is set to 1; STAMP[ 2 ]=7 when STP_NUM is set to 2; STAMP[ 3 ]=11 when STP_NUM is set to 3; and STAMP[ 4 ]=7 when STP_NUM is set to 4. 
         [0102]    Therefore, as shown in the storage state B of  FIG. 6 , in the case where the life of the frame buffer indexed by 1 is zero and the frame buffer indexed by 1 is considered to be empty (EMPTY=1), when STP_NUM=1, the processing in step S 209  leads to LIFE[ 1 ]=STAMP[STP_NUM]=STAMP[ 1 ]=19. Thus, as shown in the storage state C of  FIG. 6 , the life of the frame buffer indexed by 1 is set to 19, which is the value of STAMP[ 1 ]. 
         [0103]    As shown in the storage state C of  FIG. 6 , in the case where the life of the frame buffer indexed by 6 is zero (EMPTY=6), when STP_NUM=2, the processing in step S 209  leads to LIFE[ 6 ]=STAMP[STP_NUM]=STAMP[ 2 ]=7. Thus, as shown in the storage state D of  FIG. 6 , the life of the frame buffer  6  is set to 7, which is the value of STAMP[ 2 ]. 
         [0104]    As shown in the storage state D of  FIG. 6 , in the case where the life of the frame buffer indexed by 4 is zero (EMPTY=4), when STP_NUM=3, the processing in step S 209  leads to LIFE[ 4 ]=STAMP[STP_NUM]=STAMP[ 3 ]=11. Thus, as shown in the storage state E of  FIG. 6 , the life of the frame buffer  4  is set to 11, which is the value of STAMP[ 3 ]. 
         [0105]    As shown in the storage state E of  FIG. 6 , in the case where the life of the frame buffer indexed by 8 is zero (EMPTY=8), when STP_NUM=4, the processing in step S 209  results in LIFE[ 8 ]=STAMP[STP_NUM]=STAMP[ 4 ]=7. Thus, as shown in the storage state F of  FIG. 7 , the life of the frame buffer  8  is set to 7, which is the value of STAMP[ 4 ]. 
         [0106]    In step S 213  subsequent to step S 211  or S 212 , the counter I is initialized to 1 to carry out the life update processing in steps S 214  to S 217 . In the life update processing, it is firstly determined whether or not the value of the counter I is equal to or less than N_BUFFER (=12, in the present embodiment) (step S 214 ). If I≦N BUFFER (“YES” in step S 214 ), then it is determined whether or not LIFE[I] of the frame buffer indexed by the value of the counter I is non-zero (step S 215 ). When the life of the frame buffer I is zero (“NO” in step S 215 ), then the flow goes to step S 217  without performing step S 216 . 
         [0107]    When the life of the frame buffer (LIFE[I]) indexed by I is non-zero (“YES” in step S 215 ), then the LIFE[I] is decremented by one (step S 216 ). Next, the counter I is incremented (step S 217 ), and the flow is repeatedly executed from step S 214 . In this embodiment, therefore, steps S 214  to S 217  are repeated twelve times in succession with the result that the life of each frame buffer having non-zero value is decremented by one. 
         [0108]    When the counter I reaches 13, the determination result of step S 214  becomes “NO” and consequently the flow goes from step S 214  to S 218 , in which it is determined whether or not a command is given to terminate image capture (step S 218 ). In the absence of such a command (“NO” in step S 218 ), the flow returns to step S 207 . Thus, the life setting processing in steps S 209  to S 212  and the life update processing in steps S 214  to S 217  are repeated until a command is given to terminate image capture. 
         [0109]    By repeating the life setting processing in steps S 209  to S 212 , empty buffers are overwritten with recent images and initial lives of the empty buffers are set, as described above. By repeating the life update processing in steps S 214  to S 217 , the life of the frame buffer indexed by 2 in  FIG. 6  is decremented from 4 through 3, 2 and 1 to zero, for example. 
         [0110]    While decrementing a life of a frame buffer, when timeout of the timer occurs, the determination result in step S 21  becomes “YES”. Then, a search is made for frame buffers whose life values are not greater than 3 except frame buffers whose life values has already been set to zero (step S 22 ). In the case where step S 22  is carried out in the storage state F of  FIG. 7 , the frame buffer  7  whose life is 2, the frame buffer  10  whose life is 1 and the frame buffer  12  whose life is 3 will be found out as indicated by circled numbers. Furthermore, the lives of these frame buffers are set to zero (step S 23 ). As a result, the lives of the frame buffers indexed by 7, 10 and 12 are set to zero as shown in the storage state G of  FIG. 7 . Thereafter, the processing in steps S 24  to S 27  and then the processing in steps S 208  to S 218  are executed. 
         [0111]    When the shutter key is operated to give a command to terminate image capture, the processing according to the above flowcharts is terminated. Accordingly, when a command is given to terminate image capture in the storage state G of  FIG. 7 , for example, the processing terminates in a state where the twelve frame buffers have been respectively storing twelve images and associated time information. That is, since the process carried out in step S 26  of  FIG. 8  is an overwrite process, images are stored even in the frame buffers indexed by 2, 7, 10 and 12 which have lives set to zero. A total of twelve images and associated time information are respectively stored in all of the twelve frame buffers. 
         [0112]    In this embodiment, image capture is carried out at a frame rate of 4 fps and the number of frame buffers is 12. Therefore, if older images were sequentially erased and newer images were sequentially stored, only past images captured up to three seconds before could be stored. In this embodiment, however, the decrement and overwrite are repeatedly executed at every ¼ second from the maximal initial life of 19 to zero; therefore, past images captured up to 4.75 seconds before can be stored. 
         [0113]    Consequently, according to the present embodiment, it is possible to store even image data captured less recent past, without a process of copying image data. 
         [0114]    Moreover, according to this embodiment, since a predetermined value (in this case, “0”) indicating that a buffer is empty is compulsorily assigned at every specified time to a life or lives of frame buffer(s) decremented to less than a given value to bring the frame buffer(s) to be overwritable, it is possible to certainly secure an overwritable frame buffer in a easy manner. 
       Third Embodiment 
       [0115]      FIG. 9  is a flowchart illustrating process procedure according to a third embodiment of the present invention. In this embodiment, unlike the first embodiment, values of lives are incremented. Thus, the symbols used in this flowchart are not equivalent to those used in the flowchart of the first embodiment shown in  FIG. 3  with respect to the following items: 
         [0116]    LIFE[I]: life of frame buffer indexed by I 
         [0117]    LIFE[I] indicates a numeral corresponding to a time until it is determined that the frame buffer indexed by I is empty. The value of LIFE[I] ranges from 0 to 19. Basically, when the value of LIFE[I] becomes 19, the frame buffer indexed by I is considered to be “empty.” In some cases, however, the frame buffer indexed by 11 or 7 may be considered to be empty. 
         [0118]    N_STAMP: the number of final values of “life”; 
         [0119]    The value of N_STAMP indicates how many types of final life the frame buffers can take. In the present embodiment, the value of N_STAMP is fixed to 4. 
         [0120]    STP_NUM: index of final life type; 
         [0121]    Since the value of N_STAMP is fixed to 4 in the present embodiment, STP_NUM ranges from 1 to 4. 
         [0122]    STAMP[STP_NUM]: final life of frame buffer; 
         [0123]    STAMP[STP_NUM] indicates a final life to be set for a frame buffer. STAMP[STP_NUM] repeatedly takes 19, 7, 11, 7, and so on. STAMP[ 1 ] is 19 (first type of final life), STAMP[ 2 ]=7 (second type of final life), STAMP[ 3 ]=11 (third type of final life) and STAMP[ 4 ]=7 (fourth type of final life). 
         [0124]    In this embodiment, overwrite permission flags are used in addition to the above symbols. The overwrite permission flags are set up for the respective frame buffers. When a flag is on, the flag indicates overwriting the corresponding frame buffer is permitted; otherwise, when the flag is off, the flag indicates that overwriting the frame buffer is inhibited. 
         [0125]    As shown in the flowchart, parameter initialization processing is performed in steps S 301  to S 305 . Specifically, the counter I is initialized to 1 (step S 301 ). Next, it is determined whether or not the value of the counter I is equal to or less than N_BUFFER (=12, in the present embodiment) (step S 302 ). If I≦N_BUFFER (“YES” in step S 302 ), then LIFE[I] of the frame buffer indexed by the value of the counter I is initialized to zero (step S 303 ) and the overwrite permission flag of the frame buffer I is set (step  304 ). Subsequently, the counter I is incremented by one (step S 305 ) and the processing from step S 302  is repeatedly executed. In this embodiment, therefore, steps S 302  to S 305  are repeated twelve times with the result that the frame buffers indexed by 1 through 12 shown in  FIG. 10  are all set to zero and overwrite permission flags of the buffers are on. 
         [0126]    When the counter I reaches 13, the determination result of “I≦N BUFFER” in step S 302  becomes “NO” and thus the flow goes from step S 302  to S 306 . The index STP_NUM of the final life type is initialized to 1 (step S 306 ). Next, empty frame searching and overwriting processing is carried out (step S 307 ). 
         [0127]    The processing in step S 307  is carried out in accordance with a flowchart shown in  FIG. 11 . The  12  frame buffers are searched for an empty frame buffer for which the overwrite permission flag is on (step S 31 ). The index of the found out empty frame buffer (any of 1 through 12) is stored into a register of EMPTY (step S 32 ). When a plurality of overwritable frame buffers are found out in step S 31 , one of the plurality of frame buffers is selected and the index of the selected buffer is stored into the register of EMPTY in step S 32 . The frame buffer corresponding to the index stored in EMPTY is overwritten with a frame of image data captured by the CCD  2  as well as time information indicating a time of capture (step S 33 ). 
         [0128]    Thus, as shown in the storage state A of  FIG. 10 , in the case where overwrite permission flags of frame buffers indexed by 1 and 7 are on, EMPTY stores one of the indexes 1 and 7. By way of example, the frame buffer index 7 is selected in  FIG. 10 . A captured image is transferred to a frame buffer indexed by EMPTY (in this case, 7) and then the buffer indexed by 7 is overwritten with the transferred image and associated time information. 
         [0129]    In step S 308  of the flowchart of  FIG. 9 , completion of overwriting one frame of image data and associated time information in accordance with the flowchart of  FIG. 11  is waited. In the present embodiment, when the past capture mode is being set, the DSP/CPU  3  controls the TG  4  to drive the CCD  2  at the frame rate of 4 f/s as described above. Therefore, a waiting time of ¼ second is required to transfer the image to the frame buffer indexed by EMPTY and to overwrite the buffer with the transferred image. When the buffer is fully overwritten with the transferred image, the flow goes from step S 308  to S 309  to initiate the life setting processing. 
         [0130]    To set the lives of the frame buffers, first, the life LIFE[EMPTY] of the frame buffer indexed by the value of EMPTY is set to zero (step S 309 ), and the overwrite permission flag of the frame buffer indexed by EMPTY is cleared to inhibit overwriting (step S 310 ). 
         [0131]    Next, the index STP_NUM of the final life type is incremented by one (step S 311 ) and it is determined whether or not the incremented index STP_NUM has reached the number of types of final life N_STAMP (=4, in the present embodiment) (step S 312 ). If No, the flow goes to step S 314  without performing step S 313 . If Yes, the index STP_NUM of the final life type is initialized to 1 (step S 313 ) and then the flow goes to step S 314 . Thus, the index STP_NUM of the final life type changes from 1 through N_STAMP, that is, from 1 through 4. 
         [0132]    In step S 314  subsequent to step S 312  or S 313 , the counter I is initialized to 1 and the life update processing in steps S 315  to S 321  is executed. In the life update processing, it is firstly determined whether or not the value of the counter I is equal to or less than N_BUFFER (=12, in the present embodiment) (step S 315 ). If I≦N BUFFER (“YES” in step S 315 ), then it is determined whether LIFE[I] of the frame buffer I indicated by the value of the counter I is not 19 (step S 316 ). When the life of the frame buffer I is 19 (“NO” in step S 316 ), then the overwrite permission flag of the frame buffer I is set (step S 318 ). 
         [0133]    When the life LIFE[I] of the frame buffer I is not 19 (“YES” in step S 316 ), then it is determined whether LIFE[I] is not equal to STAMP[STP_NUM] which is indexed by the final life type STP_NUM (step S 317 ). 
         [0134]    In the case where the processing of S 311  has been repeatedly executed to set the final life type index STP_NUM with 1 through 4, the final life STAMP[STP_NUM] is set as follows: STAMP[ 1 ]=19 when STP_NUM is 1; STAMP[ 2 ]=7 when STP_NUM is [2]; STAMP[ 3 ]=11 when STP_NUM is 3; and STAMP[ 4 ]=7 when STP_NUM is 4. 
         [0135]    In step S 317 , therefore, it is determined depending on the life type index STP_NUM which is set in step S 311  whether the life LIFE[i] of the frame buffer indexed by I is not equal to 19, 7, 11 or 7. As a result of step S 317 , when it is determined that LIFE[I] of the frame buffer indexed by I accords with the final life of 19, 7, 11 or 7 corresponding to STP_NUM (“NO” in step S 317 ), the overwrite permission flag of the frame buffer indexed by I is set (S 318 ). 
         [0136]    However, when it is determined that LIFE[I] of the frame buffer indexed by I does not accord with the final life of 19, 7, 11 or 7 corresponding to STP_NUM (“YES” in step S 317 ), it is further determined whether or not the overwrite permission flag of the frame buffer I is on (step S 319 ). When the overwrite permission flag of the frame buffer indexed by I is on (“YES” in step S 319 ), then the flow goes to step S 321  without executing step S 320 . When the overwrite permission flag of the frame buffer indexed by I is not on (“NO” in step S 319 ), then LIFE[I] of the frame buffer indexed by I is incremented by one (step S 320 ). Next, the counter I is incremented by one (step S 321 ) and then the flow is repeatedly executed from step S 315 . In this embodiment, therefore, steps S 313  to S 321  are repeated twelve times in succession. 
         [0137]    In the case where the life setting processing from step S 315  to step S 321  has been repeatedly executed, when the life type index STP_NUM is 1, the final life STAMP[ 1 ] is 19, as shown in the storage state A of  FIG. 10 . Since the life of the frame buffer indexed by I becomes 19 as shown in the storage state A of  FIG. 10 , the determination result of step S 316  is “NO.” Processing in step S 318  allows the overwrite permission flag of the frame buffer indexed by 1 to be on. It should be noted that last but one execution of step S 318  has set the overwrite permission flag of the frame buffer indexed by 7. The lives of the frame buffers, excepting the frame buffers indexed by 1 and 7, are incremented by one. 
         [0138]    In subsequent execution of step S 33 , the frame buffer indexed by 7, for example, is overwritten with newly captured image data and the life of the frame buffer indexed by 7 is set to 0 in step S 309 . 
         [0139]    In the storage state B of  FIG. 10 , the life type index STP_NUM becomes 2 and the final life STAMP[ 2 ] becomes 7. In the storage state B, there are no frame buffer having the life of 7 (=STAMP[ 2 ]). However, the frame buffer indexed by 6 has the life of 19. Consequently, the determination result in step S 316  for the frame buffer indexed by 6 is “NO” and the overwrite permission flag of the frame buffer indexed by 6 is set in step S 318 . Except the frame buffer indexed by 6 for which the overwrite permission flag is now set and the frame buffer indexed by 1 for which the overwrite permission flag has already been set, the lives of the frame buffers are incremented by one. 
         [0140]    In the storage state C of  FIG. 10 , the life type index STP_NUM becomes 3 and the final life STAMP[ 3 ] becomes 11. In the storage state C, the life of the frame buffer indexed by 11 is 11, and the life of the frame buffer indexed by 4 is 19. Therefore, the determination result of step S 316  for the frame buffer indexed by 4 is “NO” and the overwrite permission flag of the frame buffer  4  is set in step S 318 . For the frame buffer indexed by 11, the determination result of step S 317  is “NO” and the overwrite permission flag of the frame buffer indexed by 11 is set in step S 318 . Except the frame buffers indexed by 4 and 11 for which the overwrite permission flags are set now and the frame buffer indexed by 6 for which the overwrite permission flag has already been on, the lives of the frame buffers are incremented. In the storage state D of  FIG. 10 , the life type index STP_NUM becomes 4 and the final life STAMP[ 4 ] becomes 7. 
         [0141]    In the storage state D of  FIG. 10 , there are no frame buffer having the life of 7 (=STAMP[ 4 ]). However, the life of the frame buffer  8  is 19. Therefore, the determination result of step S 316  for the frame buffer indexed by 8 is “NO” and the overwrite permission flag of the frame buffer indexed by 8 is set in step S 318 . The lives of the frame buffers are incremented, except the frame buffer indexed by 8 for which the overwrite permission flag is now set and the frame buffers indexed by 4 and 11 for which the overwrite permission flags have already been set. 
         [0142]    In the storage state E of  FIG. 10 , the life type STP_NUM becomes 1 again, and the final life STAMP[ 1 ] becomes 19. Since the life of the frame buffer indexed by 2 comes to 19, the determination result of step S 316  is “NO.” The overwrite permission flag of the frame buffer indexed by 2 is set in step S 318 . The lives of the frame buffers are incremented, except the frame buffer indexed by 2 for which the overwrite permission flag is now set and the frame buffers indexed by 8 and 11 for which the overwrite permission flags have already been set. 
         [0143]    Thereafter, when the counter I reaches 13, the determination result of step S 315  becomes “NO” and consequently the flow goes from step S 315  to S 322 . It is determined whether or not a command has been given to terminate image capture (step S 322 ). In the absence of such a command (“NO” in step S 322 ), the flow returns to step S 307 . Thus, the life setting processing in steps S 309  to S 313  and the life update processing in steps S 315  to S 321  are repeated until a command is given to terminate image capture. 
         [0144]    When the shutter key is operated to give a command to terminate image capture, the processing according to the above flowcharts is terminated. Accordingly, when a command is given to terminate image capture in the storage state E of  FIG. 10 , for example, the processing terminates in a state where the twelve frame buffers have been storing images and associated time information. That is, since the process carried out in step S 33  of  FIG. 11  is an overwrite process, images are stored even in the frame buffers indexed by 2, 8 and 11, for which the overwrite permission flags are on. A total of twelve images and associated time information are respectively stored in all of the twelve frame buffers. 
         [0145]    In the present embodiment, image capture is carried out at a frame rate of 4 fps and the number of frame buffers is 12. Therefore, if older images were sequentially erased and newer images were sequentially stored, only images captured up to three seconds before could be stored. According to the present embodiment, however, the decrement and overwrite are repeatedly executed at every ¼ second until maximal final life of 19; therefore, past images captured up to 4.75 seconds before can be stored. 
         [0146]    Consequently, according to the present embodiment, it is possible to store even image data captured less recent past without a process of copying image data. 
         [0147]    Moreover, the straightforward process of incrementing the life set up for each frame buffer allows even image data of the less recent past to be stored with no need to copy the image data. 
         [0148]    The time sequence of stored images is irrelevant to order of indexes of the frame buffers. Therefore, to finally record continuously-captured image data (a moving image) consisting of frames of image data stored in the frame buffers into the storage memory  13  with a file name appended, the frames of image data may be arranged and recorded in order of time based on time information stored with the image data. Alternatively, it is also possible to record the frames of image data into the storage memory  13  without arranging the frames in order of time. When reproducing the frames of image data, the frames of image data may be read out from the storage memory  13  in order of time based on time information stored together. 
         [0149]    According to the present embodiment, the initial life of zero is set for the frame buffers in the life setting processing in steps S 309  through S 312 . However, as in the first embodiment, also a limit value of increment may be set for a frame buffer. In such a case, when a life of a frame buffer is incremented up to the limit value in steps S 315  through S 321  of the life update processing, corresponding overwrite permission flag may be set. 
         [0150]    Also in the present embodiment, an empty frame entry timer may be used, similarly to the second embodiment. In such a case, upon an occurrence of a timeout of the timer, a search is made for a frame buffer having a live which is equal to or more than 16, for example, except a frame buffer for which the overwrite permission flag is set. Then the overwrite permission flag of found out frame buffer may be set. 
         [0151]    In the above embodiments, described is such a configuration that: the number of provided frame buffers is 12; frame rate for continuous image capture is 4 fps; N_BUFFER=12; LIFE[I]=19 to 0; N_STAMP=4; and STAMP[STP_NUM]=19, 7, 11 and 7. However, such a configuration is provided by way of example, and appropriate modifications of the configuration can be made. 
         [0152]    In the above embodiments, described is such a case that the present invention is applied to capturing past images. However, the invention may be applied to capturing past images and future images in such a manner that capturing the past is performed until a trigger is occurred and capturing the future is performed after the trigger. In this case, when capturing the future it is desired to perform the above-described processing for capturing the past.