Image taking apparatus and image taking method

In an automatic shooting mode, a CPU of a digital camera displays on an LCD a number setting display for setting the number of people to be taken. After the number of people to be taken is set, a through image taken by the CCD is stored in a frame memory and displayed on the LCD. A face detecting section detects and counts faces contained in the through image, and outputs the number of faces as the number of detected people to a number matching section. The number matching section judges whether the set number stored in the frame memory matches the detected number input from the face detecting section. When the number matching section judges that the numbers match each other, the CPU performs an image-taking processing after AF control and AE control.

FIELD OF THE INVENTION

The present invention relates to an apparatus and a method for taking images automatically after counting the number of subjects, for example, the number of people.

BACKGROUND OF THE INVENTION

Image taking apparatuses which take images by an image sensor such as a CCD and store the images as image data, for example digital cameras, are widely used. Various techniques are devised to take images of the subjects under optimum conditions while taking advantage of features of images, derived from converting the taken images into electrical signals.

For example, Japanese Patent Laid-Open Publication No. 2003-092701 suggests an image taking apparatus which automatically presses a release button and takes an image when a face image is recognized and each part of the face is identified.

U.S. Patent Publication No. 2006/0197845 (corresponding to Japanese Patent Laid-Open Publication No. 2006-237961) suggests an image taking apparatus provided with a motion area detecting section, a face detecting section and a control section, and an automatic image taking method using this image taking apparatus. Based on the image data, the motion area detecting section detects a block in which motion is detected as a motion area among blocks formed by dividing an image frame. The face detecting section detects a human face based on the image data. The control section takes an image when the motion in the motion area containing a human face is stopped.

In addition, Japanese Patent Laid-Open Publication No. 2006-005662 suggests an electronic camera and an electronic camera system for taking an image after detecting a position of a face region of a person (subject) and when a motion amount of the position of the face region is within a predetermined range for a predetermined time.

In a so-called self-timer shooting in which a photographer is also a subject, the photographer enters into a shooting range after a predetermined operation of the digital camera. The above-described Japanese Patent Laid-Open Publication No. 2003-092701 has a problem that an image is taken immediately after the face image is recognized and each part of the face is identified even before the photographer enters into the shooting range. In this case, the photographer is not included in the taken image.

Also in the self-timer shooting of the U.S. Patent Publication No. 2006/0197845, the image is taken when motion in the motion area containing faces is stopped even before the photographer enters into the shooting range.

The electronic camera disclosed in the Japanese Patent Laid-Open Publication No. 2006-005662 has a predetermined standby time after the release button is fully pressed. However, if the photographer fails to enter into the shooting range within the predetermined standby time, the photographer is not included in the taken image. When the standby time is extended to ensure the photographer to enter into the shooting range, the standby time may become too long for the subjects (people) other than the photographer. The subjects (people), especially children, cannot wait until the image is taken and make motion, which result in blurs in the taken image.

SUMMARY OF THE INVENTION

In view of the foregoing, an object of the present invention is to provide an image taking apparatus and an image taking method for reliable automatic shooting such as a self-timer shooting.

In order to achieve the above and other objects, an image taking apparatus of the present invention includes a number setting section, an object detecting section, a number matching section, and a control section. The number setting section sets the number of specific objects to be contained in a subject image. The object detecting section detects one or more specific objects contained in the subject image based on the image data, and counts the number of the detected specific objects. The number matching section judges whether the number of the specific objects set by the number setting section and the number of the specific objects detected by the object detecting section match each other. The control section outputs the image-taking start signal when the number matching section judges that the numbers match each other.

It is preferable that the specific objects are human faces. Other than the human faces, the specific objects may be faces of animals such as dogs and cats.

It is preferable that the control section outputs the image-taking start signal when a predetermined time lapses after the number matching section judges that the numbers match.

It is preferable that the control section outputs the image-taking start signal after at least one of focus adjustment and exposure adjustment is performed after the number matching section judges that the numbers match.

The image taking apparatus further includes a motion judging section for judging whether the specific object is in motion. It is preferable that the control section outputs the image-taking start signal after the number matching section judges that the numbers match each other and after the motion judging section judges that the specific object is motionless.

