JP5873336B2 - Focus adjustment device - Google Patents

Focus adjustment device Download PDF

Info

Publication number
JP5873336B2
JP5873336B2 JP2012000324A JP2012000324A JP5873336B2 JP 5873336 B2 JP5873336 B2 JP 5873336B2 JP 2012000324 A JP2012000324 A JP 2012000324A JP 2012000324 A JP2012000324 A JP 2012000324A JP 5873336 B2 JP5873336 B2 JP 5873336B2
Authority
JP
Japan
Prior art keywords
main
distance
subject
change
detected
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2012000324A
Other languages
Japanese (ja)
Other versions
JP2013140256A (en
Inventor
本田 公文
公文 本田
Original Assignee
キヤノン株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by キヤノン株式会社 filed Critical キヤノン株式会社
Priority to JP2012000324A priority Critical patent/JP5873336B2/en
Publication of JP2013140256A publication Critical patent/JP2013140256A/en
Application granted granted Critical
Publication of JP5873336B2 publication Critical patent/JP5873336B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

According to the present invention, when an imaging target includes a predetermined subject such as a person, a feature part (such as a face part) such as a person is extracted, and automatic focusing is performed in an imaging apparatus that performs focus adjustment in consideration of the result. The present invention relates to an apparatus and a method.

In autofocus (AF) control, which is automatic focus adjustment for a video camera or the like, the following TV-AF system is the mainstream. That is, an AF evaluation value signal indicating the sharpness (contrast state) of a video signal generated by photoelectrically converting light from a subject using an image sensor, and a focus lens that maximizes the AF evaluation value signal Search for the location of. However, when a person is photographed in an imaging apparatus having a face detection function, it is difficult to obtain a sufficient AF evaluation value because a human face generally has low contrast. Therefore, when a change in the distance to the subject occurs, it is difficult to specify the in-focus direction with a change in the AF evaluation value, and the subject image is blurred because the lens position cannot follow the subject. was there.

In order to solve such problems, the detected face sizes are compared, and if the face size increases or decreases, it is determined that the subject has moved closer or infinitely and follows the subject. A method of driving a focus lens has been proposed (see Patent Document 1 and Patent Document 2).

JP 2009-31760 A JP 2008-276214 A

However, in the autofocus using the face detection described above, since the shooting parameters such as the depth of field and the state of the subject are not considered, the following can occur. In other words, depending on the detected size variation of the face and the setting of the parameters at the time of shooting, the direction of the subject's distance change may be misjudged, or even if there is no blur on the subject, movement determination is unnecessary. The accuracy of AF may be reduced.

The present invention has been made in view of the above points. The purpose of this is to perform AF on a subject person using the TV-AF method in moving image shooting or the like, and when a change in the distance of the subject occurs, a distance change determination is performed in consideration of the state of the subject. It is an object of the present invention to provide an automatic focusing apparatus and method capable of improving stability and accuracy.

Autofocus system of the present invention are in the imaging device for converting light into electrical signals from a subject which has passed through the imaging optical system and photoelectrically converted, the point detection region focus that is output from the imaging device including a focus lens Generating means for generating an AF evaluation value from the output signal, detecting means for detecting a face from the output signal output from the image sensor, and a subject for selecting a main face from the faces detected by the detecting means Based on the detection result by the detection means, the selection means, the determination means for determining whether or not the main face selected by the subject selection means has a distance change in the optical axis direction, and the focus lens by driving and controlling the focus lens And a control means for performing. Then, before Symbol control means, wherein when it is determined that there distance change of the optical axis direction of the main face by discrimination means, said main face of the optical axis of the distance the focus lens tracking driving operation to correspond to a change The following driving operation is limited when it is determined by the determination means that there is no change in the distance of the main face in the optical axis direction. The discriminating unit switches the discriminating method of the presence / absence of the distance change between a case where one face is detected by the detecting unit and a case where a plurality of faces are detected.

The automatic focus detection method of the present invention includes the steps of converting an electric signal light from a subject which has passed through the imaging optical system including a focus lens and photoelectrically converting the point detection region focus that is output in said conversion step A step of generating an AF evaluation value from a corresponding output signal, a detection step of detecting a face from the output signal output in the conversion step, and a subject for selecting a main face from the faces detected in the detection step A selection step; a determination step for determining presence or absence of a distance change in the optical axis direction of the main face based on a detection result in the detection step; and a control step for performing focus adjustment by driving the focus lens. Including. Then, before Symbol control step, wherein when it is determined that there distance change of the optical axis direction of the main face determination step, the main face of the optical axis of the distance the focus lens tracking driving operation to correspond to a change When the determination step determines that there is no change in the distance of the main face in the optical axis direction, the following drive operation is limited. In the determination step, the determination method of the presence / absence of the distance change is switched between the case where one face is detected in the detection step and the case where a plurality of faces are detected.

As described above, according to the present invention, the state of the subject is analyzed, and the presence / absence of a change in the distance of the main subject is determined according to the result, thereby reducing erroneous determination. Furthermore, since the threshold for determining the distance change of the main subject is changed according to the state of the subject, unnecessary determination can be avoided. As a result, the stability and accuracy of autofocus can be improved.

1 is a block diagram illustrating a configuration of a video camera that is an embodiment of the present invention. The flowchart which shows the process of the camera / AF microcomputer of one Example of this invention. The flowchart which shows the process of the micro drive operation | movement of one Example of this invention. The figure which shows the micro drive operation | movement of one Example of this invention. The flowchart which shows the process of the mountain climbing operation | movement of one Example of this invention. The figure which shows the mountain climbing operation | movement of one Example of this invention. The flowchart which shows the process of the movement determination of one Example of this invention. The flowchart which shows the process of the stability determination of one Example of this invention. The flowchart which shows the process of the movement determination threshold value setting of one Example of this invention. The figure which shows the threshold value according to the zoom lens position of one Example of this invention. The figure which shows the correction coefficient K according to the reference | standard face size of one Example of this invention. FIG. 6 is a diagram illustrating a correction coefficient K ′ ″ according to a shooting mode according to an embodiment of the present invention. The figure which shows the calculation method of the reliability showing the side face of one Example of this invention. The figure of a focus operation in the state where a plurality of faces of one example of the present invention are detected. The flowchart which shows the process of the reset of the movement determination threshold value of one Example of this invention. The figure which shows the correction coefficient k according to the number of face detection of one Example of this invention. The flowchart of the 1st form of the threshold reset determination process of one Example of this invention. The flowchart of the 2nd form of the threshold reset determination process of one Example of this invention. The flowchart of the 3rd form of the threshold reset determination process of one Example of this invention. The flowchart of the 4th form of the threshold reset determination process of one Example of this invention.

The feature of the present invention is that, based on the determination that there is no distance change, the method for determining whether or not there is a change in the distance of the main subject is switched between the detection of one subject and the detection of a plurality of subjects during automatic focus adjustment on the main subject. The purpose is to perform or limit the follow-up driving operation to the main subject. Based on this concept, each of the focus adjustment apparatuses and methods of the present invention has a basic configuration as described in the section for solving the problems. Typically, the presence or absence of a change in the distance of the main subject in the optical axis direction is determined based on a change in the size of the image of the main subject, such as a human face or body part.

Examples of the present invention will be described below. FIG. 1 shows a configuration of a video camera (image pickup apparatus) including an automatic focus adjustment apparatus according to an embodiment of the present invention. In the following embodiments, a video camera will be described, but the present invention can also be applied to other imaging devices such as a digital still camera.

<First embodiment>
In FIG. 1, 101 is a first fixed lens, 102 is a variable magnification lens that moves in the optical axis direction and performs variable magnification, and 103 is a diaphragm. Reference numeral 104 denotes a second fixed lens, and reference numeral 105 denotes a focus compensator lens (also referred to as a focus lens in this specification) that has both a function of correcting the movement of the focal plane due to zooming and a focusing function. The first fixed lens 101, the variable power lens 102, the stop 103, the second fixed lens 104, and the focus lens 105 constitute an imaging optical system for imaging light from the subject. Reference numeral 106 denotes an image sensor as a photoelectric conversion element constituted by a CCD sensor or a CMOS sensor. The image sensor 106 photoelectrically converts the imaged light into an electrical signal. Reference numeral 107 denotes a CDS / AGC circuit that samples the output of the image sensor 106 and adjusts the gain. A camera signal processing circuit 108 performs various image processing on the output signal from the CDS / AGC circuit 107 to generate a video signal. Reference numeral 109 denotes a monitor constituted by an LCD or the like, which displays a video signal from the camera signal processing circuit 108. A recording unit 115 records the video signal from the camera signal processing circuit 108 on a recording medium such as a magnetic tape, an optical disk, or a semiconductor memory.

Reference numeral 110 denotes a zoom drive source for moving the variable magnification lens 102. Reference numeral 111 denotes a focusing drive source for moving the focus lens 105. The zoom drive source 110 and the focusing drive source 111 are configured by actuators such as a stepping motor, a DC motor, a vibration type motor, and a voice coil motor, respectively. Reference numeral 112 denotes an AF gate that passes only signals in a region (focus detection region) used for focus detection among output signals of all pixels from the CDS / AGC circuit 107. The AF signal processing circuit 113 extracts a high frequency component from the signal that has passed through the AF gate 112 and generates an AF evaluation value. That is, the AF signal processing circuit 113 constitutes a generation unit that generates an AF evaluation value from a focus detection area set for an electric video signal. The AF evaluation value is output to the camera / AF microcomputer 114 which is a control means. The AF evaluation value represents the sharpness (contrast state) of an image generated based on the output signal from the image sensor 106, and the sharpness changes depending on the focus state (degree of focusing) of the imaging optical system. As a result, a signal representing the focus state of the imaging optical system is obtained. The camera / AF microcomputer 114 as a control unit controls the operation of the entire video camera, and controls the focusing drive source 111 to move the focus lens 105 and adjust the focus based on the AF evaluation value. Also do.

The face detection unit 116 according to the present embodiment performs a known face detection process on the image signal to detect a human face area in the shooting screen. That is, the face detection unit 116 constitutes detection means for detecting a predetermined subject (here, a face) from the electrical signal. The detection result is transmitted to the camera / AF microcomputer 114. Based on the detection result, the camera / AF microcomputer 114 transmits information to the AF gate 112 so as to set the focus detection area at a position including the face area in the shooting screen. As face detection processing, a skin color region is extracted from the gradation color of each pixel represented by image data, and a face is detected based on a matching degree with a face contour plate prepared in advance, or a known pattern recognition technique is used. There is a method of performing face detection by extracting facial feature points such as eyes, nose and mouth.

Further, the face detection unit 116 calculates the reliability of the face and the reliability of the profile. The face reliability is calculated based on, for example, the matching degree with the face contour plate, and is expressed in five stages in descending order of matching degree. In addition, as shown in FIG. 13, the calculation of the reliability indicating the likelihood of a side face is performed by dividing the area so that the face detection frame is divided into left and right with reference to the center position of both eyes of the detected face (dotted line in the figure). Extract. Then, the skin color region included in the left and right regions is extracted, and the area is calculated by counting the number of pixels in the skin color region. The reliability representing the likelihood of profile is calculated using the ratio of the skin color area included in the left and right screens. If the left and right skin color areas have the same ratio, the probability of profile is assumed to be low, and the reliability indicating the likelihood of profile is set low, and if the ratio is significantly different, the probability of profile is assumed to be high Set high. In this embodiment, the reliability is set to 5 levels according to this ratio.

Reference numeral 117 denotes an aperture driving source, which includes an actuator for driving the aperture 103 and its driver. From the signal read by the CDS / AGC circuit 107, in order to obtain the luminance value of the photometric frame in the screen, the photometric value is obtained by the luminance information detection / calculation circuit 118, and the photometric photometric value is normalized by calculation. Is done. Then, the camera / AF microcomputer 114 calculates the difference between the photometric value and the target value set so that proper exposure can be obtained. Thereafter, the correction driving amount of the diaphragm is calculated from the calculated difference, and the driving of the diaphragm driving source 117 is controlled by the camera / AF microcomputer 114.

Next, AF control performed by the camera / AF microcomputer 114 will be described with reference to FIG. This AF control is executed according to a computer program stored in the camera / AF microcomputer 114. Step 201 indicates the start of processing. In step 202, a minute driving operation is performed, and it is determined whether the in-focus position is in focus or not. Detailed operation will be described later. In Step 203, if it is determined that the focus is in focus in Step 202, the process goes to Step 209 to perform the focusing process, and if it is not determined to be in focus in Step 202, the process goes to Step 204. In Step 204, if the direction can be determined in Step 202, go to Step 205 to perform the hill-climbing driving operation, and if the direction cannot be determined in Step 202, return to Step 202 and continue the minute driving operation. In Step 205, hill-climbing driving is performed to drive the lens at high speed in the direction in which the AF evaluation value increases. Detailed operation will be described later.

In Step 206, if it is determined in Step 205 that the peak of the AF evaluation value has been exceeded, the process goes to Step 207. If it is not determined in Step 206 that the peak of the AF evaluation value has been exceeded, the process returns to Step 205 and hill-climbing driving is continued. In Step 207, the lens is returned to the lens position where the AF evaluation value during hill-climbing driving reaches a peak. In Step 208, if the peak lens position is returned in Step 207, the process returns to Step 202 and the minute driving operation is performed again. If not returned to the peak lens position in Step 207, the process returns to Step 207 and the operation of returning to the peak lens position is continued. .

Next, the focusing operation from Step 209 will be described. In Step 209, the AF evaluation value is held. In Step 210, the latest AF evaluation value is acquired. In Step 211, the AF evaluation value held in Step 209 is compared with the AF evaluation value newly acquired in Step 210. If there is a difference of a predetermined level or more, it is determined that the operation is restarted, and the process proceeds to Step 202 to restart the minute driving operation. If it is not determined to restart in Step 211, go to Step 212. In Step 212, the lens is stopped, and the process returns to Step 210 to continue the restart determination.

Next, the minute driving operation will be described with reference to FIG. Step 301 indicates the start of processing. In Step 302, the latest face detection position / size is acquired, an AF frame that is a focus detection area is set based on the information, and an AF evaluation value is acquired. In Step 303, a process for determining movement of the subject from the acquired face size is performed. This process will be described with reference to FIG. In Step 304, it is determined whether or not the subject has moved nearer or infinitely. If the subject has moved, the process proceeds to Step 305. Otherwise, the process proceeds to Step 306. In this embodiment, the size of the subject image whose change amount is monitored is the size of the image of a person's face (which may be another part of the body) obtained by the face detection unit 116 serving as detection means. is there. Therefore, as will be described later, when the amount of change in face size is within a predetermined amount, it is determined that there is no subject distance change, and when the amount of change is greater than the predetermined amount, it is determined that there is a subject distance change. Is done. When the camera / AF microcomputer 114 determines that there is no change in the distance of the subject, the camera / AF microcomputer 114 performs focus adjustment by restricting the tracking control by the tracking control unit, and when it is determined that there is a change in the distance of the subject, The focus control is performed by allowing the tracking control by the tracking control means. Such switching is performed in Step 304 above.

In Step 305, it is determined whether the result of the movement determination is approaching or moving away. When approaching, it progresses to Step 314, the mountain climbing to a near direction is determined, it progresses to Step 313, and a process is complete | finished. Otherwise, the process proceeds to Step 315 to decide mountain climbing in the infinite direction, and the process proceeds to Step 313 to end the process. The driving for switching the hill-climbing direction according to the moving direction of the subject is the subject tracking drive control, and the AF response and accuracy are improved by performing the tracking drive. In order to execute this function, the camera / AF microcomputer 114 of the control unit includes a determination unit that determines whether or not there is a change in the distance of the subject based on a detection result by the face detection unit 116 that is a detection unit, and a focus according to the determination result. Tracking control means for causing the lens to follow a change in the distance of the subject is included. In this way, the determining means determines that the subject is approaching when the amount of change in the size of the subject image is larger than a predetermined amount, and the control means drives the focus lens to the closest side to move the subject. Follow. On the other hand, the discriminating means discriminates that the subject is far away when the amount of change in the size of the subject image is larger than a predetermined amount, and the control means drives the focus lens to the infinite side to follow the subject. . In this embodiment, the control means performs the hill-climbing drive operation of the focus lens in response to the change in the distance of the subject image in the optical axis direction when the change amount of the size of the subject image detected by the detection means is larger than a predetermined amount. Do. When the amount of change in the size of the subject image detected by the detecting means is smaller than a predetermined amount, the focus lens is finely driven.

Subsequently, in Step 306, if the AF evaluation value captured in Step 302 is larger than the previous AF evaluation value, the process proceeds to Step 307. If the AF evaluation value captured in Step 302 is smaller than the previous AF evaluation value, the process proceeds to Step 308. In Step 307, the focus lens is driven by a predetermined amount in the previous forward direction. On the other hand, in Step 308, the focus lens is driven by a predetermined amount in the reverse direction of the previous time. FIG. 4 shows the time course of the lens operation. Here, the AF evaluation value A for the electric charge accumulated in the CCD (imaging device) during A is taken in by TA, and the AF evaluation value B for the electric charge accumulated in the CCD during B is taken in by TB. In TB, the AF evaluation values A and B are compared, and if A <B, they move in the forward direction, while if A> B, they are in the reverse direction. In Step 309, if the direction determined to be the in-focus direction is continuously the same number of times, the process proceeds to Step 310. If the direction is not continuously advanced the same number of times, the process proceeds to Step 311. In Step 311, if the focus lens repeats reciprocation within a predetermined range a predetermined number of times, the process proceeds to Step 312, and if the focus lens is not within the predetermined range for a predetermined time, the process proceeds to Step 313 and the process is terminated. As a result, the operation returns to the minute driving operation in Step 202 of FIG. In Step 310, assuming that the direction can be determined, the process proceeds to Step 313, where the processing is terminated and the process proceeds to hill climbing driving in Step 205 of FIG. In Step 312, the process is terminated because the in-focus determination has been made, and the process proceeds to a restart determination routine after Step 210 in FIG. 2.

Next, the hill-climbing driving operation will be described with reference to FIG. Step 501 indicates the start of processing. In Step 502, the latest face detection position / size is acquired, an AF frame (focus detection area) is set based on the information, and an AF evaluation value is acquired. In Step 503, if the AF evaluation value captured in Step 502 is larger than the previous AF evaluation value, the process proceeds to Step 504. If the AF evaluation value captured in Step 502 is smaller than the previous AF evaluation value, the process proceeds to Step 505. In Step 504, the focus lens is driven at a predetermined speed in the previous forward direction, and the process proceeds to Step 508 to end the process. On the other hand, in Step 505, if the AF evaluation value has decreased beyond the peak, the process proceeds to Step 506 and it is determined that the peak has been exceeded. The process proceeds to Step 508, where the processing is terminated, and the process proceeds to Step 202 of Step 202 through Step 206 in FIG. If the AF evaluation value does not decrease beyond the peak in Step 505, the process proceeds to Step 507, the focus lens is driven at a predetermined speed in the direction opposite to the previous time, and the process proceeds to Step 508.

FIG. 6 illustrates the lens operation. Here, in the case of A, since the AF evaluation value has decreased beyond the peak, the hill-climbing driving operation is terminated assuming that the in-focus point exists, and the operation shifts to the minute driving operation. On the other hand, in the case of B, since the AF evaluation value decreases without a peak, it is reversed as having the wrong direction, and the hill-climbing driving operation is continued. The movement amount per fixed time, that is, the driving speed is larger than the driving speed of the minute driving. When the size of face detection increases continuously, the AF responsiveness can be improved by setting the driving speed at the time of hill-climbing driving large. As described above, the camera / AF microcomputer 114 performs control so as to increase the AF evaluation value by moving the focus lens while repeating the restart determination → micro drive → mountain climbing drive → micro drive → restart determination. Yes.

Next, a process for determining whether the subject is near or infinite will be described with reference to FIGS. First, the movement determination process in Step 303 of FIG. 3 will be described with reference to FIG. Step 701 indicates the start of the movement determination process. In Step 702, processing for calculating the average of detected face sizes is performed. The detected face size is stored in a memory in the camera / AF microcomputer, and an average of 10 stored images is calculated using a moving average method. The averaged face size is stored in FaceAveSize. The FaceAveSize has 20 arrays, and a history is stored in FaceAveSize [0] to [19] each time an average value is calculated. Here, the latest average value is stored in FaceAveSize [0].

In Step 703, it is determined whether or not there is a movement determination flag. When the movement determination flag determined in the process described later is set, the process proceeds to Step 704. Otherwise, the process proceeds to Step 707. In Step 707, it is determined whether or not the average face size FaceAveSize calculated in Step 702 is a stable value. Details of this processing will be described later with reference to FIG. In Step 708, the stability flag determined in Step 707 is determined. If the stability flag is SET, the process proceeds to Step 709. If not, the process proceeds to Step 720, and the process ends.

Here, when the stability flag is CLEAR, it means that the movement cannot be determined because the state of the subject is not stable. In this case, the process proceeds to Step 306 and subsequent steps through Step 304 in FIG. In Step 709, it is determined whether the face reference size is set. The face reference size FaceBaseSize is the size of the face that serves as a reference when performing movement determination. When the face reference size FaceBaseSize is 0, no value is set, so the process proceeds to Step 719, and in Step 719, FaceAveSize [0] is substituted into FaceBaseSize. Also in this case, the process proceeds to Step 306 and subsequent steps through Step 304 in FIG.

If the face reference size FaceBaseSize is not 0, the process proceeds to Step 710. In Step 710, a movement determination threshold value setting process is performed. This process is a process for setting a face size change threshold value used for movement determination according to the shooting parameters and the state of the subject. Details of this processing will be described later with reference to FIG. Subsequently, in Step 711, the face reference size FaseBaceSize is compared with the current face size FaceAveSize [0]. If the current face size is small, there is a possibility of moving away, so the process proceeds to Step 712. Otherwise, there is a possibility of approaching, so the process proceeds to Step 713. In Step 712, the distance determination is performed. If the difference between the face reference size FaseBaceSize and the current face size FaceAveSize [0] is greater than or equal to THfar, it is determined that the subject has moved away, and the process proceeds to Step 717. If THfar is not exceeded in Step 712, the process proceeds to Step 714. In Step 717, after setting the distance flag of the movement determination flag which means that the subject has moved away, the process proceeds to Step 720 and ends. In this case, the process proceeds to Step 305 and subsequent steps through Step 304 in FIG. In Step 713, approach determination is performed. If the difference between the face reference size FaseBaceSize and the current face size FaceAveSize [0] is equal to or greater than THnear, it is determined that the subject has approached, and the process proceeds to Step 718. If THnear is not exceeded in Step 713, the process proceeds to Step 714. In Step 718, after setting the approach flag of the movement determination flag that means that the subject has approached, the process proceeds to Step 720 and the process is terminated. Also in this case, the process proceeds to Step 305 and subsequent steps through Step 304 in FIG.

In Step 714, when the face reference size is set and the state is stable, the timer FaceJudgeTimer indicating how many times the movement determination is repeated is incremented, and the process proceeds to Step 715. In Step 715, it is determined whether FaceJudgeTimer is equal to or less than TimerTH. This process is intended to initialize the determination process when there is no movement of the subject even though the movement determination has continued for about 2 seconds. Therefore, TimerTH is set to 120, which is a value corresponding to 2 seconds, and it is determined whether this value has been exceeded. In this embodiment, since a system that performs processing 60 times per second is assumed, the value corresponding to 2 seconds is 120. If FaceJudgeTimer exceeds TimerTH, the process proceeds to Step 716 to perform initialization processing. If not, the process proceeds to Step 720 and the process ends. In this case, the process returns to Step 702 to continue the movement determination. In Step 716, FaceJudgeTimer is initialized to 0, and the process proceeds to Step 705. In Step 705, FaseBaceSize is initialized to 0, and the process proceeds to Step 706. In Step 706, the movement determination flag is cleared and initialization is performed. After the initialization process is completed, the process proceeds to Step 720 and the process ends. In this case, the process proceeds to Step 306 and subsequent steps through Step 304 in FIG.

If the movement determination flag is set in Step 703, the process proceeds to Step 704 in order to determine whether or not the movement of the subject has ended. In Step 704, FaseAveSize is compared to determine the end of movement. In order to obtain the difference between the current FaseAveSize [0] and the previous history FaseAveSize [1], FaseAveSizeDiff = FaseAveSize [0] -FaseAveSize [1] is calculated, and the process proceeds to Step 704 '. In Step 704 ′, when the subject is approaching, it is determined that the movement is finished when the face size is small (FaseAveSizeDiff is a negative value). When the subject is far away, it is determined that the movement is finished when the face size increases (FaseAveSizeDiff is a positive value). When the movement of the subject is completed, the process moves to Step 705 to perform initialization processing. When that is not right, it changes to Step 720 and complete | finishes a process. In this case, the process returns to Step 702 to continue the movement determination.

Subsequently, the subject stability determination process in Step 707 of FIG. 7 will be described with reference to FIG. Step 801 in FIG. 8 indicates the start of processing. Next, in Step 802, the camera / AF microcomputer 114 calculates a secondary differential value of the average face size. The specific calculation method of the secondary differential value is shown below. First, the camera / AF microcomputer 114 calculates the first differential value by calculating the difference between the average face size calculated in Step 702 of FIG. 7 and the average face size calculated a predetermined time ago, and the camera / AF microcomputer It is recorded in the memory in 114. Next, the camera / AF microcomputer 114 calculates a change amount between the primary differential value recorded in the memory and the primary differential value calculated in a predetermined time and recorded in the memory, thereby obtaining a secondary. Calculate the differential value. The calculated secondary differential value is a value indicating how much the primary differential value of the average face size calculated this time has changed with respect to the primary differential value of the average face size before a predetermined time. In step 803, the camera / AF microcomputer 114 determines whether the secondary differential value calculated in step 802 is equal to or less than a threshold value. When the calculated secondary differential value is less than or equal to the threshold value, the subject is stable because the amount of change in the primary differential value of the average face size calculated this time is smaller than the primary differential value of the average face size before a predetermined time. It judges that it is carrying out, and progresses to Step 804. On the other hand, if the calculated secondary differential value is larger than the threshold value, the change amount of the primary differential value of the average face size calculated this time is larger than the primary differential value of the average face size before a predetermined time, so that the subject is It judges that it is not stable and proceeds to Step 807.

In this embodiment, the threshold is empirically set to a value of 10% of the average face size. The predetermined time before is defined as 15 frames before as a value that can be determined by the threshold whether or not the secondary differential value is stable. However, in the present embodiment, the set threshold value and the predetermined time are values that can be freely changed by the system. Next, in Step 804, the camera / AF microcomputer 114 counts up StableTimer and proceeds to Step 805. However, StableTimer is a variable that counts a period in which the calculated average face size is continuously stable. Therefore, it is possible to determine that the average face size after the stable timer exceeds a predetermined period (hereinafter referred to as stable TH) is a stable average face size. Here, StableTH is 15 frames in this embodiment. Further, StableTH is a variable that counts a period during which the average face size is continuously stable, and therefore, a period that is equal to or shorter than a predetermined time (15 frames in the present embodiment) used when calculating the secondary differential value. Need to be. In Step 807, since the secondary differential value of the average face size is larger than the threshold value, the camera / AF microcomputer 114 clears StableTimer (0 in this embodiment).

Next, in Step 805, the camera / AF microcomputer 114 determines whether or not StableTimer is less than StableTH. If it is less than StableTH, the process proceeds to Step 806. If it is greater than StableTH, the process proceeds to Step 808. In Step 806, the camera / AF microcomputer 114 determines that the average face size calculated in Step 702 is not continuously stable until the StableTimer exceeds StableTH, turns off the stability flag, and finishes the process of FIG. To do. On the other hand, in Step 808, the camera / AF microcomputer 114 determines that the average face size calculated in Step 702 is a value that is stable continuously for a period of time when the StableTimer is equal to or greater than StableTH, and sets the stability flag to ON. Terminate the process.

In the processing of FIG. 8 described above, it is determined whether or not the subject is stable based on the average face size. However, whether or not the subject is stable by calculating a secondary differential value with respect to the position of the face or the human body. It may be a method of judging. Further, in the case of a system capable of detecting eyes and mouth, a method of calculating whether or not the second differential value is calculated with respect to the distance between both eyes (or eyes and mouth) and determining whether or not the system is stable may be used. Furthermore, a method may be used in which the ratio of the distance between the eyes and the mouth with respect to the distance between both eyes is calculated, and a secondary differential value is calculated with respect to the calculated ratio to determine whether or not it is stable. In short, if it is information that can determine the stability of the movement of a predetermined subject, the size of the predetermined part, the distance between the plural parts, the relative information about the ratio between the plural sizes and distances, etc. Any shape information may be used.

Next, the movement determination threshold value setting process in Step 710 of FIG. 7 will be described with reference to FIG. Step 901 in FIG. 9 indicates the start of processing. Step 902 is processing for acquiring the lens position of the variable magnification lens (zoom lens) 102. If the driving source of the variable power lens is a step motor, it is the number of steps, and is used to determine which position the lens is on the tele side or the wide side. Subsequently, in Step 903, the reference movement determination threshold Th corresponding to the current zoom position is acquired from the relationship graph between the zoom lens position and the reference movement determination threshold Th shown in FIG. In FIG. 10, the vertical axis represents the change rate (%) of the face size, and the horizontal axis represents the zoom lens position. The relationship between the zoom lens position and the reference movement determination threshold Th is a graph calculated from the relationship between the front end of the depth of field and the amount of change in face size at each zoom lens position with the aperture value Fbase being constant. is there.

If the subject moves in a state where the predetermined subject is in focus, blur will start to be recognized on the screen from the point where the depth of field is exceeded, so the reference movement determination threshold value is smaller than the depth of field. Set. Accordingly, it is possible to determine whether or not the subject has moved before the subject starts to blur and to drive the focus lens, thereby improving the follow-up performance of the subject. When the actual reference movement determination threshold Th is calculated, a table of the reference movement determination threshold Th corresponding to each zoom lens position is held in the camera / AF microcomputer 114, and the threshold Th corresponding to the zoom lens position is determined.

The depth of field is calculated using Equation 1 below. If the subject distance is s, and the front and rear ends of the depth of field are Dn and Df, respectively, the result is as follows.
Dn = s (Hf) / (H + s-2f) Equation 1a
Df = s (Hf) / (Hs) ... Equation 1b
The hyperfocal length H is expressed by Equation 2 where f is the focal length of the lens, N is the aperture value of the lens, and c is the diameter of the allowable circle of confusion.
H = f * f / N * c Equation 2

In step 904, the current aperture value Fno is acquired. The aperture value is obtained from the drive amount of the aperture 103. In Step 905, the reference movement determination threshold is corrected according to the aperture. Since the depth of field changes according to the aperture value, the acquired current aperture value Fno is compared with the aperture value Fbase when the reference movement determination threshold value in FIG. 10 is calculated. Based on Equation 3, a corrected movement determination threshold Th2 is calculated.
Th2 = (current aperture value Fno / reference aperture value Fbase) * reference movement determination threshold Th.
Thus, the threshold value or the predetermined amount is determined by the depth of field, and is set to an amount smaller than the amount of change in the size of the subject image when the subject moves the depth of field. It is a feature.

Subsequently, in Step 906, the reference face size FaceBaseSize is acquired. In Step 907, the reference movement determination threshold value is corrected according to the reference face size FaceBaseSize. FIG. 11 is a graph showing the relationship between the reference face size and the correction coefficient K. The vertical axis represents the change rate (%) of the face size, and the horizontal axis represents the reference face size. As the reference face size FaceBaseSize increases, the detected face size varies, and correction is required. From the acquired graph of the reference face size and the correction coefficient K, a corrected movement determination threshold Th3 is calculated based on Equation 4.
Th3 = correction coefficient K * movement determination threshold Th2 Expression 4
Thus, the subject situation is the size of the subject image detected by the detection means, and the threshold value or the predetermined amount is changed according to the size of the subject image, and a reference value for the size of the subject image. It is changed according to the difference.

Subsequently, in Step 908, the face reliability is obtained from the signal of the face detection unit 116. As described above, the reliability of the face is evaluated in five stages of 1 to 5, evaluation 5 has the highest reliability, and evaluation 1 has the lowest reliability. In Step 909, the movement determination threshold value is corrected using the face reliability. When the reliability is low, the detected face size varies greatly, or even if it is small, there is a possibility of erroneous detection. Therefore, it is necessary to perform threshold correction and set the threshold high. In this embodiment, when the face reliability is 3 or less, the correction coefficient K ′ is set to 1.5, and the corrected movement determination threshold Th4 is calculated based on Expression 5 using the acquired face reliability. To do.
Th4 = correction coefficient K ′ * movement determination threshold Th3 Equation 5
Thus, the subject situation is a reliability indicating the likelihood of the face detected by the detection means, and the threshold value or the predetermined amount is changed according to the reliability indicating the likelihood of the face, and the reliability If is low, it is changed to a larger amount.

Next, in Step 910, the reliability of profile likelihood is acquired from the signal of the face detection unit 116. As described above with reference to FIG. 13, the reliability of profile likelihood is evaluated in five stages of 1 to 5. Evaluation 5 has the highest possibility of profile and evaluation 1 has the lowest possibility of profile. In Step 911, the movement determination threshold value is corrected using the reliability of the profile likelihood. When the reliability of the side face is high, the detected face size varies greatly, and even if it is small, there is a possibility of erroneous detection. Therefore, it is necessary to correct the threshold value and set the threshold value high. In the present embodiment, when the reliability of the side face likelihood is 3 or more, the correction coefficient K ″ is set to 1.5, and the movement after correction is performed based on Expression 6 using the acquired reliability of the side face likelihood. A determination threshold Th5 is calculated.
Th5 = correction coefficient K ″ * movement determination threshold value Th4 Equation 6
In this way, the subject situation is a reliability indicating whether the face detected by the detection means is facing sideways, and the threshold value or the predetermined amount corresponds to a reliability indicating whether the face is facing sideways. If the reliability is high, the amount is changed to a larger amount.

Subsequently, in Step 912, the photographing mode is acquired from the information in the camera / AF microcomputer 114. A general imaging apparatus has a plurality of shooting modes as shown in FIG. 12 in order to set shooting parameters optimal for a shooting scene. In Step 913, the movement determination threshold value is corrected according to the shooting mode. FIG. 12 is a table showing the relationship between the shooting mode and the correction coefficient K ′ ″. In a shooting mode in which the movement of the subject is assumed to be large, the coefficient K ′ ″ is set to a value of 1 or less so that the threshold value is set low, thereby increasing the autofocus response. Further, in the shooting mode in which the movement of the subject is assumed to be small, the value of the coefficient K ′ ″ is set high so as to increase the threshold for movement determination, and importance is attached to the stability of autofocus. Based on the obtained photographing mode and the correction coefficient K ′ ″ determined from FIG.
Th6 = correction coefficient K ′ ″ * movement judgment threshold Th5 Equation 7
Thus, the shooting parameter is a shooting mode, and the threshold value or the predetermined amount is changed according to the shooting mode, and a large amount is set when the shooting mode is set to a mode for shooting a subject with much movement. When the shooting mode is set to a mode for shooting a subject with little movement, the amount is changed to a small amount.

Subsequently, in Step 914, the degree of focus is acquired. The method for calculating the degree of focus is a value obtained by dividing the peak hold value of the AF evaluation value in the evaluation frame by the difference between the maximum value and the minimum value of the luminance level of each line. This degree of focus is represented by 0 to 1, and in the case of a focused subject, the difference between the peak hold of the AF evaluation value and the luminance level tends to be the same value, so the degree of focus approaches 1. An object with a low degree of focus is likely to be blurred and the reliability of the face size may be low, so the threshold value for movement determination is set to be high. For example, using the obtained degree of focus, when the degree of focus is 0.5 or less, the correction coefficient K ″ ″ is set to 1.5, and the movement determination threshold value after correction based on Expression 8 Th7 is calculated.
Th7 = correction coefficient K ″ ″ * movement determination threshold Th6.
In this way, the imaging parameter is the degree of focus estimated from the state of the AF evaluation value level and the driving state of the focus lens, and the threshold value or the predetermined amount is changed according to the degree of focus. If the degree is low, it is changed to a larger amount. These correction factors K ', K'',K''', K '''' are determined after sufficient measurement according to the camera, and are not limited to these values. Absent.

Subsequently, in Step 916, a limit is set to the movement determination threshold Th7 calculated in Step 915. In the case of the correction method described above, the movement determination threshold value is several times the reference movement determination threshold value due to accumulation of corrections, and may not be appropriate as the movement determination threshold value. Therefore, the upper limit of the threshold is set. If the movement determination threshold Th7 is greater than or equal to twice the reference movement determination threshold Th, the process proceeds to Step 918; otherwise, the process proceeds to Step 917. In this embodiment, the limit is set to double in order to maintain the accuracy of the movement determination, but this value can be arbitrarily set to a value that can perform sufficient measurement and reduce erroneous determination. In Step 917, Th7 is substituted for the movement determination threshold value THface, and the process proceeds to Step 919. In Step 918, since the movement determination threshold is too large, a limit is set for the threshold. A value obtained by doubling the reference movement determination threshold Th is substituted for the final movement determination threshold THface, and the process proceeds to Step 919.

In Step 919, the threshold for distance determination and approach determination is changed based on the movement determination threshold THface. For face detection, there is a method of determining the face size based on the interval between eyes. When a person turns sideways, the distance between the eyes is reduced, so that the detected face size is reduced even though the distance to the subject has not changed. For this reason, the distance of the subject may be detected. Therefore, by setting the distance detection threshold THfar larger than the approach detection threshold THnear, erroneous determination due to a size change during profile shooting is reduced. In the present embodiment, the distance detection threshold is increased by a factor of 1.5, but this value is set to a value that performs sufficient measurement and reduces erroneous determination. In this way, the subject situation is the result of the determination, and the threshold value or the predetermined amount is set to a different value when the determination result is far away and closer, and when the distance is far away, it approaches. A larger amount is set than when.

The processing flow for setting the movement determination threshold has been described above, and is the processing for calculating the approach detection threshold THnear and the away detection threshold THfar. The coefficients and formulas used in this processing are examples, and the present invention is not limited to these. The threshold value change need not necessarily include all the above-described changes, and may include at least one change.

As described above, in the above-described embodiment, focus detection is performed on the subject person using the AF evaluation value using face detection. At the same time, the discrimination means monitors the change in the size of the face, uses the face size in a state where the subject is stable as a reference, and changes the threshold value for movement judgment according to the shooting parameters and the subject situation. Therefore, it is possible to determine the movement of the subject with high accuracy and stability. Then, by using the information and driving the focus following the infinite or close-up movement of the subject, the focusing accuracy can be improved.

<Second embodiment>
In the first embodiment, a change in the size of the detected face is monitored, the face size in a state where the subject is stable is used as a reference, and the threshold value for movement determination is changed according to the shooting parameters and the like. This makes it possible to determine the movement of the subject with high accuracy and stability. Then, by using this determination information to drive the focus to follow the movement of the subject, the stability and accuracy of autofocus are improved. In the second embodiment of the present invention, in addition to the configuration in the first embodiment, a processing function for selecting one face as a main face from a plurality of detected subjects (such as a face) is also provided. With this process, even in situations where the main face frequently changes, the stability and accuracy of autofocus can be improved.

Here, a problem when a plurality of faces (subjects) are detected will be described. FIG. 14 shows a focusing operation in a state where a plurality of faces are detected. For example, when a plurality of faces are detected, one face is selected as the main face, and a focusing operation is performed on the main face. As a condition for selecting the main face, the priority of selection is determined from the position and size of the face. The closer to the center, the higher the priority. FIG. 6A shows a state where the subject A is selected as the main face and focused on the subject A by framing the subject A so that the subject A is at the center of the angle of view. In this state (b), the subject B crosses in front of the subject A while approaching the camera. At this time, the main face is switched to the subject B without the photographer's intention. Then, following the movement of the main face, the focus is driven to follow in the closest direction, and the focus on the subject B is maintained. Next, in FIG. 6C, the subject B starts to be out of the frame from the angle of view, and the main face is switched to the subject A again. Also, the focus position returns to the subject A in FIG.

As described above, when multiple faces are detected, when multiple faces (subjects) intersect and the main face moves unintentionally, the focus position changes according to the movement of the moved main face. There was a situation in which the focus deviated and the stability of the focus was impaired. A second embodiment for dealing with such problems will be described below. In the second embodiment, the camera / AF microcomputer 114 has a processing function for selecting one face from a plurality of detected faces in addition to the processing functions described in the first embodiment. Further, the camera / AF microcomputer 114 has a “movement determination threshold reset processing” function in addition to the “movement determination threshold setting processing” function described in the first embodiment. Here, the description of the processing function portion described in the first embodiment is omitted. As for the process of selecting one face from a plurality of faces, the selection priority is determined from the position and size of the detected face as described above. Here, the selection process is such that the priority is higher as the face is closer to the center or larger, but the method of setting the priority is not limited to this.

Hereinafter, the “movement determination threshold resetting process” which is a feature of the second embodiment will be described with reference to FIG. In the movement determination threshold value resetting process, first, in Step 1501, it is confirmed whether or not a plurality of faces are detected by the face detection unit 116. If there are not a plurality of faces, this process becomes unnecessary, and the process ends. In addition, when one face is locked as the main face (that is, when it is fixed to a specific subject) or when a subject that has been personally authenticated in advance is designated as the main subject, switching of the main subject occurs. Therefore, the processing of this embodiment is not necessary. Therefore, the end of the process is determined in Step 1502 and Step 1503, respectively.

On the other hand, when the process proceeds to Step 1504, it is further determined whether or not to reset the threshold value for movement determination. In the threshold reset determination process, when reset is determined, a “threshold reset flag” is set. In Step 1505, it is confirmed whether or not the threshold reset flag is set. If it is not set, the process is terminated as it is. On the other hand, if the threshold reset flag is set, the process proceeds to Step 1506, and the threshold reset for the movement determination is performed thereafter.

In the threshold resetting process, first, in steps 1506 and 1507, the correction coefficient k is set according to the number of detected faces. FIG. 16 shows correction coefficients k determined for the number of detected faces, and the correction coefficient k is set higher as the number of detected faces is larger. That is, when resetting the threshold value, the threshold value is reset to a larger value as the number of subjects detected by the detection means increases. However, the set value of the correction coefficient k is determined in accordance with the performance and focus performance of the imaging optical system of the video camera and the processing capability of the camera / AF microcomputer. Therefore, a value that has been studied as a setting value that provides the most stable focus performance may be set. In Step 1508, a threshold value Th8 obtained by correcting THface with the correction coefficient k is set. Here, THface indicates the movement determination threshold set in Steps 916 to 918 in the movement determination threshold setting processing described with reference to FIG. For the same reason as the processing of Steps 916 to 918, in Steps 1509 to 1511, the threshold value Th 8 is limited to a threshold value within twice the reference movement determination threshold value Th before correction, and then reset as the movement determination threshold value THface. Next, similarly to Step 919 of the movement determination threshold setting process, the approach determination threshold THnear and the distance determination threshold THfar are respectively set in Step 1512. Finally, the threshold reset flag is cleared in Step 1513 to reset the movement determination threshold. This process ends.

Here, the threshold resetting determination process in Step 1504 will be described. FIG. 17 shows “a process for determining threshold resetting when main face switching frequently occurs” as a first form of threshold resetting determination process. In the threshold resetting determination process, first, at Step 1701 to Step 1703, the main face switching history Pt for the past 30 times is updated. That is, in Step 1701, the Pt array data is shifted so that the oldest main face switching history is stored in Pt (29), and then the latest data is stored in Pt (0). When it is confirmed in Step 1702 that the main face has been switched, 1 is set as the latest data Pt (0) in Step 1703. Next, in Step 1704, the history data for the past 30 times are added together to calculate the number p of main face switching confirmed in the past 30 determinations. If it is determined in step 1705 that the number p of main face switching is larger than the determination reference value, a threshold reset flag is set in step 1706. Here, the past 30 main face switching histories are used as the determination period, but this number is determined according to the performance of the imaging optical system of the video camera, the focusing performance, and the processing capability of the camera / AF microcomputer. What is necessary is just to set the value considered as the frequency | count which can obtain the determination accuracy most. Also, the determination reference value is not designated here for the same reason. As described above, in FIG. 17, the process of performing the threshold resetting determination when the main face switching frequently occurs has been described. However, the occurrence of the main face switching is predicted according to the movement of the main face, and the threshold resetting is performed. A determination can also be made. As described above, in the present embodiment, the determination unit of the camera / AF microcomputer determines whether or not there is a change in distance with a predetermined amount of threshold when one subject is detected. On the other hand, when a plurality of subjects are detected, the number of switching times per unit period of the main subject selected by the subject selection means of the camera / AF microcomputer is counted, and when the predetermined number of times is not exceeded, The presence / absence of a change in distance is determined with a predetermined amount of threshold. When the predetermined number of times is exceeded, the threshold is reset to a value larger than the predetermined amount to determine whether there is a change in distance.

As a second form of the threshold reset determination process, FIG. 18 shows a “determination method in the case where the main face is predicted to change due to the intersection with another subject because the main face is moving rapidly”. In the figure, first, the coordinates of the face detection position set to the coordinates (x0, y0) in Step 1801 are saved as (x1, y1) as the previous coordinates, and this time the coordinates (x0, y0) are detected this time in Step 1802. Set the coordinates of the face detection position. Subsequently, in Step 1803, the amount of movement from the coordinates (x1, y1) to the coordinates (x0, y0) is calculated using Equation 9.
Movement amount = SQR ((x1-x0) ^ 2 + (y1-y0) ^ 2) Equation 9

If it is determined in Step 1804 that the calculated movement amount exceeds the preset reference amount, the main face is predicted to be switched by the intersection with another subject. If it is determined in step 1804 that the reference value has been exceeded, the process proceeds to step 1805 to set the threshold reset flag. The reference amount is determined according to the performance and focus performance of the imaging optical system of the video camera and the processing capability of the camera / AF microcomputer. Therefore, a value that has been studied as a setting value that provides the most stable focus performance may be set. As described above, in the present embodiment, the determination unit of the camera / AF microcomputer determines whether or not there is a change in distance with a predetermined amount of threshold when one subject is detected. On the other hand, when a plurality of subjects are detected, the amount of movement of the main subject selected by the subject selection means of the camera / AF microcomputer per unit period is measured and does not exceed the predetermined amount of movement. When it is determined that there is a change in distance with a predetermined amount of threshold value, and when it exceeds the predetermined movement amount, the threshold value is reset to a value larger than the predetermined amount to determine whether there is a change in distance. To do.

As a third form of the threshold resetting determination process, FIG. 19 shows a “determination method when the main face repeats approaching / distant, and switching of the main face is predicted due to an intersection with another subject”. First, in Step 1901, the movement determination flag is confirmed, and if the movement determination flag is not set, the processing is ended as it is. Here, the movement determination flag is a flag set in the movement determination process described in the first embodiment. If a movement determination (distant) is confirmed from the movement determination flag, the process proceeds to Step 1902. On the other hand, if the movement determination (approaching) flag is confirmed, the process proceeds to Step 1905. Here, Mm records a movement determination history, and the older the history is recorded the higher the bit is. In Step 1902, in order to record the history, Mm data is first shifted by 1 bit to the upper bit side, then 1 is added to Mm and the lowest bit is set. On the other hand, in the case of proceeding to Step 1905, the Mm data is simply shifted by 1 bit to the upper bit side, 1 is not added, and the least significant bit remains cleared. That is, in Mm, “1” is left as a history when the movement determination (distance) flag is confirmed, and “0” is left as a history when the movement determination (approach) flag is confirmed. In Step 1903 and Step 1906, the upper 3 bits of the Mm data are masked, and only the history for the past 5 times is recorded. Next, in Step 1904 and Step 1907, Mm data for the past five times is confirmed, and when 0 and 1 are repeated (Mm = 00010101b to 00001010b), the process proceeds to Step 1908 and the threshold reset flag is set. Here, the threshold is reset using the history of the past five times, but the number of times is determined according to the imaging optical system performance and focus performance of the video camera and the processing capability of the camera / AF microcomputer. It is. Therefore, the number of times studied may be set as the number of times that the most stable focus performance can be obtained.

As described above, in the present embodiment, the determination unit of the camera / AF microcomputer determines whether or not there is a change in distance with a predetermined amount of threshold when one subject is detected. On the other hand, when a plurality of subjects are detected, the main subject selected by the subject selection means of the camera / AF microcomputer is monitored for the state of determination of whether or not there is a change in the distance, and the main subject is approached and separated. Is not repeated alternately, it is determined whether or not there is a distance change with a predetermined amount of threshold, and when the main subject approaching and moving away is alternately repeated, the threshold value is larger than the predetermined amount. The value is reset to a value to determine whether there is a change in distance.

As a fourth form of the threshold resetting determination process, FIG. 20 shows a “determination method when the main face continues to move in the angle of view, eventually protrudes from the angle of view, and switching is predicted due to the disappearance of the current main face”. Is shown. First, in Steps 2001 and 2002, the coordinates of the face detection position set in the coordinates (x0, y0) are saved as (x1, y1) as the previous coordinates, and the coordinates detected this time are set in the coordinates (x0, y0). To do. In Step 2003, DIRx and DIRy are each shifted by 1 bit to the upper bit side. Here, DIRx and DIRy record the history of the movement direction of the main face on the x-axis and the y-axis, respectively, and the older history is recorded in the higher bits. When the moving direction is positive, “1” is set, and when it is negative, “0” is set.

From Step 2004 to Step 2009, first, processing of data DIRx on the x-axis is performed. In Step 2004, the movement direction is obtained from the difference between the current time and the previous time, and when movement in the forward direction is determined, 1 is set to the least significant bit in Step 2005. On the other hand, when the movement in the negative direction is determined, the least significant bit remains set to 0. In Step 2006, the past eight histories are confirmed, and if it is always moving in the positive direction, the process proceeds to Step 2008. In step 2008, the upper limit x (upper) of the x coordinate is compared. If the upper limit is exceeded, the process proceeds to step 2009, where a threshold reset flag is set. On the other hand, if it is determined in Step 2007 that the movement is always in the negative direction, the process proceeds to Step 2010. In Step 2010, it is compared with the lower limit x (lower) of the x coordinate. If the lower limit is exceeded, the process proceeds to Step 2009, and a threshold reset flag is set. Here, the upper limit x (upper) and the lower limit x (lower) of the x coordinate are data set to determine the vicinity of the angle of view.

Next, from Step 2011, processing of data DIry on the y-axis is performed. In Step 2011, the movement direction is obtained from the difference between the current time and the previous time, and when movement in the positive direction is determined, 1 is set to the least significant bit in Step 2012. On the other hand, when the movement in the negative direction is determined, the least significant bit remains set to 0. In Step 2013, the history of the past eight times is confirmed, and if it is always moving in the positive direction, the process proceeds to Step 2015. In Step 2015, the upper limit y (upper) of the y coordinate is compared. If the upper limit is exceeded, the process proceeds to Step 2016, and a threshold reset flag is set. On the other hand, if it is determined in Step 2014 that the movement is always in the negative direction, the process proceeds to Step 2017. In step 2017, it is compared with the lower limit y (lower) of the y coordinate. If the lower limit is exceeded, the process proceeds to step 2016, and a threshold reset flag is set. Here, the upper limit y (upper) and lower limit y (lower) of the y-coordinate are data set to determine the vicinity of the field angle, and the values are determined according to the image size and the performance of the face detection unit. Is. Therefore, the value considered as the number of times that the most stable focus performance can be obtained may be set. Here, the threshold resetting determination is performed using the history of the past eight times, but the number of times is determined according to the performance and focus performance of the imaging optical system of the video camera and the processing capability of the camera / AF microcomputer. Is. Therefore, the number of times studied may be set as the number of times that the most stable focus performance can be obtained.

As described above, in the present embodiment, the determination unit of the camera / AF microcomputer determines whether or not there is a change in distance with a predetermined amount of threshold when one subject is detected. On the other hand, when a plurality of subjects are detected, the movement direction of the detection position of the main subject selected by the subject selection means of the camera / AF microcomputer is monitored, and the main subject moves in a direction protruding from the screen. When the main subject is moving in a direction that protrudes from the screen, the threshold is reset to a value larger than the predetermined amount. To determine whether there is a distance change.

The four types of threshold reset determination processing have been described above with reference to FIGS. 17 to 20, but the four types of determination processing may be combined as a threshold reset determination processing. In this case, the movement determination threshold value resetting process to which the processes selected from FIGS. 17 to 20 are applied may be performed in order, or the processes selected from FIGS. The treatment may be performed continuously at a time. As described above, in the second embodiment, in a situation where a plurality of subjects (such as faces) are detected and the main subject is frequently switched, the focus of the main subject is determined by setting a high threshold value. Avoided moving unintentionally. Therefore, the stability and accuracy of autofocus can be improved.

For the processing in the above-described embodiments, a storage medium storing software program codes embodying each function may be provided to the system or apparatus. The functions of the above-described embodiments can be realized by the computer (or CPU or MPU) of the system or apparatus reading and executing the program code stored in the storage medium. In this case, the program code itself read from the storage medium realizes the functions of the above-described embodiments, and the storage medium storing the program code constitutes the present invention. As a storage medium for supplying such a program code, for example, a floppy (registered trademark) disk, a hard disk, an optical disk, a magneto-optical disk, or the like can be used. Alternatively, a CD-ROM, CD-R, magnetic tape, nonvolatile memory card, ROM, or the like can be used. The functions of the above-described embodiments are not only realized by executing the program code read by the computer. This includes the case where the OS (operating system) running on the computer performs part or all of the actual processing based on the instruction of the program code, and the functions of the above-described embodiments are realized by the processing. ing. Further, the program code read from the storage medium may be written in a memory provided in a function expansion board inserted into the computer or a function expansion unit connected to the computer. Thereafter, the CPU of the function expansion board or function expansion unit performs part or all of the actual processing based on the instruction of the program code, and the functions of the above-described embodiments are realized by the processing. It is a waste.

As mentioned above, although preferable embodiment thru | or Example of this invention was demonstrated, this invention is not limited to the said embodiment thru | or Example, A various deformation | transformation and change are possible within the range of the summary.

105 ... Focus lens, 106 ... CCD (imaging device), 113 ... AF signal processing circuit (generation means), 114 ... Camera / AF microcomputer (control means, discrimination means, subject selection means), 116 ... Face Detection unit (detection means)

Claims (9)

An image sensor that photoelectrically converts light from a subject that has passed through an imaging optical system including a focus lens into an electrical signal;
Generating means for generating an AF evaluation value from the output signal corresponding to the point detection region focus that is output from the imaging element,
Detecting means for detecting a face from an output signal output from the image sensor;
Subject selection means for selecting a main face from the faces detected by the detection means;
A discriminating unit for discriminating whether or not there is a change in the distance in the optical axis direction of the main face selected by the subject selecting unit based on a detection result by the detecting unit;
Control means for controlling the focus by driving the focus lens; and
Have,
Before SL control means wherein when it is determined that there distance change of the optical axis direction of the main face by discrimination means, driving of the main face of the optical axis of the distance the focus lens tracking driving operation to correspond to a change As a control, when it is determined by the determination means that there is no distance change in the optical axis direction of the main face , the tracking drive operation is limited ,
The automatic focusing apparatus according to claim 1, wherein the determination unit switches the determination method of the presence / absence of the distance change between a case where a single face is detected by the detection unit and a case where a plurality of faces are detected .
It said determining means, an automatic focusing device according to claim 1, characterized in that to determine the presence or absence of the optical axis direction of the distance variation in size the main face based on a change in the image of the main face. The discrimination means includes
When one face is detected by the detecting means, the presence or absence of the distance change is determined with a predetermined amount of threshold,
When a plurality of faces are detected by the detection means, the number of switching times per unit period of the main face selected by the subject selection means is counted, and when the predetermined number of times is not exceeded, Determine the presence or absence of the distance change with a predetermined amount of threshold value, and if the predetermined number of times is exceeded, reset the threshold value to a value larger than the predetermined amount and determine the presence or absence of the distance change The automatic focusing apparatus according to claim 1 or 2 , wherein
The discrimination means includes
When one face is detected by the detecting means, the presence or absence of the distance change is determined with a predetermined amount of threshold,
When a plurality of faces are detected by the detection means, the movement amount within the screen per unit period of the main face selected by the subject selection means is measured and does not exceed a predetermined movement amount When the distance change is determined based on a predetermined amount of threshold value, and when the predetermined movement amount is exceeded, the threshold value is reset to a value larger than the predetermined amount to determine whether the distance change exists. The automatic focusing apparatus according to claim 1 or 2 , wherein discrimination is performed.
The discrimination means includes
When one face is detected by the detecting means, the presence or absence of the distance change is determined with a predetermined amount of threshold,
When a plurality of faces are detected by the detection means, the state of the presence / absence of the change in the distance of the main face selected by the subject selection means is monitored, and the approach and distance of the main face are monitored. When the determination is not repeated alternately, the determination of the presence or absence of the distance change is performed with a predetermined amount of threshold, and when the main face approaching and moving away determination is alternately repeated, the threshold is set to The automatic focus adjustment apparatus according to claim 1 or 2 , wherein a determination is made as to whether or not there is a change in the distance by resetting to a value larger than a predetermined amount.
The discrimination means includes
When one face is detected by the detecting means, the presence or absence of the distance change is determined with a predetermined amount of threshold,
Wherein when a plurality of faces at detecting means is detected, monitor the moving direction of the detected position of the main face, when the main face is not moved in a direction protruding from the screen, a predetermined amount When the main face is moving in a direction that protrudes from the screen, the threshold value is reset to a value larger than the predetermined amount, and the distance change presence / absence is determined. The automatic focusing apparatus according to claim 1 or 2 , wherein the discrimination is performed.
The automatic focus adjustment according to any one of claims 3 to 6 , wherein when the threshold value is reset, the threshold value is reset to a larger value as the number of faces detected by the detection unit increases. apparatus. The main face is selected by the object selecting means, when the case and the personal authentication facial which is fixed to a specific face, claims 3 to, characterized in that the resetting of the threshold is not performed 7. The automatic focusing apparatus according to any one of items 6 . Photoelectrically converting light from a subject that has passed through an imaging optical system including a focus lens into an electrical signal;
And generating an AF evaluation value from the output signal corresponding to the point detection region focus that output in the converting step,
A detection step of detecting a face from the output signal output in the conversion step;
A subject selection step of selecting a main face from the faces detected in the detection step;
A determination step of determining whether or not there is a change in the distance of the main face in the optical axis direction based on the detection result in the detection step;
A control step for driving and controlling the focus lens to adjust the focus;
An automatic focusing method including:
In the control step, the discrimination when it is determined that there distance change of the optical axis direction of the main face in the step, driving control of the main face of the optical axis of the distance the focus lens tracking driving operation to correspond to a change If the determination step determines that there is no distance change in the optical axis direction of the main face , the tracking drive operation is limited ,
An automatic focus detection method characterized in that, in the determination step, the method for determining whether or not there is a change in distance is switched between a case where one face is detected and a plurality of faces are detected in the detection step .
JP2012000324A 2012-01-05 2012-01-05 Focus adjustment device Expired - Fee Related JP5873336B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012000324A JP5873336B2 (en) 2012-01-05 2012-01-05 Focus adjustment device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012000324A JP5873336B2 (en) 2012-01-05 2012-01-05 Focus adjustment device

Publications (2)

Publication Number Publication Date
JP2013140256A JP2013140256A (en) 2013-07-18
JP5873336B2 true JP5873336B2 (en) 2016-03-01

Family

ID=49037739

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012000324A Expired - Fee Related JP5873336B2 (en) 2012-01-05 2012-01-05 Focus adjustment device

Country Status (1)

Country Link
JP (1) JP5873336B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101623332B1 (en) 2016-03-07 2016-05-23 (주)디지탈라인 Detection and close up shooting method using images of moving objects
KR101623331B1 (en) 2016-03-07 2016-05-31 (주)디지탈라인 Detection and close up shooting method using images of moving objects
CN107257433B (en) * 2017-06-16 2020-01-17 Oppo广东移动通信有限公司 Focusing method, device, terminal and computer readable storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5088118B2 (en) * 2007-12-07 2012-12-05 株式会社ニコン Focus adjustment device
JP5517435B2 (en) * 2008-10-22 2014-06-11 キヤノン株式会社 Automatic focusing device, automatic focusing method, and imaging device
JP5207918B2 (en) * 2008-10-27 2013-06-12 キヤノン株式会社 Image processing apparatus, imaging apparatus, and image processing method
JP5483953B2 (en) * 2009-08-18 2014-05-07 キヤノン株式会社 Focus adjustment device, focus adjustment method and program
JP4975134B2 (en) * 2010-04-06 2012-07-11 キヤノン株式会社 IMAGING DEVICE AND IMAGING DEVICE CONTROL METHOD

Also Published As

Publication number Publication date
JP2013140256A (en) 2013-07-18

Similar Documents

Publication Publication Date Title
JP2010015024A (en) Image pickup apparatus, control method thereof, program and storage medium
US8502912B2 (en) Focusing apparatus and method for controlling the same
JP2010139666A (en) Imaging device
US9160916B2 (en) Focus adjustment apparatus with a size detector
JP2008058788A (en) Focusing device, image pickup apparatus and control method
JP6184189B2 (en) SUBJECT DETECTING DEVICE AND ITS CONTROL METHOD, IMAGING DEVICE, SUBJECT DETECTING DEVICE CONTROL PROGRAM, AND STORAGE MEDIUM
JP2008129255A (en) Imaging apparatus, imaging method, and program
JP5873336B2 (en) Focus adjustment device
JP5335408B2 (en) Focus adjustment apparatus and method
JP5075110B2 (en) Focus adjustment apparatus and method
JP6851726B2 (en) Control device, image pickup device, control method, program, and storage medium
JP2014106411A (en) Automatic focus adjustment device and automatic focus adjustment method
JP4996568B2 (en) IMAGING DEVICE AND IMAGING DEVICE CONTROL METHOD
JP5913902B2 (en) Automatic focusing device and automatic focusing method
JP6159055B2 (en) Automatic focusing device, imaging device, and automatic focusing method
JP6053287B2 (en) Automatic focusing apparatus and automatic focusing method
JP5017195B2 (en) Focus adjustment apparatus and method
US9357124B2 (en) Focusing control device and controlling method of the same
JP6120478B2 (en) Automatic focusing device and automatic focusing method
JP5202292B2 (en) IMAGING DEVICE, IMAGING DEVICE CONTROL METHOD, PROGRAM, AND STORAGE MEDIUM
JP5932340B2 (en) Focus adjustment device
JP5882745B2 (en) Focus adjustment device
JP5898455B2 (en) Automatic focusing device and automatic focusing method
JP6039184B2 (en) Automatic focusing device, imaging device, and automatic focusing method
JP5451869B2 (en) Focus adjustment apparatus and method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20141225

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20150812

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20150820

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20150914

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20151218

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20160115

R151 Written notification of patent or utility model registration

Ref document number: 5873336

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

LAPS Cancellation because of no payment of annual fees