Imaging device

The imaging device employs a dual-pixel autofocus system with dual focus detection regions to improve focusing accuracy by using focus detection pixels and imaging pixels, effectively addressing the challenges of varying exit pupil distances and subject clarity.

WO2025074900A1PCT designated stage expired Publication Date: 2025-04-10NIKON CORP
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/JP2024/033883
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-10-02
Filing Date
2024-09-24
Publication Date
2025-04-10

AI Technical Summary

Technical Problem

Existing imaging devices face challenges in achieving precise focusing accuracy, particularly in scenarios where the subject is not clearly defined or when the exit pupil distance varies, affecting the focus detection accuracy.

Method used

The imaging device incorporates a dual-pixel autofocus system with first and second focus detection regions, utilizing focus detection pixels and imaging pixels to perform focus detection and image generation. A control unit adjusts focus detection based on contrast evaluation from the imaging pixels, improving focusing accuracy.

Benefits of technology

This configuration enhances focusing accuracy by accurately detecting defocus amounts and adjusting the focus lens position based on contrast evaluation, ensuring the subject is properly focused even in varying exit pupil distance conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure JP2024033883_10042025_PF_FP_ABST
    Figure JP2024033883_10042025_PF_FP_ABST
Patent Text Reader

Abstract

This imaging device includes: an imaging portion having a first pixel that photoelectrically converts light transmitted through an optical system and outputs a signal used for focus detection, and a second pixel that photoelectrically converts the light transmitted through the optical system and outputs a signal used for image generation; a focus detection portion that performs focus detection of the optical system on the basis of the signal output from the first pixel; an evaluation portion that evaluates, in a region including a subject in an image based on the signal output from the second pixel, contrast of the image on the basis of the signal output from the second pixel; and a control portion that controls the focus detection by the focus detection portion on the basis of the evaluation by the evaluation portion.
Need to check novelty before this filing date? Find Prior Art

Description

Imaging device

[0001] This relates to an imaging device.

[0002] Various methods have been proposed for focusing on a desired subject (for example, see Japanese Patent Application Laid-Open No. 2003-122294). Improvements in focusing accuracy have been desired for some time.

[0003] JP 2014-132321 A

[0004] According to one aspect of the disclosure, an imaging device includes an imaging unit having a first pixel that photoelectrically converts light that has passed through an optical system and outputs a signal used for focus detection, and a second pixel that photoelectrically converts light that has passed through the optical system and outputs a signal used for image generation, a focus detection unit that performs focus detection of the optical system based on the signal output from the first pixel, an evaluation unit that evaluates the contrast of the image based on the signal output from the second pixel in an area including a subject in the image based on the signal output from the second pixel, and a control unit that controls focus detection by the focus detection unit based on the evaluation by the evaluation unit.

[0005] The configurations of the embodiments described below may be modified as appropriate, and at least a portion of the configuration may be replaced with other components. Furthermore, components that are not particularly limited in terms of their placement may be placed in any position that can achieve their function, not limited to the placement disclosed in the embodiments.

[0006] FIG. 1 is a diagram illustrating an example of the configuration of an imaging device according to an embodiment. FIG. 2A is a diagram illustrating a first focus detection area on the imaging surface of an image sensor, and FIG. 2B is a diagram illustrating a second focus detection area on the imaging surface of the image sensor. FIG. 3 is a diagram illustrating an example of the arrangement of pixels within the first and second focus detection areas. FIGS. 4A to 4C are diagrams illustrating an example of the configuration of focus detection pixels and imaging pixels provided in a pixel unit. FIG. 5 is a diagram illustrating an image generated based on signals from imaging pixels, the first focus detection area, and an AF frame indicating that a subject detected by the subject detection unit is to be focused, superimposed on each other. FIG. 6 is a flowchart (part 1) illustrating an example of processing executed by the body control unit according to this embodiment. FIG. 7 is a flowchart (part 2) illustrating an example of processing executed by the body control unit according to this embodiment. FIG. 8 is a flowchart (part 3) illustrating an example of processing executed by the body control unit according to this embodiment. FIGS. 9A to 9D are diagrams illustrating the contrast evaluation value calculated by the second focus detection unit. 10A to 10D are diagrams illustrating the relationship between the focus state of a subject and the contrast evaluation value. Fig. 11A is a diagram illustrating an image generated based on signals from imaging pixels, a first focus detection area, and an AF frame indicating that the subject detected by the subject detection unit is to be focused on, superimposed on the image. Fig. 11B is a diagram illustrating an image generated based on signals from imaging pixels, a second focus detection area, and an AF frame indicating that the subject detected by the subject detection unit is to be focused on, superimposed on the image. Fig. 12A is a diagram illustrating the position of the focus lens obtained when a scanning operation is performed and an example of the reliability that the subject detected by the subject detection unit is a predetermined subject. Fig. 12B is a diagram illustrating an image generated based on signals output from imaging pixels when the focus lens is at position P1 in Fig. 12A. Fig. 12C is a diagram illustrating the distribution of contrast evaluation values ​​in a region including the subject in the image shown in Fig. 12B.Figure 13(A) is a diagram showing an image generated based on signals from imaging pixels and an AF frame, Figure 13(B) is a diagram showing an example of the defocus amount in each first focus detection area within the AF frame, and Figure 13(C) is a diagram showing an example of the contrast evaluation value in each first focus detection area within the AF frame.

[0007] An electronic camera 1 (hereinafter referred to as camera 1) as an example of an imaging device according to an embodiment will be described below with reference to FIGS.

[0008] 1 is a diagram showing an example of the configuration of an electronic camera 1 (hereinafter referred to as camera 1) according to one embodiment. The camera 1 comprises a camera body 2 and an interchangeable lens 3. Because the camera 1 comprises the camera body 2 and the interchangeable lens 3, it is sometimes referred to as a camera system.

[0009] (Interchangeable Lens 3) The interchangeable lens 3 includes a lens-side mount unit 301, a photographing optical system (imaging optical system) 31, a lens control unit 32, and a lens memory 33. The lens-side mount unit 301 includes a lens-side connection unit 302. The lens-side connection unit 302 has multiple terminals, such as a terminal for a clock signal, a terminal for a data signal, and a terminal for power supply. The interchangeable lens 3 is detachably attached to the camera body 2 by the lens-side mount unit 301 and a body-side mount unit 201, which will be described later.

[0010] The photographic optical system 31 includes a plurality of lenses, including a zoom lens (variable magnification lens) 31a that changes the focal length and a focus lens (focus adjustment lens) 31b, and an aperture 31c, and forms a subject image on the imaging surface 22a of the image sensor 22. Note that although the zoom lens 31a and the focus lens 31b are shown in Fig. 1 as a schematic illustration, a typical photographic optical system is generally made up of a large number of optical elements.

[0011] The photographing optical system 31 of the interchangeable lens 3 has an optical characteristic in which the position of its exit pupil, i.e., the exit pupil distance, changes depending on the image height. In other words, the exit pupil distance of the photographing optical system 31 changes depending on the position on the imaging plane 22a, i.e., the distance from the optical axis OA1 of the photographing optical system 31 to the imaging plane 22a. The optical axis OA1 of the photographing optical system 31 intersects with the imaging plane 22a at the center of the imaging plane 22a. In other words, the exit pupil distance of the photographing optical system 31 changes depending on the distance from the center of the imaging plane 22a. Here, the exit pupil distance is the distance between the exit pupil of the photographing optical system 31 and the image plane of the image formed by the photographing optical system 31. The imaging plane 22a of the image sensor 22 is, for example, the surface on which a photoelectric conversion unit (described later) or a microlens is arranged.

[0012] The photographic optical system 31 differs depending on the type of interchangeable lens 3 attached to the body side mount unit 201. Therefore, the exit pupil distance of the photographic optical system 31 differs depending on the type of interchangeable lens 3. Furthermore, the optical characteristics of the exit pupil distance, which changes depending on the image height, also differ depending on the type of interchangeable lens 3.

[0013] The lens control unit 32 is configured with a processor such as a CPU, FPGA, or ASIC, and memories such as ROM and RAM, and controls each part of the interchangeable lens 3 based on a control program. The lens control unit 32 controls the position of the zoom lens 31a, the position of the focus lens 31b, and the drive of the diaphragm 31c based on signals output from the body control unit 21 of the camera body 2. When a signal indicating the movement direction and amount of the focus lens 31b is input from the body control unit 21, the lens control unit 32 moves the focus lens 31b back and forth along the optical axis OA1 based on the signal to adjust the focal position of the photographic optical system 31.

[0014] The lens memory 33 is composed of, for example, a non-volatile storage medium. Information related to the interchangeable lens 3 is stored (recorded) in the lens memory 33 as lens information. The lens information includes data on the optical characteristics of the photographic optical system 31, data on the infinity position and close position of the focus lens 31b, and data on the shortest focal length and longest focal length of the interchangeable lens 3. The optical characteristics of the photographic optical system 31 include the exit pupil distance and F-number (aperture value of the diaphragm 31c). The lens information differs depending on the type of interchangeable lens 3. The lens information may also be stored in an internal memory of the lens control unit 32. The lens information may also be stored in a body memory 23 included in the camera body 2, which will be described later. In this case, the body memory 23 stores lens information for multiple interchangeable lenses 3.