In a preferred embodiment of the present invention, the image taking apparatus includes an object detecting section, an increment or decrement setting section, an increment or decrement matching section, a motion judging section, and a control section. The object detecting section detects the number of specific objects contained in the subject image based on the image data. The increment or decrement setting section sets an increment or decrement of the detected number. The increment or decrement matching section judges whether an equation Q3=Q1+Q2is satisfied, when Q1is the increment or decrement set in the increment or decrement setting section, and Q2is the detected number of the specific objects in the image data of the time when the Q1is set, and Q3is the detected number of the specific objects in the latest image data. The motion judging section judges whether the specific object is in motion. The control section outputs the image-taking start signal after the increment and the decrement judging section judges that Q3=Q1+Q2is satisfied, and after the motion judging section judges that the specific object is motionless.

An image taking method of the present invention includes the following steps: setting the number of specific objects to be contained in the subject image; detecting and counting the specific objects contained in the subject image based on the image data; judging whether the number of the specific objects set in the number setting step and the number of the specific objects detected in the number detecting step match each other; and outputting the image-taking start signal when the numbers are judged to match in the number matching step.

A preferred embodiment of the present invention includes the following steps: detecting the number of the specific objects contained in the subject image based on the image data; setting an increment or decrement of the detected number; judging whether an equation Q3=Q1+Q2is satisfied, when Q1is the increment or decrement set in the increment or decrement setting step, Q2is the detected number of the specific objects in the image data of the time when the Q1is set, and Q3is the detected number of the specific objects contained in the latest image data; judging whether the specific object is in motion; and outputting the image-taking start signal when it is judged that Q3=Q1+Q2is satisfied in the increment or decrement judging step, and the specific object is judged motionless in the motion judging step.

According to the image taking apparatus of the present invention, the number of the specific objects is set, and the image-taking start signal for storing the image data on the recording medium is output when the number of the specific objects and the detected number of the specific objects match. By properly setting the number of the specific objects, the image-taking is delayed until the photographer is detected even when the photographer enters into the shooting range late, and the image is taken only after the photographer is detected. Thereby, problems, such as an image is taken before the photographer enters into the shooting range in the self-timer shooting, are solved.

The image-taking start signal is output after a predetermined time after the matching of the set number of the specific objects and the detected number of the specific objects. Therefore, the photographer has a time to stand still after entering into the shooting range even when the photographer enters into the shooting range late. As a result, a failure caused by taking the photographer before standing still, such as a blurred face, is prevented.

According to the image taking apparatus of the present invention, the increment or decrement Q1of the specific objects is set, and the image-taking start signal is for storing the image data on the recording medium is output when the detected number Q3of the specific objects in the latest image data equals the sum of the increment or decrement Q1and the detected number Q2of the specific objects in the image data of the time the increment or decrement Q1is set. Accordingly, by properly setting the increment or decrement Q1, the image-taking is delayed until the photographer is detected, and taken only after the photographer is detected, even when there are a large number of people to be taken and it is difficult to ascertain the exact number.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

As shown inFIG. 1, a digital camera10is provided with an image producing system11, a control system12, an image display system13, a video transfer circuit14, a compression/decompression circuit15, a frame memory16, and a face detecting section (object detecting section)17. Additionally, the digital camera10is provided with a focal point detector21, a brightness calculator22, a number matching section23.

The image producing system11has a taking lens31, a CCD (an imaging device)32, a correlated double sampling circuit (CDS)33, an A/D converter34, a color processing circuit35, a TG (timing generator)36, and a driver37. Subject light enters into the CCD32through the taking lens31. The CCD32photoelectrically converts the subject image and generates RGB signals in time series, and sends the RGB signals to the CDS33. A timing signal (clock signal) is input to the driver37from the TG36controlled by the CPU41. The CCD32is driven by the driver37.

The RGB signals output from the CCD32are sent to the CDS33. In the CDS33, noise is removed from the RGB signals such that each signal accurately corresponds to an amount of accumulated charge of a corresponding cell in the CCD32. The RGB signals output from the CDS33is amplified by an amplifier (not shown) in accordance with ISO sensitivity, and converted into an image data in the A/D converter34.

