IMAGE PROCESSING APPARATUS, IMAGING APPARATUS, IMAGE PROCESSING METHOD, AND COMPUTER PROGRAM
The image processing device corrects gradient directions in local areas of reference images to accurately identify aperture problem areas, enhancing image matching and parallax calculation precision.
Patent Information
- Application Number
- JP2022124723
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2022-08-04
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2042-08-04
AI Technical Summary
Existing image processing methods struggle to accurately determine aperture problem areas, particularly when reference images have linear textures, strong or weak contrasts, leading to errors in parallax calculation.
An image processing device that generates and corrects gradient directions for local areas within reference images, using multiple pixel value changes along different directions to calculate reliability, ensuring accurate identification of aperture problem areas.
Enables precise determination of aperture problem areas, improving the accuracy of image matching and parallax calculation regardless of image texture characteristics.
Smart Images

Figure 0007559015000028 
Figure 0007559015000029 
Figure 0007559015000030
Abstract
Description
[Technical field]
[0001] The present invention relates to an image processing device, an imaging device, an image processing method, a computer program, and the like that perform image matching. [Background technology]
[0002] Block matching is a method for acquiring multiple images and calculating 3D information. In this method, first, for two images (hereafter referred to as image A and image B, respectively) taken from different viewpoints, an arbitrary region 1 is set as a base image in image A. Then, region 2 is set as a reference image in image B, and the position of region 2 is shifted to search for region 2 that is most highly correlated with region 1.
[0003] Then, the distance is calculated based on the positional deviation between region 1 and region 2 when the correlation is at its highest. Note that the search uses cross-correlation, which represents the degree of difference (or similarity) between regions of different images, to determine which regions are similar. This positional deviation is called disparity, and distance information can be obtained by using known techniques such as triangulation.
[0004] Parallax occurs in the direction of deviation of the viewpoints of image A and image B, so generally, search of area 2 is often performed in only one direction. However, in reality, deviations can occur in a direction different from the expected direction of parallax due to errors when assembling the device or distortions caused by the optical system. This deviation causes errors that depend on the subject when calculating the amount of parallax. For this reason, this error can be reduced by searching area 2 in a two-dimensional range (two-dimensional search).
[0005] However, in 2D search, errors may occur in the calculation of the disparity in certain areas. For example, the aperture problem is an area where errors occur. This error occurs when the reference image only has features in one direction (one-dimensional features).
[0006] When the base image has one-dimensional features, there are multiple positions of the reference image that have the same texture as the base image during block matching. In this case, the reference image at a position different from the actual disparity position may end up matching as the image most similar to the base image, and in that case, the calculated disparity value will contain an error.
[0007] In response to this, Patent Document 1 discloses a method for determining whether a reference image is a region where an opening problem occurs (opening problem region) and calculating reliability. That is, the method discloses a method for calculating the direction in which pixel value changes occur for each local region in the reference image, and determining that the region is an opening problem region when the variance of the direction in which pixel value changes occur is small in the entire reference image. [Prior art documents] [Patent documents]
[0008] [Patent Document 1] JP 2011-182084 A Summary of the Invention [Problem to be solved by the invention]
[0009] However, the method disclosed in Patent Document 1 may not be able to make a correct judgment when the reference image has a linear texture, or when the reference image contains textures with high and low contrast.
[0010] Therefore, an object of the present invention is to provide an image processing device capable of determining an opening problem area with high accuracy. [Means for solving the problem]
[0011] According to one aspect of the present invention, there is provided an image processing device comprising: 1. An image processing device for generating a confidence of a match between a first image and a second image, comprising: a pixel value change generating means for generating a reference image including a pixel of interest in the first image or the second image, and generating at least a first pixel value change along a first direction and a second pixel value change along a second direction for each local region of the reference image; a gradient direction generating means for generating a gradient direction of the local region based on the first pixel value change and the second pixel value change; When the local region is moved symmetrically with respect to a point, the gradient of the local region becomes equal to the gradient of a local region different from the local region. A gradient direction correction means for correcting the gradient direction; and a reliability generating means for generating the reliability based on the gradient direction corrected by the gradient direction correcting means. Effect of the Invention
[0012] According to the present invention, it is possible to provide an image processing device capable of determining an opening problem area with high accuracy. [Brief description of the drawings]
[0013] [Figure 1] 1A to 1C are diagrams illustrating an imaging device including a reliability calculation device according to a first embodiment of the present invention. [Diagram 2] 1 is a diagram showing an exit pupil 123 of an optical system 122 as viewed from the intersection (central image height) of an optical axis 130 and an image sensor 121. [Diagram 3] 4 is an explanatory diagram of pixel value changes in a non-opening problem area in the first embodiment. FIG. [Figure 4] 4 is an explanatory diagram of pixel value changes in an opening problem area in the first embodiment. FIG. [Diagram 5] 4A to 4C are diagrams illustrating pixel value changes in a linear texture according to the first embodiment. [Figure 6] 6A to 6C are explanatory diagrams of pixel value changes in the case where a high-contrast texture and a low-contrast texture are included in the first embodiment. [Figure 7]1A and 1B are explanatory diagrams of a reliability calculation device according to a first embodiment, where 1A is a functional block diagram illustrating a schematic configuration of a reliability calculation device 110 according to the first embodiment, and 1B is a flowchart illustrating the operation of the reliability calculation device 110 according to the first embodiment. [Figure 8] 13 is a diagram for explaining the positional relationship between the reference image and the local region set in step S711. FIG. [Figure 9] FIG. 4 is an explanatory diagram of a gradient direction calculation unit according to the first embodiment. [Figure 10] FIG. 11 is an explanatory diagram of the process of step S714 by a gradient direction correction unit according to the first embodiment. [Figure 11] 6A to 6C are diagrams for explaining the effect of the process in the reliability calculation unit of the first embodiment. [Figure 12] 13A and 13B are diagrams for explaining the positional relationship between a base image and a reference image. [Figure 13] FIG. 11 is an explanatory diagram of an imaging device including a reliability calculation device according to a second embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0014] Hereinafter, an embodiment of the present invention will be described with reference to the drawings. However, the present invention is not limited to the following embodiment. In each drawing, the same members or elements are given the same reference numerals, and duplicated descriptions are omitted or simplified.
[0015] <Embodiment 1> 1(A) to 1(C) are diagrams for explaining an imaging device including a reliability calculation device according to embodiment 1 of the present invention. Fig. 1(A) is a schematic diagram of the imaging device according to embodiment 1, in which an imaging device 100 includes a reliability calculation device 110, an imaging unit 120, and an image matching unit 140. The imaging device 100 is provided with a CPU as a computer (not shown), and a memory (not shown) that stores a computer program.
[0016] Here, the imaging device 100 functions as an image processing device that generates a reliability of matching between the first image and the second image. The image matching unit 140 includes a measuring means that measures the distance to the subject based on the reliability of matching between the first image and the second image.
[0017] The reliability calculation device 110 and the image matching unit 140 can be configured using logic circuits. Note that the reliability calculation device 110 and the image matching unit 140 may be realized by causing a CPU provided in the imaging device 100 to execute a computer program stored in a memory.
[0018] The imaging unit 120 functions as an imaging means, and includes an imaging element 121 and an optical system 122. The optical system 122 is a photographing lens of the imaging device 100, and has a function of forming an image of a subject on the imaging element 121. The optical system 122 is composed of a plurality of lens groups (not shown), an aperture (not shown), etc., and has an exit pupil 123 at a position separated by a predetermined distance from the imaging element 121.
[0019] In this embodiment, the z-axis is parallel to the optical axis 130 of the optical system 122, and the x-axis and y-axis are perpendicular to each other and perpendicular to the z-axis. The optical system 122 is provided with a focus adjustment circuit (focus adjustment means) (not shown) that adjusts the focus of the optical system based on information on the distance to the subject output from the image matching unit 140.
[0020] The image sensor 121 is composed of a CMOS (complementary metal oxide semiconductor) or CCD (charge-coupled device) image sensor. An object image formed on the image sensor 121 via an optical system 122 is photoelectrically converted by the image sensor 121 to generate an image signal based on the object image.
[0021] 1(B) is a diagram showing an example of an xy cross section of the imaging element 121. The imaging element 121 is configured by arranging a plurality of pixel groups 150 in a two-dimensional manner, each of which has 2 rows and 2 columns. In the pixel group 150, green pixels 150G1 and 150G2 are arranged in the diagonal direction, and a red pixel 150R and a blue pixel 150B are arranged as the other two pixels.
[0022] 1(C) is a schematic diagram showing the II' cross section of the pixel group 150. Each pixel is composed of a light receiving layer 182 and a light guide layer 181. In the light receiving layer 182, a pair of photoelectric conversion units (photoelectric conversion unit 161 as a first photoelectric conversion unit and photoelectric conversion unit 162 as a second photoelectric conversion unit) are arranged for photoelectrically converting received light.
[0023] The light guide layer 181 is provided with microlenses 183 for efficiently guiding the light beam incident on the pixel to the photoelectric conversion section, color filters (not shown) that pass light of a predetermined wavelength band, wiring for image reading (not shown), wiring for pixel driving (not shown), and the like.
[0024] Furthermore, the photoelectric conversion signal of each pixel is read out via wiring, converted into an AD-converted image signal, and input to the reliability calculation device 110. Figures 1(B) and (C) show an example of a pair of photoelectric conversion units divided into two in one pupil division direction (x-axis direction). However, depending on the specifications, for example, four photoelectric conversion units divided in two pupil division directions (x-axis direction and y-axis direction) may be provided, and the pupil division direction and number of divisions are arbitrary.
[0025] 2 is a diagram showing the exit pupil 123 of the optical system 122 as viewed from the intersection (central image height) of the optical axis 130 and the image sensor 121. A first light flux that has passed through a first pupil region 210, which is a different region of the exit pupil 123, and a second light flux that has passed through a second pupil region 220 are incident on the photoelectric conversion units 161 and 162, respectively.
[0026] The photoelectric conversion unit 161 and the photoelectric conversion unit 162 in each pixel perform photoelectric conversion on the incident light beam to generate photoelectric conversion signals corresponding to an A image (first image) and a B image (second image), respectively. That is, the multiple photoelectric conversion units 161 as the first photoelectric conversion unit generate the first image, and the multiple photoelectric conversion units 162 as the second photoelectric conversion unit generate the second image. The generated photoelectric conversion signals are AD converted into image signals and input to the reliability calculation device 110.
[0027] 2 shows the center position (first center position 211) of the first pupil region 210 and the center position (second center position 221) of the second pupil region 220. In this embodiment, the first center position 211 is decentered (moved) from the center of the exit pupil 123 along a first axis 200.
[0028] On the other hand, the second center of gravity position 221 is decentered (moved) in the opposite direction to the first center of gravity position 211 along the first axis 200. The direction of the first axis 200 connecting the first center of gravity position 211 and the second center of gravity position 221 is called the pupil division direction. In addition, the distance between the centers of gravity of the first center of gravity position 211 and the second center of gravity position 221 is the base length 230.
[0029] Next, a description will be given of the reliability calculation device 110 of this embodiment. The reliability calculation device 110 acquires image information, and calculates a reliability that indicates the likelihood of a matching result between that image and another image.
[0030] First, the characteristics of the gradient directions of the opening problem area and the non-opening problem area will be described with reference to Fig. 3 and Fig. 4. Fig. 3 is an explanatory diagram of pixel value changes in the non-opening problem area of the embodiment 1, and Fig. 4 is an explanatory diagram of pixel value changes in the opening problem area of the embodiment 1. Two types of reference images set in an image acquired using the imaging device 100 are shown as reference image 310 in Fig. 3 and reference image 410 in Fig. 4.
[0031] In Fig. 3, 320A, 320B, and 320C indicate local regions in reference image 310. In addition, 330A, 330B, and 330C in the figure indicate gradient directions. Note that gradient directions will be described later with reference to Fig. 9. In addition, 420A, 420B, and 420C in Fig. 4 indicate local regions in reference image 410. In addition, 430A, 430B, and 430C in the figure indicate gradient directions in reference image 410.
[0032] Here, the case of a non-opening problem region will be described using the reference image 310 in Fig. 3. The gradient direction 330A, gradient direction 330B, and gradient direction 330C in Fig. 3 each indicate a different direction. Therefore, the consistency of the gradient directions is low in the reference image 310. When the consistency of the gradient directions is low like this, it can be determined that the region is a non-opening problem region.
[0033] On the other hand, the case of an opening problem region will be described using the reference image 410 in Fig. 4. Gradient direction 430A, gradient direction 430B, and gradient direction 430C indicate the same direction. Therefore, the uniformity of the gradient directions is high in the reference image 410. By evaluating the uniformity of the gradient directions in this way, it is possible to determine whether or not the region is an opening problem region. In other words, if the uniformity of the gradient directions is high, it can be determined that the region is an opening problem region.
[0034] Next, the problem to be solved by the present invention will be described. Fig. 5 is an explanatory diagram of pixel value changes in a linear texture according to the first embodiment, and Fig. 6 is an explanatory diagram of pixel value changes in a case where a texture with high contrast and a texture with low contrast according to the first embodiment are included. Two types of reference images set in an image acquired using the imaging device 100 are shown as reference image 510 in Fig. 5 and reference image 610 in Fig. 6.
[0035] The case of the opening problem area, which is a problem, will be described using reference image 510. A band-shaped area with small pixel values exists in the center of reference image 510. Local area 520A, local area 520B, local area 520C, and local area 520D are set within reference image 510. In addition, the gradient directions of the respective local areas are indicated by local area 530A, local area 530B, local area 530C, and local area 530D.
[0036] In local region 520A and local region 520B, the gradient direction is to the left. On the other hand, in local region 520C and local region 520D, the gradient direction is to the right. In this way, local regions with different gradient directions exist in reference image 510, and the consistency of the gradient directions is low. Therefore, there is a high possibility that reference image 510 will be erroneously determined to be a non-opening problem region.
[0037] Another opening problem area will be described using reference image 610. Reference image 610 is an image in which strong and weak textures coexist. There is an area with low pixel values in the lower left of reference image 610. The pixel values in the upper right of reference image 610 are higher than those in the lower left, and there are random weak fluctuations in pixel values. When matching is performed with such an image, the boundary between the lower left and upper right of reference image 610, which has strong contrast, dominates the result, and it becomes an opening problem area like reference image 410 in FIG. 4.
[0038] Here, local region 620A, local region 620B, local region 620C, and local region 620D are set in reference image 610. The gradient directions of the respective local regions are indicated by local region 630A, local region 630B, local region 630C, and local region 630D. In local region 620A and local region 620B, which exist in the boundary portion between the lower left and upper right of reference image 610, the gradient direction is oriented toward the upper right.
[0039] On the other hand, the gradient directions are random in local regions 620C and 620D that exist in the upper right of the reference image 610. In this way, local regions with different gradient directions exist, and the uniformity of the gradient directions is low in the reference image 610. Therefore, there is a high possibility that the reference image 610 will be erroneously determined to be a non-opening problem region.
[0040] 7(A) and (B) are explanatory diagrams of a reliability calculation device according to embodiment 1, and Fig. 7(A) is a functional block diagram illustrating an outline of the configuration of a reliability calculation device 110 according to embodiment 1. In Fig. 7(A), the reliability calculation device 110 includes a first pixel value change amount calculation unit 111, a second pixel value change amount calculation unit 112, a gradient direction calculation unit 113, a gradient direction correction unit 114, a gradient magnitude calculation unit 115, a reliability calculation unit 116, and a reliability correction unit 117.
[0041] 7A is realized by causing the CPU included in the imaging device to execute a computer program stored in a memory serving as a storage medium, but may be realized in part or in whole by hardware.
[0042] The hardware may be a dedicated circuit (ASIC), a processor (reconfigurable processor, DSP), etc. Also, the functional blocks shown in Fig. 7(A) do not have to be built into the same housing, and may be configured by separate devices connected to each other via signal paths.
[0043] Fig. 7(B) is a flowchart showing the operation of the reliability calculation device 110 of the embodiment 1. Note that the operation of each step of the flowchart in Fig. 7(B) is performed by the CPU as a computer in the imaging device 100 executing a computer program stored in the memory.
[0044] When the image processing according to the first embodiment is started, the process proceeds to step S710. In step S710, the CPU performs shooting using the imaging device 100, generates and acquires an image, and stores the acquired image in the main body memory (not shown). It is to be noted that either image A or image B may be acquired.
[0045] The image acquired in step S710 may be subjected to a process for correcting the loss of balance in light quantity caused mainly by vignetting of the optical system 122. Specifically, in the image capturing device 100, a correction value is stored in advance in a memory based on the result of capturing an image of a surface light source with uniform brightness, such that the brightness value of the image becomes a substantially constant value regardless of the angle of view. Then, the image acquired in step S710 is corrected based on the correction value stored in the memory, thereby making it possible to correct the unevenness in the balance in light quantity.
[0046] In addition, for example, in order to reduce the influence of optical shot noise generated in the image sensor 121, the acquired image may be subjected to filtering using a band-pass filter, a low-pass filter, or the like. In addition, the image may be reduced in size in order to reduce the calculation cost. Alternatively, the image may be made higher resolution by a known method in order to calculate the reliability at a higher resolution.
[0047] In step S711, the CPU calculates the first pixel value change amount using first pixel value change amount calculation unit 111. Specifically, in step S711, an image of a partial region on an image including a pixel (a pixel of interest) for which matching reliability is to be calculated is set as a reference image. Then, a plurality of partial regions in the reference image are set as local regions, and the pixel value change amount (first pixel value change amount) along an arbitrary direction of each local region is calculated.
[0048] 8 is a diagram for explaining the positional relationship between the reference image and the local regions set in step S711, where 810 indicates the image acquired in step S710. In step S711, first pixel value change amount calculation unit 111 calculates the pixel value change amount in each of the multiple local regions of the reference image.
[0049] Specifically, first pixel value change amount calculation section 111 first extracts a partial region including a pixel of interest 820 and its vicinity from image 810, and sets it as reference image 811. Next, a plurality of partial regions 812 are extracted from reference image 811, and set them as local regions 812A, 812B, etc. A method for setting partial region 812 as a partial region will be described below.
[0050] Next, a first direction 830 is set as a direction in which a pixel value change is calculated. At this time, the direction in which the pixel value change is calculated may be any direction. Since setting the direction along the pixel array makes it easier to calculate the pixel value change amount described below, the following description will be given assuming that the first direction 830 is the x-axis direction.
[0051] Next, the pixel value change amount along the first direction 830 is calculated. The pixel value change amount may be calculated using any known method that can evaluate the pixel value change amount along the first direction 830 of the local region. For example, the pixel value change amount may be calculated by applying a Sobel filter or a Prewitt filter. Alternatively, the pixel value change amount may be calculated using the central difference gradient or the median difference gradient of the local region. In the central difference gradient, the gradient of a pixel is the weighted difference of the neighboring pixels. In the median difference gradient, the gradient of a pixel is the difference between the neighboring pixels and the current pixel.
[0052] 7, the CPU calculates the pixel value change amount (second pixel value change amount) of the pixel values along the second direction 840 of the local region 812A and the local region 812B by the second pixel value change amount calculation unit 112. Specifically, the second pixel value change amount calculation unit 112 first sets the second direction 840 which is the direction in which the pixel value change is calculated. At this time, the second direction 840 may be any direction different from the first direction 830.
[0053] Setting the direction along the pixel array makes it easy to calculate the pixel value change amount described below. Also, setting a second direction perpendicular to the first direction 830 makes it easy to perform calculations by the gradient direction calculation unit 113 and the gradient magnitude calculation unit 115 described below. In the following description, the second direction 840 is assumed to be the y-axis direction.
[0054] Next, the amount of change in pixel value along the second direction 840 is calculated. The amount of change in pixel value may be calculated using any known method as long as it is possible to evaluate the amount of change in pixel value along the second direction 840 of the local region. For example, the amount of change in pixel value may be calculated by applying either a Sobel filter or a Prewitt filter and calculating a differential value.
[0055] Alternatively, the first and second differential values may be calculated using a central differential gradient or an intermediate differential gradient of a local region. In this manner, at least two directions, a first direction and a second direction, may be set, and a first differential value obtained by performing a differentiation process in the first direction and a second differential value obtained by performing a differentiation process in the second direction may be calculated. Also, the first pixel value change may be generated based on the first differential value, and the second pixel value change may be generated based on the second differential value.
[0056] Steps S711 and S712 function as a pixel value change generating step for setting a reference image including the pixel of interest in the first image or the second image and generating a first pixel value change and a second pixel value change along at least two directions for each local region of the reference image. These two directions are called the first direction and the second direction, respectively. In addition, the first pixel value change amount calculation unit 111 and the second pixel value change amount calculation unit 112 function as pixel value change generating means.
[0057] Next, in step S713 in FIG. 7B, the CPU calculates, by the gradient direction calculation unit 113, a direction in which the pixel values of the local region change, using any known method.
[0058] First, the direction in which pixel values change will be described with reference to Fig. 9. Fig. 9 is an explanatory diagram of the gradient direction calculation unit of the first embodiment, and shows a local region 910 and its pixel values. It shows that the pixel values are small in the lower left region of the local region 910, and large in the upper right region of the local region 910. The direction perpendicular to the boundary of the pixel values is the gradient direction 920 of the local region 910.
[0059] The gradient direction calculation unit 113 calculates the gradient direction based on the first pixel value change and the second pixel value change. That is, the gradient direction is calculated by a vector having a first component and a second component calculated from the first pixel value change and the second pixel value change. Specifically, the gradient direction calculation unit 113 calculates the pixel value change dx in the x-axis direction along the pixel value array from the first direction 830 and the first pixel value change amount.
[0060] In addition, a pixel value change dy in the y-axis direction perpendicular to the x-axis direction is calculated from the second direction 840 and the second pixel value change amount. A gradient direction is calculated as a vector from the pixel value change dx in the x-axis direction and the pixel value change dy in the y-axis direction using the following Equation 1.
[0061]
number
[0062] Alternatively, the gradient vector v' may be calculated as the following Equation 2 obtained by normalizing Equation 1 by the magnitude of the gradient.
number
[0063] Here, step S713 functions as a gradient direction generating step of generating a gradient direction of a local region based on the first pixel value change and the second pixel value change. At this time, the gradient direction calculation unit 113 functions as a gradient direction generating means.
[0064] Next, in step S714 in Fig. 7, the CPU corrects the gradient direction calculated in step S713. The effect of the processing in step S714 will be described. Fig. 10 is an explanatory diagram of the processing in step S714 by the gradient direction correction unit in the first embodiment. In step S714, the gradient is corrected so that the gradient has the same value even when the local region is moved point-symmetrically, and a corrected gradient direction is calculated.
[0065] 10, when the local region 520A and the local region 520B are moved point-symmetrically, the texture becomes the same as that of the local region 520D and the local region 520C, respectively. Therefore, in step S714, correction is applied so that the corrected gradient directions of these local regions become the same. For example, the corrected gradient direction 1030A is corrected to 1030D.
[0066] When the process of step S716 described later is performed using the corrected gradient direction thus corrected, a low reliability is calculated. Therefore, the reference image 510 is correctly determined to be an opening problem area. This is because in step S716, the uniformity of the gradient direction is evaluated as a reliability by a value such as variance, and a low reliability is calculated when the variation in the direction is low, such as in the point-symmetric corrected gradient directions 1030A to 1030D.
[0067] In this manner, in step S714, the pixel value gradient direction is corrected based on the gradient direction of the local region (for example, based on the positive and negative values of the first pixel value change and the second pixel value change) for the reference image as shown in Fig. 10. This allows a correct reliability to be calculated in the subsequent step S716, and makes it possible to determine that the region is an opening problem region.
[0068] Specifically, first, a reference direction is set. Any direction can be used as the reference direction. Since the correction described below can be easily performed by setting the reference direction to a direction along the pixel value array, the following description will be given assuming the reference direction to be the +x-axis direction. The reference direction is set to 0°, and the range from -90° to +90° is set as the utilization range. In other words, the pixel value gradient direction is calculated from the ratio between the first pixel value change and the second pixel value change, and a utilization range of 180° is determined.
[0069] Next, it is determined whether the gradient direction calculated in step S713 is within the usable range. For example, the gradient angle θ, which is the angle with the positive direction of the x-axis, is calculated from the ratio of the first component and the second component of the gradient vector v or the gradient vector v'. For example, in the case of Fig. 5, the gradient angle θ of the local region 520A and the local region 520B is 180°, and the gradient angle θ of the local region 520C and the local region 520D is 0°.
[0070] Next, it is determined whether the gradient angle θ is within the utilization range of -90° to +90°. If the gradient angle θ is not within the utilization range, i.e., if the pixel value gradient direction is outside the predetermined utilization range, the gradient angle θ is corrected by correcting the pixel value gradient direction to +180° or -180° so that it falls within the utilization range.
[0071] For example, in the case of FIG. 5, the gradient angle θ of local region 520A and local region 520B is outside the usable range, so 180° is subtracted so that the point-symmetric corrected gradient angle θp becomes 0° as in corrected gradient direction 1030A and corrected gradient direction 1030B in FIG.
[0072] On the other hand, since the gradient angle θ of local region 520C and local region 520D is within the usable range, the angle is not changed, and the point-symmetric corrected gradient angle θp is made to be 0°, the same as the original gradient angle θ, as in corrected gradient direction 1030C and corrected gradient direction 1030D in Fig. 10. Note that the pixel value gradient direction may be calculated by narrowing the range so as to be within the usable range based on the ratio between the first pixel value change and the second pixel value change.
[0073] The point-symmetric corrected gradient angle θp can be calculated using the following formulas 3 and 4 to calculate a point-symmetric corrected gradient vector vp obtained by correcting the gradient vector v or the gradient vector v', or a point-symmetric corrected gradient vector vp' obtained by normalizing the gradient vector v or the gradient vector v'.
[0074]
number
[0075]
number
[0076] Alternatively, if the first component a is negative, it may be determined that the region is a used region, and the signs of the first component a and the second component b may be inverted to calculate the range-corrected first component af and the range-corrected second component bf.
[0077] Furthermore, a correction is made to the loss of continuity of the gradient direction due to the determination of the utilization range. Specifically, when calculating Equation 3 and Equation 4, θ is doubled before the calculation. That is, the angle of the pixel value gradient direction is corrected to be doubled. Then, the double angle corrected gradient vector vd or a normalized double angle corrected gradient vector vd' may be calculated.
[0078] The first component ap and the second component bp of the point-symmetric correction gradient vector vp are expressed by the following formulas 5 and 6. Furthermore, by utilizing the fact that the double angle formula can be used to express the vector as in the following formulas 7 and 8, the double angle correction gradient vector vd may be calculated from the following formula 9 or 10. Using a similar concept, the double angle correction gradient vector vd' may be calculated from the first component ap' and the second component bp' of the point-symmetric correction gradient vector vp'.
[0079]
number
[0080]
number
[0081]
number
[0082]
number
[0083]
number
[0084]
number
[0085] Here, step S714 functions as a gradient direction correction step for correcting the gradient direction in accordance with the gradient direction. Also, at this time, the gradient direction correction unit 114 functions as gradient direction correction means.
[0086] 7, the CPU calculates the strength of change in pixel values in local region 812A and local region 812B by any known method using gradient magnitude calculation unit 115. Specifically, at least one of the sum, maximum value, average value, sum of squares, and square root of the sum of squares of the first pixel value change amount and the second pixel value change amount may be calculated as the gradient magnitude. Note that, as described later, this gradient magnitude may be used as a weight.
[0087] Alternatively, the gradient magnitude may be calculated as the sum, maximum value, average value, sum of squares, or square root of the sum of squares of the first and second components of the gradient vector vp or the double-angle-corrected gradient vector vd. Note that this is the same value as when the first pixel value change amount and the second pixel value change amount are used.
[0088] 7, the CPU calculates the consistency of the gradient direction of each local region in the reference image as a reliability using any known method by the reliability calculation unit 116. Specifically, first, the gradient direction is obtained from each local region set in the reference image. This gradient direction may be corrected in step S714. Furthermore, the gradient strength calculated in step S715 may also be obtained.
[0089] Next, for the multiple gradient directions obtained, at least one of the variance value, weighted variance value, standard deviation value, or weighted standard deviation value is set as uniformity, and the reliability is calculated to be higher as these values are larger. Alternatively, at least one of the average composite vector length value, weighted average composite vector length, square value of the average composite vector length, or square value of the weighted average composite vector length of the gradient directions may be set as uniformity, and the reliability is calculated to be higher as these values are smaller.
[0090] Here, we will explain the variance and standard deviation of the gradient direction. Here, the gradient direction is data that can be expressed as an angle, and the angle has periodicity. Therefore, the variance and standard deviation cannot be obtained by general statistical processing.
[0091] Here, we will assume that the gradient vector v' normalized by the magnitude of the gradient is acquired as the gradient direction. We assume n pieces of data v'1 to v'n as gradient vector data, and calculate their variance and standard deviation. Note that the first component a' and second component b' of each data are a1' to an' and b1' to bn'.
[0092] The resultant vector R' of v'1 to v'n can be obtained using the following formula 11.
[0093]
number
[0094] In addition, the average resultant vector Rm' can be calculated by dividing the resultant vector R' by the number of data n. This can be converted as shown in the following formula 12 using the length (average resultant vector length) Rmlen' of the average resultant vector Rm' and the angle (average resultant vector angle) φ.
[0095]
number
[0096] Using the average composite vector length Rmlen', the variance V' is defined by the following formula 13, and the standard deviation S' is defined by the following formula 14. Note that the variance V' and standard deviation S' take values between 0 and 1, and the closer to 1 the value is, the greater the degree of dispersion of the data.
[0097]
number
[0098]
number
[0099] Here, the average resultant vector length Rmlen' is calculated using the following formulas 15 to 17.
number
[0100]
number
[0101]
number
[0102] In addition, a method for calculating the weighted variance and standard deviation will be described. The weights for each data are set as w1 to wn. The weighted average composite vector length Rwlen' is calculated using the following formulas 18 to 20.
[0103]
number
[0104]
number
[0105]
number
[0106] By performing calculations in the same manner as in Equation 13 or Equation 14 using the weighted average resultant vector length Rwlen' instead of the average resultant vector length Rmlen', the weighted variance Vw' or the weighted standard deviation Sw' can be calculated.
[0107] A case will be described where the gradient vector v is acquired as the gradient direction. The first component a and the second component b of each data are a1 to an and b1 to bn. The average resultant vector length Rlen is expressed by the following formulas 21 to 23.
[0108]
number
[0109]
number
[0110]
number
[0111] The variance V or standard deviation S can be calculated by performing calculations in the same manner as in Equation 13 or Equation 14 using the average resultant vector length Rlen instead of the average resultant vector length Rmlen'.
[0112] Here, the average composite vector length R'len, the weighted average composite vector length Rw'len, the square of the average composite vector length R'len, or the square of the weighted average composite vector length Rw'len are also numerical values that indicate the degree of dispersion of each data. These take values from 0 to 1, and the closer to 0, the greater the degree of dispersion of the data. In this case, calculations can be performed with lighter processing.
[0113] In this case, the gradient strength may be used as the weight. For example, the larger the gradient strength, the larger the weight may be. Alternatively, the weight may be set to 1 only for gradient strengths above a certain level, and the weight may be set to 0 for gradient strengths below the certain level. Alternatively, the weight may be set to 1 only for gradient strengths that are larger than the certain level compared within the reference region, and the weight may be set to 0 for gradient strengths below the certain level.
[0114] Next, the effect of using the weighted variance, weighted standard deviation, weighted average resultant vector length, or the square of the weighted average resultant vector length of the gradient direction as uniformity and using the gradient magnitude as the weight in step S716 will be described. Fig. 11 is a diagram for explaining the effect of the process in the reliability calculation unit of the first embodiment.
[0115] In Fig. 11, local region 620A and local region 620B have a larger weight than local region 620C and local region 620D. Here, gradient direction 1130A and gradient direction 1130B are the same direction. Therefore, when the uniformity of the gradient direction is evaluated taking the weight into consideration, it is calculated that the uniformity is high. In other words, it is possible to correctly determine that the reference image 610 is an opening problem area.
[0116] The above-mentioned effect can be obtained when the gradient direction calculated in step S713 is used, or when the gradient direction corrected in step S714 is used. Although the reliability may be calculated using any of the above methods, the calculation process can be lightened by using an appropriate weight in step S716.
[0117] For example, in step S714, the double angle corrected gradient vector vd corrected by the formula 9 is calculated as the gradient direction, and in step S715, the sum of the squares of the first and second components of the double angle corrected gradient vector vd is calculated as the gradient magnitude.
[0118] Then, when the square of the weighted average resultant vector length is calculated using the gradient intensity as a weight in step S716, the sum of squares of the first and second components of the double angle corrected gradient vector vd appearing in the intermediate formula can be cancelled out. Specifically, Formula 22 and Formula 23 can be expressed as the following Formulas 24 to 27.
[0119]
number
[0120]
number
[0121]
number
[0122]
number
[0123] Here, the double-angle corrected gradient vector vd resulting from the correction performed in step S714 is used. Therefore, selecting the sum of squares of the first and second components as the weight contributes to reducing the calculation cost, and selecting the weight depending on the content of the gradient direction can reduce the calculation processing.
[0124] Here, step S716 functions as a reliability generating step of generating the reliability based on at least one of the gradient direction corrected in the gradient correction step and the gradient strength of the local region. Also, at this time, the reliability calculation unit 116 functions as a reliability generating means.
[0125] 7, the CPU corrects the reliability calculated in step S716 by using reliability correction unit 117 as a reliability correction means. Specifically, first, a direction in which there is no problem even if an error occurs in matching (error-tolerant direction) is obtained. For example, when the reference image is used for parallax calculation, even if an error occurs in the matching result in a direction (y-axis direction) perpendicular to the x-axis direction, which is the pupil division direction, there is no effect on the parallax. In other words, the y-axis direction is the error-tolerant direction.
[0126] Next, the gradient direction of the entire reference image is calculated. Specifically, the average value, weighted average value, mode, or median value of the gradient directions of each local region may be set as the gradient direction of the entire reference image. Here, the average value is defined by the average composite vector angle φ of Equation 12.
[0127] Next, the reliability is corrected. If the error tolerance direction is close to the gradient direction of the entire reference image, the reliability is corrected to be higher. If the error tolerance direction is the y-axis direction, the reliability is corrected to be higher if the gradient direction is close to 90° or -90°. For example, when using the average value of the gradient direction of each local region, the reliability is corrected to be higher if Cval is close to 0.
[0128] In addition, when the angle is doubled in step S714, the reliability is corrected to be high when the gradient direction is close to 180°. For example, when the average value of the gradient directions of each local region is used, the reliability is corrected to be high when Cval is close to -1. In addition, an experimentally determined threshold may be used for this judgment, and the reliability may be increased if the reliability is close to the threshold. Also, if it is determined that there is a sufficiently large reliability using the experimentally determined threshold, a judgment may be made that the pixel of interest is trusted, and if not, that the pixel of interest is not trusted.
[0129] Next, the image matching unit 140 of this embodiment will be described. The image matching unit 140 calculates parallax from an image set including image A and image B acquired using the imaging device 100. Specifically, first, an image set including image A and image B acquired using the imaging device 100 is generated and acquired, and the acquired image set is stored in a main body memory (not shown). A process for correcting the loss of balance in light amount caused mainly by vignetting of the optical system 122 may be performed on the acquired image set.
[0130] Specifically, the light quantity balance can be corrected by correcting the luminance values of the A and B images to be substantially constant regardless of the angle of view based on the result of capturing an image of a surface light source with a constant luminance in advance by the imaging device 100. Also, in order to reduce the influence of light shot noise generated in the imaging element 121, for example, a band-pass filter or a low-pass filter may be applied to the acquired A and B images.
[0131] Next, on image A, an image of a partial region including a pixel (a pixel of interest) for which disparity is to be calculated is set as a base image, and a reference image is set on image B. Then, a cross-correlation value between the base image and the reference image is calculated while moving the position of the reference image in a predetermined direction.
[0132] Here, Fig. 12(A) and (B) are diagrams for explaining the positional relationship between the standard image and the reference image. Fig. 12(A) shows an A image 810A, and Fig. 12(B) shows a B image 1210B. The image matching unit 140 calculates a cross-correlation value between the A image 1210A and the B image 1210B.
[0133] Specifically, first, a partial area including the pixel of interest 1220 and its neighboring pixels is extracted from the A image 1210A and set as the base image 1211. Next, an area having the same area (image size) as the base image 1211 is extracted from the B image 1210B and set as the reference image 1212.
[0134] Then, the position on the B image 1210B from which the reference image 1212 is extracted is moved, and the cross-correlation value between the reference image 1212 and the standard image 1211 at each amount of movement (each position) is calculated. In this way, the cross-correlation value consisting of a correlation value data string corresponding to each amount of movement is calculated. At this time, the movement direction of the reference image 1212 may be any direction. The direction in which the reference image 1212 is moved to perform the cross-correlation calculation is called the parallax search direction. By setting the parallax search direction and the pupil division direction to the same direction, the calculation described below can be performed easily.
[0135] The cross-correlation value may be calculated using any known method that can evaluate the degree of correlation between the base image 1211 and the reference image 1212. For example, the sum of squared differences (SSD), the sum of absolute differences (SAD), or normalized cross-correlation (NCC) may be used.
[0136] Next, the disparity value is calculated by any known method. For example, the position where the cross-correlation value is the minimum may be set as the disparity value. Furthermore, sub-pixel estimation may be performed to obtain the disparity in units of decimal pixels. For example, when the cross-correlation value is SSD, the minimum value can be obtained by performing interpolation with a quadratic function. Also, when the cross-correlation value is SAD, the minimum value can be obtained by performing interpolation with an equiangular straight line.
[0137] Alternatively, the image matching unit 140 may calculate the optical flow between multiple images A or B captured at different times. An image at an arbitrary time is set as image 1, and an image at another time as image 2. In image 1, an image of a partial region including a pixel (pixel of interest) for which disparity calculation is performed is set as a base image, and image 2 is set as a reference image. Using the base image and reference image, the optical flow can be calculated using a similar concept to the above-mentioned method of calculating disparity.
[0138] Furthermore, the image matching unit 140 may correct the matching result by using the reliability acquired by the reliability calculation device 110. For example, when the reliability of the disparity of the pixel of interest is lower than a threshold, interpolation may be performed from the results in the vicinity of the pixel of interest.
[0139] In this case, only results with a reliability higher than a threshold value among the results in the vicinity of the pixel of interest may be used, and the average or median of the results may be used for interpolation. Alternatively, the interpolation may be performed using results calculated from images taken at times close to the time the image was captured. Alternatively, a process of extracting only results with high reliability may be performed.
[0140] In the reliability calculation device of this embodiment, the opening problem area is determined by evaluating the uniformity of the gradient direction. According to this process, the opening problem area can be determined regardless of the texture of the reference image. As a result, even if the reference image has a linear texture or contains a texture with high contrast and a texture with low contrast, the opening problem area can be correctly determined. By using the reliability calculated by the reliability calculation device, it is possible to obtain a highly accurate image matching result.
[0141] <Embodiment 2> Hereinafter, a second embodiment in which the present invention is applied to a stereo camera will be described in detail with reference to the drawings. Fig. 13 is a diagram showing a schematic configuration of a reliability calculation device according to the second embodiment. In Fig. 13, the same parts as those in Fig. 1 are denoted by the same reference numbers as in Fig. 1, and the description thereof will be omitted.
[0142] 13, an imaging device 1300 as a stereo camera includes a reliability calculation device 110, an imaging unit 1320, and an image matching unit 140. The imaging unit 1320 has an imaging element 1321 as a first imaging element, and an imaging element 1322 as a second imaging element.
[0143] Also, the camera includes an optical system 1323 as a first optical system that forms a subject image on a first imaging element, and an optical system 1324 as a second optical system that forms a subject image on a second imaging element. A first image (image A) is acquired by the first imaging element, and a second image (image B) is acquired by the second imaging element.
[0144] The optical systems 1323 and 1324 are composed of a plurality of lens groups (not shown) and an aperture (not shown), and have an exit pupil 1325 or 1326 at a predetermined distance from the image sensor 1321 or 1322. At this time, the optical axes of the optical systems 1323 and 1324 are 1331 and 1332, respectively.
[0145] The parallax between images can be calculated accurately by calibrating parameters such as the positional relationship of the optical systems in advance. Also, the parallax between images can be calculated accurately by correcting lens distortion in each optical system. Note that, although there are two optical systems for acquiring image A and image B having parallax according to distance in the second embodiment, a stereo camera composed of three or more optical systems and corresponding image pickup elements may be used.
[0146] In the second embodiment, the degree of freedom in designing the base line length is improved, and the distance measurement resolution can be improved, resulting in a more accurate image matching result.
[0147] Although the present invention has been described in detail based on the preferred embodiments, the present invention is not limited to the above-mentioned embodiments, and various modifications are possible based on the spirit of the present invention, and are not excluded from the scope of the present invention. In addition, the above-mentioned embodiments may be appropriately combined. In addition, the present invention includes the following combinations.
[0148] (Configuration 1) An image processing device that generates a reliability of matching between a first image and a second image, comprising: a pixel value change generation means that sets a reference image including a pixel of interest in the first image or the second image, and generates at least a first pixel value change along a first direction and a second pixel value change along a second direction for each local region of the reference image; a gradient direction generation means that generates a gradient direction of the local region based on the first pixel value change and the second pixel value change; a gradient direction correction means that corrects the gradient direction in accordance with the gradient direction; and a reliability generation means that generates the reliability based on the gradient direction corrected by the gradient direction correction means.
[0149] (Configuration 2) An image processing device that generates a reliability of matching between a first image and a second image, comprising: a pixel value change generating means that sets a reference image including a pixel of interest in the first image or the second image, and generates at least a first pixel value change along a first direction and a second pixel value change along a second direction for each local region of the reference image; a gradient direction generating means that generates a gradient direction of the local region based on the first pixel value change and the second pixel value change; and a reliability generating means that generates the reliability based on the gradient direction and the gradient strength of the local region.
[0150] (Configuration 3) The image processing device according to configuration 1 or 2, wherein the pixel value change generating means sets at least two directions, the first direction along a pixel array and the second direction perpendicular to the first direction, for the local region, calculates a first differential value obtained by performing a differential process in the first direction and a second differential value obtained by performing a differential process in the second direction, generates the first pixel value change based on the first differential value, and generates the second pixel value change based on the second differential value.
[0151] (Configuration 4) The image processing device according to any one of configurations 1 to 3, wherein the pixel value change generating means calculates a differential value by applying either a Sobel filter or a Prewitt filter to the local region.
[0152] (Configuration 5) The image processing device according to any one of configurations 1 to 4, wherein the pixel value change generation means calculates the first differential value and the second differential value using a central differential gradient or an intermediate differential gradient of the local region.
[0153] (Configuration 6) The image processing device according to any one of configurations 1 to 5, wherein the gradient direction generating means calculates the gradient direction based on the first pixel value change and the second pixel value change.
[0154] (Configuration 7) The image processing device according to any one of configurations 1 to 6, wherein the gradient direction generating means calculates the gradient direction using a vector having a first component and a second component calculated from the first pixel value change and the second pixel value change.
[0155] (Configuration 8) The image processing device according to any one of configurations 1 to 7, characterized in that the reliability generation means calculates at least one of the sum, maximum value, average value, sum of squares, or square root of the sum of squares of the first pixel value change and the second pixel value change as a weight, and calculates the reliability so that the larger the weighted variance value or weighted standard deviation value of the gradient direction is, the higher the reliability is.
[0156] (Configuration 9) The reliability generating means The image processing device according to any one of configurations 1 to 8, characterized in that the image processing device calculates, as a weight, any one of a sum, a maximum value, an average value, a sum of squares, or a square root of the sum of squares of the first pixel value change and the second pixel value change, and calculates the reliability so that the smaller the value of the weighted average composite vector length in the gradient direction or the square value of the weighted average composite vector length is, the higher the reliability is.
[0157] (Configuration 10) The image processing device according to any one of configurations 1 to 9, wherein the gradient direction correction means corrects the gradient of the local region so that it has the same value when the local region is moved point-symmetrically.
[0158] (Configuration 11) The image processing device according to any one of configurations 1 to 10, wherein the gradient direction correction means corrects the gradient direction by +180° or -180° when the gradient direction is outside a predetermined utilization range so that it is within the utilization range.
[0159] (Configuration 12) The gradient direction correction means The image processing device according to any one of configurations 1 to 11, characterized in that the gradient direction is calculated by narrowing down a range so that the gradient direction is within a predetermined utilization range from a ratio between the first pixel value change and the second pixel value change.
[0160] (Configuration 13) The image processing device according to any one of configurations 1 to 12, wherein the gradient direction correction means corrects the gradient direction based on positive and negative values of the first pixel value change and the second pixel value change.
[0161] (Configuration 14) The image processing device according to any one of configurations 1 to 13, wherein the gradient direction correction means corrects the angle of the gradient direction to be doubled.
[0162] (Configuration 15) The image processing device according to any one of configurations 1 to 14, wherein the reliability generating means calculates the reliability so that the reliability increases as the variance or standard deviation of the gradient direction increases.
[0163] (Configuration 16) The image processing device according to any one of configurations 1 to 15, characterized in that the reliability generation means calculates the reliability so that the smaller the value of the average composite vector length in the gradient direction or the square value of the average composite vector length, the higher the reliability.
[0164] (Configuration 17) The image processing device according to any one of configurations 1 to 16, wherein the reliability generating means includes a reliability correcting section that corrects the reliability.
[0165] (Configuration 18) The image processing device according to any one of configurations 1 to 17, wherein the reliability correction unit corrects the reliability so as to increase it when the gradient direction of the entire reference image is close to the error allowable direction.
[0166] (Configuration 19) The image processing device according to any one of configurations 1 to 18, wherein the reliability generating means generates the reliability based on a gradient intensity of the local region.
[0167] (Configuration 20) The image processing device according to any one of configurations 1 to 19, wherein the matching comprises calculating an optical flow between images taken at different times.
[0168] (Configuration 21) 21. An imaging device comprising: an image processing device according to any one of configurations 1 to 20; an imaging means for capturing an image of a subject formed by an optical system; a measuring means for measuring a distance to a subject based on the reliability of the matching between the first image and the second image; and a focus adjusting means for adjusting the focus of the optical system based on the distance.
[0169] (Configuration 22) The imaging device described in Configuration 21, wherein the imaging means includes a plurality of first photoelectric conversion units for generating the first image and a plurality of second photoelectric conversion units for generating the second image.
[0170] (Configuration 23) The image processing device described in Configuration 21, characterized in that the imaging means includes a first imaging element, a first optical system that forms the subject image on the first imaging element, a second imaging element, and a second optical system that forms the subject image on the second imaging element, and acquires the first image by the first imaging element and acquires the second image by the second imaging element.
[0171] (Method 1) An image processing method for generating a confidence level of matching between a first image and a second image, comprising: a pixel value change generating step of setting a reference image including a pixel of interest in the first image or the second image, and generating at least a first pixel value change along a first direction and a second pixel value change along a second direction for each local region of the reference image; a gradient direction generating step of generating a gradient direction of the local region based on the first pixel value change and the second pixel value change; a gradient direction correcting step of correcting the gradient direction in accordance with the gradient direction; and a confidence generating step of generating the confidence level based on the gradient direction corrected in the gradient direction correcting step.
[0172] (Method 2) An image processing method for generating a confidence level of matching between a first image and a second image, comprising: a pixel value change generation step of setting a reference image including a pixel of interest in the first image or the second image, and generating at least a first pixel value change along a first direction and a second pixel value change along a second direction for each local region of the reference image; a gradient direction generation step of generating a gradient direction of the local region based on the first pixel value change and the second pixel value change; and a confidence generation step of generating the confidence level based on the gradient direction and the gradient strength of the local region.
[0173] (Program) A computer program for controlling each means of the image processing device according to any one of configurations 1 to 20 or the imaging device according to any one of configurations 21 to 23 by a computer.
[0174] The present invention may be realized by supplying a storage medium on which a program code (control program) of software for implementing the functions of the above-described embodiments is recorded to a system or device, and the computer (or CPU or MPU) of the system or device reads and executes the computer-readable program code stored in the storage medium.
[0175] In this case, the program code itself read out from the storage medium will realize the functions of the above-mentioned embodiment (example), and the storage medium storing the program code will constitute the present invention. [Explanation of symbols]
[0176] 100: Imaging device 110: Reliability calculation device 120: Imaging unit 121: Image sensor 122:Optical system 123: Exit pupil 130: Optical axis 140: Parallax calculation unit
Claims
1. 1. An image processing device for generating a confidence of a match between a first image and a second image, comprising: a pixel value change generating means for setting a reference image including a pixel of interest in the first image or the second image and generating at least a first pixel value change along a first direction and a second pixel value change along a second direction for each local region of the reference image; a gradient direction generating means for generating a gradient direction of the local region based on the first pixel value change and the second pixel value change; a gradient direction correction means for correcting the gradient direction of the local region so that the gradient of the local region becomes the same value as the gradient of a local region different from the local region when the local region is moved point-symmetrically; and a reliability generating unit that generates the reliability based on the gradient direction corrected by the gradient direction correcting unit.
2. The pixel value change generating means at least two directions, the first direction along a pixel array and the second direction perpendicular to the first direction, are set for the local region; Calculating a first differential value obtained by performing differentiation processing in the first direction and a second differential value obtained by performing differentiation processing in the second direction; 2 . The image processing apparatus according to claim 1 , wherein the first pixel value change is generated based on the first differential value, and the second pixel value change is generated based on the second differential value.
3. The pixel value change generating means 3. The image processing apparatus according to claim 2, wherein the local region is filtered using either a Sobel filter or a Prewitt filter to calculate a differential value.
4. The pixel value change generating means 3. The image processing apparatus according to claim 2, wherein the first differential value and the second differential value are calculated using a central differential gradient or an intermediate differential gradient of the local region.
5. The gradient direction generating means The image processing apparatus according to claim 1 , wherein the gradient direction is calculated based on the first pixel value change and the second pixel value change.
6. The gradient direction generating means 2 . The image processing apparatus according to claim 1 , wherein the gradient direction is calculated using a vector having a first component and a second component calculated from the first pixel value change and the second pixel value change.
7. The reliability generating means calculating at least one of a sum, a maximum value, an average value, a sum of squares, or a square root of the sum of squares of the first pixel value change and the second pixel value change as a weight; The image processing apparatus according to claim 1 , wherein the reliability is calculated so that the greater the weighted variance value or the weighted standard deviation value of the gradient direction, the higher the reliability becomes.
8. The reliability generating means calculating a sum, a maximum value, an average value, a sum of squares, or a square root of the sum of squares of the first pixel value change and the second pixel value change as a weight; The image processing apparatus according to claim 1 , wherein the reliability is calculated so that the smaller the value of the weighted average resultant vector length of the gradient direction or the square value of the weighted average resultant vector length is, the higher the reliability is.
9. 2. The image processing device according to claim 1, wherein the gradient direction correction means corrects the gradient direction by +180° or -180° when the gradient direction is outside a predetermined utilization range so that the gradient direction is within the utilization range.
10. The gradient direction correction means 2 . The image processing apparatus according to claim 1 , wherein the gradient direction is calculated by narrowing down a range from the ratio of the first pixel value change to the second pixel value change so that the gradient direction falls within a predetermined usable range.
11. The gradient direction correction means The image processing apparatus according to claim 1 , wherein the gradient direction is corrected based on positive and negative values of the first pixel value change and the second pixel value change.
12. The gradient direction correction means The image processing apparatus according to claim 1 , wherein the angle of the gradient direction is corrected to be doubled.
13. The reliability generating means The image processing apparatus according to claim 1 , wherein the reliability is calculated so that the reliability increases as the variance or standard deviation of the gradient direction increases.
14. The reliability generating means The image processing apparatus according to claim 1 , wherein the reliability is calculated so that the smaller the value of the average resultant vector length in the gradient direction or the square value of the average resultant vector length is, the higher the reliability is.
15. 2. The image processing apparatus according to claim 1, wherein the reliability generating means includes a reliability correcting section for correcting the reliability.
16. The reliability correction unit is The image processing apparatus according to claim 15 , wherein the reliability is corrected to be increased when the gradient direction of the entire reference image is close to the error allowable direction.
17. The image processing apparatus according to claim 1 , wherein the reliability generating means generates the reliability based on a gradient intensity of the local region.
18. The image processing apparatus according to claim 1 , wherein the matching comprises calculating an optical flow between images taken at different times.
19. An image processing device according to any one of claims 1 to 18, an imaging means for capturing an object image formed by an optical system; a measuring means for measuring a distance to a subject based on the reliability of the matching between the first image and the second image; and a focus adjustment unit that adjusts the focus of the optical system based on the distance.
20. 20. The imaging device according to claim 19, wherein the imaging means comprises a plurality of first photoelectric conversion units for generating the first image, and a plurality of second photoelectric conversion units for generating the second image.
21. The imaging means is A first imaging element; a first optical system that forms the subject image on the first image sensor; A second imaging element; a second optical system that forms the subject image on the second image sensor; Equipped with 20. The imaging apparatus according to claim 19, wherein the first image is acquired by the first imaging element, and the second image is acquired by the second imaging element.
22. 1. A method of image processing for generating a confidence measure of a match between a first image and a second image, comprising the steps of: a pixel value change generating step of setting a reference image including a pixel of interest in the first image or the second image and generating at least a first pixel value change along a first direction and a second pixel value change along a second direction for each local region of the reference image; a gradient direction generating step of generating a gradient direction of the local region based on the first pixel value change and the second pixel value change; a gradient direction correction step of correcting the gradient direction so that a gradient of the local region becomes the same value as a gradient of a local region different from the local region when the local region is moved point-symmetrically; a confidence generating step of generating the confidence based on the gradient direction corrected in the gradient direction correcting step.
23. A computer program for controlling each unit of the image processing apparatus according to any one of claims 1 to 18 by a computer.
Citation Information
Patent Citations
Picture matching system
JP1990255990A
Movement vector extracting device
JP1992271485A
Image processor
JP2007041752A
Motion vector detection device
JP2008003674A
Image processor and image processing program
JP2011182084A