[0015] In this embodiment, the lens information includes information regarding the exit pupil distance of the photographing optical system 31. The information regarding the exit pupil distance includes information indicating the exit pupil distance (Co) at the position where the imaging plane 22a and the optical axis OA1 intersect (the position where the image height is zero) and information regarding a coefficient included in an arithmetic expression expressing the relationship between the exit pupil distance and the image height. The writing of data to the lens memory 33 and the reading of data from the lens memory 33 are controlled by the lens control unit 32. When the interchangeable lens 3 is attached to the camera body 2, the lens control unit 32 transmits the lens information to the body control unit 21 via the terminals of the lens side connection unit 302 and the body side connection unit 202. The lens control unit 32 also transmits to the body control unit 21 position information (focal length information) of the controlled zoom lens 31a, position information of the controlled focus lens 31b, information regarding the F-number of the controlled aperture 31c, and the like.

[0016] The lens control unit 32 communicates by sending and receiving information bidirectionally between the camera body 2 and the interchangeable lens 3 via the terminals of the lens-side connection unit 302 and the body-side connection unit 202. When a signal requesting the transmission of information regarding the exit pupil distance is input from the camera body 2, the lens control unit 32 transmits information regarding the exit pupil distance to the camera body 2. Note that the information regarding the exit pupil distance differs depending on the type of interchangeable lens 3. The lens control unit 32 may also transmit information regarding the exit pupil distance to the camera body 2 each time the image sensor 22 captures an image. The lens control unit 32 may also transmit information regarding the exit pupil distance to the camera body 2 when the zoom lens 31a moves and the focal length of the photographic optical system 31 changes. The lens control unit 32 may transmit information regarding the focal length of the photographic optical system 31 and information regarding the exit pupil distance to the camera body 2 in a single bidirectional communication.

[0017] (Camera Body 2) The camera body 2 includes a body-side mount unit 201, an image sensor 22, a body memory 23, a display unit 24, an operation unit 25, and a body control unit 21.

[0018] The body side mount section 201 includes a body side connection section 202. The body side connection section 202 has a plurality of terminals, such as a terminal for a clock signal, a terminal for a data signal, and a terminal for power supply.

[0019] When the interchangeable lens 3 is attached to the camera body 2, a terminal provided on the body-side connector 202 is electrically connected to a terminal provided on the lens-side connector 302. This enables power to be supplied from the camera body 2 to the interchangeable lens 3 and communication between the camera body 2 and the interchangeable lens 3.

[0020] The imaging element 22 is a CMOS image sensor or a CCD image sensor. The imaging element 22 captures an image of a subject formed by the photographing optical system 31. The imaging element 22 includes a pixel unit 221 in which a plurality of pixels each having a photoelectric conversion unit are arranged two-dimensionally (in the row and column directions), and a control unit 222 that controls the pixel unit 221. The photoelectric conversion unit is composed of a photodiode (PD).

[0021] As will be described later, the pixel unit 221 includes imaging pixels that photoelectrically convert received light using a photoelectric conversion unit to output signals used for image generation, and focus detection pixels that photoelectrically convert received light using a photoelectric conversion unit to output signals used for focus detection. The imaging pixels include pixels (hereinafter referred to as R pixels) that have filters with spectral characteristics that separate incident light in a first wavelength range (red (R) light), pixels (hereinafter referred to as G pixels) that have filters with spectral characteristics that separate incident light in a second wavelength range (green (G) light), and pixels (hereinafter referred to as B pixels) that have filters with spectral characteristics that separate incident light in a third wavelength range (blue (B) light). The R, G, and B pixels are arranged in a Bayer array. The focus detection pixels are arranged to replace some of the imaging pixels and are distributed across substantially the entire imaging surface 22a of the image sensor 22.

[0022] The control unit 222 causes the focus detection pixels to output signals based on instruction signals from the body control unit 21. The control unit 222 also causes the imaging pixels to output signals based on instruction signals from the body control unit 21.

[0023] The body memory 23 is composed of, for example, a non-volatile storage medium, etc. Image data, control programs, etc. are recorded in the body memory 23. Writing data to the body memory 23 and reading data from the body memory 23 are controlled by the body control unit 21. The display unit 24 displays an image based on the image data, an image showing a focus detection area (AF area) such as an AF frame, information related to shooting such as the shutter speed and F-number, a menu screen, etc.

[0024] The operation unit 25 includes various setting switches such as a release button, a power switch, and switches for switching between various modes, and outputs operation signals corresponding to the respective operations to the body control unit 21. The operation unit 25 is also a setting unit that can set an arbitrary focus detection area from a plurality of focus detection areas, and the user can select an arbitrary focus detection area by operating the operation unit 25.

[0025] The body control unit 21 is configured with a processor such as a CPU, FPGA, or ASIC, and memories such as ROM and RAM, and controls each unit of the camera 1 based on a control program. The body control unit 21 has an image data generation unit 211, a subject detection unit 212, an area setting unit 213, a selection unit 214, a focus detection unit 215, an evaluation unit 216, and a position control unit 217. The image data generation unit 211, the subject detection unit 212, the area setting unit 213, the selection unit 214, the focus detection unit 215, the evaluation unit 216, and the position control unit 217 are realized, for example, by the processor executing a program.

[0026] The image data generation unit 211 generates image data by performing various image processing on signals output from the imaging pixels 13 of the image sensor 22. Note that the image data generation unit 211 may also generate image data using signals output from the focus detection pixels.

[0027] The subject detection unit 212 detects a predetermined subject from an image based on the image data generated by the image data generation unit 211. For example, when a "bird mode" suitable for photographing wild birds or the like is set as the shooting mode, the subject detection unit 212 detects a bird as the subject. When an "airplane mode" suitable for photographing airplanes is set as the shooting mode, the subject detection unit 212 detects an airplane as the subject. When a "portrait mode" suitable for photographing people is set as the shooting mode, the subject detection unit 212 detects a person as the subject.

[0028] The area setting unit 213 sets (selects) at least one first focus detection area 101 from among the plurality of first focus detection areas 101 provided on the imaging surface 22a of the image sensor 22 shown in FIG. 2A.

[0029] 2A is a diagram showing the first focus detection area 101 on the imaging surface 22a of the image sensor 22, and FIG. 2B is a diagram showing the second focus detection area 102 on the imaging surface 22a of the image sensor 22. The height H1 of the first focus detection area 101 in the Y direction is equal to the height H2 of the second focus detection area 102 in the Y direction. Meanwhile, the length L1 of the first focus detection area 101 in the X direction is shorter than the length L2 of the second focus detection area 102 in the X direction. Therefore, the second focus detection area 102 is larger than the first focus detection area 101. The second focus detection area 102 is set so as to overlap with at least one portion of the first focus detection area 101 (so as to include at least one portion of the first focus detection area 101).

[0030] The multiple AF frames displayed on the display unit 24 correspond to the multiple first focus detection areas 101 provided on the image sensor 22. The area setting unit 213 sets, for example, the first focus detection area 101 corresponding to the AF frame selected by the user by operating the operation unit 25 from among the multiple AF frames displayed on the display unit 24, or the first focus detection area 101 corresponding to the AF frame including the subject detected by the subject detection unit 212, as the area in which focus detection is performed.

[0031] In addition to imaging pixels, multiple types of pairs of focus detection pixels (AF pixel pairs) are arranged in each first focus detection area 101. Note that the second focus detection area 102 includes at least one of the first focus detection areas 101, and therefore, like the first focus detection area 101, the second focus detection area 102 also has multiple types of pairs of focus detection pixels (AF pixel pairs) arranged in addition to imaging pixels.

[0032] 3 is a diagram showing an example of the arrangement of pixels in the first focus detection area 101 and the second focus detection area 102. In Fig. 3, a first pixel group 401 in which R pixels 13 and G pixels 13 are arranged alternately in the ±X directions, i.e., in the row direction, and a second pixel group 402 in which G pixels 13 and B pixels 13 are arranged alternately in the ±Y directions, i.e., in the column direction, are arranged alternately. The imaging pixels 13 are arranged according to a Bayer array.

[0033] Some of the multiple second pixel groups 402 include the first or second focus detection pixel 11, 12. The first and second focus detection pixels 11, 12 each have a light-shielding portion 43. In FIG. 3 , the second pixel groups 402 including the first focus detection pixel 11 are indicated as second pixel groups 402a, 402c, and 402e, and the second pixel groups 402 including the second focus detection pixel 12 are indicated as second pixel groups 402b, 402d, and 402f. The second pixel groups 402a, 402c, and 402e including the first focus detection pixel 11 and the second pixel groups 402b, 402d, and 402f including the second focus detection pixel 12 will be described below.