The color processing circuit35performs image processing to the image data output from the A/D converter34, for example, offset correction, white balance processing, color matrix processing, gradation conversion, demosaicing, and edge enhancement. Thereafter, the image data is output from the color processing circuit35to the video transfer circuit14.

The video transfer circuit14is connected to the compression/decompression circuit15and the frame memory16. The compression/decompression circuit15performs compression and decompression on the image data.

Image data of a through image (a simplified image) is temporarily stored in the frame memory16when an LCD51is used as a viewfinder, namely, when the through image is taken or preparatory imaging is performed. The through image is a frame image with low resolution. The through image is displayed on the LCD51. The digital camera10has a RAM (recording medium)39for storing high-resolution image data when an image to be stored is taken.

The control system12is composed of a CPU (control section)41and an operating section42. The operating section42has a release button43and a mode selector44. The release button43has a switch S1(not shown) and a switch S2(not shown). The switch S1is turned on when the release button43is half-pressed. The Switch S2is turned on when the release button43is fully pressed. Upon receiving an ON signal from the switch S1, the CPU41performs preparatory processing such as AF (autofocus) control and AE (auto exposure) control. Upon receiving an ON signal from the switch S2, the CPU41controls each section of the digital camera10to take an image that is to be stored. The operating section42includes, in addition to the release button43and the mode selector44, a zoom up button (not shown) and a zoom down button (not shown) for optically or electronically enlarging or reducing the taken image, a playback button (not shown) for reproducing the data stored in a RAM39, a display changeover button (not shown) for changing the image displayed on the LCD51, and a menu key (not shown) for various settings. In addition to the AF control and the AE control, automatic white-balance control (hereinafter referred to as AWB) can be performed in the preparatory processing.

The digital camera10is provided with a normal shooting mode, an automatic shooting mode, and a playback mode. In the normal shooting mode, the release button43is operated to take an image. In the automatic shooting mode, the image-taking is started without operating the release button43. In the playback mode, the stored image is reproduced and displayed on the LCD51. To select the mode, the mode selector44is operated. The automatic shooting mode is selected to take a self-portrait. In this case, the digital camera10is fixed to a tripod or the like.

To take an image (namely, when the release button43is fully pressed in the normal shooting mode, or the preparatory processing is completed in the automatic shooting mode), the CPU41outputs an image-taking start signal to the image producing system11, the video transfer circuit14and the compression/decompression circuit15. When the image-taking start signal is input, the image producing system11outputs high-resolution image data to the video transfer circuit14. The video transfer circuit14outputs the high-resolution image data to the compression/decompression circuit15. The compression/decompression circuit15compresses the high-resolution image data. The compressed high-resolution image data is stored in the RAM (recording medium)39by a data reader (not shown) driven and controlled by a memory controller (not shown). Instead of using the RAM39, the image data can be stored on a recording medium detachably connected such as a memory card. In addition, the image data can be stored in both the RAM39and the memory card.

The image display system13is composed of the LCD51, a digital video encoder52, a touch panel53, and a touch panel I/F54. When the LCD51is used as a viewfinder, namely when the thorough image is taken, image data of the through image (through image data) stored in the frame memory16is sent to the LCD51through a data bus55and the digital video encoder52.

The touch panel53is provided on the back side of the LCD51. The touch panel53is connected to the CPU41through the touch panel I/F54and the data bus55. When the digital camera10is switched to the automatic shooting mode, as shown inFIG. 2A, the CPU41displays on the LCD51a number setting display60for setting the number of people (the number of specific objects) to be taken and enables the touch panel I/F54. On the number setting display60, a message61“set the number of people to be taken” is displayed. Below the message61, a number button62, with numerals of zero to nine, for setting the number of people to be taken, a setting OK button63, and a set number display area64are displayed. The number of people to be taken is set by touching any numeral of the number button62with a finger (hereinafter simply referred to as touching), and confirmed when the setting OK button63is touched. Before touching the number button62, “00” is displayed in the set number display area64.

