The present application claims priority from Japanese application JP 2023-083131 filed on May 19, 2023, the content of which is hereby incorporated by reference into this application.
The present invention relates to a device for generating a depth map, a method for generating a depth map, and a non-transitory information storage medium storing a program for generating a depth map.
A paper described below proposes a technique for generating a depth map from an image captured through a coded aperture. In the paper, two coded apertures having different aperture patterns (shapes of light-transmissive areas and light-shielding areas) are used. The two coded apertures are used in combination to prevent a frequency band in which a power spectrum is zero from occurring in a filter (a filter for generating a restored image) used in a process for generating a depth map.
In the paper as below, depths are calculated in the following manner. (1) Point Spread Functions (PSFs) having sizes according to prespecified reference depths e.g., 100 mm and 300 mm and corresponding to aperture patterns of coded apertures are prepared. (2) Restored images are generated for each reference depth by using two captured images respectively acquired through the two coded apertures and the PSFs. (3) Deviations between gray scale values of the respective pixels of the captured images and pixel values (gray scale values) of the respective pixels of the restored images are calculated, and then the reference depth corresponding to the PSF that makes a smaller deviation is calculated as the estimated depth of the respective pixels displaying a subject.
“C. Zhou, S. Lin, and S. Nayar: Coded Aperture Pairs for Depth from Defocus, IEEE international conference on computer vision, 2009”
The depths calculated in the method disclosed in the paper as above may contain a depth with lower accuracy (that is, a depth largely different from a real depth).
A device for generating a depth map proposed in the present disclosure is a device for generating a depth map containing a plurality of pixels respectively indicating depths from a captured image captured through a coded aperture. The generation device includes a depth calculation unit configured to calculate depths of the plurality of pixels, a pixel selection unit configured to select a depth indicating pixel that is a pixel for indicating a depth, and a memory unit storing a point spread function (PSF) corresponding to a prespecified reference depth and corresponding to an aperture pattern of the coded aperture. The pixel selection unit is configured to calculate deviation values indicating degrees of deviation between a real depth and the reference depth for the respective pixels based on a reference depth restored image. The reference depth restored is reproduced from the captured image by using the PSF and the captured image. The pixel selection unit is configured to select the depth indicating pixel based on changes of the deviation values of the pixels arranged in a predetermined direction.
A method for generating a depth map proposed in the present disclosure is a method for generating a depth map containing a plurality of pixels respectively indicating depths from a captured image captured through a coded aperture. The generation method includes a depth calculation step of calculating depths of the plurality of pixels, a pixel selection step of selecting a depth indicating pixel that is a pixel for indicating a depth, and a step acquiring a point spread function (PSF) corresponding to a prespecified reference depth and corresponding to an aperture pattern of the coded aperture from a memory unit. At the pixel selection step, deviation values indicating degrees of deviation between a real depth and the reference depth are calculated for the respective pixels based on a reference depth restored image. The reference depth restored image is reproduced from the captured image using the PSF and the captured image. The depth indicating pixel is selected based on changes of the deviation values of the pixels arranged in a predetermined direction.
A program proposed in the present disclosure is a program for controlling a computer to function as a device for generating a depth map containing a plurality of pixels respectively indicating depths from a captured image captured through a coded aperture. The program is for controlling the computer to function as a depth calculation unit configured to calculate depths of the plurality of pixels, a pixel selection unit configured to select a depth indicating pixel that is a pixel for indicating a depth, and a unit acquiring a point spread function (PSF) corresponding to a prespecified reference depth and corresponding to an aperture pattern of the coded aperture from a memory unit. The pixel selection unit is configured to calculate deviation values indicating degrees of deviation between a real depth and the reference depth for the respective pixels based on a reference depth restored image. The reference depth restored image is reproduced from the captured image by using the PSF and the captured image. The pixel selection unit is configured to select the depth indicating pixel based on changes of the deviation values of the pixels arranged in a predetermined direction.
According to the device for generating a depth map, the method for generating a depth map, and a program for generating a depth map, accuracy of the depth indicated in the depth map may be increased.
As below, a device for generating a depth map, a method for generating a depth map, and a program for generating a depth map proposed in the present disclosure will be explained.
The imaging device 13 is an image sensor such as a CMOS (Complementary Metal Oxide Semiconductor) sensor or a CCD (Charge Coupled Device).
The liquid crystal panel 14 contains a plurality of pixels. The liquid crystal panel 14 has a coded aperture 14a in a part thereof. A control section 11, which will be described later, drives liquid crystal of the coded aperture 14a to form a prespecified aperture pattern. The aperture pattern will be described later in detail.
As shown in
The control section 11 includes at least one processor, e.g., a CPU (Central Processing Unit), a GPU (Graphical Processing Unit), or the like. Image data acquired by the imaging device 13 is provided to the control section 11. The control section 11 generates a depth map showing distances to a subject using the image data.
The memory unit 12 includes a main memory unit and an auxiliary memory unit. For example, the main memory unit is a volatile memory such as a RAM (Random Access Memory) and the auxiliary memory unit is a nonvolatile memory such as a ROM (Read Only Memory), an EEPROM (Electrically Erasable and Programmable Read Only Memory), a flash memory, or a hard disc. The control section 11 executes a program stored in the memory unit 12 to control the liquid crystal panel 14 and calculate depths (distances to the subject). The processing executed by the control section 11 will be described later. The generation device 10 is a portable device e.g., a smartphone, a tablet PC (Personal Computer), or the like, or a personal computer connected to a camera.
The input section 16 may be a touch sensor attached to the liquid crystal panel 14. Further, the input section 16 may be a pointing device such as a keyboard and a mouse. The input section 16 inputs a signal according to an operation by a user to the control section 11.
The aperture control unit 11b controls the liquid crystal of the coded aperture 14a of the liquid crystal panel 14 to form the prespecified aperture pattern.
In aperture patterns B1, B2 shown in
The image acquisition unit 11a controls the imaging device 13 and the coded aperture 14a and continuously captures two images f1, f2 using the two aperture patterns B1, B2 (hereinafter, the images f1, f2 are referred to as captured images). Here, an interval between imaging by the aperture pattern B1 and imaging by the aperture pattern B2 may be several hundreds of milliseconds or several tens of milliseconds.
Note that the number of the aperture patterns formed by the aperture control unit 11b may be more than two. In this case, the image acquisition unit 11a may continuously capture images in the number of more than two aperture patterns. The aperture control unit 11b sequentially changes the plurality of aperture patterns in synchronization with light reception by the imaging device 13.
The depth calculation unit 11c calculates depths (distances from the imaging system N to the subject) with respect to the respective pixels forming the depth map. Each pixel of the depth map may correspond to one pixel of the captured images f1, f2. In contrast, each pixel of the depth map may correspond to a plurality of adjacent pixels (e.g., 2×2) in the captured images.
As will be described later, in the generation device 10, the depth calculation unit 11c calculates the depths only with respect to the pixels selected by the pixel selection unit 11d (depth indicating pixels). Then, the map generation unit 11g displays the calculated depths in the depth indicating pixels of the depth map. In contrast, the depth calculation unit 11c may calculate the depths with respect to all pixels. Then, the map generation unit 11g may display the calculated depths only with respect to the pixels selected by the pixel selection unit 11d (depth indicating pixels).
First, the depth calculation unit 11c performs two-dimensional Fourier transform on the captured images f1, f2 (S101). Hereinafter, frequency characteristics of the captured images f1, f2 obtained by the two-dimensional Fourier transform are referred to as F1, F2. That is, F1 and F2 is are the results of the two-dimensional Fourier transform executed for the captured images f1 and f2, respectively. Note that, if an image contains a high-frequency component, noise may excessively affect calculation of a reference depth restored image. Accordingly, high-frequency components may be removed from the frequency characteristics F1, F2. For example, a low-pass filter that transmits only frequencies equal to or lower than a half of the sampling frequency (Nyquist frequency) may be used. Further, the frequency characteristics F1, F2 with the high-frequency components removed may be used in processing, which will be described later.
In the generation device 10, a plurality of point spread functions (PSFs) are prepared, which respectively corresponding to a plurality of reference depths that is defined discretely. The reference depths are candidate values of distances to the subject, e.g., 100 mm, 300 mm, 700 mm, etc. The respective PSFs have shapes corresponding to the aperture patterns B1, B2 of the coded aperture 14a. Further, the respective PSFs have sizes according to the reference depths. Specifically, the larger the reference depth, the smaller the size of the PSF. The storage unit 12 stores the frequency characteristics obtained by two-dimensional Fourier transform of the plurality of PSFs. The depth calculation unit 11c acquires, as the PSF, the frequency characteristics of the PSFs from the memory unit 12. The frequency characteristics are also referred to as optical transfer functions (OTFs).
The depth calculation unit 11c generates restored images according to the reference depths for each of the plurality of reference depths, by using the captured images f1, f2 and the PSFs (S102). Hereinafter, the restored image is referred to as “reference depth restored image”. Specifically, the depth calculation unit 11c calculates frequency characteristics of the reference depth restored images according to the frequency characteristics F1, F2 of the captured images f1, f2 and the frequency characteristics of the PSFs using the following expression 1.
The expression 1 is obtained by generalization of the Wiener filter to be applicable to the two aperture patterns B1, B2. In the expression 1, the respective signs refer to the following elements:
F0_d: a reference depth restored image expressed by a frequency domain, that is a frequency characteristic of the reference depth restored image;
F1: the frequency characteristics of the captured image f1 obtained by the first aperture pattern B1;
F2: the frequency characteristics of the captured image f2 obtained by the second aperture pattern B2;
K1_d: frequency characteristics (optical transfer function) of the PSF having the shape corresponding to the first aperture pattern B1 and corresponding to a size of “reference depth: d”;
K2_d: frequency characteristics (optical transfer function) of the PSF having the shape corresponding to the second aperture pattern B2 and corresponding to the size of “reference depth: d”;
C: a matrix of an S/N-ratio regularized in consideration of noise due to fluctuations. C can be obtained by e.g., a variance σ of image noise and a frequency distribution S of a natural image; and
K1_d bar, K2_d bar (K1_d, K2_d with overlines): conjugate complex numbers of the frequency characteristics K1_d, K2_d of PSFs.
The size of the PSF is smaller as the distance (depth) from the imaging system N to the subject is larger. Accordingly, the frequency characteristics K1_d, K2_d of the PSFs are defined according to the distance from the imaging system N to the subject. In the expression 1, index “d” attached to K1, K2corresponds to the reference depth of 100 mm, 300 mm, or the like. For example, functions K1_100, K2_100 are frequency characteristics (optical transfer functions) of the PSFs for the subject which is distant at 100 mm from the imaging system N. The number of reference depths may be more than two, e.g., 10, 20, 30, or the like.
At S102, the depth calculation unit 11c calculates frequency characteristics F0_d of the reference depth restored image according to the frequency characteristics F1, F2 of the captured images f1, f2 and the frequency characteristics K1_d, K2_d of the PSFs. The depth calculation unit 11c calculates the frequency characteristics F0_d of the reference depth restored images for each of the plurality of reference depths. For example, the depth calculation unit 11c calculates frequency characteristics F0_100 of the reference depth restored image based on the frequency characteristics K1_100, K2_100 and the frequency characteristics F1, F2 of the captured images f1, f2. Further, the depth calculation unit 11c calculates frequency characteristics F0_300 of the reference depth restored image based on the frequency characteristics K1_300, K2_300 and the frequency characteristics F1, F2 of the captured images f1, f2. The depth calculating unit 11c executes the same calculations for the other frequency characteristics K1_700, K2_700, K1_1000, K2_1000, or the like.
According to the expression 1, the subject at the distance from the imaging system N equal to the reference depth appears without blur in the reference depth restored image. For example, the subject placed at 100 mm from the imaging system N appears without blur in the reference depth restored image obtained by the frequency characteristics K1_100, K2_100 of the PSFs. On the other hand, in the reference depth restored images obtained by the frequency characteristics K1_d, K2_d of the PSFs corresponding to the other reference depths at 300 mm, 700 mm, or the like, the same subject appears with blur (shifts in gray level values). The larger the difference between the real depth of the subject and the reference depth, the stronger the blur. Accordingly, the depth calculation unit 11c calculates the distance (depth) to the subject by using the degree of blur in the subsequent processing.
The depth calculation unit 11c calculates a deviation value map Md based on the frequency characteristics F0_d of the reference depth restored image and the frequency characteristics F1, F2 of the captured images f1, f2 (S103). The deviation value map Md is calculated for each of the plurality of reference depths (100 mm, 300 mm, etc.) In each deviation value map Md, a degree of deviation between the real depth and the reference depth (deviation value) is indicated at each pixel of the depth map.
The depth calculation unit 11c calculates the deviation value map Md with reference to e.g., the following expression 2.
In the expression 2, the respective signs refer to the following elements:
Md: a deviation value map for “reference depth: d”;
IFFT: two-dimensional inverse Fourier transform;
F0_d: the frequency characteristics of the reference depth restored image with respect to “reference depth: d”;
K1_d: the frequency characteristics (optical transfer function) of the PSF having the shape corresponding to the first aperture pattern B1 and corresponding to the size of “reference depth: d”;
K2_d: the frequency characteristics (optical transfer function) of the PSF having the shape corresponding to the second aperture pattern B2 and corresponding to the size of “reference depth: d”;
F1: the frequency characteristics of the captured image f1 obtained by the first aperture pattern B1; and
F2: the frequency characteristics of the captured image f2 obtained by the second aperture pattern B2.
As described above, in the processing at S102, the depth calculation unit 11c generates a plurality of reference depth restored images (more specifically, the frequency characteristics F0_d thereof) from the captured images f1, f2 (more specifically, the frequency characteristics F1, F2 thereof) respectively by using the frequency characteristics K1_d and K2_d expressing PSFs defined for the reference depths (d). Then, at S103, the deviation values w between the real depths and the reference depths are calculated by using the plurality of reference depth restored images expressed by the frequency characteristics F0_d and the frequency characteristics F1 and F2 expressing the captured images f1 and f2.
The pixel selection unit 11d selects depth indicating pixels with reference to the plurality of deviation value maps Md at S104 to S106. The depth indicating pixel is a pixel indicating the depth (the distance from the imaging system N to the subject) in the depth map. Then, the depth calculation unit 11c calculates the depths for the depth indicating pixels at S107.
Note that, unlike the example described here, the depth calculation unit 11c may calculate depths for all pixels. Then, the calculated depths may be indicated only in the depth indicating pixels selected by the pixel selection unit 11d.
As below, processing by the pixel selection unit 11d and the depth calculation unit 11c will be explained with a case where a checker pattern exemplified in
The deviation value w becomes the minimum at the reference depth same as the real depth or the reference depth close to the real depth. For example, a line A in
However, in an area apart from the boundary between white and black, the pixel values (gray scale values) of the plurality of pixels are substantially the same, and blur is hard to appear in the captured images f1, f2. Accordingly, in a pixel located in the area, the changes of the deviation values w according to the reference depths are smaller. Therefore, in the area, the reference depth having the minimum deviation value w is hard to coincide with the real depth (the distance to the subject). In other words, in the area, a difference between the reference depth having the minimum deviation value w and the real depth is larger.
For example, a line B in
As described above, in the area with the smaller changes in gray scale value, e.g., the white area, the black area, or the like, an accurate estimated depth d0 is hard to be calculated. Accordingly, as shown by an upper part of
Further, as shown by a lower part of
Accordingly, the pixel selection unit 11d selects a pixel having a high probability that the accurate estimated depth d0 is calculated as a depth indicating pixel. Then, the depth calculation unit 11c calculates a depth for the depth indicating pixel.
Specifically, the pixel selection unit 11d searches for a pixel having a high probability that the accurate estimated depth d0 is calculated based on the changes of the deviation values w of the pixels arranged along a predetermined direction with reference to the respective deviation value maps Md (hereinafter, the predetermined direction is referred to as a pixel scanning direction). More specifically, the pixel selection unit 11d searches for a pixel having a local maximum deviation value w from the pixels arranged along the pixel scanning direction. Then, the unit sets the pixel obtained by the search as a candidate pixel (S104).
For example, the unit selects one or more pixels having the local maximum deviation values w as candidate pixels from the pixels arranged along the pixel scanning direction in the deviation value map M100. Further, the unit selects one or more pixels having the local maximum deviation values w as candidate pixels from the pixels arranged along the pixel scanning direction in a deviation value map M300. The pixel selection unit 11d performs the same processing with respect to the other deviation value maps Md.
Then, when a plurality of candidate pixels respectively selected from the plurality of deviation value maps Md satisfy a predetermined condition, the pixel selection unit 11d selects the pixels that satisfy the condition as depth indicating pixels. For example, when the number of candidate pixels located at an identical position (having the same coordinate value) is equal to or larger than a predetermined number, the pixel selection unit 11d selects the candidate pixels as one of depth indicating pixels. In other words, candidate pixels selected from the predetermined number or more deviation value maps Md are selected as one of the depth indicating pixels (S105, (the candidate pixels selected in the above described processing are hereinafter referred as a common candidate pixel).
Referring to
The pixel selection unit 11d scans the deviation values w of the pixels along the pixel scanning direction. The pixel scanning direction is a direction according to the two types of aperture patterns B1, B2, specifically, a longitudinal direction. At S104, for example, the pixel selection unit 11d compares the deviation values w of the plurality of pixels arranged in the longitudinal direction (e.g., three to seven pixels) with one another, and searches for a pixel (candidate pixel) having the local maximum deviation value w. The pixel selection unit 11d sequentially performs the search from one end portion (upper end pixel) to the opposite end portion (lower end pixel) in the longitudinal direction of the pixel area. The pixel selection unit 11d records the found candidate pixel in the memory unit 12.
The pixel selection unit 11d may fit a function to the deviation values w of a predetermined number of pixels arranged in the longitudinal direction in the nth column or all pixels in the nth column. Further, the pixel selection unit 11d may specify the candidate pixel having the local maximum deviation value w by using derivatives of the function (a first derivative value and a second derivative value).
In the deviation value map M100 exemplified in the left part of
In the deviation value map M300 shown in the center part of
The pixel selection unit 11d refers to all pixels arranged in the nth column. As a result, depending on the captured image, as shown in
At S105, the pixel selection unit 11d refers to positions (that is, coordinates in the image) of the plurality of candidate pixels recorded in the memory unit 12. Then, the unit selects, as the common candidate pixel, the candidate pixels selected in a predetermined number or more (e.g., three or more) deviation value maps Md. In the example shown in
As shown in
Note that the method of selecting the common candidate pixel is not limited to the above described example. For example, in contrast to the above described example, the pixel selected as the candidate pixel only in the deviation value maps Md in the number less than the predetermined number may be excluded from the candidate pixels and the remaining candidate pixels may be selected as the common candidate pixels. For example, the pixel selected as the candidate pixels only in one or two deviation value maps Md may be excluded from the candidate pixels and all of the remaining candidate pixels may be selected as the common candidate pixels.
As described above, the pixel selection unit 11d scans the pixels in the longitudinal direction (pixel scanning direction) in the selection processing of the depth indicating pixels. This is for the following reason.
The first aperture pattern B1 and the second aperture pattern B2 exemplified in
Accordingly, in the selection processing of the depth indicating pixels, the pixel selection unit 11d scans the pixels in the longitudinal direction and searches for the pixel having the local maximum deviation value w. In other words, though the aperture patterns B1, B2 has a disadvantage that it is difficult to calculate the accurate estimated depth d0 for the boundary line along the longitudinal direction by the aperture patterns B1, B2, the selection processing utilize the disadvantage conversely by scanning the pixels in the longitudinal direction.
Note that the pixel scanning direction is not limited to the longitudinal direction. For example, even if the aperture patterns of the coded aperture 14a are the patterns B1, B2 exemplified in
Further, depending on the first aperture pattern B1 and the second aperture pattern B2, scanning may be performed in a different direction from the longitudinal direction (e.g., the lateral direction or an oblique direction). Then, the pixel selection unit 11d may search for the pixel having the local maximum deviation value w (candidate pixel).
For example, when the first aperture pattern B1 and the second aperture pattern B2 are symmetrical with respect to a line along the longitudinal direction, the pixel selection unit 11d may scan the pixels arranged in a direction orthogonal to the line (lateral direction) to search for the candidate pixel.
Further, for example, when the first aperture pattern B1 and the second aperture pattern B2 are symmetrical with respect to a line oblique to the lateral direction and the longitudinal direction, the pixel selection unit 11d may scan the pixels in a direction orthogonal to the line and search for the candidate pixel.
The depth calculation unit 11c calculates a depth (a distance from the imaging system N to the subject) for the selected depth indicating pixel with reference to the plurality of deviation value maps Md (S107). In the example illustrated in
The calculation processing of the depth is not limited to the example described here. In the above described processing, the depth calculation unit 11c sets, as the estimated depth d0 of the depth indicating pixel, the reference depth corresponding to the deviation value map Md minimizing the deviation value wd. Unlike this, the depth calculation unit 11c may obtain a function expressing the relationship between the reference depth and the deviation value wd and then calculate the local minimum value of the function. Then, the unit 11c may calculate the depth with which the local minimum value is obtained as the estimated depth d0 of the pixel.
For example, the processing by the depth calculation unit 11c is performed in the following manner. The depth calculation unit 11c fits e.g. a cubic function to the relationship between the reference depth and the deviation value wd shown in
Then, the depth calculation unit 11c obtains the local minimum of the expression 3. That is, the depth calculation unit 11c calculates a depth at which the function W(d) is the local minimum by solving δW/δd=0. Then, the depth calculation unit 11c sets the calculated depth as the estimated depth d0. According to the processing, resolution for the depth may be increased without increase of the number of reference depths (the number of PSFs).
The depth calculation unit 11c determines whether the processing at S104 to S107 is finished for all columns of the captured images f1, f2 (S108). Then, when there is an unprocessed column (“No” at S108), the depth calculation unit 11c returns to S104 and executes the processing at S104 to S107.
When the processing at S104 to S107 is finished for all columns (“Yes” at S108), the map generation unit 11g displays the calculated estimated depth d0 in the depth map.
The device for generating a depth map proposed in the present disclosure is not limited to the example of the above described generation device 10.
In the generation device 10, in the selection processing of the depth indicating pixel, the candidate pixel is searched for by scanning of the pixels in the longitudinal direction in the deviation value map. The pixel scanning direction is not limited to the longitudinal direction, but may be determined according to the first aperture pattern and the second aperture pattern.
When the checker pattern exemplified in
15) extending in a direction orthogonal to the line Le. In this case, the pixel selection unit 11d may scan the pixels in a direction (pixel scanning direction shown in
The subsequent processing is the same as that in the example of the above described generation device 10. That is, the pixel selection unit 11d selects a common candidate pixel that is a pixel selected as a candidate pixel in the predetermined number or more deviation value maps Md (S105). Then, the unit 11d selects, as the depth indicating pixels, the common candidate pixel and a predetermined number of pixels sandwiching the common candidate pixel in the pixel scanning direction (S106). The depth calculation unit 11c calculates estimated depths for the selected depth indicating pixels (S107). At S108, when a determination that the processing at S104 to S107 is finished for pixel columns along the pixel scanning direction is made, the map generation unit 11g displays the calculated estimated depths as a depth map (S109).
(1) The device for generating a depth map 10 includes the depth calculation unit 11c configured to calculate depths for respect to the plurality of pixels, the pixel selection unit 11d configured to select the depth indicating pixel that is a pixel indicating the depth in the depth map, and the memory unit 12 storing the PSF corresponding to the prespecified reference depth and corresponding to the aperture pattern of the coded aperture. The pixel selection unit 11d is configured to calculate the deviation values w indicating degrees of deviation between the real depth and the reference depth for the respective pixels based on the reference depth restored image. The reference depth restored image is reproduced from the captured images f1, f2 using the PSF and the captured images f1, f2. The pixel selection unit 11d is configured to select the depth indicating pixel based on the changes of the deviation values of the pixels arranged in the pixel scanning direction.
According to the device for generating a depth map 10 of (1), the depth indicating pixel is selected based on the changes of the deviation values w of the pixels arranged in the pixel scanning direction, and thereby, the accuracy of the depth displayed in the depth map may be increased. For example, compared to a configuration in which a pixel having a larger difference between the maximum and minimum deviation values w (e.g., Δwa, Δwb in
(2) In the generation device 10 of (1), the pixel selection unit 11d calculates a first deviation value for each pixel based on the first reference depth restored image and the captured images f1, f2. The first deviation value indicates a degree of deviation between the real depth and a first reference depth. The first reference depth restored image is reproduced by using a first PSF and the captured images f1, f2. Then, the pixel selection unit 11d selects one or more pixels as first candidate pixels based on changes of the first deviation values of the pixels arranged in the pixel scanning direction. Further, the pixel selection unit 11d calculates a second deviation value for each pixel based on the second reference depth restored image and the captured images f1, f2. The second deviation value indicates a degree of deviation between the real depth and a second reference depth. The second reference depth restored image is reproduced by using a second PSF and the captured images f1, f2. Then, the pixel selection unit 11d selects one or more pixels as second candidate pixels based on changes of the second deviation values of the pixels arranged in the pixel scanning direction. When the first candidate pixel and the second candidate pixel satisfy a predetermined condition, the pixel selection unit 11d selects the first candidate pixel and the second candidate pixel as the depth indicating pixels.
According to the generation device 10 of (2), the depth indicating pixels are selected using the two candidate pixels calculated from the two reference depth restored images. Accordingly, for example, compared to a case where the depth indicating pixel is selected using only the candidate pixels calculated from one reference depth restored image, the accuracy of the depth displayed in the depth map may be increased.
(3) In the generation device 10 of (1) or (2), the candidate pixel is a pixel providing a local maximum of the deviation value of the pixels arranged along the pixel scanning direction. According to the generation device 10 of (3), the candidate pixel may be selected using a characteristic that the deviation value is larger in the pixel in which the depth with higher accuracy is calculated.
(4) In the generation device 10 of (2), the pixel selection unit 11d selects a plurality of candidate pixels, which includes the first candidate pixel and the second candidate pixel, from a plurality of reference depth restored images, respectively. When a predetermined number of candidate pixels contained among the plurality of candidate pixels have an identical position (coordinates), the pixel selection unit 11d selects the candidate pixels at the identical position as the depth indicating pixel. Thereby, the accuracy of the depth displayed in the depth map may be further increased.
(5) In the generation device 10 of (1) to (4), the coded aperture 14a includes the first aperture patterns B1 (or B3) and the second aperture patterns B2 (or B4). The device for generating a depth map 10 generates the depth map from the first captured image f1 captured through the first aperture patterns B1 (or B3) and the second captured image f2 captured through the second aperture patterns B2 (or B4). Thereby, compared to a case where the number of aperture patterns is one, the accuracy of the depth displayed in the depth map may be increased.
(6) In the generation device 10 of (1) to (5), the pixel scanning direction is a direction determined according to the first aperture patterns B1 (or B3) and the second aperture patterns B2 (or B4). Thereby, the depth may be calculated conversely utilizing a disadvantage that the calculation of a accurate depth is difficult depending on the relationship between the aperture patterns and the pixel scanning direction.
(7) In the generation device 10 of (6), the first aperture patterns B1 (or B3) and the second aperture patterns B2 (or B4) are symmetrical to each other with respect to the straight lines Lc (or Le). The pixel scanning direction is a direction crossing the straight lines Lc (or Le).
Although the present invention has been illustrated and described herein with reference to embodiments and specific examples thereof, it will be readily apparent to those of ordinary skill in the art that other embodiments and examples may perform similar functions and/or achieve like results. All such equivalent embodiments and examples are within the spirit and scope of the present invention, are contemplated thereby, and are intended to be covered by the following claims.
Number | Date | Country | Kind |
---|---|---|---|
2023-083131 | May 2023 | JP | national |