[0034] In the second pixel group 402a, the B pixels 13 are replaced with the first focus detection pixels 11a. In the second pixel group 402a, the first focus detection pixels 11a and the G pixels 13 are arranged alternately. The photoelectric conversion units of the first focus detection pixels 11a receive light beams that have passed through one of the first and second pupil regions of the exit pupil of the photographing optical system 31. The light-shielding units 43 of the first focus detection pixels 11a block light beams that have passed through the other of the first and second pupil regions of the exit pupil of the photographing optical system 31. In the following description, it is assumed that the photoelectric conversion units of the first focus detection pixels 11a receive light beams that have passed through the first pupil region of the exit pupil of the photographing optical system 31. It is assumed that the light-shielding units 43 of the first focus detection pixels 11a block light beams that have passed through the second pupil region of the exit pupil of the photographing optical system 31.

[0035] In the second pixel group 402b, which is a predetermined number of rows away from the second pixel group 402a, the B pixels 13 are replaced with second focus detection pixels 12a. In the second pixel group 402b, the second focus detection pixels 12a and G pixels 13 are arranged alternately. The photoelectric conversion units of the second focus detection pixels 12a receive light beams that have passed through a pupil region of an exit pupil different from that of the first focus detection pixel 11a. The light-shielding units 43 of the second focus detection pixels 12a block light beams that have passed through a pupil region of an exit pupil different from that of the first focus detection pixel 11a. In the following description, the photoelectric conversion units of the second focus detection pixels 12a receive light beams that have passed through a second pupil region of the exit pupil of the photographing optical system 31. The light-shielding units 43 of the second focus detection pixels 12a block light beams that have passed through a first pupil region of the exit pupil of the photographing optical system 31.

[0036] The arrangement position of the first focus detection pixel 11a in the second pixel group 402a and the arrangement position of the second focus detection pixel 12a in the second pixel group 402b are the same, i.e., the first focus detection pixel 11a and the second focus detection pixel 12a are arranged in the same column.

[0037] The first focus detection pixel 11a of the second pixel group 402a and the second focus detection pixel 12a of the second pixel group 402b constitute a first AF pixel pair PR1. Note that the second pixel group 402a and the second pixel group 402b may be arranged in multiple rows, and multiple first AF pixel pairs PR1 may be arranged.

[0038] In the second pixel group 402c, which is a predetermined number of rows away from the second pixel group 402b, the B pixels 13 are replaced with the first focus detection pixels 11b. In the second pixel group 402c, the first focus detection pixels 11b and G pixels 13 are arranged alternately. Like the first focus detection pixel 11a, the photoelectric conversion unit of the first focus detection pixel 11b receives the light beam that has passed through a first pupil region of the exit pupil of the photographing optical system 31. Like the light-shielding unit 43 of the first focus detection pixel 11a, the light-shielding unit 43 of the first focus detection pixel 11b blocks the light beam that has passed through a second pupil region of the exit pupil of the photographing optical system 31.

[0039] In a second pixel group 402d, which is a predetermined number of rows away from the second pixel group 402c, the B pixels 13 are replaced with second focus detection pixels 12b. In the second pixel group 402d, the second focus detection pixels 12b and G pixels 13 are arranged alternately. Like the second focus detection pixel 12a, the photoelectric conversion units of the second focus detection pixels 12b receive light beams that have passed through a second pupil region of the exit pupil of the photographing optical system 31. Like the light-shielding unit 43 of the second focus detection pixel 12a, the light-shielding unit 43 of the second focus detection pixel 12b blocks light beams that have passed through a first pupil region of the exit pupil of the photographing optical system 31.

[0040] The arrangement position of the first focus detection pixel 11b in the second pixel group 402c and the arrangement position of the second focus detection pixel 12b in the second pixel group 402d are the same, i.e., the first focus detection pixel 11b and the second focus detection pixel 12b are arranged in the same column.

[0041] The first focus detection pixel 11b of the second pixel group 402c and the second focus detection pixel 12b of the second pixel group 402d constitute a second AF pixel pair PR2. Note that the second pixel group 402c and the second pixel group 402d may be arranged in multiple rows, and multiple second AF pixel pairs PR2 may be arranged.

[0042] In a second pixel group 402e, which is a predetermined number of rows away from the second pixel group 402d, the B pixels 13 are replaced with first focus detection pixels 11c. In the second pixel group 402e, the first focus detection pixels 11c and G pixels 13 are arranged alternately. The photoelectric conversion unit of the first focus detection pixel 11c, like the first focus detection pixels 11a and 11b, receives light beams that have passed through a first pupil region of the exit pupil of the photographing optical system 31. The light-shielding unit 43 of the first focus detection pixel 11c, like the light-shielding units 43 of the first focus detection pixels 11a and 11b, blocks light beams that have passed through a second pupil region of the exit pupil of the photographing optical system 31.

[0043] In a second pixel group 402f, which is a predetermined number of rows away from the second pixel group 402e, the B pixels 13 are replaced with second focus detection pixels 12c. In the second pixel group 402f, the second focus detection pixels 12c and the G pixels 13 are arranged alternately. The photoelectric conversion units of the second focus detection pixels 12c receive light beams that have passed through a second pupil region of the exit pupil of the photographing optical system 31. The light-shielding units 43 of the second focus detection pixels 12c, like the light-shielding units 43 of the second focus detection pixels 12a and 12b, block light beams that have passed through a first pupil region of the exit pupil of the photographing optical system 31.

[0044] The position of the first focus detection pixel 11c in the second pixel group 402e and the position of the second focus detection pixel 12c in the second pixel group 402f are the same, i.e., the first focus detection pixel 11c and the second focus detection pixel 12c are arranged in the same column.

[0045] The first focus detection pixel 11c of the second pixel group 402e and the second focus detection pixel 12c of the second pixel group 402f constitute a third AF pixel pair PR3. Note that the second pixel group 402e and the second pixel group 402f may be arranged in multiple rows, and multiple third AF pixel pairs PR3 may be arranged.

[0046] The areas of the light-shielding portions 43 of the first AF pixel pair PR1, the second AF pixel pair PR2, and the third AF pixel pair PR3 are different, except for pixel pairs located around the optical axis OA1 of the photographing optical system 31 (the center of the image pickup surface 22a). When the exit pupil distance is different, the angle of incidence of light incident on the focus detection pixels is different, except for focus detection pixels located around the optical axis OA1 of the photographing optical system 31. The shorter the exit pupil distance, the larger the angle of incidence, and the longer the exit pupil distance, the smaller the angle of incidence. The areas of the light-shielding portions 43 differ for each AF pixel pair in order to block a portion of the light incident at different angles depending on the exit pupil distance. This allows the focus detection unit 215 and the evaluation unit 216 to accurately detect the defocus amount even at different exit pupil distances. However, the angle of incidence of pixel pairs located around the optical axis OA1 of the photographing optical system 31 (the center of the image pickup surface 22a) is 0° regardless of the exit pupil distance. Therefore, the areas of the light-shielding portions 43 of the first AF pixel pair PR1, the second AF pixel pair PR2, and the third AF pixel pair PR3 located around the optical axis OA1 (center of the imaging surface 22a) of the photographing optical system 31 are the same. The areas of the light-shielding portions 43 also differ depending on the position (image height) of the focus detection pixel.

[0047] In this embodiment, the first focus detection pixels 11a to 11c and the second focus detection pixels 12a to 12c each have a filter with spectral characteristics that separates light in a second wavelength range (green (G) light) from the incident light. Note that the filters of the first focus detection pixels 11a to 11c and the second focus detection pixels 12a to 12c may also be filters with spectral characteristics that separate light in a first wavelength range (red (R) light) or light in a third wavelength range (blue (B) light). Furthermore, the first focus detection pixels 11a to 11c and the second focus detection pixels 12a to 12c may also have filters with spectral characteristics that separate light in the first, second, and third wavelength ranges from the incident light.

[0048] 4A to 4C are diagrams illustrating exemplary configurations of focus detection pixels and imaging pixels provided in the pixel section 221. Fig. 4A shows an exemplary cross section of the first focus detection pixel 11 of the first and second focus detection pixels 11, 12 that make up an AF pixel pair, and Fig. 4B shows an exemplary cross section of the second focus detection pixel 12 of the first and second focus detection pixels 11, 12. Fig. 4C shows an exemplary cross section of an imaging pixel 13 (R pixel, G pixel, B pixel).

[0049] 4A to 4C, the first and second focus detection pixels 11, 12 and the imaging pixel 13 each have a microlens 44, a color filter 51, and a photoelectric conversion unit 42 (PD 42). The photoelectric conversion unit 42 photoelectrically converts light that has transmitted (passed) through the microlens 44 and the color filter 51. A first light beam 61 is a light beam that has passed through a first pupil region that divides the exit pupil of the photographing optical system 31 into approximately two equal parts. A second light beam 62 is a light beam that has passed through a second pupil region that divides the exit pupil of the photographing optical system 31 into approximately two equal parts.

