Image processing method, image processing apparatus, imaging apparatus, and program
The image processing method corrects distance information based on parallax direction to address inaccuracies caused by optical aberrations, achieving precise distance measurements.
Patent Information
- Application Number
- JP2023031411
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-03-01
- Publication Date
- 2024-09-12
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing methods for acquiring distance information based on parallax images fail to account for errors dependent on the parallax direction, leading to inaccuracies in distance measurement due to aberrations in the imaging optical system.
An image processing method that includes acquiring distance information from multiple images taken from different viewpoints and correcting this information based on the parallax direction, using a correction step to account for aberrations such as astigmatism, thereby improving accuracy.
The method enables the acquisition of highly accurate distance information by correcting for parallax direction-dependent errors, enhancing the precision of distance measurements.
Smart Images

Figure 2024123760000001
Abstract
Description
[Technical field]
[0001] The present invention relates to an image processing method, an image processing device, an imaging device, and a program. [Background technology]
[0002] Conventionally, there is known a method for acquiring distance information such as the defocus state of a subject or the distance from an imaging device to a subject (subject distance) based on multiple images (parallax images) obtained by imaging from different viewpoints. Patent Document 1 discloses a method for improving the accuracy of distance information by correcting the field curvature and the imaging surface tilt of an imaging element due to design or manufacturing errors in an imaging optical system. [Prior art documents] [Patent documents]
[0003] [Patent Document 1] JP 2017-9640 A Summary of the Invention [Problem to be solved by the invention]
[0004] When an aberration occurs in the imaging optical system, the distance information acquired based on the parallax image has an error that depends on the parallax direction. However, the method disclosed in Patent Document 1 does not take into account the error that depends on the parallax direction, and therefore cannot acquire highly accurate distance information.
[0005] SUMMARY OF THE PRESENT EMBODIMENTS An object of the present invention is to provide an image processing method capable of acquiring distance information with high accuracy. [Means for solving the problem]
[0006] An image processing device as one aspect of the present invention has an acquisition step of acquiring distance information based on multiple images obtained by capturing images from different viewpoints, and a correction step of correcting the distance information based on a parallax direction corresponding to the distance information and a position on at least one of the multiple images.
[0007] Other objects and features of the present invention are illustrated in the following examples. Effect of the Invention
[0008] According to the present invention, it is possible to provide an image processing method capable of acquiring distance information with high accuracy. [Brief description of the drawings]
[0009] [Figure 1] FIG. 2 is an external view of an imaging device in each embodiment. [Diagram 2] FIG. 2 is a block diagram of an imaging device in each embodiment. [Diagram 3] 4 is a flowchart showing an image processing method in each embodiment. [Figure 4] 4 is a diagram illustrating the relationship between an image position and a pupil division direction in the first embodiment. FIG. [Diagram 5] 6A and 6B are diagrams illustrating errors in distance information in each embodiment. [Figure 6] FIG. 2 is an explanatory diagram of a two-viewpoint shooting method in each embodiment. [Figure 7] 3A and 3B are diagrams for explaining the relationship between a light receiving portion of an image sensor and a pupil of an image pickup optical system in each embodiment. [Figure 8] 3A and 3B are diagrams for explaining the relationship between a light receiving portion of an image sensor and a subject in each embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0010] DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings. In the drawings, the same components are designated by the same reference numerals, and duplicated descriptions will be omitted.
[0011] First, referring to FIG. 6, the principle of subject distance calculation using multiple images (parallax images) obtained by capturing images from different viewpoints will be described. FIG. 6 is a diagram for explaining a model of a two-viewpoint capturing method. In FIG. 6, the coordinate system has the center of the left and right cameras as the origin, the x axis in the horizontal direction, and the y axis in the depth direction. The height direction is omitted for simplification. It is assumed that the principal points of the imaging optical systems of the left and right cameras are located at (-Wc, 0) and (Wc, 0), respectively. Here, the focal lengths of the imaging optical systems of the left and right cameras are f. In this state, it is considered that subject A located at (0, y1) on the y axis is captured by each camera. If the amount of deviation of the image of subject A from the sensor center of the left and right cameras is the parallax (capture parallax, parallax deviation amount), which is Plc and Prc, respectively, it can be expressed by the following formulas (1) and (2).
[0012]
number
[0013]
number
[0014] Based on the above principle, by photographing the same subject from different viewpoints, it is possible to obtain left and right parallax images with the shift amounts (parallax) expressed by formulas (1) and (2) in the viewpoint shift (baseline) directions, i.e., in the parallax directions. The distance y1 to subject A can be calculated by the following formula (3).
[0015]
number
[0016] In each embodiment, the parallax shift amount is considered based on the focal plane. Therefore, the parallax shift amount for a given object is obtained by subtracting the parallax shift amount for a focused object from the difference between the corresponding Prc and Plc. The distance from the image sensor to the focal point of the imaging optical system (defocus amount) can be obtained by multiplying the parallax shift amount by a given conversion coefficient, and the conversion coefficient is determined according to the position shift amount of the viewpoint.
[0017] Therefore, to calculate the subject distance using the parallax images, it is sufficient to specify the corresponding subject area between the parallax images. Various methods can be used to specify the same subject area between the images. For example, a block matching method using one of the parallax images as a reference image can be used. This allows the parallax shift amount to be obtained, and the defocus amount or the subject distance to be obtained. In each embodiment, the distance information may be defined as the distance between two points defined as either the shift amount on the object side or the image side, and may be the defocus amount or the subject distance, etc. In addition, the parallax shift amount, the defocus map, and the subject distance are mutually convertible, and in each embodiment, the distance information also includes the parallax shift amount. That is, in each embodiment, the distance information is information on at least one of the parallax shift amount, the defocus amount (defocus map), or the subject distance. Note that in each embodiment, the method of obtaining the distance information is not limited to the above-mentioned method, and for example, the defocus amount or the subject distance may be obtained directly from the parallax image by machine learning.
[0018] In addition, the parallax image can be obtained by using an imaging unit that guides a plurality of light beams that have passed through different regions of the pupil of one imaging optical system to different light receiving units (pixels) in one imaging element for photoelectric conversion. In other words, it is possible to obtain the parallax image required for distance calculation with one imaging unit (an imaging unit composed of one optical system and one imaging element).
[0019] FIG. 7 is a diagram for explaining the relationship between the light receiving part of the image sensor and the pupil of the image sensor in such an image sensor. ML is a microlens, and CF is a color filter. EXP indicates the exit pupil of the image sensor. G1 and G2 are light receiving parts (hereinafter referred to as G1 pixel and G2 pixel, respectively), and one G1 pixel and one G2 pixel are paired with each other. A plurality of pairs (pixel pairs) of G1 and G2 pixels are arranged in the image sensor. The pair of G1 and G2 pixels has a substantially conjugate relationship with the exit pupil EXP via a common microlens ML (i.e., one provided for each pixel pair). A plurality of G1 pixels arranged in the image sensor are collectively referred to as a G1 pixel group, and a plurality of G2 pixels arranged in the image sensor are collectively referred to as a G2 pixel group.
[0020] FIG. 8 is a diagram for explaining the relationship between the light receiving section of the image sensor and the subject, and shows a schematic diagram of an image pickup system assuming that a thin lens is located at the position of the exit pupil EXP in FIG. 7. The G1 pixel receives the light beam that has passed through the P1 region of the exit pupil EXP, and the G2 pixel receives the light beam that has passed through the P2 region of the exit pupil EXP. OSP is the object point being imaged. An object does not necessarily have to exist at the object point OSP, and the light beam that has passed through this point is incident on the G1 pixel or the G2 pixel depending on the region (position) in the pupil through which it passes. The light beam passing through different regions in the pupil corresponds to the incident light from the object point OSP being separated by an angle (parallax). That is, of the G1 and G2 pixels provided for each microlens ML, an image generated using an output signal from the G1 pixel and an image generated using an output signal from the G2 pixel become multiple (here, a pair) parallax images having parallax with each other. In the following description, receiving light beams that have passed through different regions in the pupil by different light receiving sections (pixels) is also referred to as pupil division.
[0021] Here, an example in which the pupil is divided into two in one pupil division direction has been described, but the pupil division direction and the number of divisions are arbitrary, and the pupil may be divided into two directions, for example, the horizontal direction and the vertical direction. The pupil division direction and the number of divisions may differ depending on the pixel positions of the image sensor. In the pupil division method, the parallax direction is the direction of positional deviation when the divided pupils are regarded as the respective viewpoints. The viewpoint position is defined based on the pupil area through which each light beam passes, and may be, for example, the center of gravity of the light beam. The pupil division direction is not limited to the horizontal direction and the vertical direction, and may be an oblique direction.
[0022] In addition, in Figures 7 and 8, even if the position of the exit pupil EXP is shifted, etc., causing the above-mentioned conjugate relationship to be incomplete or causing the P1 area and the P2 area to partially overlap, the multiple images obtained can be treated as parallax images.
[0023] In the split pupil method, the amount of parallax shift can be calculated in the same way as in the two-viewpoint shooting method. Similarly, the amount of defocus and the subject distance can be obtained. The distance from the image sensor to the focal point of the imaging optical system (the amount of defocus) can be obtained as the value obtained by multiplying the amount of parallax shift by a predetermined conversion coefficient, and the conversion coefficient is determined according to the amount of positional shift of the viewpoint. In addition, the object point and the image point that are conjugate via the imaging optical system have a lens formula relationship expressed by the following formula (4), where a is the distance from the imaging optical system to the object point and b is the distance from the imaging optical system to the image point.
[0024] 1 / a+1 / b=1 / f (4) Based on this relationship, the subject distance can also be obtained from the defocus amount and focal length. By calculating distance information from parallax images using the above-mentioned method and extracting corresponding pixels between these parallax images, distance calculation can be performed with a single imaging unit.
[0025] In the above-mentioned distance calculation, the aberration of the imaging optical system is not taken into consideration, and the imaging surface of the imaging optical system is assumed to be an ideal image surface. However, if the imaging optical system has aberration, an error occurs on the image surface of the imaging optical system. The error occurring on the image surface directly becomes an error in the defocus amount, so the corresponding error also occurs in the parallax shift amount and the subject distance. In particular, when astigmatism occurs, the image surface position where the light beam on the meridional plane of the optical system and the light beam on the sagittal plane are focused differs. As a result, when astigmatism exists, the image surface position differs between the case where the pupil is divided in the circumferential (sagittal) direction and the case where the pupil is divided in the radial (meridional) direction. That is, the image surface position differs depending on the parallax direction, and the parallax shift amount, defocus amount, and subject distance information also have errors according to the parallax direction. In each embodiment, the astigmatism is not limited to the image surface position shift between the meridional light beam and the sagittal light beam, but includes the image surface position differing in the optical axis direction depending on the pupil division direction of the optical system. Furthermore, the aberration is not limited to that of a rotationally symmetric optical system, but includes that of a non-rotationally symmetric optical system. EXAMPLES
[0026] First, an imaging device 1000 according to a first embodiment of the present invention will be described with reference to Fig. 1 and Fig. 2. Fig. 1 is an external view of the imaging device 1000. Fig. 2 is a block diagram of the imaging device 1000. In this embodiment, each pixel of the imaging element is divided into two, and a parallax image is acquired by receiving each of the light beams that divide the pupil of the imaging optical system into two. An image processing unit of the imaging device in this embodiment acquires distance information based on the parallax image, and performs correction based on the parallax direction to acquire the distance information with high accuracy.
[0027] The imaging device 1000 includes an imaging unit that captures an image of a subject. The imaging unit includes an imaging optical system 101. The imaging optical system 101 includes a plurality of lenses and an aperture (aperture stop) 101a, and forms an image of light from a subject on an imaging element 102. In this embodiment, the imaging optical system 101 is configured to be detachably attached to a camera body 200 as an interchangeable lens. However, this embodiment is not limited to this, and the camera body 200 and the imaging optical system 101 may be configured integrally. The imaging element 102 is configured by a photoelectric conversion element such as a CCD sensor or a CMOS sensor. The imaging unit is configured as a whole as shown in FIG. 7 and FIG. 8, and is capable of acquiring a plurality of images (parallax images) having different viewpoints. That is, a plurality of light beams that have passed through different regions of the pupil of the imaging optical system 101 are guided to different light receiving sections (pixels) in the imaging element 102 and photoelectrically converted. An analog electric signal generated by photoelectric conversion of the image sensor 102 is converted into a digital signal by an A / D converter 103 and input to an image processing unit (image processing device) 104 .
[0028] The image processing unit 104 has a function of acquiring distance information of the subject in addition to image processing generally performed on digital signals. As the distance information, depth information of the subject (subject distance) based on a predetermined position may be acquired. The reference position may be, for example, a predetermined position of the imaging unit, a focal plane on the subject side, or a main plane of the imaging optical system. In particular, when the reference position is the focal plane, it is equal to the defocus information of the subject on the object side of the imaging optical system. Note that in an imaging unit that guides a plurality of light beams that have passed through different regions of the pupil of the imaging optical system 101 to different light receiving units of the imaging element 102, the reference for the amount of parallax shift (the shift in the positional relationship of the subject due to parallax) is the focal plane of the imaging optical system, as described above.
[0029] The image processing unit 104 has an acquisition unit 104a and a correction unit 104b. The acquisition unit 104a acquires distance information from a plurality of images (parallax images) obtained by capturing images from different viewpoints. The correction unit 104b corrects the distance information based on the parallax direction of the plurality of images (parallax direction corresponding to the distance information) and the position on at least one of the plurality of images. The output image processed by the image processing unit 104 is stored in an image recording unit 109 such as a semiconductor memory or an optical disk. The output image may also be displayed on a display unit 105.
[0030] The information input unit 108 supplies the imaging conditions (aperture value, exposure time, focal length, etc.) selected by the user to the system controller 110. The imaging control unit 107 acquires an image under the desired imaging conditions selected by the user based on the information output from the system controller 110. The ROM 111 is a storage unit that stores various programs executed by the system controller 110 and data required for executing the programs. The ROM 111 may also store correction information.
[0031] Next, a method for acquiring distance information (image processing method) in the imaging device 1000 of this embodiment will be described with reference to Fig. 3. Fig. 3 is a flowchart showing the image processing method of this embodiment. The method for acquiring distance information of this embodiment is executed by the system controller 110 and the image processing unit 104 in accordance with an image processing program for causing a computer to function as an image processing device. The image processing program may be recorded, for example, on a computer-readable recording medium.
[0032] First, in step S101, the system controller 110 sets the imaging conditions (aperture value, exposure time, focal length, etc.) set by the user via the information input unit 108. Thereafter, in conjunction with the full press of the release button 300, parallax images (multiple images) are acquired by capturing an image of a subject using the image sensor 102 under the set imaging conditions. The A / D converter 103 forms a captured image (luminance information) by A / D converting an analog signal output from the image sensor 102, and outputs the captured image to the image processing unit 104. Note that the image processing unit 104 may execute normal development processing and various image correction processing for image generation.
[0033] Next, in step S102, the acquisition unit 104a of the image processing unit 104 acquires the amount of parallax shift by a known method such as block matching using the parallax image acquired in step S101. In this embodiment, the amount of parallax shift is a two-dimensional map (correction map) calculated for each pixel (partial region of the image), but is not limited to this.
[0034] Next, in step S103, the acquisition unit 104a multiplies the parallax shift amount acquired in step S102 by a predetermined conversion coefficient to acquire a two-dimensional defocus map in which the defocus amount for each pixel is arranged. Next, in step S104, the acquisition unit 104a acquires a correction component for the defocus map acquired in step S103. Here, the correction component is an error amount for astigmatism, and is a two-dimensional map corresponding to each pixel position (each area on the image) of the defocus map. The correction component is data calculated in advance based on the parallax direction determined by the image sensor 102 and stored in the ROM 111, and the acquisition unit 104a acquires the correction component based on the data. The correction component will be described in detail later.
[0035] Next, in step S105, correction unit 104b of image processing unit 104 corrects the defocus map by subtracting the correction component acquired in step S104 from the defocus map acquired in step S103. Next, in step S106, acquisition unit 104a acquires a two-dimensional subject distance map (distance information) from the lens formula described above based on the defocus map corrected in step S105. Image recording unit 109 stores the finally acquired subject distance map or image information, and this flow ends.
[0036] In this embodiment, the correction component of the defocus map is acquired, and the defocus map is corrected based on the acquired correction component. However, as described above, the parallax shift amount, the defocus map, and the subject distance can be converted into each other, and any one of them may be corrected, and any of the error amounts may be acquired as the correction component (correction component of the distance information). In addition, the correction component may be acquired before the correction process, and the order of the other processes may be changed, or the processes may be executed in parallel. It is not necessary to acquire all of the parallax shift amount, the defocus map, and the subject distance. For example, the subject distance may be calculated directly from the parallax shift amount, or the defocus map or the subject distance may be acquired directly from the parallax image using a machine learning model. In addition, when it is desired to add defocus blur by image processing based on distance information, it is sufficient to have a defocus map as distance information. In this case, it is not necessary to acquire the subject distance.
[0037] In this embodiment, the parallax image, the parallax shift amount, the defocus map, the correction component, the corrected defocus map, and the subject distance are acquired by the acquisition unit 104a of the image processing unit 104, but at least some of the steps may be performed by another image processing unit (another image processing device). For example, the parallax image may be communicated to an image processing device other than the imaging device, and the subsequent processing may be performed on this image processing device, or the distance information acquired on the imaging device may be corrected by another image processing device.
[0038] In addition, the parallax displacement amount, the defocus map, and the subject distance are two-dimensional maps corresponding to the subject on the parallax image, but they do not need to have the same number of pixels as the parallax image. Therefore, it is not necessary to have a value for each pixel of the parallax image, and a value may be provided for each image region including multiple pixels. Also, they may be obtained only for a partial region of the parallax image.
[0039] Next, the correction components acquired in step S104 in Fig. 3 will be described in detail. In the image sensor 102 of this embodiment, all pixels are vertically divided, and G1 pixels and G2 pixels are arranged side by side. That is, the parallax direction is uniformly horizontal for all pixels. Also, the image pickup optical system 101 of this embodiment is a rotationally symmetric optical system.
[0040] An error in distance information when the orientation on the image differs in a parallax image acquired by the image sensor 102 will be described with reference to Fig. 4. Fig. 4 is a diagram showing the relationship between the position on the image (orientation on the image) and the pupil division direction.
[0041] Here, the orientation on the image refers to the orientation of the pixel position as viewed from the center (optical axis O) on the imaging surface 004 (on the image) of the image sensor 102 (orientation based on a predetermined position (such as the center position) on the image). If the optical axis O and the center of the imaging surface approximately coincide or in the case of a non-rotationally symmetric optical system, the orientation may be as viewed from the center of the image. For pixel pair 001 located horizontally from the optical axis O on the image, both the parallax direction and the orientation on the image are horizontal and parallel to each other. In this case, the partial regions of the pupil corresponding to the G1 pixel and the G2 pixel are divided in the circumferential direction, and the viewpoint positions differ in the radial direction.
[0042] On the other hand, for pixel pair 002 located in the vertical direction from the optical axis O on the image, the parallax direction is horizontal, whereas the orientation on the image is vertical, and the parallax direction and the orientation on the image form an angle of 90 degrees with each other. At this time, the partial regions of the pupil corresponding to the G1 pixel and the G2 pixel are divided in the radial direction, and the viewpoint position differs in the circumferential direction. Also, for pixel pair 003 located in the diagonal direction from the optical axis O on the image, the parallax direction is horizontal, whereas the orientation on the image is diagonal. Hereinafter, if the direction is defined as 0 degrees to the right in the horizontal direction, the orientation on the image is 225 degrees, and the parallax direction and the orientation on the image form an angle of 45 degrees. At this time, the partial regions of the pupil corresponding to the G1 pixel and the G2 pixel are divided in the direction between the radial direction and the circumferential direction, and the viewpoint position differs in both the circumferential direction and the radial direction.
[0043] As described above, the parallax direction is always horizontal, but when the optical system is taken as a reference, the parallax direction changes between the circumferential direction and the radial direction depending on the position on the image (the pixel position of the image sensor). Similarly, the pupil division direction is always vertical, but when the optical system is taken as a reference, it changes between the circumferential direction and the radial direction depending on the position on the image. As a result, the amount of error in the distance information caused by astigmatism differs depending on the position on the image (the angle between the parallax direction and the orientation on the image). For this reason, in this embodiment, it is preferable to correct the distance information based on the angle between the parallax direction and the orientation corresponding to the position on the image.
[0044] Next, the amount of error in distance information according to the position on the image will be described with reference to Figures 5(A) to (F). Figures 5(A) to (F) are explanatory diagrams of errors in distance information.
[0045] Figures 5 (A) and (B) show the amount of error due to curvature of field in an optical system. Curvature of field changes depending on the image height, and occurs as a rotationally symmetric error in a rotationally symmetric optical system. Since curvature of field is also an error that occurs on the image plane of an imaging optical system, it results in errors in the amount of parallax shift, the amount of defocus, and the subject distance. On the other hand, curvature of field is different from astigmatism in that it is an image plane shift that is not dependent on the position where the light rays contained in the light beam pass through the pupil of the optical system. Therefore, the image plane position is the same in the pupil division direction of the optical system.
[0046] 5C and 5D show the amount of error due to astigmatism in the optical system. As with the curvature of field, it changes depending on the image height, but it is not necessarily rotationally symmetric because it occurs as an error depending on the line of sight direction or the position on the screen. When the parallax direction is only in the circumferential direction or only in the concentric direction regardless of the position on the image, and in the case of a rotationally symmetric optical system, it occurs as a rotationally symmetric error. However, in this embodiment, a non-rotationally symmetric error occurs. For example, in a pixel pair located horizontally from the optical axis center in the image, an error due to astigmatism occurs when the pupil is divided in the circumferential direction. On the other hand, in a pixel pair located vertically from the optical axis center in the image, an error due to astigmatism occurs when the pupil is divided in the radial direction. Furthermore, in a pixel pair located diagonally from the optical axis center in the image, an error due to astigmatism occurs according to the corresponding pupil division direction. That is, the amount of error differs depending on whether the parallax direction is the circumferential direction or the radial direction. In other words, the amount of error differs depending on the relationship between the parallax direction and the orientation on the image. In particular, in a rotationally symmetric optical system, the amount of error is determined by the angle between the parallax direction and the orientation on the image. In this embodiment, the parallax direction is horizontal for all pixels, so an error with two-fold symmetry (point symmetry) occurs with respect to the optical axis as shown in Figures 5(C) and (D).
[0047] 5(E) and (F) show the amount of error when tilt of the image sensor 102 occurs due to manufacturing error. Also called one-sided blur, the error occurs according to the distance from the center of the optical axis along the tilt direction. Similar errors occur due to decentering or tilt of the optical system. Unlike astigmatism, this is an image plane deviation that does not depend on the position where the light rays contained in the light beam pass through the pupil of the optical system. Therefore, the image plane position does not change in the pupil division direction of the optical system.
[0048] The amount of error due to the designed aberration can be obtained in advance based on the design data. For example, the image plane position at which the optical performance is the best can be obtained by calculating the optical characteristics when astigmatism is present for the light beams corresponding to the G1 pixel and the G2 pixel while changing the image plane position along the optical axis. The difference between the image plane position obtained according to the position on the image and the reference image plane position is the amount of error. The reference image plane position is the image plane position at which the optical performance is the best when there is no astigmatism, for example, the image plane position at which the optical performance is the best for the pixel on the optical axis. Since the calculation load is large when calculating for all pixels, the error amount may be interpolated by calculating at discrete pixel positions.
[0049] Also, calculations may not be performed using light beams corresponding to the G1 and G2 pixels exactly, but may be performed using light beams on a predetermined cross section that can take into account the same parallax direction. For example, if the parallax direction is the radial direction, calculations may be performed using meridional light beams; if the parallax direction is the circumferential direction, calculations may be performed using sagittal light beams; if the parallax direction is the horizontal direction, calculations may be performed using light beams on a horizontal cross section. Also, the parallax direction may be calculated discretely. For example, calculations may be performed only when the parallax directions are in two different directions, and for the other parallax directions, calculations may be performed using the angle of the parallax direction.
[0050] As another method, the amount of error may be obtained by measurement. In particular, when manufacturing errors are taken into consideration, it is preferable to perform measurements for each individual object. The amount of error may be measured by photographing a plane chart at a known distance and acquiring distance information. In addition, by photographing a plane chart while moving the chart or the image sensor in the optical axis direction, the defocus amount and subject distance with the best optical performance can be acquired as values corresponding to the position on the image. In the latter case, since there is no need to acquire distance information, when acquiring an error due to astigmatism in an imaging optical system in a detachable lens device, it is possible to perform the measurement using an image sensor that does not have pixels corresponding to pupil division. Furthermore, in the latter case, in order to measure astigmatism, it is preferable that the chart includes edges in two or more directions. When acquiring by measurement, it is necessary to perform a measurement for each subject distance to be measured, which results in a large workload. Therefore, when acquiring an amount of error corresponding to a design value, it is preferable to acquire it by calculation.
[0051] As described above, in this embodiment, distance information can be obtained with high accuracy by correcting distance information based on the parallax direction. In this embodiment, all pixels of the image sensor 102 are divided vertically, and G1 pixels and G2 pixels are arranged side by side. However, according to this embodiment, distance information can be obtained with high accuracy even with an image sensor of a different form. For example, consider a case where a parallax image is obtained by an image sensor in which all pixels are divided in the radial direction and the parallax direction is the circumferential direction, and a case where a parallax image is obtained by an image sensor in which all pixels are divided in the circumferential direction and the parallax direction is the radial direction. In either case, if the imaging optical system is rotationally symmetric, the error amount of distance information due to astigmatism becomes a rotationally symmetric component regardless of the orientation on the screen. On the other hand, the magnitude of the error amount differs in each case. Therefore, by generating a correction component based on the parallax direction, distance information can be corrected with high accuracy.
[0052] In the image sensor 102 of this embodiment, the correction components differ depending on whether the parallax direction is the radial direction or the circumferential direction. Therefore, when the correction components are made into a two-dimensional map corresponding to the position on the image, the correction components differ depending on the parallax direction. In this way, by performing correction based on different correction components depending on the parallax direction, the distance information can be corrected with high accuracy. In addition, the division direction may differ depending on the position of the pixel pair. In this case, it is necessary to obtain a correction component that differs depending on the parallax direction for each pixel pair. Note that the divided pixels to correspond to the light beam obtained by dividing the pupil do not need to be all pixels of the image sensor 102.
[0053] The distance information may be corrected based on the position of the image. This allows the distance information to be corrected with high accuracy even in an image sensor in which the pixel division direction differs depending on the image position. In addition, when it is known that the parallax direction determined by the image sensor is the horizontal direction, it is possible to obtain whether the parallax direction is the radial direction or the circumferential direction based on the image position. Therefore, the distance information can be corrected with high accuracy based on the parallax direction.
[0054] Distance information may be corrected based on the relationship between the parallax direction and the orientation on the image. This embodiment is not limited to an optical system that is rotationally symmetric about the optical axis, and in a non-rotationally symmetric optical system, for example, even in the radial direction of the same image height, the amount of error due to astigmatism may differ. On the other hand, in a rotationally symmetric imaging optical system, if the image height is the same, the amount of error due to astigmatism is determined based on the relationship (the angle between the parallax direction and the orientation on the image) between the parallax direction and the orientation on the image (the direction based on a predetermined position on the image). Therefore, distance information can be corrected with high accuracy based on the relationship between the parallax direction and the orientation on the image.
[0055] Correction information may be obtained based on the parallax direction from a plurality of correction information corresponding to a plurality of different parallax directions. By obtaining correction information selected based on the parallax direction from a storage unit having a plurality of correction information corresponding to a plurality of different parallax directions, a correction component according to the parallax direction can be obtained. Alternatively, a plurality of correction information corresponding to a plurality of different parallax directions can be obtained by interpolating the plurality of correction information to obtain a correction component based on the parallax direction. For example, the correction information may be a correction information corresponding to a circumferential direction and a radial direction, or a correction information corresponding to a horizontal direction and a vertical direction. In other words, when the parallax direction includes a first direction and a second direction different from the first direction, the distance information can be corrected based on at least one of the first correction information corresponding to the first direction or the second correction information corresponding to the second direction.
[0056] Correction information related to the imaging optical system stored in the lens device may be acquired through communication between the imaging device (camera body) and the lens device (interchangeable lens) and used to correct distance information. When the lens device including the imaging optical system is detachable, it is preferable that the lens device stores information related to optical characteristics such as astigmatism of the imaging optical system. Since the parallax direction is determined by the imaging element, it is preferable that the lens device acquires the parallax direction from the imaging device and communicates correction information in the corresponding parallax direction to the imaging device. In addition, the imaging device may select and acquire only the correction information in the parallax direction corresponding to the imaging element from the correction information for the multiple parallax directions communicated from the lens device. In addition, the image processing unit 104 may record the correction information acquired from the lens device as meta information of the image, and acquire the correction information from the meta information when performing image processing.
[0057] Based on the distance information, a sharpening process may be performed on an image corresponding to a parallax image. The image corresponding to a parallax image is, for example, the parallax image itself, an image generated based on at least one parallax image, or an image obtained by capturing the same subject as the parallax image, and is an image to which distance information acquired based on the parallax image can be applied. The sharpening process based on the distance information may apply a sharpening strength according to the distance information, for example, by performing a sharpening process only on the focused subject. This makes it possible to sharpen only the focused subject without changing the background subject. The sharpening process may also be based on the optical performance of the imaging device. In particular, in the case of a sharpening process assuming the optical performance of the focused subject, the sharpening process can be performed as expected by performing a sharpening process only on the focused subject.
[0058] As another example, the sharpening process may be performed based on optical characteristics according to distance information. Even if the focus state of the imaging optical system is the same, the optical performance differs depending on the distance of the subject. Therefore, the sharpening process can be performed accurately based on the optical characteristics according to the distance information. In particular, in an imaging optical system with astigmatism, the change in optical performance due to the distance of the subject differs depending on the orientation on the image. In particular, in a rotationally symmetric optical system, the optical performance differs between the meridional direction and the sagittal direction. Therefore, by performing the sharpening process using distance information in which the error due to astigmatism is corrected, the sharpening process can be performed accurately in response to the change in optical performance depending on the orientation on the image.
[0059] In this embodiment, the error amount of the defocus amount due to astigmatism is acquired as a correction component, but it may be acquired as a correction amount with the sign inverted and added to the defocus amount for correction. Also, the error amount due to the curvature of field, the tilt of the image sensor, etc. may be acquired as a correction component independent of the error amount due to astigmatism, or may be acquired together as a correction component that simultaneously corrects these errors.
[0060] According to this embodiment, distance information can be obtained with high accuracy by correcting the distance information based on the parallax direction. EXAMPLES
[0061] Next, an imaging device according to a second embodiment of the present invention will be described. This embodiment differs from the first embodiment in terms of the pixel division method of the imaging element. Each pixel of the imaging element in this embodiment is divided into two in the horizontal and vertical directions, and a parallax image (multiple images) is obtained by receiving each of the light beams that divide the pupil of the imaging optical system into four. Note that the external view and block diagram of the imaging device in this embodiment are the same as those in Figs. 1 and 2 described in the first embodiment, and therefore their description will be omitted.
[0062] Next, a method for acquiring distance information (image processing method) in this embodiment will be described with reference to Fig. 3. The image processing method in this embodiment is basically the same as that in the first embodiment described with reference to Fig. 3, but the detailed processing is different. The following description will focus on the processing that differs from that in the first embodiment.
[0063] First, in step S101, a parallax image is acquired using the image sensor 102, as in the first embodiment. However, in this embodiment, four images are acquired as parallax images obtained by imaging from different viewpoints. Next, in step S102, a parallax shift amount is acquired as a two-dimensional map (correction map) calculated for each pixel (partial region of an image) by a known method, as in the first embodiment. However, since four parallax images are acquired, there are parallax images corresponding to three parallax directions, namely, the horizontal direction, the vertical direction, and the diagonal direction. In this embodiment, three two-dimensional maps of parallax shift amount are acquired corresponding to each parallax direction. The parallax direction corresponding to the parallax shift amount is determined by the parallax image used for acquisition. In addition, a reliability map is acquired for each parallax shift amount at the same time as acquiring the parallax shift amount. The reliability map may be acquired based on the similarity in block matching, for example.
[0064] Next, in step S103, the acquisition unit 104a of the image processing unit (image processing device) 104 multiplies each of the parallax shift amounts acquired in step S102 by a predetermined conversion coefficient to acquire a two-dimensional defocus map in which the defocus amount for each pixel is arranged. The conversion coefficient may be a conversion coefficient that differs depending on the parallax direction or the image position. This is because the parallax shift amount is affected by aberration and therefore differs depending on the parallax direction or the screen position when there is asymmetric aberration such as coma aberration.
[0065] Next, in step S104, the acquisition unit 104a acquires a correction component for the defocus map acquired in step S103. Here, the correction component is an error amount for astigmatism. The correction component is calculated in advance based on three parallax directions, the horizontal direction, the vertical direction, and the diagonal direction, and the data is stored in the ROM 111, and the acquisition unit 104a acquires the correction component based on the data. The correction component is acquired by calculation or measurement, similarly to the first embodiment.
[0066] Next, in step S105, the correction unit 104b of the image processing unit 104 corrects each defocus map by subtracting the corresponding correction component acquired in step S104 from each defocus map acquired in step S103. The corresponding correction component is a correction component for the corresponding parallax direction, and the corresponding parallax direction is determined by the parallax image used to acquire the parallax shift amount corresponding to each defocus map. For example, in a defocus map acquired based on parallax images with different viewpoint positions in the horizontal direction, a correction component corresponding to the case where the parallax direction is the horizontal direction is used.
[0067] The acquisition unit 104a acquires a defocus map integrated from the three corrected defocus maps by selecting a defocus map in the most reliable parallax direction for each image position based on the reliability map acquired in step S102. Note that instead of selecting a defocus map in the most reliable parallax direction, a defocus map integrated by a weighted average of the three corrected defocus maps based on the reliability may be acquired. Alternatively, the method of acquiring the integrated defocus map may be based on at least one of the respective defocus maps, and is not limited to the weighted average.
[0068] Next, in step S106, the acquisition unit 104a acquires a two-dimensional object distance map (distance information) from the above-mentioned lens formula based on the defocus map acquired in step S105. The image recording unit 109 stores the finally acquired object distance map or image information, and this flow ends.
[0069] In this embodiment, one integrated defocus map is obtained from the defocus maps corresponding to the respective parallax directions. However, this embodiment is not limited to this, and object distance information corresponding to each parallax direction may be obtained from the defocus maps corresponding to each parallax direction, and the object distance information may be integrated based on the reliability.
[0070] In this embodiment, a defocus map corresponding to each of the three parallax directions is acquired. However, this embodiment is not limited to this, and one integrated parallax shift amount may be acquired based on the reliability map to acquire one defocus map. By integrating the parallax shift amount, the calculation load when acquiring the defocus map can be reduced. In this case, when correcting the defocus map, the correction may be performed based on the method of integrating the parallax shift amount. Alternatively, the correction component for the parallax shift amount may be acquired and corrected without acquiring the correction component for the defocus map.
[0071] In this embodiment, the defocus maps corresponding to the three parallax directions are corrected. However, this embodiment is not limited to this, and the correction may be performed on the integrated defocus map, or may be performed simultaneously with the integration. In this case, correction information may be obtained based on the parallax direction used during integration from a plurality of pieces of correction information corresponding to a plurality of different parallax directions.
[0072] In this embodiment, a reliability map is obtained based on the parallax image, and an integrated defocus map is obtained based on the reliability map. However, this embodiment is not limited to this, and a parallax direction used for calculating the parallax shift amount may be obtained based on the parallax image. Since the parallax shift amount cannot be obtained without a luminance change in the parallax direction, for example, when the object is a horizontal edge divided into upper and lower parts, the accuracy of obtaining the parallax in the horizontal direction decreases. On the other hand, the accuracy of obtaining the parallax shift amount is good in the vertical direction in which the luminance change of the object is large. Therefore, by obtaining a direction in which the luminance change is large within the image area used for block matching, a parallax direction that allows the parallax shift amount to be obtained with high accuracy for each area on the image can be obtained. The parallax direction used for calculating the parallax shift amount is, in other words, the parallax direction corresponding to the distance information. The parallax direction corresponding to the distance information is the parallax direction in the multiple images used when obtaining the distance information. Note that the method is not limited to the method of obtaining the distance information based on only one parallax direction. The amount of luminance change may be used in the same way as the reliability map, and the distance information may be obtained by weighting the results obtained in multiple parallax directions. In this case, a plurality of parallax directions may be acquired based on the parallax image.
[0073] According to this embodiment, the distance information can be obtained with high accuracy by correcting the distance information based on the parallax direction.
[0074] (Other Examples) The present invention can also be realized by supplying a program for realizing one or more functions of the above-mentioned embodiments to a system or device via a network or a storage medium, and having one or more processors in a computer of the system or device read and execute the program. It can also be realized by a circuit (e.g., ASIC) for realizing one or more functions. The image processing device in the present invention may be any device having the image processing function of the present invention, and may be realized in the form of an imaging device or a PC.
[0075] According to each embodiment, the image processing method for acquiring distance information based on images from different viewpoints can reduce the influence of errors that depend on the parallax direction. Therefore, according to each embodiment, it is possible to provide an image processing method, an image processing device, an imaging device, and a program that can acquire distance information with high accuracy.
[0076] The disclosure of each embodiment includes the following methods and compositions:
[0077] (Method 1) An acquisition step of acquiring distance information based on a plurality of images obtained by capturing images from different viewpoints; and correcting the distance information based on a parallax direction corresponding to the distance information and a position on at least one of the plurality of images. (Method 2) the position on the image is an orientation based on a predetermined position on the image, The image processing method according to method 1, characterized in that in the correction step, the distance information is corrected based on an angle between the parallax direction and the orientation corresponding to the position on the image. (Method 3) 3. The image processing method according to method 1 or 2, wherein the distance information is information regarding at least one of a parallax shift amount, a defocus amount, and a subject distance. (Method 4) 4. The image processing method according to any one of Methods 1 to 3, wherein in the correction step, the distance information is corrected based on astigmatism of an optical system used when acquiring the multiple images. (Method 5) 5. The image processing method according to any one of Methods 1 to 4, wherein in the correction step, the distance information is corrected using a two-dimensional correction map calculated for each partial region on the image. (Method 6) 6. The image processing method according to any one of Methods 1 to 5, wherein in the correcting step, the distance information is corrected using a correction component that is two-fold symmetric with respect to the optical axis. (Method 7) the parallax direction includes a first direction and a second direction different from the first direction, An image processing method according to any one of methods 1 to 6, characterized in that, in the correction step, the distance information is corrected based on at least one of first correction information corresponding to the first direction or second correction information corresponding to the second direction. (Method 8) 8. The image processing method according to any one of Methods 1 to 7, wherein in the acquisition step, the parallax direction is acquired based on the multiple images. (Method 9) The image processing method according to any one of Methods 1 to 8, wherein the parallax direction differs depending on the pixel position of an imaging element used when acquiring the multiple images. (Method 10) 10. An image processing method according to any one of Methods 1 to 9, characterized in that the multiple images are acquired by directing multiple light beams that have passed through different regions of a pupil of an optical system to different pixels of an image sensor. (Method 11) 11. The image processing method according to any one of Methods 1 to 10, wherein in the correction step, the distance information is corrected using correction information relating to an optical system used when acquiring the multiple images. (Method 12) An image processing method according to any one of methods 1 to 11, further comprising a processing step of performing a sharpening process on an image corresponding to the plurality of images based on the distance information corrected in the correction step. (Configuration 1) an acquisition unit that acquires distance information from a plurality of images captured from different viewpoints; an image processing device comprising: a correction unit that corrects the distance information based on a parallax direction corresponding to the distance information and a position on at least one of the plurality of images. (Configuration 2) the position on the image is an orientation based on a predetermined position on the image, 2. The image processing device according to configuration 1, wherein the correction unit corrects the distance information based on an angle between the parallax direction and the orientation corresponding to the position on the image. (Configuration 3) 3. An imaging device comprising: the image processing device according to configuration 1 or 2; and an imaging element that acquires the plurality of images. (Configuration 4) A program for causing a computer to execute the image processing method according to any one of Methods 1 to 12.
[0078] Although the preferred embodiments of the present invention have been described above, the present invention is not limited to these embodiments, and various modifications and changes are possible within the scope of the gist of the present invention. [Explanation of symbols]
[0079] 104 Image processing unit (image processing device) 104a Acquisition Department 104b Correction section
Claims
1. An acquisition step of acquiring distance information based on a plurality of images obtained by capturing images from different viewpoints; and correcting the distance information based on a parallax direction corresponding to the distance information and a position on at least one of the plurality of images.
2. the position on the image is an orientation based on a predetermined position on the image, 2. The image processing method according to claim 1, wherein in the correcting step, the distance information is corrected based on an angle between the parallax direction and the orientation corresponding to the position on the image.
3. 2. The image processing method according to claim 1, wherein the distance information is information regarding at least one of a parallax shift amount, a defocus amount, and a subject distance.
4. 2. The image processing method according to claim 1, wherein in said correcting step, said distance information is corrected based on astigmatism of an optical system used when said plurality of images are acquired.
5. 5. The image processing method according to claim 1, wherein in the correcting step, the distance information is corrected using a two-dimensional correction map calculated for each partial region on the image.
6. 5. The image processing method according to claim 1, wherein in the correcting step, the distance information is corrected using a correction component that is two-fold symmetric with respect to an optical axis.
7. the parallax direction includes a first direction and a second direction different from the first direction, 5. The image processing method according to claim 1, wherein in the correction step, the distance information is corrected based on at least one of first correction information corresponding to the first direction or second correction information corresponding to the second direction.
8. 5. The image processing method according to claim 1, wherein in the obtaining step, the parallax direction is obtained based on the plurality of images.
9. 5. The image processing method according to claim 1, wherein the parallax direction differs depending on pixel positions of an image sensor used when acquiring the plurality of images.
10. 5. The image processing method according to claim 1, wherein the plurality of images are acquired by guiding a plurality of light beams that have passed through different regions of a pupil of an optical system to different pixels of an image sensor.
11. 5. The image processing method according to claim 1, wherein in the correcting step, the distance information is corrected using correction information relating to an optical system used when the plurality of images are acquired.
12. 5. The image processing method according to claim 1, further comprising a processing step of performing a sharpening process on an image corresponding to the plurality of images based on the distance information corrected in the correction step.
13. an acquisition unit that acquires distance information from a plurality of images captured from different viewpoints; an image processing device comprising: a correction unit that corrects the distance information based on a parallax direction corresponding to the distance information and a position on at least one of the plurality of images.
14. the position on the image is an orientation based on a predetermined position on the image, The image processing device according to claim 13 , wherein the correction unit corrects the distance information based on an angle between the parallax direction and the orientation corresponding to the position on the image.
15. 15. An imaging apparatus comprising: the image processing apparatus according to claim 13; and an imaging element for acquiring the plurality of images.
16. A program for causing a computer to execute the image processing method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Imaging device and imaging device control method
JP2017009640A
