Focus control device, imaging apparatus, and focus control method
Patent Information
- Application Number
- JP2022184290
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2022-11-17
- Publication Date
- 2025-11-19
AI Technical Summary
Existing focus adjustment methods using phase difference detection risk refocusing due to improper detection of defocus amounts near the start position, leading to inadequate search operations for desired subject focus.
A focus control device and method that utilize phase difference detection to set a drivable range for the focus lens based on the search direction and position, adjusting the focus lens drive based on focus detection results within this range and ignoring results outside the range, and setting offset amounts to ensure appropriate search operations.
Enables quick and accurate focus adjustment on the desired subject by avoiding refocusing on background and ensuring the focus lens drives appropriately within the drivable range, enhancing user satisfaction.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
[Technical field]
[0001] The present invention relates to focus control. [Background technology]
[0002] Some imaging devices perform a search operation to move a focus lens to search for a focus position. Patent Document 1 discloses a method for performing a search operation by limiting the search operation to the farther side than the near-distance end point or the closer side than the far-distance end point in response to a user's designation of the current lens position as the near-distance end point or the far-distance end point as the start position of the search operation. [Prior art documents] [Patent documents]
[0003] [Patent Document 1] JP 2007-164051 A Summary of the Invention [Problem to be solved by the invention]
[0004] However, the method disclosed in Patent Document 1 is premised on contrast detection type focus adjustment. If the method of Patent Document 1 is applied to phase difference detection type focus adjustment, there is a risk that the defocus amount near the start position of the search operation is detected near the start position, and the focus is re-adjusted to the start position of the search operation based on the defocus amount. For this reason, it is not possible to perform an appropriate search operation for quickly focusing on a subject desired by the user.
[0005] The present invention provides a focus control device capable of performing an appropriate search operation in focus adjustment using a phase difference detection method. [Means for solving the problem]
[0006] A focus control device according to one aspect of the present invention includes a focus detection unit that performs focus detection using a phase difference detection method, and a control unit that controls driving of a focus lens included in an optical system based on a focus detection result obtained by the focus detection. In a search operation in which a focus detection result is obtained while driving the focus lens in a search direction, the control unit sets a driveable range of the focus lens based on the search direction and a position of the focus lens, and when a focus detection result for a position within the driveable range is obtained, the control unit drives the focus lens based on the focus detection result, and when a focus detection result for a position outside the driveable range is obtained, the control unit drives the focus lens in the search direction without using the focus detection result.
[0007] A focus control device according to another aspect of the present invention includes a focus detection unit that performs focus detection using a phase difference detection method, and a control unit that controls driving of a focus lens based on a focus detection result obtained by focus detection. In a search operation in which a focus detection result is obtained while driving the focus lens in a search direction, the control unit drives the focus lens based on the focus detection result when a difference between the position of the focus lens and a start position of the search operation is greater than a threshold value and the direction of the focus detection result is the same as the search direction, and drives the focus lens in the search direction without using the focus detection result when the direction of the focus detection result is opposite to the search direction. Note that an imaging device having the above focus control device and an imaging element that images a subject through an optical system also constitutes another aspect of the present invention.
[0008] A focus control method according to another aspect of the present invention includes a step of performing focus detection using a phase difference detection method, and a step of controlling driving of a focus lens included in an optical system based on a focus detection result obtained by the focus detection, wherein in a search operation in which a focus detection result is obtained while driving the focus lens in a search direction, a drivable range of the focus lens is set based on the search direction and a position of the focus lens, and when a focus detection result for a position within the drivable range is obtained, the focus lens is driven based on the focus detection result, and when a focus detection result for a position outside the drivable range is obtained, the focus lens is driven in the search direction without using the focus detection result.
[0009] A focus control method according to another aspect of the present invention includes a step of performing focus detection using a phase difference detection method, and a step of controlling the drive of a focus lens based on a focus detection result obtained by the focus detection. In a search operation in which a focus detection result is obtained while driving the focus lens in a search direction, if a difference between the position of the focus lens and a start position of the search operation is greater than a threshold value and the direction of the focus detection result is the same as the search direction, the focus lens is driven based on the focus detection result, and if the direction of the focus detection result is opposite to the search direction, the focus lens is driven in the search direction without using the focus detection result. Note that a program for causing a computer to execute processing according to the above focus control method also constitutes another aspect of the present invention. Effect of the Invention
[0010] According to the present invention, an appropriate search operation can be performed in focus adjustment using the phase difference detection method. [Brief description of the drawings]
[0011] [Figure 1] FIG. 1 is a block diagram showing the arrangement of an imaging apparatus according to a first embodiment. [Diagram 2] FIG. 2 is a diagram showing a pixel array of an image sensor according to the first embodiment. [Diagram 3]3A and 3B are a plan view and a cross-sectional view of a pixel in the first embodiment. [Figure 4] 4A to 4C are diagrams for explaining pupil division in the first embodiment. [Diagram 5] 4A to 4C are diagrams for explaining the relationship between an image sensor and pupil division in the first embodiment. [Figure 6] 5A to 5C are diagrams illustrating the relationship between the defocus amount and the image shift amount in the first embodiment. [Figure 7] 5 is a flowchart showing an imaging process according to the first embodiment. [Figure 8] 5 is a flowchart showing a search AF process in the first embodiment. [Figure 9] 6 is a flowchart showing a process for calculating a driveable range of a focus lens according to the first embodiment. [Figure 10] FIG. 4 is a diagram showing the positional relationship between a subject and a background in the first embodiment. [Figure 11] FIG. 4 is a diagram showing subject and background signals in the first embodiment. [Figure 12] 5 is a graph showing the relationship between the focus lens position and the defocus amount in the first embodiment. [Figure 13] 5A to 5C are diagrams showing the relationship between a search direction, a search start position, a focus lens position, a focus driveable range, a defocus amount, and a focus lens drive amount in the first embodiment. [Figure 14] 11 is a flowchart showing a search AF process in the second embodiment. [Figure 15] 10A to 10C are diagrams showing the relationship between a search direction, a search start position, a focus lens position, a defocus amount, and a focus lens driving amount in the second embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0012] Hereinafter, embodiments of the present invention will be described with reference to the drawings.
[0013] (Embodiment 1) 1 is a lens-interchangeable single-lens reflex digital camera system capable of performing autofocusing using an image plane phase difference detection method (hereinafter referred to as image plane phase difference AF). Note that this embodiment and the second embodiment described below are applicable to lens-integrated digital cameras and digital video cameras, and further to various imaging devices such as terminal devices such as tablets and smartphones, surveillance cameras, in-vehicle cameras, and medical cameras.
[0014] <Device configuration> The imaging system 10 is made up of a lens unit 100 and a camera body 120 as an imaging device. The lens unit 100 is detachably connected to the camera body 120 via a mount M indicated by a dotted line in the center of the figure.
[0015] The lens unit 100 has an imaging optical system including a first lens group 101, an aperture 102, a second lens group 103, and a focus lens group (hereinafter referred to as a focus lens) 104.
[0016] The first lens group 101 is disposed on the most object side of the lens unit 100, and is held so as to be movable in the optical axis direction OA. Hereinafter, the optical axis direction OA is defined as the Z direction, and the direction in which the subject side is viewed from the camera side is defined as the positive direction. In this embodiment, the origin 0 of the Z direction axis corresponds to the position of an image sensor 122 in a camera body 120, which will be described later.
[0017] The aperture 102 adjusts the amount of light by changing its opening diameter. The aperture 102 also functions as a mechanical shutter that controls the exposure time when capturing a still image. The aperture 102 and the second lens group 103 can move together in the optical axis direction OA, and move in conjunction with the first lens group 101 to achieve a zoom function.
[0018] The focus lens 104 is movable forward and backward in the optical axis direction OA, and the subject distance (focusing distance) at which the lens unit 100 focuses changes depending on the position of the focus lens 104. In this embodiment, autofocus is achieved by controlling the position of the focus lens 104 in the optical axis direction OA.
[0019] The lens unit 100 has a drive / control system (including devices, circuits, program code, and the like). The drive system in the drive / control system includes a zoom actuator 111, an aperture / shutter actuator 112, a focus actuator 113, a zoom driver 114, an aperture / shutter driver 115, and a focus driver 116. In addition, the control system that controls the drive system includes a lens MPU 117 and a lens memory 118.
[0020] The zoom actuator 111 drives the first lens group 101 and the second lens group 103 to advance and retreat in the optical axis direction OA, thereby performing zoom control to change the angle of view of the imaging optical system. The iris / shutter actuator 112 controls the aperture diameter of the iris 102 to adjust the amount of light, and controls the opening and closing operation of the iris 102 to control the exposure time during imaging. The focus actuator 113 drives the focus lens 104 to advance and retreat in the optical axis direction OA to perform autofocus, and also has a function of detecting the current position (actual position) of the focus lens 104.
[0021] A zoom driver 114 drives the zoom actuator 111 in response to a user's zoom operation or a control value of a lens MPU 117. An aperture / shutter driver 115 drives the aperture / shutter actuator 112. A focus driver 116 drives the focus actuator 113.
[0022] The lens MPU 117 performs calculations related to the imaging optical system, and controls the zoom driver 114, the aperture / shutter driver 115, the focus driver 116, and the lens memory 118. The lens MPU 117 can communicate commands and data with the camera MPU 125 via the mount M. For example, the lens MPU 117 detects the current position of the focus lens 104, and notifies the camera MPU 125 of lens position information in response to a request from the camera MPU 125. The lens position information includes information such as the position of the focus lens 104 in the optical axis direction OA, the position and diameter of the exit pupil in the optical axis direction OA, and the position and diameter of the lens frame that limits the light flux of the exit pupil in the optical axis direction OA.
[0023] In addition, the lens MPU 117 controls the zoom driver 114, the aperture / shutter driver 115, and the focus driver 116 in response to a request from the camera MPU 125. The lens memory 118 stores optical information necessary for the image plane phase difference AF of this embodiment in advance. In addition, the lens memory 118 stores, for example, a defocus map indicating the correspondence between the position and movement amount of the focus lens 104 and the defocus amount. The defocus map is generated by calculating the defocus amount at each pixel position of the image sensor 122 described later. When the lens MPU 117 receives a request from the camera MPU 125 to change the defocus amount by a predetermined amount, it refers to the defocus map stored in the lens memory 118. Then, it controls the focus actuator 113 to move the focus lens 104 by a distance corresponding to the predetermined amount.
[0024] The camera MPU 125 executes programs stored in the ROM 125a, the lens memory 118, etc., to control the operation of the lens unit 100. The lens memory 118 also stores optical information about the imaging optical system, etc.
[0025] The camera body 120 has an optical low-pass filter 121, an image sensor 122, and a drive / control system (described later). The optical low-pass filter 121 reduces false colors and moire in a captured image.
[0026] The imaging element 122 is composed of, for example, a CMOS image sensor and its peripheral circuits. The CMOS image sensor has a pixel group (imaging surface) in which a photoelectric conversion element is provided in each pixel that receives light, and a plurality of unit pixels are arranged two-dimensionally, with each pixel being a unit pixel. The imaging element 122 has a plurality of focus detection pixels that receive light beams that pass through different pupil regions of the imaging optical system, and is capable of outputting an independent signal for each pixel. This makes it possible to detect (calculate) the amount of defocus by imaging surface phase difference AF. The imaging element 122 also has a plurality of imaging pixels that each receive a light beam that passes through the entire area of the exit pupil of the imaging optical system that forms an image of the subject, and generate an image signal of the subject.
[0027] The drive / control system of the camera body 120 has an image sensor drive unit 123, an image processing unit 124, a camera MPU 125, a display unit 126, an operation switch 127, a memory 128, and a phase difference AF unit 129. It further has an AE unit 130, a white balance adjustment unit 131, and a subject detection unit 132.
[0028] The image sensor driver 123 controls the charge accumulation operation of the image sensor 122, and converts the image signal read from the image sensor 122 into a digital signal and sends it to the camera MPU 125. The image processor 124 performs various image processing such as gamma conversion, color interpolation, and JPEG compression on the image signal read from the image sensor 122. The image processor 124 also generates a signal for image plane phase difference AF (focus detection signal), a signal for exposure adjustment, a signal for white balance adjustment, and a signal for subject detection, which will be described later.
[0029] The camera MPU 125 serving as a control means is a computer having at least one microprocessor. The camera MPU 125 performs calculations related to the camera body 120, and controls the image sensor drive section 123, the image processing section 124, the display section 126, the operation switch 127, the memory 128, and the phase difference AF section 129. The camera MPU 125 can communicate with the lens MPU 117 via a signal line disposed in the mount M. This allows the camera MPU 125 to issue a request to obtain the lens position, to issue a request to perform zoom drive, aperture drive, or lens drive at a predetermined drive amount, and to issue a request to obtain optical information specific to the lens unit 100 to the lens MPU 117.
[0030] The camera MPU 125 has a ROM 125a that stores a program for controlling the operation of the camera, a RAM 125b that stores variables, and an EEPROM 125c that stores various parameters built in. The camera MPU 125 reads out the program stored in the ROM 125a, loads it into the RAM 125b, and executes focus adjustment processing, subject detection processing, exposure adjustment processing, and white balance adjustment processing according to the program.
[0031] Display unit 126 has a display device such as an LCD (liquid crystal) panel or an organic EL display, and displays various information related to the operation mode set in camera body 120. The operation modes include a still image capturing mode, a video capturing mode, and a playback mode in which captured images stored in memory 128 are played back.
[0032] The operation switches 127 include a shutter switch, a power switch, a zoom switch, a mode changeover switch, a search switch (instruction means), etc. The memory 128 is a flash memory that is detachable from the camera, and records captured images.
[0033] The phase difference AF unit 129 as a focus detection means performs focus detection by an imaging plane phase difference detection method based on focus detection signals as a pair of image signals having parallax for focus detection obtained from the image sensor 122 and the image processing unit 124. Specifically, the image processing unit 124 performs correlation calculation on a pair of phase difference image data generated from the pair of focus detection signals to calculate an image shift amount (phase difference) between the pair of phase difference image data. Then, the image shift amount is converted into a defocus amount to detect the defocus amount. The phase difference AF unit 129 performs focus adjustment (AF) processing to control the position of the focus lens 104 using the detected defocus amount (focus detection result). Note that the phase difference AF unit 129 may perform focus detection by a phase difference detection method using a focus detection sensor other than the image sensor 122, instead of the imaging plane phase difference detection method.
[0034] The phase difference AF section 129 in this embodiment has a signal generation block 129a that generates first and second focus detection signals described later, and a calculation block 129b that calculates a phase difference between the first and second focus detection signals and further calculates a defocus amount from the phase difference. At least a part of the phase difference AF section 129 (a part of the signal generation block 129a or the calculation block 129b) may be provided in the camera MPU 125. The AF process (focus control process) executed by the camera MPU 125 and the phase difference AF section 129 will be described later. The camera MPU 125 and the phase difference AF section 129 configure a focus control device.
[0035] The subject detection section 132 performs subject detection processing to detect the type, part, and state (detection type) of the subject, the position and size (detection area) of the subject, and the like, based on a subject detection signal generated by the image processing section 124.
[0036] The AE unit 130 controls the exposure conditions by measuring light based on exposure adjustment signals obtained from the image sensor 122 and the image processor 124. Specifically, it calculates the amount of exposure at the currently set aperture value, shutter speed, and ISO sensitivity, and calculates appropriate aperture value, shutter speed, and ISO sensitivity at the time of image capture based on the difference between the calculated amount of exposure and a predetermined appropriate amount of exposure, and sets these as exposure conditions. This realizes automatic exposure adjustment (AE).
[0037] The white balance adjustment unit 131 performs white balance adjustment processing based on a signal for white balance adjustment obtained from the imaging element 122 and the image processing unit 124. Specifically, it adjusts color weighting based on the difference between a white balance parameter acquired from the signal for white balance adjustment and a predetermined appropriate white balance parameter. In this way, automatic white balance adjustment (AWB) is realized.
[0038] The camera body 120 of this embodiment is capable of performing AF, AE, and AWB in combination with subject detection, and can select positions within the imaging range where AF, AE, and AWB are performed according to the subject detection results.
[0039] <Image sensor configuration> Fig. 2 shows an array of imaging pixels in an area of 4 columns x 4 rows in the image sensor 122 as a two-dimensional CMOS sensor, and an array of focus detection pixels in an area of 8 columns x 4 rows. In the 2 columns x 2 rows imaging pixel group 200 shown in Fig. 2, an imaging pixel 200R having a spectral sensitivity of R (red) is arranged at the upper left, imaging pixels 200G having a spectral sensitivity of G (green) are arranged at the upper right and lower left, and an imaging pixel 200B having a spectral sensitivity of B (blue) is arranged at the lower right. Furthermore, each imaging pixel is composed of a first focus detection pixel 201 and a second focus detection pixel 202 arranged in 2 columns x 1 row.
[0040] By arranging a large number of such imaging pixel groups 200 on the imaging surface, it is possible to obtain a captured image and a focus detection signal.
[0041] Fig. 3(a) shows one imaging pixel (hereinafter simply referred to as pixel) 200G of the imaging element 122 shown in Fig. 2, viewed from the light receiving surface side (+z side) of the imaging element 122. Fig. 3(b) shows a cross section of the aa cross section of Fig. 3(a) viewed from the -y side.
[0042] The pixel 200G is provided with a microlens 305 for collecting incident light, and a photoelectric conversion unit 301 and a photoelectric conversion unit 302 that are divided into two in the x direction. The photoelectric conversion unit 301 and the photoelectric conversion unit 302 correspond to the first focus detection pixel 201 and the second focus detection pixel 202 shown in FIG. 2, respectively.
[0043] The photoelectric conversion unit 301 and the photoelectric conversion unit 302 may be a pin structure photodiode with an intrinsic layer sandwiched between a p-type layer and an n-type layer, or may be a pn junction photodiode with the intrinsic layer omitted. In the pixel 200G, a color filter 306 is provided between the microlens 305 and the photoelectric conversion unit 301 and the photoelectric conversion unit 302. The spectral transmittance of the color filter may be changed for each photoelectric conversion unit, or the color filter may be omitted.
[0044] Light incident on pixel 200G is collected by microlens 305, dispersed by color filter 306, and then received by photoelectric conversion unit 301 and photoelectric conversion unit 302. In photoelectric conversion unit 301 and photoelectric conversion unit 302, pairs of electrons and holes are generated according to the amount of received light, and after being separated by a depletion layer, negatively charged electrons are accumulated in an n-type layer, while holes are discharged to the outside of image sensor 122 through a p-type layer connected to a constant voltage source (not shown).
[0045] The electrons stored in the n-type layers of the photoelectric conversion units 301 and 302 are transferred to the capacitance unit (FD) via a transfer gate and converted into a voltage signal.
[0046] Fig. 4 shows the correspondence between the pixel structure and pupil division of the image sensor 122 shown in Fig. 3. Fig. 4 shows a cross section of the pixel structure of the image sensor 122 shown in Fig. 3(a) viewed from the +y side and the pupil plane (pupil distance Ds) of the image sensor 122. Note that in Fig. 4, the x-axis and y-axis of the cross section of the image sensor 122 are shown inverted with respect to Fig. 3 in order to correspond to the coordinate axes of the pupil plane of the image sensor 122.
[0047] 4, a first pupil partial region 501 is a region capable of receiving light by the first focus detection pixel 201, which is generally conjugate with the light receiving surface of the photoelectric conversion unit 301, whose center of gravity is decentered in the -x direction, via the microlens 305. A second pupil partial region 502 is a region capable of receiving light by the second focus detection pixel 202, which is generally conjugate with the light receiving surface of the photoelectric conversion unit 302, whose center of gravity is decentered in the +x direction, via the microlens. Also, in FIG. 4, a pupil region 500 including the first and second pupil partial regions 501, 502 is a region capable of receiving light by the entire pixel 200G, which includes the photoelectric conversion units 301, 302 (first and second focus detection pixels 201, 202).
[0048] As shown in Fig. 5, light beams that pass through a first pupil partial region 501 and a second pupil partial region 502 that are different from each other in a pupil region 500 of the imaging optical system are incident on each pixel on the imaging plane 800 at different angles from each other and are received by a first focus detection pixel 201 and a second focus detection pixel 202. Fig. 5 shows an example in which the pupil region is divided into two in the horizontal direction, but the pupil may also be divided in the vertical direction. Furthermore, the light beams that pass through the pupil region 500 are received by the first and second focus detection pixels 201, 202 in each pixel.
[0049] A first focus detection signal is generated by combining photoelectric conversion signals from first focus detection pixels 201 of a plurality of pixels, and a second focus detection signal is generated by combining photoelectric conversion signals from second focus detection pixels 202. Also, an image pickup signal with a resolution of the effective pixel number N is generated by adding the photoelectric conversion signals from the first and second focus detection pixels 201, 202 in each pixel and combining the photoelectric conversion signals from all pixels. Note that the second focus detection signal may be generated by subtracting the first focus detection signal from the image pickup signal.
[0050] <Relationship between defocus amount and image shift amount> FIG. 6 shows the relationship between the defocus amount and the image shift amount between the first and second focus detection signals. As shown in FIG. 5, the pupil region of the imaging optical system is divided into two parts, a first pupil partial region 501 and a second pupil partial region 502. The defocus amount d is the distance from the imaging position of the subject image to the imaging plane 800, |d|, and a front-focus state in which the imaging position of the subject image is on the subject side of the imaging plane 800 is indicated by a negative sign (d<0). A back-focus state in which the imaging position of the subject image is on the opposite side of the subject side of the imaging plane 800 is indicated by a positive sign (d>0). In a focused state in which the imaging position of the subject image is on the imaging plane 800, d=0. In FIG. 6, subject 801 indicates a subject in a focused state (d=0), and subject 802 indicates a subject in a front-focus state (d<0). The front-focus state (d<0) and the back-focus state (d>0) are collectively referred to as a defocus state (|d|>0).
[0051] In a front-focus state (d<0), the light beams from the subject 802 that pass through the first and second pupil partial regions 501, 502 are each focused once and then spread to widths Γ1, Γ2 around the center positions G1, G2 of the light beams, forming blurred images on the imaging plane 800. The blurred images are received by the first and second focus detection pixels 201, 202 to generate first and second focus detection signals. Thus, the first and second focus detection signals are recorded as subject images of the subject 802 blurred to widths Γ1, Γ2 at the center positions G1, G2 on the imaging plane 800, respectively. The blur widths Γ1, Γ2 of the subject image increase approximately in proportion to an increase in the magnitude |d| of the defocus amount d. Similarly, the magnitude |p| of the image shift amount p (the difference G1-G2 between the center of gravity positions of the light beams) between the first and second focus detection signals increases roughly in proportion to the increase in the magnitude |d| of the defocus amount d. The same is true in the back-focus state (d>0), except that the direction of the image shift between the first and second focus detection signals is opposite to that in the front-focus state.
[0052] Because the amount of image shift between the first and second focus detection signals increases as the defocus amount increases, the phase difference AF unit 129 converts the amount of image shift into a defocus amount d using a conversion coefficient calculated based on the distance (baseline length) between the first and second focus detection pixels 201, 202.
[0053] <Image capture processing> The flowchart in FIG. 7 shows the imaging process that the camera MPU 125 executes in accordance with a program in this embodiment.
[0054] In step S701, the camera MPU 125 causes the phase difference AF section 129 to perform focus detection and acquires the defocus amount as the focus detection result.
[0055] Next, in step S702, the camera MPU 125 determines whether or not an AF instruction has been issued, and if an AF instruction has been issued, the process proceeds to step S703, and if an AF instruction has not been issued, the process proceeds to step S704.
[0056] In step S703, the camera MPU 125 executes normal AF (imaging surface phase difference AF) processing, and sets the drive amount of the focus lens 104 (hereinafter referred to as the focus drive amount) according to the defocus amount acquired in step S701. Then, the process proceeds to step S706.
[0057] In step S704, camera MPU 125 determines whether a search instruction has been issued by the user operating the search switch of operation switch 127. The search instruction includes an instruction to start search AF processing and an instruction for the search direction (the driving direction of focus lens 104). If a search instruction has been issued, the process proceeds to step S705, and if a search instruction has not been issued, the process proceeds to step S701.
[0058] In step S705, the camera MPU 125 executes a search AF process, and then proceeds to step S706. The search AF process will be described later.
[0059] In step S706, the camera MPU 125 transmits the focus driving amount set in step S703 or step S705 to the lens MPU 117 to drive the focus lens 104.
[0060] In step S707, the camera MPU 125 determines whether or not the imaging optical system is in focus on the subject. If it is determined that the subject is in focus, the process proceeds to step S708, and if it is determined that the subject is not in focus, the process proceeds to step S701.
[0061] In step S708, the camera MPU 125 captures an image for recording. When the image capture ends, this process ends.
[0062] <Search AF processing> The flowchart in Fig. 8 shows the search AF process (focus control method) executed in step S705. In the search AF (processing), a search operation (hereinafter also simply referred to as search) is performed to perform focus detection at a predetermined cycle while moving the focus lens 104 to search for the in-focus position of the focus lens 104. Then, the focus lens 104 is moved to the in-focus position identified by the search.
[0063] In step S801, the camera MPU 125 acquires the search direction in the search instruction determined in step S704 in FIG.
[0064] Next, in step S802, the camera MPU 125 acquires the current position (search start position) of the focus lens 104 from the lens MPU 117.
[0065] Next, in step S803, camera MPU 125 calculates the driveable range of focus lens 104 (hereinafter referred to as focus driveable range). The calculation of the focus driveable range will be described later.
[0066] Next, in step S804, camera MPU 125 determines whether the defocus amount acquired in step S701 of Fig. 7 is for a position within the focus driveable range calculated in step S803. In other words, it determines whether the target position of focus lens 104 when focus lens 104 is driven by a focus drive amount based on the defocus amount is within the focus driveable range. If a defocus amount for a position within the focus driveable range has been obtained (the target position is within the focus driveable range), the process proceeds to step S805, and if the defocus amount is not for a position within the focus driveable range, the process proceeds to step S806. Here, if the reliability of the defocus amount is low and it cannot be used, it is determined that the defocus amount is not within the focus driveable range.
[0067] In step S805, the camera MPU 125 sets the focus driving amount based on the defocus amount acquired in step S701, and then ends this process.
[0068] In step S806, the camera MPU 125 sets a predetermined focus drive amount in the search direction obtained in step S801 without using the defocus amount obtained in step S701. The predetermined focus drive amount is a drive amount during search, and may be set according to the focus detection cycle, shooting distance, aperture value, imaging mode, etc. After step S806, this process ends.
[0069] <Calculation of focus driving range> The calculation of the focus drivable range in step S803 in Fig. 8 will be described. Fig. 10 shows the positional relationship between the subject and the background. The subject is located close to the imaging system 10, and the background is located sufficiently far from the imaging system 10.
[0070] Figures 11(a) and (b) show a signal indicating a subject (hereinafter referred to as a subject signal) and a signal indicating a background (hereinafter referred to as a background signal) acquired from the image sensor 122 when the subject and background are in the positional relationship shown in Figure 10. Figure 11(a) shows a subject signal 1102 and a background signal 1101 when the image sensor is focused on the background. Figure 11(b) shows a subject signal 1104 and a background signal 1103 when the image sensor is focused on a subject. In reality, the subject signal and the background signal are acquired from the image sensor 122 as a signal obtained by adding these together, but here the subject signal and the background signal are shown separately.
[0071] In the background-focused state of FIG. 11(a), the contrast of background signal 1101 is high and the contrast of object signal 1102 is very low. For this reason, the background-focused state is heavily influenced by background signal 1101, and the amount of defocus relative to the background is detected as the focus detection result. On the other hand, in the object-focused state of FIG. 11(b), the contrast of object signal 1104 is high and the contrast of background signal 1103 is very low. For this reason, the object-focused state is heavily influenced by object signal 1104, and the amount of defocus relative to the object is detected as the focus detection result.
[0072] Fig. 12 shows the relationship between the focus lens position and the focus detection result when the subject and background are in the positional relationship shown in Fig. 10. The horizontal axis shows the focus lens position, and the vertical axis shows the defocus amount. The search direction is the direction from the side where the focusing distance is long (background) to the side where it is short (subject).
[0073] When the focus lens position is in the vicinity of the background in-focus position (1201, 1202), the defocus amount for the background is detected under the large influence of the background signal as described above. On the other hand, when the focus lens position is in the vicinity of the subject in-focus position (1203, 1204), the defocus amount for the subject is detected under the large influence of the subject signal. In the section between the vicinity of the background in-focus position and the vicinity of the subject in-focus position, the contrast of both the background signal and the subject signal is low, so the reliability of the defocus amount is low and it is not possible to detect a defocus amount that can be used for AF.
[0074] 9 shows a calculation process of the focus drivable range. In step S901, the camera MPU 125 calculates a difference x between the search start position of the focus lens 104 acquired in step S802 at the start of search AF (search start) and the current position of the focus lens 104 acquired in step S802 in the current frame.
[0075] Next, in step S902, the camera MPU 125 determines whether the difference x is equal to or less than a predetermined first threshold Th1. If it is equal to or less than the first threshold Th1, the process proceeds to step S903, and if it is not equal to or less than the first threshold Th1, the process proceeds to step S905.
[0076] In step S903, camera MPU 125 acquires the focus detectable range of phase difference AF section 129, and further acquires the currently set aperture value and focus sensitivity (optical information of the imaging optical system) from lens MPU 117. The focus detectable range is the amount of image blur (amount of spread of the subject image) that can be detected by phase difference AF section 129. Focus sensitivity indicates the relationship (ratio) between the unit drive amount of focus lens 104 and the amount of change in defocus amount.
[0077] Next, in step S904, camera MPU 125 calculates an offset amount in the same direction as the search direction obtained in step S801, based on the difference x calculated in step S901 and the focus detectable range R, aperture value F, and focus sensitivity S obtained in step S903. The offset amount is a drive amount of focus lens 104 calculated taking into consideration the case where the search start position is in the opposite direction to the search direction from the background in-focus position, and is calculated, for example, by the following formula (1). α is a predetermined gain value.
[0078] Offset amount = α(R / x)FS If an image blur that exceeds the focus detectable range occurs for a subject near the search start position, a focus detection result cannot be obtained for that subject, so there is no need to set an offset amount that would cause an image blur that exceeds the focus detectable range. Therefore, in such cases, the offset amount is set based on the focus detectable range.
[0079] Moreover, as the current position of the focus lens 104 moves away from the search start position, the possibility that the current position exceeds the background focus position increases. For this reason, the offset amount is reduced as the current position moves away from the search start position so as to be inversely proportional to the difference x between the search start position and the current position, thereby preventing an excessively large offset amount from being set. Note that the aperture value F is used for converting the image blur amount to the defocus amount, and the focus sensitivity is used for converting the defocus amount to the focus drive amount. Also, Equation (1) is an example of an equation for calculating the offset amount, and the offset amount may be calculated by other methods. From step S904, the process proceeds to step S909.
[0080] In step S909, camera MPU 125 calculates the focus driveable range based on the current position of focus lens 104, the offset amount calculated in step S904, and the search direction acquired in step S801. The focus driveable range is the range from a position shifted (away) in the search direction from the current position by the offset amount to the drive end (control end or mechanical end) of focus lens 104 in the search direction. After calculating the focus driveable range, camera MPU 125 ends this process.
[0081] 13(a) to (d) show the relationship between the search direction, search start position, focus lens position, focus driveable range, defocus amount, and focus drive amount in this embodiment. Note that focus positions (current positions) 1201 to 1204 in the figures correspond to the positions 1201 to 1204 shown in FIG.
[0082] FIG. 13(a) shows a state at the start of a search, and the focus lens 104 is located at a search start position as a current position 1201. In this state, since x (=0)≦Th1, an offset amount 1302a is set in the same direction as the search direction based on the focus detectable range, the aperture value, the focus sensitivity, and x (step S904). A focus drivable range 1303a is set in the search direction from a position shifted in the search direction from the search start position by the offset amount 1302a. In this state, a defocus amount 1301a to the background in-focus position is detected. However, the background in-focus position as the target position of the focus lens 104 based on the defocus amount 1301a is outside the focus drivable range 1303a. For this reason, the defocus amount 1301a is not used, and a predetermined amount for the search is set as a focus drive amount 1304a (step S806).
[0083] In this way, a focus drivable range is set that is shifted from the search start position (current position) in the search direction by an offset amount. This makes it possible to search for the subject focus position without focusing on the background, even if the search start position is in the opposite search direction to the background focus position.
[0084] FIG. 13B shows a state where the focus lens has moved from the search start position to a current position 1202 that is closer to the subject focus position than the background focus position. Since x (>0)≦Th1 in this state as well, an offset amount 1302b is set in the same direction as the search direction based on the focus detectable range, the aperture value, the focus sensitivity, and x (step S904). A focus drivable range 1303b is set in the search direction from a position shifted from the current position 1202 by the offset amount 1302b. Note that since x is larger than in the state of FIG. 13A, the offset amount 1302b is smaller than the offset amount 1302a. Even in this state, a defocus amount 1301b to the background focus position is detected. However, the background focus position as the target position of the focus lens 104 based on the defocus amount 1301b is outside the focus drivable range 1303b. For this reason, the defocus amount 1301b is not used, and a predetermined amount for searching is set as the focus driving amount 1304b (step S806). Note that the focus driving amount 1304b is the same as the focus driving amount 1304a shown in FIG. 13(a), but may be different, such as being smaller.
[0085] In this way, a focus driveable range is set that is shifted by the offset amount from the focus lens position after the start of the search. This makes it possible to search for a subject focus position without focusing on the background, even if the detected defocus amount 1301a is for a position within the focus driveable range (1303a) set at the start of the search.
[0086] In step S905 in FIG. 9, the camera MPU 125 determines whether the difference x is equal to or greater than a predetermined second threshold Th2 (>Th1), and proceeds to step S906 if the difference x is equal to or greater than the threshold Th2, and proceeds to step S908 if the difference x is not equal to or greater than the threshold Th2.
[0087] In step S906, the camera MPU 125 acquires the drive speed of the focus lens 104 and the focus detection period.
[0088] Next, in step S907, the camera MPU 125 calculates an offset amount in the opposite direction to the search direction obtained in step S801, based on the drive speed and focus detection cycle obtained in step S906, and further the difference x calculated in step S901. The offset amount here is set in consideration of the case where the subject focus position is overshot during search, in accordance with the relationship between the drive speed v of the focus lens 104 and the focus detection cycle T, and is calculated, for example, by the following formula (2). β is a predetermined gain value.
[0089] Offset amount = βvTx The drive amount of the focus lens 104 between frames where focus detection is performed is calculated by the product of the drive speed v and the focus detection period T. Since the drive amount of the focus lens 104 between the frames is the maximum amount by which the focus lens 104 will overshoot the subject focus position, the offset amount is set based on this drive amount. In addition, the further away from the search start position, the higher the possibility that the focus lens 104 will overshoot the subject focus position. For this reason, by increasing the offset amount in proportion to the difference x between the search start position and the current position of the focus lens 104, the subject focus position can be easily captured within the driveable range even if it overshoots. In other words, since the possibility of overshooting is low at the start of the search, the driveable range is narrowed to reduce the risk of returning to the background. Then, since the risk of returning to the background decreases and the risk of overshooting increases when the focus lens 104 moves away from the start position, the driveable range is expanded in the search start direction to make it easier for the subject focus position to fall within the driveable range even if it overshoots. The above calculation method of the offset amount is merely an example, and it may be calculated by other methods. For example, the offset amount (that is, the focus drivable range) may be set based on only one of the drive speed of the focus lens 104 and the focus detection cycle.
[0090] On the other hand, in step S908, the camera MPU 125 sets the offset amount to 0. Then, the process proceeds to step S909, where the focus drivable range is calculated as described above, and this process ends.
[0091] FIG. 13C shows a state where the focus lens 104 has moved to a current position 1203 that is closer to the subject in-focus position than the state in FIG. 13B. In this state, since x≧Th2, an offset amount 1302c is set in the opposite direction to the search direction based on the drive speed of the focus lens 104, the focus detection cycle, and the difference x (step S907). A focus driveable range 1303c is set in the search direction from a position shifted from the current position 1203 in the opposite direction to the search direction by the offset amount 1302c. In this state, a defocus amount 1301c to the subject in-focus position is detected, and the subject in-focus position as the target position of the focus lens 104 based on the defocus amount 1301c is within the focus driveable range 1303c. Therefore, a focus drive amount 1304c is set based on the defocus amount 1301c (step S805).
[0092] In this way, the focus drivable range is set in the search direction from a position shifted by the offset amount in the opposite direction to the search direction from the current position of focus lens 104. This makes it possible to drive focus lens 104 to focus on the subject based on the defocus amount detected at the timing when the subject in-focus position is included in the focus drivable range.
[0093] FIG. 13D shows a state where the focus lens 104 has moved to a current position 1204 that has passed the subject focus position. Even in this state, since x≧Th2, the offset amount 1302d is set in the opposite direction to the search direction based on the drive speed of the focus lens 104, the focus detection cycle, and the difference x (step S907). The focus drivable range 1303d is set in the search direction from a position shifted by the offset amount 1302d in the opposite direction to the search direction from the current position 1204. Note that since the difference x is larger than in the state of FIG. 13C, the offset amount 1302d is larger than the offset amount 1302c. In this state, a defocus amount 1301d to the subject focus position located in the opposite direction to the search direction is detected, and the subject focus position as the target position of the focus lens 104 based on the defocus amount 1301d is within the focus drivable range 1303d. Therefore, the focus driving amount 1304d is set based on the defocus amount 1301d (step S806).
[0094] In this way, the focus drivable range is set in the search direction from a position shifted by the offset amount in the opposite direction to the search direction from the current position of focus lens 104. This makes it possible to drive focus lens 104 based on the defocus amount to focus on the subject, even if focus lens 104 passes the subject in-focus position in the search direction.
[0095] As described above, in this embodiment, the focus driveable range is set from a position shifted by the offset amount from the current position of the focus lens 104. Then, the focus drive amount is set depending on whether or not a focus detection result has been obtained for a position within the focus driveable range. This makes it possible to perform appropriate search AF for a subject desired by the user, and quickly obtain a focused state for the subject.
[0096] (Embodiment 2) Next, a description will be given of embodiment 2. In embodiment 2, the direction of the defocus amount as a result of focus detection (hereinafter, referred to as the defocus direction) is determined, and a search is performed by setting the driving amount of the focus lens depending on whether the defocus direction is the same as the search direction.
[0097] The configurations and imaging processing of the imaging system 10 and the image sensor 122 of the second embodiment are the same as those of the first embodiment. The positional relationship between the subject and the background, the subject signal and the background signal, and the relationship between the focus lens position and the focus detection result are also the same as those of the first embodiment.
[0098] <Search AF processing> Fig. 14 shows the search AF process executed in this embodiment in step S705 of Fig. 7. In step S1401, the camera MPU 125 acquires the search direction in the search instruction determined in step S704 of Fig. 7.
[0099] Next, in step S1402, the camera MPU 125 determines the defocus direction of the focus detection result acquired in step S701.
[0100] Next, in step S1403, camera MPU 125 calculates difference x between the search start position of focus lens 104 acquired in step S802 at the start of the search and the current position of focus lens 104 acquired in step S802 in the current frame.
[0101] Next, in step S1404, the camera MPU 125 determines whether the difference x is equal to or less than the third threshold Th3. If the difference x is equal to or less than the third threshold Th3, the process proceeds to step S1408, and if not, the process proceeds to step S1405.
[0102] In step S1405, the camera MPU 125 judges whether the search direction and the defocus direction were the same in a past (for example, previous) frame (a frame in which a reliable defocus amount could be obtained) in the range of x>Th3. If they were the same, proceed to step S1407, and if they were not the same, proceed to step S1406. This judgment takes into consideration the case where the focus lens 104 has overshot the subject focus position during the search. That is, if the search direction and the defocus direction were the same in the past frame (see FIG. 15(c) to be described later) and the search direction and the defocus direction are opposite in the current frame (see FIG. 15(d)), the subject focus position is deemed to have been overshot and proceed to step S1407. Also, if the search direction and the defocus direction were the same in the past frame and the search direction and the defocus direction are the same in the current frame (if the state shown in FIG. 15(c) continues), proceed to step S1407.
[0103] In step S1406, camera MPU 125 determines whether the search direction acquired in step S1401 in the current frame is the same as the defocus direction determined in step S1401. If they are the same, proceed to step S1407, and if they are not the same, proceed to step S1408. That is, if the search direction and the defocus direction are opposite to each other in the past frame (see FIG. 15(b)) and are the same to each other in the current frame (see FIG. 15(c)), proceed to step S1407. Also, if the search direction and the defocus direction are opposite to each other in the current frame and are also opposite to each other in the current frame (if the state as in FIG. 15(b) continues), proceed to step S1408.
[0104] In step S1407, the camera MPU 125 sets the focus driving amount based on the defocus amount of the current frame acquired in step S701, and then ends this process.
[0105] On the other hand, in step S1408, the camera MPU 125 sets a predetermined focus drive amount in the search direction acquired in step S801 without using the defocus amount acquired in step S701. The predetermined focus drive amount is a drive amount for search as in the first embodiment, and may be set according to the focus detection cycle, shooting distance, aperture value, imaging mode, etc. Then, the camera MPU 125 ends this process.
[0106] 15(a) to (d) show the relationship between the search direction, search start position, focus lens position, focus driveable range, defocus amount, and focus drive amount in this embodiment.
[0107] 15(a) shows the state at the start of a search, with focus lens 104 located at the search start position as current position 1201. In this state, since x(=0)≦Th3, a defocus amount 1501a to the background in-focus position is detected, but the defocus amount 1501a is not used, and a predetermined amount for the search is set as focus drive amount 1504a (step S1408).
[0108] In this way, when x≦Th3, the focus drive amount for the search is set without using the detected defocus amount, which makes it possible to search for the subject focus position without focusing on the background, even if the search start position is located in the opposite direction to the search direction from the background focus position.
[0109] 15B shows a state where the focus lens has moved from the search start position to a current position 1202 that is closer to the subject focus position than the background focus position. This state indicates a state where x>Th3, and the search direction and the defocus direction are opposite in each of the past frames and the current frame in the range of x>Th3 (no in steps S1405 and S1406). Therefore, a defocus amount 1501b to the background focus position is detected, but the defocus amount 1501b is not used, and a predetermined amount for the search is set as a focus drive amount 1504b (step S1408).
[0110] In this way, when the search direction and the defocus direction are opposite to each other, the focus drive amount for the search is set without using the detected defocus amount, which makes it possible to search for the subject focus position without focusing on the background even if the defocus amount to the background focus position is detected.
[0111] Fig. 15(c) shows a state where the focus lens 104 has moved to a current position 1203 that is closer to the subject focus position than in the state of Fig. 15(b). In this state, x>Th3, and the search direction and the defocus direction are opposite in the past frame (Fig. 15(b)) in the range of x>Th3 (no in step S1405), but are the same in the current frame (yes in step S1406). Therefore, a focus drive amount 1504c is set based on a defocus amount 1501c to the subject focus position detected in the current frame (step S1407).
[0112] In this way, when the search direction and the detection direction are the same, the focus drive amount is set based on the detected defocus amount, making it possible to drive the focus lens 104 to focus on the subject based on the defocus amount detected at the timing when the defocus direction becomes the same as the search direction.
[0113] Fig. 15(d) shows a state where the focus lens 104 has moved to a current position 1204, past the subject in-focus position. In this state, x>Th3, and the search direction and the defocus direction are opposite in the current frame, but in a past frame (Fig. 15(c)) in the range of x>Th3, the search direction and the defocus direction are the same (yes in step S1405). Therefore, a focus drive amount 1504d is set based on a defocus amount 1501d detected in the current frame (step S1407).
[0114] In this way, when the search direction and the defocus direction are the same in the previous frame, the focus drive amount is set based on the detected defocus amount. As a result, even if the focus lens 104 passes the subject in-focus position, the defocus amount to the subject in-focus position located in the opposite direction to the search direction is detected, and the focus lens 104 can be driven based on the defocus amount to focus on the subject.
[0115] As described above, according to the second embodiment, the focus drive amount is set according to the determination result of whether the search direction and the defocus direction are the same direction or not. Furthermore, when x>Th3, after the defocus direction in the previous frame becomes the same direction as the search direction, the focus lens 104 is driven based on the defocus amount in the current frame regardless of the defocus direction in the current frame thereafter. This allows appropriate search AF to be performed for a subject desired by the user, and makes it possible to quickly obtain a focused state for the subject.
[0116] In the above-mentioned embodiments, the search direction is set in a direction from the side where the shooting distance to be focused is long to the side where the shooting distance is short, and the subject is focused on while avoiding focusing on the background. In contrast, the search direction may be set in a direction from the side where the shooting distance is short to the side where the shooting distance is long, and the same search AF as in the above-mentioned embodiments may be performed. For example, when capturing an image of an animal in a cage, it is possible to focus on the animal in the cage (the side where the shooting distance is long) while avoiding focusing on the cage in front (the side where the shooting distance is short).
[0117] The above embodiment includes the following configurations.
[0118] (Configuration 1) A focus detection unit that performs focus detection using a phase difference detection method; a control unit that controls driving of a focus lens included in the optical system based on a focus detection result obtained by the focus detection; The control means In a search operation in which the focus detection result is obtained while driving the focus lens in a search direction, a driveable range of the focus lens is set based on the search direction and a position of the focus lens; a focus control device which drives the focus lens based on the focus detection result when the focus detection result is obtained for a position within the driveable range, and drives the focus lens in the search direction without using the focus detection result when the focus detection result is obtained for a position outside the driveable range. (Configuration 2) 2. The focus control device according to configuration 1, wherein the control means sets the drivable range based on a difference between a start position of the search operation of the focus lens and the actual position. (Configuration 3) 3. The focus control device according to claim 2, wherein the control means sets the drivable range from a position that is an offset amount that is set based on the difference from the position of the focus lens. (Configuration 4) The focus control device according to configuration 3, characterized in that the control means sets the offset amount in the same direction as the search direction when the difference is smaller than a first threshold, and sets the offset amount in the opposite direction to the search direction when the difference is larger than a second threshold that is larger than the first threshold. (Configuration 5) 5. The focus control device according to any one of configurations 1 to 4, wherein the control means sets the drivable range based on an amount of blur of a subject image that can be detected by the focus detection means. (Configuration 6) 6. The focus control device according to any one of configurations 1 to 5, wherein the control means sets the drivable range based on optical information of the optical system. (Configuration 7) The focus control device according to any one of configurations 1 to 6, characterized in that the control means sets the drivable range based on at least one of a drive speed of the focus lens and a cycle at which the focus detection is performed. (Configuration 8) The focus control device according to any one of configurations 1 to 7, further comprising an instruction means for allowing a user to specify at least one of the search directions, that is, a direction in which the focusing distance becomes shorter from the side where the focusing distance is long and a direction in which the focusing distance becomes longer from the side where the focusing distance is short. (Configuration 9) A focus detection unit that performs focus detection using a phase difference detection method; a control unit that controls driving of a focus lens based on a focus detection result obtained by the focus detection; In a search operation for obtaining the focus detection result while driving the focus lens in a search direction, the control unit driving the focus lens based on the focus detection result when a difference between the position of the focus lens and a start position of the search operation is greater than a threshold value and the direction of the focus detection result is the same as the search direction; 2. A focus control device comprising: a focus lens driving unit that drives the focus lens in the search direction without using the focus detection result when the direction of the focus detection result is opposite to the search direction. (Configuration 10) The focus control device described in configuration 9, characterized in that after the difference becomes larger than the threshold value and the direction of the focus detection result becomes the same direction as the search direction, the control means drives the focus lens based on the focus detection result regardless of the direction of the focus detection result. (Configuration 11) The focus control device according to configuration 9 or 10, further comprising an instruction means for allowing a user to specify at least one of the search directions, that is, a direction in which the focusing distance becomes shorter from the side where the focusing distance is long and a direction in which the focusing distance becomes longer from the side where the focusing distance is short. (Configuration 12) A focus control device according to any one of configurations 1 to 11, and an image sensor for capturing an image of a subject through the optical system.
[0119] (Other Examples) The present invention can also be realized by a process in which a program for implementing one or more of the functions of the above-described embodiments is supplied to a system or device via a network or a storage medium, and one or more processors in a computer of the system or device read and execute the program. The present invention can also be realized by a circuit (e.g., ASIC) that implements one or more of the functions.
[0120] The embodiments described above are merely representative examples, and various modifications and alterations are possible for each embodiment when implementing the present invention. [Explanation of symbols]
[0121] 100 Lens unit 104 Focus Lens 120 Camera body 125 Camera MPU 129 Phase difference AF section
Claims
1. A focus detection means for performing focus detection; a control unit that controls the driving of a focus lens included in the optical system based on a focus detection result obtained by the focus detection; The control means In a search operation in which the focus detection result is obtained while the focus lens is driven in a search direction in accordance with an instruction from a user, a driveable range of the focus lens is set based on the search direction and a position of the focus lens; a focus control device that drives the focus lens based on the focus detection result when the focus detection result is obtained within the drivable range, and drives the focus lens in the search direction without using the focus detection result when the focus detection result is obtained outside the drivable range.
2. 2. The focus control device according to claim 1, wherein the control means sets the drivable range based on a difference between a start position of the search operation of the focus lens and a current position of the focus lens.
3. 3. The focus control device according to claim 2, wherein the control means sets the drivable range from a position that is spaced apart by an offset amount that is set based on the difference.
4. 4. The focus control device according to claim 3, wherein the control means sets the offset amount in the same direction as the search direction when the difference is smaller than a first threshold, and sets the offset amount in the opposite direction to the search direction when the difference is larger than a second threshold that is larger than the first threshold.
5. A focus control device as described in Claim 1, characterized in that the focus detection means performs focus detection using an image plane phase difference detection method based on focus detection signals as a pair of image signals having parallax from each other.
6. 6. The focus control device according to claim 5, wherein the control means sets the drivable range based on the amount of blur of the subject image that can be detected by the focus detection means.
7. 2. The focus control device according to claim 1, wherein the control means sets the drivable range based on optical information of the optical system.
8. 2. The focus control device according to claim 1, wherein the control means sets the drivable range based on at least one of a drive speed of the focus lens and a cycle at which the focus detection is performed.
9. 2. The focus control device according to claim 1, further comprising an instruction means for allowing a user to specify at least one of a direction in which the focusing distance becomes shorter from the side where the focusing distance is longer and a direction in which the focusing distance becomes longer from the side where the focusing distance is shorter as the search direction.
10. A focus detection means for performing focus detection; a control means for controlling the driving of the focus lens based on a focus detection result obtained by the focus detection; The control unit, in a search operation for obtaining the focus detection result while driving the focus lens in a search direction in accordance with an instruction from a user, driving the focus lens based on the focus detection result when the difference between the current position of the focus lens and the start position of the search operation is greater than a threshold value and the direction of the focus detection result is the same as the search direction; A focus control device comprising: a focus detection unit that drives the focus lens in the search direction without using the focus detection result when the direction of the focus detection result is opposite to the search direction;
11. 11. The focus control device according to claim 10, wherein the control means drives the focus lens based on the focus detection result regardless of the direction of the focus detection result after the difference becomes larger than the threshold value and the direction of the focus detection result becomes the same as the search direction.
12. 11. The focus control device according to claim 10, further comprising an instruction means for allowing a user to specify at least one of a direction in which the focusing distance becomes shorter from the side where the focusing distance is longer and a direction in which the focusing distance becomes longer from the side where the focusing distance is shorter as the search direction.
13. A focus control device according to any one of claims 1 to 12; and an image sensor that captures an image of a subject through the optical system.
14. A step of performing focus detection; and controlling the driving of a focus lens included in the optical system based on a focus detection result obtained by the focus detection. In a search operation in which the focus detection result is obtained while the focus lens is driven in a search direction in accordance with an instruction from a user, a driveable range of the focus lens is set based on the search direction and a position of the focus lens; a focus control method for driving the focus lens based on the focus detection result when the focus detection result is obtained within the drivable range, and for driving the focus lens in the search direction without using the focus detection result when the focus detection result is obtained outside the drivable range.
15. A step of performing focus detection; and controlling the driving of the focus lens based on a focus detection result obtained by the focus detection. In a search operation for obtaining the focus detection result while driving the focus lens in a search direction in accordance with an instruction from a user, driving the focus lens based on the focus detection result when the difference between the current position of the focus lens and the start position of the search operation is greater than a threshold value and the direction of the focus detection result is the same as the search direction; a focus control method for controlling a focus lens in a direction opposite to the search direction, the focus detection result being ignored and the focus lens being driven in the search direction when the direction of the focus detection result is opposite to the search direction;
16. 16. A program causing a computer to execute processing according to the focus control method of claim 14.