[0050] In FIG. 4A , the first focus detection pixel 11 is provided with a light-shielding portion 43 that blocks the second light beam 62 of the first and second light beams 61, 62. The light-shielding portion 43 is located between the color filter 51 and the photoelectric conversion portion 42 and is provided on the photoelectric conversion portion 42. In the example shown in FIG. 4A , the light-shielding portion 43 is disposed so as to block the left half (the −X direction side) of the photoelectric conversion portion 42. The right end (the end in the +X direction) of the light-shielding portion 43 approximately coincides with the center line that divides the photoelectric conversion portion 42 into left and right halves. The photoelectric conversion portion 42 of the first focus detection pixel 11 receives the first light beam 61. The photoelectric conversion portion 42 of the first focus detection pixel 11 photoelectrically converts the first light beam 61 to generate an electric charge, and the first focus detection pixel 11 outputs a first signal Sig1 based on the electric charge generated by the photoelectric conversion portion 42.

[0051] The area of ​​the light-shielding portion 43 varies depending on the position (image height) of the first focus detection pixel 11, except for the first focus detection pixels 11 located around the optical axis OA1 (center of the image pickup surface 22a) of the photographing optical system 31. When the position of the first focus detection pixel 11 varies, i.e., when the image height varies, the angle of incidence of light incident on the first focus detection pixel 11 varies. The angle of incidence increases as the image height increases, and decreases as the image height decreases, and when the image height is zero, the angle of incidence is 0°. The area of ​​the light-shielding portion 43 varies depending on the image height in order to block the second light beam 62, which is part of the light incident at angles of incidence that vary depending on the image height.

[0052] In FIG. 4B , the second focus detection pixel 12 is provided with a light-shielding portion 43 that blocks the first light beam 61 of the first and second light beams 61, 62. The light-shielding portion 43 is located between the color filter 51 and the photoelectric conversion portion 42 and is provided on the photoelectric conversion portion 42. In the example shown in FIG. 4B , the light-shielding portion 43 is disposed so as to block light from the right half (the +X direction side) of the photoelectric conversion portion 42. The left end (the end in the −X direction) of the light-shielding portion 43 approximately coincides with the center line that divides the photoelectric conversion portion 42 into left and right halves. The photoelectric conversion portion 42 of the second focus detection pixel 12 receives the second light beam 62. The photoelectric conversion portion 42 of the second focus detection pixel 12 photoelectrically converts the second light beam 62 to generate an electric charge, and the second focus detection pixel 12 outputs a second signal Sig2 based on the electric charge generated by the photoelectric conversion portion 42.

[0053] As with the first focus detection pixels 11, the area of ​​the light-shielding portion 43 varies depending on the position (image height) of the second focus detection pixels 12, except for the second focus detection pixels 12 located around the optical axis OA1 (center of the imaging surface 22a) of the imaging optical system 31. The area of ​​the light-shielding portion 43 varies depending on the image height in order to block the first light beam 61 of light incident at different angles of incidence depending on the image height. The area of ​​the light-shielding portion 43 can be set according to the position (image height) of the focus detection pixel, for example, as disclosed in International Publication No. 2020 / 017640.

[0054] 4C , the photoelectric conversion unit 42 of the imaging pixel 13 receives first and second light beams 61 and 62 that have passed through first and second pupil regions, respectively, of the exit pupil of the imaging optical system 31. The photoelectric conversion unit 42 of the imaging pixel 13 photoelectrically converts the first and second light beams 61 and 62 to generate electric charges, and the imaging pixel 13 outputs a signal (image signal) based on the electric charges generated by the photoelectric conversion unit 42.

[0055] 2A, the multiple first focus detection areas 101 are arranged in two dimensions (row and column directions) and are provided at positions with different image heights. The image height of the first focus detection areas 101 increases as the area moves away from the center of the imaging surface 22a (the optical axis OA1 of the photographing optical system 31). In other words, the image height of the first focus detection areas 101 increases as the distance from the center of the imaging surface 22a increases.

[0056] Note that, because the first focus detection area 101 has a predetermined area, the image height varies for each focus detection pixel depending on its position within the first focus detection area 101. However, in this embodiment, the image height value at the center position of one first focus detection area 101 is used as the image height value for the entire first focus detection area 101.

[0057] The selection unit 214 selects which of the first to third AF pixel pairs PR1 to PR3 arranged within the first focus detection area 101 set by the area setting unit 213 will use to perform focus detection, using the signals Sig1 and Sig2 output from the AF pixel pair.

[0058] Specifically, the selection unit 214 first calculates the exit pupil distance of the photographing optical system 31 at image height IH. The selection unit 214 calculates the exit pupil distance Po(IH) of the photographing optical system 31 at image height IH of the first focus detection area 101 set by the area setting unit 213 using a predetermined equation. The selection unit 214 selects an AF pixel pair appropriate for the calculated exit pupil distance Po(IH) from among the first to third AF pixel pairs PR1 to PR3. Furthermore, if multiple first focus detection areas 101 are set by the area setting unit 213, the selection unit 214 selects AF pixel pairs of the same type in each of the selected first focus detection areas 101. Furthermore, the selection unit 214 selects AF pixel pairs of the same type in the second focus detection area 102 as in the first focus detection area 101.

[0059] The focus detection unit 215 performs focus detection processing required for automatic focus adjustment (AF) of the photographic optical system 31. The focus detection unit 215 calculates the defocus amount by a split-pupil phase difference detection method using signals Sig1 and Sig2 output from the AF pixel pair selected by the selection unit 214.

[0060] The focus detection unit 215 performs a correlation calculation between a first signal Sig1 generated by capturing an image formed by a first light beam that has passed through a first pupil region of the exit pupil of the photographing optical system 31 and a second signal Sig2 generated by capturing an image formed by a second light beam that has passed through a second pupil region, and calculates the amount of deviation between the image plane of the image formed by the photographing optical system 31 and the image plane 22a of the image sensor 22. The focus detection unit 215 converts this amount of deviation into a defocus amount based on a predetermined conversion formula.

[0061] In this embodiment, the focus detection unit 215 executes first focus detection to calculate a defocus amount for each first focus detection area 101, and second focus detection to calculate a defocus amount for each second focus detection area 102. The focus detection unit 215 calculates the defocus amount based on signals Sig1 and Sig2 from the AF pixel pair selected by the selection unit 214.

[0062] The evaluation unit 216 evaluates the contrast of the image based on the signals output from the imaging pixels 13 in an area including a subject in the image based on the signals output from the imaging pixels 13. Specifically, the evaluation unit 216 calculates an evaluation value related to the contrast of the image (hereinafter referred to as a contrast evaluation value) based on the signals output from the imaging pixels 13.

[0063] The position control unit 217 controls the position of the focus lens 31 b. Specifically, based on the defocus amount calculated by the focus detection unit 215, the position control unit 217 calculates the in-focus position of the focus lens 31 b (the amount of movement of the focus lens 31 b to the in-focus position) for the image formed by the photographing optical system 31 to be focused (imaged) on the imaging surface 22 a of the image sensor 22.

[0064] In this embodiment, the position control unit 217 calculates the focus position of the focus lens 31b (the amount of movement of the focus lens 31b to the focus position) based on either the defocus amount calculated for the first focus detection area 101 or the defocus amount calculated for the second focus detection area 102, depending on the evaluation of the image contrast by the evaluation unit 216.

[0065] The position control unit 217 determines whether the defocus amount is within a tolerance, and determines that the lens is in focus if the defocus amount is within the tolerance. On the other hand, the position control unit 217 determines that the lens is not in focus if the defocus amount exceeds the tolerance, and sends a signal to the lens control unit 32 of the interchangeable lens 3 indicating the amount of movement of the focus lens 31b and an instruction to move the lens. The lens control unit 32 moves the focus lens 31b according to the amount of movement, thereby automatically adjusting the focus.

[0066] 5 is a diagram showing an image generated based on signals from the imaging pixels 13, a first focus detection area 101, and an AF frame FR1 indicating that the subject (a bird in FIG. 5 ) detected by the subject detection unit 212 is to be focused on, superimposed on the image. In the image shown in FIG. 5 , the background is in focus, and the bird is blurred, revealing the background. In this case, of the multiple first focus detection areas 101 within the AF frame FR1, the absolute value of the defocus amount is smallest in the first focus detection area 101 that overlaps with the background. Therefore, when calculating the focus position of the focus lens 31b based on the defocus amount of the first focus detection area 101, the focus position of the focus lens 31b is calculated based on the defocus amount of the first focus detection area 101 that overlaps with the background, resulting in the focus remaining fixed on the background (the background remains in focus).

[0067] Therefore, in this embodiment, based on the evaluation of the contrast of the image by the evaluation unit 216 (the state of focus on the subject), the focus lens 31b is driven based on the detection result of the first focus detection, the focus lens 31b is driven based on the detection result of the second focus detection, or the focus lens 31b is driven without using the detection result of the focus detection, thereby improving the accuracy of focusing on the desired subject.