When a photographer touches the number button62displayed on the LCD51, the touch panel I/F54outputs a touch signal to the CPU41. For example, to set “12” as the number of people to be taken, the photographer touches “1” of the number button62first. When the photographer touches “1” of the number button62, as shown inFIG. 2B, the touch panel I/F54outputs the touch signal corresponding to “1” to the CPU41. The CPU41displays “01” in the set number display area64. Next, the photographer touches “2” of the number button62. When “2” is touched, as shown inFIG. 2C, the touch panel I/F54outputs the touch signal corresponding to “2” to the CPU41. The CPU41displays “12” in the set number display area64. The photographer is able to set the number of people to be taken while checking the number displayed in the set number display area64.

When the photographer touches the setting OK button63, the touch panel I/F54outputs a touch signal to the CPU41. The CPU41stores the number “12” in the frame memory16as the number of people to be taken, and closes the number setting display60, and displays the through image being taken on the LCD51. The number matching section23judges whether the set number stored in the frame memory16and the number of the faces detected by the face detecting section17match each other. In this embodiment, a number setting section for setting the number of faces to be taken is composed of the CPU41, the LCD51, the touch panel53, and the touch panel I/F54.

As shown inFIG. 1, the face detecting section17detects the faces as the specific objects in the image data when the release button43is half-pressed in the normal shooting mode or automatically does the same thing in the automatic shooting mode. The through image data stored in the frame memory16is input to the face detecting section17. The face detecting section17detects the face by pattern recognition of features such as eyes, a nose and a mouth based on the through image data. Known face detecting methods, such as feature vector approximation method, a face detecting method by edge detection or shape pattern detection, a face region detecting method by hue detection or skin color detection (see, for example, Japanese Patent Laid Open Publication No. 2005-286940) can be used. In the feature vector approximation method, each of the above described features is vectorized, and the face is detected by approximate detection of the feature vector. In this embodiment, the face detecting section17is able to detect up to 20 faces. The number of faces to be detected can be changed as necessary.

The result of the face detection by the face detecting section17is used in the AF control, the AE control, the AWB control and the like. The result of the face detection can also be used for correction in the AF control, the AE control, the AWB control and the like.

The face detecting section17detects faces in the image data and, in the automatic shooting mode, counts the number of detected faces and outputs the number of detected faces as the number of detected people to the number matching section23.

The number matching section23judges whether the set number stored in the frame memory16and the number of detected people input from the face detecting section17match each other. When it is judged that the set number and the detected number match, the number matching section23outputs a match signal to the CPU41. Upon receiving the match signal, the CPU41starts the preparatory processing (the AF control and the AE control). Upon completion of the preparatory processing, the CPU41outputs the image-taking start signal to the image producing system11, the video transfer circuit14and the compression/decompression circuit15.

The face detecting section17may output information indicating a face region (for example, a frame around the face) to the CPU41. In this case, such information is used for storing and displaying the image. For example, when the through image is displayed on the LCD51as the viewfinder, the photographer recognizes that the face of the subject is detected when the frame is displayed around the face of the subject.

The focal point detector21detects focal condition based on the contrast of the through image stored in the frame memory16when the release button43is half-pressed or when the number matching section23judges the matching of the set number and the detected number in the automatic shooting mode.

The brightness calculator22calculates the brightness of the face of the subject using a known calculating method based on the through image data stored in the frame memory16when the release button43is half-pressed or when the number matching section23judges the matching in the automatic shooting mode.

When the photographer fully presses the release button43in the normal shooting mode, image-taking processing for storing the taken image is performed. The CPU41controls each part of the digital camera10to take the image to be stored after the AF control and the AE control.

As shown inFIG. 3A, when the number of people to be taken is set in the automatic shooting mode, the through image is displayed on the LCD51. For example, when the photographer sets “12” as the number of people to be taken, the preparatory processing is not performed in a state that the face detecting section17detects11faces in the through image data.