[0068] 6 to 8 are flowcharts showing an example of processing executed by the body control unit 21 according to this embodiment. Figures 6 to 8 are started, for example, when the release button is half-pressed, and are executed repeatedly at predetermined time intervals (predetermined frame rate) while the release button is being half-pressed.

[0069] First, the position control unit 217 determines whether or not a subject has been captured (whether or not a subject has been captured) (step S11). If a subject has not been captured (step S11 / NO), the position control unit 217 calculates the in-focus position of the focus lens 31b based on the defocus amount calculated in the first focus detection area 101 and instructs the focus lens 31b to be driven (step S23). The position control unit 217 calculates the in-focus position of the focus lens 31b based on, for example, the defocus amount in the first focus detection area 101 included in an AF frame that is preset in the camera body 2 and is used when a subject has not been captured, and instructs the focus lens 31b to be driven.

[0070] In the following explanation, when the position control unit 217 performs processing based on the defocus amount calculated in the first focus detection area 101 (processing that uses the defocus amount calculated in the first focus detection area 101), the position control unit 217 may cause the focus detection unit 215 to perform at least the first focus detection at the start of the processing to obtain the defocus amount in the first focus detection area 101, or the focus detection unit 215 may perform the first focus detection and the second focus detection at the start of the processing of Figures 6 to 8, and the position control unit 217 may obtain the result of the first focus detection by the focus detection unit 215. Furthermore, when the position control unit 217 executes processing based on the defocus amount calculated in the second focus detection area 102 (processing that uses the defocus amount calculated in the second focus detection area 102), the position control unit 217 may cause the focus detection unit 215 to execute at least second focus detection at the start of the processing to obtain the defocus amount in the second focus detection area 102, or the focus detection unit 215 may perform first focus detection and second focus detection at the start of the processing of Figures 6 to 8, and the position control unit 217 may obtain the result of the second focus detection by the focus detection unit 215.

[0071] If a subject has been captured (step S11 / YES), the position control unit 217 determines whether the shooting mode is set to "bird mode" (step S13). If the shooting mode is not set to "bird mode" (step S13 / NO), the position control unit 217 calculates the in-focus position of the focus lens 31b based on the defocus amount calculated for the first focus detection area 101 and instructs the focus lens 31b to be driven (step S23). The position control unit 217 calculates the in-focus position of the focus lens 31b based on, for example, the defocus amount in the first focus detection area 101 included in the AF frame corresponding to the shooting mode preset in the camera body 2.

[0072] On the other hand, if the "bird mode" is set as the photography mode (step S13 / YES), the position control unit 217 determines whether or not a bird has been detected as the subject (step S15).

[0073] If a bird is detected as the subject (step S15 / YES), the position control unit 217 determines whether the detected part is an eye (step S17).

[0074] If the detected part is the pupil (step S17 / YES), the position control unit 217 calculates the focus position of the focus lens 31b based on the defocus amount calculated in the first focus detection area 101 near the detected pupil, and instructs the focus lens 31b to be driven (step S23).

[0075] If the detected part is not an eye (step S17 / NO), the position control unit 217 determines whether the detection size of the subject (the size of the subject detection frame) is smaller than a predetermined size (step S19). This is because if the size of the subject is small compared to the size of the captured image, the subject is likely to be blurred and the background is easily visible.

[0076] If the detected size of the subject is equal to or larger than the predetermined size (step S19 / NO), the position control unit 217 calculates the in-focus position of the focus lens 31b based on the defocus amount calculated for the first focus detection area 101, and instructs the focus lens 31b to be driven (step S23). The position control unit 217 calculates the in-focus position of the focus lens 31b based on, for example, the defocus amount in the first focus detection area 101 included in the AF frame set based on the subject detection frame.

[0077] On the other hand, if the detected size of the subject is smaller than the predetermined size (step S19 / YES), the position control unit 217 determines the focus state of the subject (step S21) based on the contrast evaluation value calculated by the evaluation unit 216. Specifically, based on the contrast evaluation value calculated by the evaluation unit 216, it determines whether the focus is on the subject or on the background.

[0078] The processing of step S21 will be described in detail. Figures 9A to 9D are diagrams for explaining the contrast evaluation value calculated by the evaluation unit 216. Figure 9A shows an image generated based on signals from the imaging pixels 13. Note that the background is omitted from Figure 9A for ease of viewing.

[0079] 9A, the evaluation unit 216 calculates a contrast evaluation value for each of a plurality of small areas ar included in an area AR1 including the subject, based on signals from the imaging pixels 13. Each small area ar includes a plurality of imaging pixels 13.

[0080] The evaluation unit 216 calculates, for example, for each imaging pixel 13, an F1 filter maximum value, which is the maximum value of a frequency signal obtained by extracting the low-frequency components of the signal output from the imaging pixel 13 using a low-frequency pass filter, an F1 focus evaluation value, which is the integrated value of that frequency signal, an F2 filter maximum value, which is the maximum value of a frequency signal obtained by extracting the high-frequency components of the signal output from the imaging pixel 13 using a high-frequency pass filter, and an F2 focus evaluation value, which is the integrated value of that frequency signal.

[0081] The evaluation unit 216 calculates, for each small area ar, an average F1 filter maximum value ave which is the average value of the F1 filter maximum values ​​calculated for the multiple imaging pixels 13 included in the small area ar, a maximum F1 filter maximum value max which is the maximum of the F1 filter maximum values, an average F1 focus evaluation value ave which is the average of the F1 focus evaluation values, and a maximum F1 focus evaluation value max which is the maximum of the F1 focus evaluation values. Also, for each small area ar, the evaluation unit 216 calculates an average F2 filter maximum value ave which is the average value of the F2 filter maximum values ​​calculated for the multiple imaging pixels 13 included in the small area ar, a maximum F2 filter maximum value max which is the maximum of the F2 filter maximum values, an average F2 focus evaluation value ave which is the average of the F2 focus evaluation values, and a maximum F2 focus evaluation value max which is the maximum of the F2 focus evaluation values.

[0082] Here, the relationship between the focus state of the subject and the contrast evaluation value will be described. Figures 10A to 10D are diagrams for explaining the relationship between the focus state of the subject and the contrast evaluation value.

[0083] 10A shows an image generated based on signals from the imaging pixels 13, and in the image of FIG. 10A , the subject is assumed to be in focus. As described above, the evaluation unit 216 calculates the average F1 filter maximum value ave, the maximum F1 filter maximum value max, the average F1 focus evaluation value ave, the maximum F1 focus evaluation value max, the average F2 filter maximum value ave, the maximum F2 filter maximum value max, the average F2 focus evaluation value ave, and the maximum F2 focus evaluation value max for each of a plurality of small areas ar included in the area AR1 that includes the subject detected by the subject detection unit 212. It is preferable that the area AR1 be set so that the center of the area AR1 coincides with the center of the subject detected by the subject detection unit 212.

[0084] 10B is a three-dimensional diagram showing the contrast evaluation values ​​calculated for each small region ar when the subject is in focus. The contrast evaluation values ​​in FIG. 10B show, for example, the maximum F2 filter value max for each small region ar. However, a similar distribution can be obtained using the average F1 filter value ave, the maximum F1 filter value max, the average F1 focus evaluation value ave, the maximum F1 focus evaluation value max, the average F2 filter value ave, the average F2 focus evaluation value ave, and the maximum F2 focus evaluation value max. When the subject is in focus, as shown in FIG. 10B, the contrast evaluation value within region AR1 can be represented three-dimensionally as an upwardly convex shape with the maximum value at the center of region AR1 (the center of the subject).

[0085] FIG. 10C shows an image generated based on signals from the imaging pixels 13, and in the image of FIG. 10C, it is assumed that the background is in focus.

[0086] 10(D) is a three-dimensional diagram showing the contrast evaluation values ​​calculated for each small region ar when the subject is out of focus (when the background is in focus). The contrast evaluation values ​​in FIG. 10(D) show, for example, the maximum F2 filter maximum value max for each small region ar. However, a similar distribution can be obtained using the average F1 filter maximum value ave, the maximum F1 filter maximum value max, the average F1 focus evaluation value ave, the maximum F1 focus evaluation value max, the average F2 filter maximum value ave, the average F2 focus evaluation value ave, and the maximum F2 focus evaluation value max. When the subject is out of focus (when the background is in focus), as shown in FIG. 10(D), the contrast evaluation values ​​within region AR1 can be represented three-dimensionally as a downwardly convex shape with the minimum value at the center of region AR1.

[0087] As described above, the three-dimensional shape indicated by the contrast evaluation value differs depending on whether the subject is in focus or not, and therefore, in step S21, the state of focus on the subject is determined based on the three-dimensional shape indicated by the contrast evaluation value in area AR1 that includes the subject. Specifically, as shown in Figures 9B to 9D, area AR1 is divided into a central area CR, a first peripheral area SR1 that is located outside the central area CR and surrounds the central area CR, and a second peripheral area SR2 that is located outside the first peripheral area SR1 and surrounds the first peripheral area SR1.

[0088] The central region CR is made up of a small region ar1 at the center of the region AR1, the first peripheral region SR1 is made up of a small region ar2 surrounding the small region ar1, and the second peripheral region SR2 is made up of a small region ar3 surrounding the small region ar2.

[0089] The position control unit 217, for example, compares the contrast evaluation value in the central region CR with the same type of contrast evaluation value in the second peripheral region SR2 to determine whether the three-dimensional shape indicated by the contrast evaluation value is an upwardly convex shape or a downwardly convex shape, and determines whether the focus is on the subject or the background.

[0090] For example, the position control unit 217 determines whether the value obtained by dividing the maximum F2 filter maximum value max in the central region CR (small region ar1) by the average value of the maximum F2 filter maximum values ​​max in the second peripheral region SR2 is greater than 1. Here, if Val1 = the maximum F2 filter maximum value max in the central region CR (small region ar1) and Val2 = the average value of the maximum F2 filter maximum values ​​max in the second peripheral region SR2, the position control unit 217 determines whether Val1 / Val2 > 1. The average value of the maximum F2 filter maximum values ​​max in the second peripheral region SR2 can be obtained by dividing the sum of the maximum F2 filter maximum values ​​max in the multiple small regions ar2 included in the second peripheral region SR2 by the number of small regions ar2 included in the second peripheral region SR2.

[0091] Val1 / Val2>1 indicates that the three-dimensional shape indicated by the contrast evaluation value is an upward convex shape. Therefore, in step S21, the position control unit 217 determines whether Val1 / Val2 is greater than 1.

[0092] Val1 may be the maximum F1 filter maximum value max in the central region CR. In this case, Val2 may be the average value of the maximum F1 filter maximum values ​​max in the second peripheral region SR2. Note that Val2 may also be the average value of the maximum F1 filter maximum values ​​max in the first peripheral region SR1. Val1 may also be the average F1 filter maximum value ave, average F1 focus evaluation value ave, maximum F1 focus evaluation value max, average F2 filter maximum value ave, average F2 focus evaluation value ave, or maximum F2 focus evaluation value max in the central region CR. In this case, Val2 may be the average value of the average F1 filter maximum values ​​ave, average F1 focus evaluation values ​​ave, average maximum F1 focus evaluation values ​​max, average F2 filter maximum values ​​ave, average F2 focus evaluation values ​​ave, or average maximum F2 focus evaluation values ​​max in the second peripheral region SR2, respectively. Note that Val2 may be the average value of the average F1 filter maximum values ​​ave, the average value of the average F1 focus evaluation values ​​ave, the average value of the maximum F1 focus evaluation values ​​max, the average value of the average F2 filter maximum values ​​ave, the average value of the average F2 focus evaluation values ​​ave, or the average value of the maximum F2 focus evaluation values ​​max in the first peripheral region SR1. That is, Val1 and Val2 may be the same type of contrast evaluation value in the central region CR and the first or second peripheral region SR1, SR2. Note that the size of region AR1, the size of each small region ar, and the number of imaging pixels 13 included in each small region ar may be set appropriately.

[0093] Returning to Figure 6, if Val1 / Val2 is greater than 1 (step S21 / YES), it is considered that the focus is on the subject, so the position control unit 217 calculates the in-focus position of the focus lens 31b based on the defocus amount calculated for the first focus detection area 101 and instructs the focus lens 31b to be driven (step S23).

[0094] If Val1 / Val2 is equal to or less than 1 (step S21 / NO), it is considered that the focus is on the background, and therefore the position control unit 217 executes the first process (step S100).

[0095] FIG. 7 is a flowchart showing the details of the first process. In the first process, the position control unit 217 first determines whether the defocus amount in the second focus detection area 102 near the face of the subject detected by the subject detection unit 212 is a value indicating a close distance (step S101). The value indicating a close distance is a negative value, and the position control unit 217 determines whether the defocus amount in the second focus detection area 102 is a negative value and its absolute value is greater than the absolute value of the value indicating a close distance. For example, if the value indicating a close distance is set to a value of −120 μm or less, the position control unit 217 determines whether the defocus amount in the second focus detection area 102 is a negative value and its absolute value is greater than 120, which is the absolute value of −120. The value indicating a close distance may be set as appropriate.

[0096] Here, the reason for determining whether the defocus amount in the second focus detection area 102 near the face of the subject is a value indicating closeness will be described.

[0097] Fig. 11(A) is a diagram showing an image generated based on signals from the imaging pixels 13, the first focus detection area 101, and an AF frame FR1 indicating that the subject (a bird in Fig. 5) detected by the subject detection unit 212 is to be focused on, superimposed on the image. Fig. 11(B) is a diagram showing an image generated based on signals from the imaging pixels 13, the second focus detection area 102, and the AF frame FR1 indicating that the subject detected by the subject detection unit 212 is to be focused on, superimposed on the image. In the images shown in Fig. 11(A) and Fig. 11(B), the background is in focus, and the subject, the bird, is blurred.

[0098] The first process is initiated when it is determined that the background is in focus in step S21 of Fig. 6. At this time, among the defocus amounts calculated for the multiple first focus detection areas 101 near the subject's face, the defocus amount closest to 0 (in-focus state) (the smallest absolute value) is likely to be the defocus amount for the first focus detection area 101a that overlaps with the background.

[0099] If the in-focus position of the focus lens 31b is calculated based on the defocus amount in this first focus detection area 101a, the focus will remain on the background.

[0100] Therefore, the position control unit 217 acquires the defocus amount in the second focus detection area 102a, which is located near the subject's face. If the subject is included in the second focus detection area 102a, the subject is located in front of (closer to camera 1 than) the background, and a value indicating the closest focus is calculated as the defocus amount. In this case, if the position control unit 217 calculates the in-focus position of the focus lens 31b based on the defocus amount in the second focus detection area 102a, which includes the subject image, and drives the focus lens 31b, the focus lens 31b moves to the closest focus side, preventing the focus from remaining on the background.

[0101] In this way, when the defocus amount in the second focus detection area 102 near the subject's face is a value indicating close proximity (Figure 7: step S101 / YES), the position control unit 217 calculates the in-focus position of the focus lens 31b based on the defocus amount calculated for the second focus detection area 102 near the subject's face, instructs the focus lens 31b to be driven (step S105), and ends the first processing.

[0102] On the other hand, if the defocus amount in the second focus detection area 102 near the subject's face is not a value indicating close proximity (step S101 / NO), the position control unit 217 determines whether the defocus amount in the second focus detection area 102 near the subject's body is a value indicating close proximity (step S103).

[0103] If the defocus amount in the second focus detection area 102 near the subject's body is a value indicating close proximity (step S103 / YES), the position control unit 217 calculates the in-focus position of the focus lens 31b based on the defocus amount calculated for the second focus detection area 102 near the subject's body, instructs the focus lens 31b to be driven (step S105), and terminates the first processing.

[0104] On the other hand, if the defocus amount in the second focus detection area 102 near the subject's body is not a value indicating close proximity (step S103 / NO), the position control unit 217 determines whether the reliability that the subject detected by the subject detection unit 212 is a specified subject (bird) is less than a threshold value and whether the three-dimensional shape indicated by the contrast evaluation value calculated by the evaluation unit 216 is a downward convex shape (step S107).

[0105] The processing of step S107 will be described. FIG. 12A shows the positions of the focus lens 31b obtained when a scanning operation is performed and an example of the reliability that the subject detected by the subject detection unit 212 at each position of the focus lens 31b is a predetermined subject (bird). FIG. 12B shows an image generated based on signals output from the imaging pixels 13 when the focus lens 31b is at position P1 in FIG. 12A, and FIG. 12C shows the distribution of contrast evaluation values ​​in an area AR1 including the subject in the image shown in FIG. 12B. The scanning operation is an operation in which the position control unit 217 moves the focus lens 31b of the imaging optical system 31 in the optical axis OA1 direction while the evaluation unit 216 sequentially calculates the contrast evaluation values ​​of the subject image based on signals output from the imaging pixels 13 to detect the focus position.

[0106] The first process (step S100) is initiated when it is determined in step S21 of FIG. 6 that the subject is in focus on the background. Step S107 is executed when the defocus amount in the second focus detection area 102 near the subject's face is not a value indicating close focus, and the defocus amount in the second focus detection area 102 near the subject's body is not a value indicating close focus. In this case, the subject image detected by the subject detection unit 212 is likely to be so blurred that the defocus amount cannot be calculated in the second focus detection area 102. When the subject image detected by the subject detection unit 212 is in a blurred state, it becomes difficult to determine whether the subject detected by the subject detection unit 212 is a predetermined subject (a bird), and the reliability calculated by the subject detection unit 212 also becomes low. Therefore, the position control unit 217 determines whether the subject image is in a blurred state based on whether the reliability calculated by the subject detection unit 212 is below a threshold. Furthermore, the position control unit 217 checks whether the three-dimensional shape indicated by the contrast evaluation value calculated by the evaluation unit 216 is a downward convex shape or not, and confirms that the subject is not in focus.