As shown inFIG. 3B, when the photographer enters into the shooting range as a subject, the face detecting section17detects12faces in the through image data. Thereby, the number matching section23judges that the set number (“12”) stored in the frame memory16and the number (“12”) detected by the face detecting section17match each other, and outputs the match signal to the CPU41. In response to this, the CPU41performs the preparatory processing. Upon completion of the preparatory processing, the CPU41controls to perform the image-taking processing.

The operation of the digital camera10is described using the flowchart shown inFIG. 4. By operating the mode selector44, the digital camera10is set in the automatic shooting mode (Y in a step1, hereinafter step is referred to as S) to automatically take an image. In the automatic shooting mode, the CPU41displays the number setting display60on the LCD51. The photographer sets the number of people to be taken (S2). The set number is stored in the frame memory16. Next, the through image is started to be taken, and the obtained through image is stored in the frame memory16and also displayed on the LCD51(S3). The face detecting section17detects and counts faces in the through image, and outputs the number of detected faces as the number of detected people to the number matching section23(S4).

The number matching section23judges whether the set number stored in the frame memory16and the number input from the face detecting section17match each other (S5). When the number matching section23judges that the set number and the detected number match (Y in S5), the number matching section23outputs the match signal to the CPU41. In response to this, the CPU41performs the AF control and AE control (S6). Thereafter, the image-taking processing is started (S7).

On the other hand, when the number matching section23judges that the set number and the detected number do not match (N in S5), the above S3, S4, and S5are performed again. In other words, the S3to S5are repeated until the number matching section23judges that the set number and the detected number match (Y in S5).

As described above, in the automatic shooting mode, the image is taken when the number of people set by the photographer and the number of faces detected by the face detecting section17match. Since the set number is greater by 1 than the detected number at the time of setting, the image is taken only after the photographer enters into the shooting range. Thus, a failure in the self timer shooting, namely, an image taken before the photographer enters into the shooting range is prevented. The photographer is able to take his/her time to enter into the shooting range without being in a hurry as in the self timer shooting.

When it is judged that the set number and the detected number match each other, the image-taking processing is performed after the preparatory processing (the AE control and the AF control). Therefore, preparatory processing is also performed to the photographer that enters into the shooting range late. The image is taken under an optimum condition compared to the digital camera which performs the image-taking processing immediately after the detection of the photographer.

In the above embodiment, when the number matching section23judges that the set number and the detected number match, the image-taking processing is performed after the preparatory processing. Alternatively, it is also possible to perform the image-taking processing without the preparatory processing. In this case, the image-taking processing is not performed until the face of the photographer that entered into the shooting range late is detected. In addition, it is also possible to set that a face in motion is not detected by the face detection. Accordingly, the image-taking processing is not performed when the photographer moves toward a predetermined position until the photographer reaches there and stops. Thus, the failure caused by taking the subject in motion, such as a blurred face, is prevented.

In the above embodiment, the number of people to be taken is set using the touch panel53and the touch panel I/F54. Instead, a menu key or the like provided in the operating section42may be used.

In the above embodiment, when the number matching section23judges that the set number stored in the frame memory16and the number detected by the face detecting section17match, the CPU41controls to perform the image-taking processing after the preparatory processing. Alternatively, the CPU41may control to perform steps shown inFIG. 5. In this embodiment, S11to S15are the same as the steps1to5shown inFIG. 4. When the number matching section23judges that the set number and the detected number match (Y in S15), the CPU41judges whether a predetermined time (for example, 5 seconds) has passed (S16). When it is judged that 5 seconds have passed (Y in S6), the CPU41controls to perform image-taking processing (S18) after the preparatory processing (S17). Thereby, the photographer has a time to stand still after entering into the shooting range, and failures caused by taking the subject in motion, such as the blurred face, is prevented. The time lapse can be changed as necessary.

Another embodiment of the present invention is shown inFIGS. 6,7and8. InFIG. 6, the same components are designated by the same numerals as the embodiment depicted inFIG. 1, and the detailed explanation thereof is omitted. In this embodiment, the digital camera10has a motion area detecting section70.

The through image stored in the frame memory16is input to the motion area detecting section70through the data bus55. As shown inFIG. 7, the motion area detecting section70divides the through image displayed on the LCD51into blocks, and detects a block as a motion area MA where a moving subject is detected.