[0107] If the reliability that the subject detected by the subject detection unit 212 is a predetermined subject is less than the threshold value and the three-dimensional shape indicated by the contrast evaluation value calculated by the evaluation unit 216 is a downward convex shape (step S107 / YES), the position control unit 217 drives the focus lens 31b toward the close-up side (step S108) and ends the first process. The position control unit 217 may drive the focus lens 31b to the close-up end or may drive it a predetermined amount toward the close-up side. That is, in step S108, the focus lens 31b is not driven based on the defocus amount calculated by the focus detection unit 215.

[0108] On the other hand, if the judgment in step S107 is NO, the position control unit 217 calculates the in-focus position of the focus lens 31b based on the defocus amount calculated for the first focus detection area 101, instructs the focus lens 31b to be driven (step S109), and terminates the first processing.

[0109] Meanwhile, if a bird is not detected as the subject in step S15 of FIG. 6 (step S15 / NO), the position control unit 217 executes the second process (step S200).

[0110] 8 is a flowchart showing the details of the second process. In the second process, the position control unit 217 first determines whether the defocus amounts in two or more adjacent second focus detection areas 102 are values ​​indicating close focus (step S201). The two or more adjacent second focus detection areas 102 may be adjacent in the X direction or may be adjacent in the Y direction.

[0111] If the defocus amount in two or more adjacent second focus detection areas 102 is a value indicating the closest focus (step S201 / YES), the position control unit 217 determines whether the number of times the defocus amount in two or more adjacent second focus detection areas 102 has been a value indicating the closest focus is M or more times out of the N focus detection histories (step S203), where N is, for example, 5 and M is, for example, 3.

[0112] If the judgment in step S203 is NO, the position control unit 217 calculates the in-focus position of the focus lens 31b based on the defocus amount calculated for the first focus detection area 101, instructs the focus lens 31b to be driven (step S211), and terminates the second processing.

[0113] If the judgment in step S203 is YES, the position control unit 217 calculates the in-focus position of the focus lens 31b based on the defocus amount calculated for the second focus detection area 102, instructs the focus lens 31b to be driven (step S205), and terminates the second processing.

[0114] On the other hand, if the defocus amounts in two or more adjacent second focus detection areas 102 are not values ​​indicating close focus (step S201 / NO), the position control unit 217 determines whether or not there are any areas in which the defocus amounts in multiple areas obtained by dividing the AF frame are all values ​​near in-focus but the contrast evaluation value is extremely small (step S207). Note that the second process is a process that is executed when a subject is not detected, and therefore the AF frame is, for example, an AF frame of a predetermined size set by the user on the camera body 2.

[0115] FIGS. 13A to 13C are diagrams illustrating the processing of step S207. FIG. 13A illustrates an image generated based on signals from the imaging pixels 13 and the AF frame FR1. FIG. 13B illustrates an example of the defocus amount for each first focus detection area 101 within the AF frame FR1. FIG. 13C illustrates the contrast evaluation value for each first focus detection area 101 within the AF frame FR1. In the image shown in FIG. 13A, the background is in focus, and the subject, a bird, is blurred, allowing the background to show through. Furthermore, the subject detection unit 212 is unable to detect the subject, and an AF frame FR1 of a predetermined size including the center of the imaging surface 22a, which was previously set by the user on the camera body 2, is displayed.

[0116] 13B, the defocus amount is set to a value near the in-focus point in all of the multiple first focus detection areas 101 within the AF frame FR1. A near-in-focus point value is a value within a predetermined range including 0, for example, a value within the range of −100 μm to 100 μm.

[0117] 13C , although the contrast evaluation value is high in most of the multiple first focus detection areas 101 within the AF frame FR1, there are areas where the contrast evaluation value is extremely low. Such defocus amount and contrast evaluation value results are obtained when the subject image is so blurred that the subject detection unit 212 cannot detect the subject. The position control unit 217 can determine that there is an area where the contrast evaluation value is extremely low when the contrast evaluation value in one of the multiple first focus detection areas 101 is smaller than the contrast evaluation value in the other parts of the multiple first focus detection areas 101 by a predetermined value or more (e.g., 300).

[0118] Therefore, in this embodiment, if the determination in step S207 is YES, the position control unit 217 drives the focus lens 31b to the close-up side (step S209), and ends the second process. This is because if the determination in step S207 is YES, it is considered that the subject image is so blurred that the subject detection unit 212 cannot detect the subject. Note that the body control unit 21 may instruct the lens control unit 32 to reduce the aperture diameter of the diaphragm 31c (increase the F-number) until a defocus amount indicating close-up is calculated in the second focus detection area 102.

[0119] On the other hand, if the judgment in step S207 is NO, the position control unit 217 calculates the in-focus position of the focus lens 31b based on the defocus amount calculated for the second focus detection area 102, instructs the focus lens 31b to be driven (step S205), and terminates the second processing.

[0120] As described above in detail, according to this embodiment, the camera 1 includes an image sensor 22 having first and second focus detection pixels 11 and 12 that photoelectrically convert light transmitted through the photographing optical system 31 and output signals used for focus detection, and an imaging pixel 13 that photoelectrically converts light transmitted through the photographing optical system 31 and outputs signals used for image generation, a focus detection unit 215 that performs focus detection of the photographing optical system 31 based on signals Sig1 and Sig2 output from the first and second focus detection pixels 11 and 12, an evaluation unit 216 that evaluates the contrast of the image based on the signals output from the imaging pixel 13 in an area AR1 that includes a subject in the image based on the signals output from the imaging pixel 13, and a position control unit 217 that controls focus detection by the focus detection unit 215 based on the evaluation by the evaluation unit 216. This makes it possible to improve the accuracy of focusing on a desired subject (the probability that the desired subject will be in focus).

[0121] Furthermore, in this embodiment, the position control unit 217 controls whether or not to perform focus detection by the focus detection unit 215, based on the evaluation by the evaluation unit 216. If the focus lens 31b is driven based on the focus detection result by the focus detection unit 215, the focus may remain on the background. However, by controlling whether or not to perform focus detection by the focus detection unit 215, based on the evaluation by the evaluation unit 216, it is possible to improve the accuracy of focusing on the desired subject (the probability that the desired subject will be in focus).

[0122] Furthermore, in this embodiment, the camera 1 includes a subject detection unit 212 that detects a subject within an image, and when a subject is detected by the subject detection unit 212, the position control unit 217 performs focus detection using the focus detection unit 215. This makes it possible to improve the accuracy of focusing on the subject detected by the subject detection unit 212 (the probability that the desired subject will be in focus).

[0123] Furthermore, in this embodiment, when a subject is detected by the subject detection unit 212 (step S15 / YES), the evaluation unit 216 evaluates the contrast of the image in area AR1 (step S19), and focus detection is performed by the focus detection unit 215. This makes it possible to determine whether or not to drive the focus lens 31b based on the focus detection result of the focus detection unit 215, depending on the evaluation of the contrast of the image of the subject detected by the subject detection unit 212, thereby improving the accuracy of focusing on the subject detected by the subject detection unit 212.

[0124] In this embodiment, when the contrast evaluation value calculated by the evaluation unit 216 indicates that the subject is not in focus (step S21 / NO), the position control unit 217 drives the focus lens 31b based on the focus detection result by the focus detection unit 215 (step S105). More specifically, the focus detection unit 215 performs first focus detection, which detects the focus of the photographing optical system 31 in a first focus detection area 101, and second focus detection, which detects the focus of the photographing optical system 31 in a second focus detection area 102 that includes the first focus detection area 101 and is larger than the first focus detection area 101. When the contrast evaluation value calculated by the evaluation unit 216 indicates that the subject is not in focus, the position control unit 217 drives the focus lens 31b based on the detection result of the second focus detection. By driving the focus lens 31b based on the focus detection result in the second focus detection area 102 that is larger than the first focus detection area 101, it is possible to prevent the subject from remaining in focus on the background.

[0125] In this embodiment, the evaluation unit 216 calculates a contrast evaluation value in a central region CR of the region AR1 that includes the center of the region AR1, and a contrast evaluation value in a first peripheral region SR1 or a second peripheral region SR2 that surrounds the central region CR of the region AR1. This makes it possible to determine whether or not the subject is in focus based on the relationship between the contrast evaluation value in the central region CR and the contrast evaluation value in the first peripheral region SR1 or the second peripheral region SR2.

[0126] Furthermore, in this embodiment, if the relationship between the contrast evaluation value in the central region CR and the contrast evaluation value in the first peripheral region SR1 or the second peripheral region SR2 indicates that the subject is not in focus (step S21 / NO) and the defocus amount in the second focus detection region 102 corresponding to a part of the subject (e.g., a face) indicates a close focus (step S101 / YES), the position control unit 217 drives the focus lens 31b based on the detection result of the second focus detection (step S105), thereby improving the accuracy of focusing on the subject.