The motion area detecting section70uses for example, a motion vector detection method in which a motion vector V is detected, a frame difference detection method in which frames are correlated, or a background difference detection method in which an area with motion is identified with respect to a motionless background. For example, in the case the motion vector detection method is used, sequential through images are input to the motion area detecting section70from the frame memory16. The motion area detecting section70detects changes in the through images by, for example, changes in their brightness level, and the motion vector V is detected based on the detected results. The motion area detecting section70detects a block in which a motion vector V is equal to or above a predetermined value as the motion area MA. The CPU41judges whether the motion area MA is detected by the motion area detecting section70. When the motion area MA is detected, it is judged whether a face is detected in the motion area MA. In this embodiment, a motion judging section for judging whether a face (specific object) is moving is composed of the CPU41and the motion area detection section70.

As shown inFIG. 8, when the digital camera10is set in the automatic shooting mode (Y in S21), the number of faces to be taken is set using the number setting display60displayed on the LCD51(S22). When the number of people to be taken is set, the through image is stored in the frame memory16and displayed on the LCD51(S23). Next, the motion area detecting section70detects the motion area MA (S24). The face detecting section17detects and counts the faces in the through image, and outputs the number of detected faces as the number of detected people to the number matching section23(S25).

The number matching section23judges whether the set number stored in the frame memory16and the detected number input from the face detecting section17match each other (S26). When the number matching section23judges the set number and the detected number match (Y in S26), the CPU41judges whether the motion area MA is detected by the motion area detecting section70(S27). When the motion area MA is detected (Y in S27), the CPU41judges whether a face is detected in the motion area MA (S28).

When the face is detected in the motion area MA (Y in S28), the CPU41judges whether motion is stopped in the motion area MA in which the face is detected (S29). When it is judged that the motion is stopped (Y in S29), the CPU41performs preparatory processing (S30). After the completion of the preparatory processing, the CPU controls to perform the image-taking processing (S31).

On the other hand, when the motion area MA is not detected (N in S27), and when a face is not detected in the motion area MA (N in S28), the CPU41judges whether a predetermined time (for example, 5 seconds) has passed (S32). When it is judged that 5 seconds has passed (Y in S32), the CPU41performs the preparatory processing (S30). After the completion of the preparatory processing, the CPU41controls to perform the image-taking processing (S31).

As described above, it is judged whether the face as the object is moving, and the image is taken only when the face remains still. As a result, the failure caused by taking the subject in motion, such as the blurred face, is prevented.

When a face is not detected in the motion area MA, the preparatory processing and the subsequent image-taking processing is performed after the 5 seconds lapse. Accordingly, the image is taken without waiting for a stop of motion in the motion area MA in which the face is not detected, for example, a motion area MA in which swaying leaves are detected in outdoor shooting.

A still another embodiment is depicted inFIGS. 9 and 10. In this embodiment, a circuit shown inFIG. 6is used. When the digital camera10is switched to the automatic shooting mode, the face detecting section17detects and counts faces in the through image, and stores the number of detected faces as the number of people in the frame memory16.

As shown inFIG. 9A, the CPU41displays on the LCD51an increment or decrement setting display80for setting an increment or decrement Q1of the number of people to be taken, and enables the touch panel I/F54. At the same time, the face detecting section17detects the faces in the through image and counts the number of faces as the number of people, and constantly stores the number of the detected people in the frame memory16. On the increment or decrement setting display80, an initial number display area81for displaying the number Q2of people initially detected by the face detecting section17(for example, “15”), a message82indicating “please set the increment or decrement of the number of people to be taken”, a number button83with numerals of zero to nine, and “+” and “−” sign buttons90for setting the increment or decrement Q1, a setting OK button84to confirm the increment or decrement Q1set by touching the number button83, and a set number display area85are displayed. Before touching the number button83, the set number display area85displays “±00”. Although the face detecting section17constantly updates the number Q2of initially detected people, the number Q2of initially detected people is set to be the number of faces detected in the through image of the time the increment or decrement Q1is set.

When the photographer touches the number button83displayed on the LCD51, the touch panel I/F54outputs the touch signal to the CPU41. For example, to set “+1” as the increment Q1, first, touch the “+” sign button90, and then the numeral “1” of the number button83. As shown inFIG. 9B, the CPU41displays “+01” in the set number display area85. The photographer is able to set the increment or decrement Q1while checking the number displayed on the set number display area85.

When the photographer touches the setting OK button84, the CPU41stores “+1” as the increment Q1in the frame memory16and closes the increment or decrement setting display80, and displays the through image on the LCD51. The face detecting section17again detects and counts the number of faces in the latest through image, and outputs the number of detected faces as the number Q3of latest detected people to the number matching section23. The number matching section23judges whether the number Q3of the latest detected people equals to the sum of the increment or decrement Q1and the number Q2of the initially detected people. In this embodiment, the number matching section23functions as an increment or decrement matching section which judges whether the number Q3of the latest detected people equals to the sum of the increment or decrement Q1and the number Q2of the initially detected people.

As shown inFIG. 10, in the automatic shooting mode (Y in S41), the through image is stored in the frame memory16and displayed on the LCD51(S42). The face detecting section17detects the faces in the through image (S43). The CPU41displays the increment or decrement setting display80and displays the number Q2of initially detected people (for example, 15) (S44).

After the increment or decrement Q1of the number of people to be taken is confirmed (S45), the through image is taken again and stored in the frame memory16and displayed on the LCD51(S46). Next, the motion area detecting section70detects the motion area MA (S47). The face detecting section17detects and counts the faces in the through image, and outputs the number of faces as the number Q3of the latest detected people to the number matching section23(S48).

The number matching section23judges whether the number Q3of the latest detected people equals to the sum of the increment or decrement Q1and the number Q2of the initially detected people (S49). When it is judged that the number Q3of the latest detected people equals to the sum of the increment or decrement Q1and the number Q2of the initially detected people (Y in S49), the CPU41judges whether the motion area MA is detected in the motion area detecting section70(S50). In the case the motion area MA is detected (Y in S50), it is judged whether a face is detected in the motion area MA (S51).

When a face is detected in the motion area MA (Y in S51), the CPU41judges whether motion stops or not in the motion area MA containing a face (S52). When it is judged that the motion is stopped in the motion area MA containing the face (Y in S52), the CPU41performs preparatory processing (S53). After the completion of the preparatory processing, the CPU41controls to perform the image-taking processing (S54).

On the other hand, when the motion area MA is not detected (N in S50), or a face is not detected in the motion area MA (N in S51), the CPU41judges whether a predetermined time (for example, 5 seconds) has passed (S55). When it is judged that 5 seconds have passed (Y in S55), the CPU41performs the preparatory processing (S53). After the completion of the preparatory processing, the CPU41controls to perform the image-taking processing (S54).

In this embodiment, the increment or decrement Q1is set in the automatic shooting mode, and the image is taken only when the number Q3of the latest detected people equals to the sum of the increment or decrement Q1and the number Q2of the initially detected people in the image data of the time when the increment or the decrement Q1is set. Therefore, by properly setting the increment or decrement Q1, the image-taking is delayed until the photographer that enters into the shooting range late is detected, even when there are a large number of people to be taken and it is difficult to ascertain the exact number.

It is also possible to start taking the image without setting the increment or decrement Q1. In this case, the image may be taken when the detected number is increased from the number Q2of the initially detected people and motion is stopped in the motion area MA in which the face is detected.

In the above embodiments, human faces are detected as the specific objects. The specific objects are not limited to the human faces and can be changed as necessary. It is also possible to detect, for example, faces of animals such as dogs and cats.

In the above embodiments, the image data is stored in the RAM39. It is also possible to store the image data in a photographic film.

In the above embodiments, the digital camera10is provided with the normal shooting mode, an automatic shooting mode, and the playback mode. The present invention is applicable to digital cameras provided at least with the automatic shooting mode.

Various changes and modifications are possible in the present invention and may be understood to be within the present invention.