[0127] Furthermore, in this embodiment, if the subject cannot be detected in the image (step S15 / NO), if the defocus amount in each of the adjacent second focus detection areas 102 is a value indicating a close distance (step S201 / YES), and if a defocus amount indicating a close distance has been detected a predetermined number of times or more in the history of multiple defocus amount detections (step S203 / YES), the position control unit 217 drives the focus lens 31b based on the detection result of the second focus detection (step S205). This makes it possible to improve the accuracy of focusing on the subject.

[0128] In this embodiment, the camera 1 also includes a subject detection unit 212 that calculates the reliability that a subject in an image is a predetermined subject (e.g., a bird). If the reliability is less than a threshold and the relationship between the contrast evaluation value in the central region CR and the contrast evaluation value in the first peripheral region SR1 or the second peripheral region SR2 indicates that the subject is not in focus (step S107 / YES), the position control unit 217 changes the position of the photographing optical system 31 to a position on the closest side. This makes it possible to prevent the background from remaining in focus.

[0129] In this embodiment, the focus detection unit 215 detects the defocus amount in each of the first focus detection areas 101 in a predetermined area (AF frame FR1 (see FIG. 13A)) that includes a plurality of first focus detection areas 101, and the evaluation unit 216 calculates a contrast evaluation value in each of the first focus detection areas 101. The position control unit 217 changes the position of the focus lens 31b based on the defocus amount and contrast evaluation value in the first focus detection areas 101 (step S209). More specifically, if the defocus amount in each of the first focus detection areas 101 is within a predetermined range indicating near-in-focus, and the contrast evaluation value in one part of the first focus detection areas 101 is smaller than the contrast evaluation value in the other parts of the first focus detection areas 101 by a predetermined value or more (step S207), the position of the focus lens 31b is changed to a position closer to the subject (step S209). This makes it possible to prevent the background from remaining in focus.

[0130] In the above embodiment, the first AF pixel pair PR1, the second AF pixel pair PR2, and the third AF pixel pair PR3 are arranged in each first focus detection area 101. However, it is sufficient that at least one of the first AF pixel pair PR1, the second AF pixel pair PR2, and the third AF pixel pair PR3 is arranged in each first focus detection area 101. If, for example, only the first AF pixel pair PR1 is arranged in each first focus detection area 101, the first AF pixel pair PR1 may be arranged throughout the entire first focus detection area 101. In this case, the defocus amount may be calculated based on the signals Sig1 and Sig2 from the first AF pixel pair PR1, regardless of the image height of the first focus detection area 101.

[0131] 6, it is determined whether the "bird mode" is set as the shooting mode (step S13), but the determination in step S13 may be omitted and it may be determined whether a subject is detected in step S15. That is, regardless of the type of subject to be detected, if the detected part of the subject is not an eye (step S17 / NO) and the size of the subject detected by subject detection unit 212 (the size of the subject detection frame) is smaller than a predetermined size (step S19 / YES), the in-focus state of the subject may be determined based on the contrast evaluation value (step S21).

[0132] 6, if the subject detection unit 212 cannot detect a subject (step S15 / NO), the second process (step S200) is executed, but the scanning operation may be performed without executing the second process. In other words, if the subject detection unit 212 cannot detect a subject (step S15 / NO), the focus detection unit 215 may not perform focus detection.

[0133] Furthermore, in the above embodiment, for example, when the shooting mode is set to "bird mode," a scanning operation may be performed if the number of times the release button is half-pressed within a predetermined time period exceeds a predetermined number. This is because if the release button is half-pressed a predetermined number of times or more within a predetermined time period, it is considered that even though the user has captured the subject through the viewfinder or the like, the subject detection unit 212 has not been able to detect the subject because the subject image is greatly blurred, for example.

[0134] In the above embodiment, multiple operations may be performed by operating any of the operation units 25 once. For example, pressing a specific button once may perform autofocus after a scanning operation. This increases user convenience.

[0135] The above-described embodiment is a preferred example of the present invention, but the present invention is not limited to this and can be modified in various ways without departing from the spirit of the present invention.

[0136] REFERENCE SIGNS LIST 1 camera 2 camera body 3 interchangeable lens 11, 12 focus detection pixel 13 imaging pixel 21 body control unit 22 imaging element 25 operation unit 31 photographing optical system 31b focus lens 31c aperture 101 first focus detection area 102 second focus detection area 212 subject detection unit 215 focus detection unit 216 evaluation unit 217 position control unit AR1 area

Claims

1. An imaging device comprising: an imaging unit having a first pixel that performs photoelectric conversion on light transmitted through an optical system and outputs a signal used for focus detection; and a second pixel that performs photoelectric conversion on light transmitted through the optical system and outputs a signal used for image generation; a focus detection unit that performs focus detection of the optical system based on the signal output from the first pixel; an evaluation unit that evaluates the contrast of the image based on the signal output from the second pixel in an area including a subject in an image based on the signal output from the second pixel; and a control unit that controls focus detection by the focus detection unit based on the evaluation by the evaluation unit.

2. The imaging device according to claim 1, wherein the control unit controls whether or not to perform focus detection by the focus detection unit based on the evaluation by the evaluation unit.

3. An imaging device as described in claim 1 or claim 2, further comprising a subject detection unit that detects a subject from the image, wherein the control unit performs focus detection using the focus detection unit when a subject is detected by the subject detection unit.

4. The imaging device according to claim 3, wherein when a subject is detected by the subject detection section, the evaluation section evaluates the contrast of the image in the region and performs focus detection by the focus detection section.

5. The imaging device according to claim 3 or 4, wherein the control unit does not cause the focus detection unit to perform focus detection unless a subject is detected by the subject detection unit.

6. An imaging device as described in any one of claims 1 to 5, wherein the control unit performs focus detection using the focus detection unit when the evaluation by the evaluation unit indicates that the subject is not in focus.

7. An imaging device as described in any one of claims 1 to 6, wherein the focus detection unit performs first focus detection to detect the focus of the optical system in a first region on the imaging plane of the imaging unit, and second focus detection to detect the focus of the optical system in a second region that includes the first region and is larger than the first region, and the control unit controls whether to perform the first focus detection or the second focus detection based on the evaluation by the evaluation unit.

8. The imaging device described in claim 7, wherein the focus detection unit detects a first amount of shift between the image plane created by the optical system in the region and the imaging plane of the imaging unit as the first focus detection, and detects a second amount of shift between the image plane created by the optical system in the second region and the imaging plane of the imaging unit as the second focus detection, and the evaluation unit calculates a first evaluation value regarding the contrast of the image in a third region of the region that includes the center of the region, and a second evaluation value regarding the contrast of the image in a fourth region of the region surrounding the third region.

9. The imaging device according to claim 8, wherein the control unit performs the second focus detection when the relationship between the first evaluation value and the second evaluation value indicates a state in which the subject is not in focus.

10. An imaging device as described in claim 8 or claim 9, wherein the control unit performs the second focus detection when the relationship between the first evaluation value and the second evaluation value indicates a state in which the subject is not in focus and the second shift amount in the second area corresponding to a first portion of the subject is a value indicating closeness.

11. An imaging device as described in any one of claims 8 to 10, wherein the control unit performs the second focus detection when a subject cannot be detected in the image, when the second shift amount in each of a plurality of adjacent second regions is a value indicating closeness, and when the second shift amount indicating closeness has been detected a predetermined number of times or more in a history of multiple detections of the second shift amount.

12. An imaging device as described in any one of claims 8 to 11, further comprising a calculation unit that calculates a reliability that a subject in the image is a predetermined subject designated in advance, and the control unit changes the position of the optical system to a closer position when the reliability is less than a threshold value and the relationship between the first evaluation value and the second evaluation value indicates a state in which the subject is not in focus.

13. An imaging device as described in any one of claims 8 to 12, wherein the focus detection unit detects the first shift amount in each of a plurality of first regions in a predetermined region including a plurality of the first regions, the evaluation unit calculates an evaluation value related to image contrast in each of the plurality of first regions, and the control unit changes the position of the optical system or changes the aperture diameter of the iris based on the first shift amount and the evaluation value in the plurality of first regions.

14. An imaging device as described in claim 13, wherein when the first shift amount in each of the multiple first regions is within a predetermined range indicating near focus, and the evaluation value in one part of the multiple first regions is smaller than the evaluation value in another part of the multiple first regions by a predetermined value or more, the position of the optical system is changed to a position on the close side, or the aperture diameter of the diaphragm is reduced.

Citation Information

Patent Citations

  • Information processing device, information processing method, and program

    JP2013097136A

  • Imaging device, storage device, and imaging program

    JP2014021373A

  • Focus detection device and imaging device

    JP2018049281A

  • Single lens reflex camera comprising a focus detecting apparatus and method of photographing

    US20100166405A1