GENERATION APPARATUS, GENERATION METHOD, AND PROGRAM

By generating and correcting distance images using a pair of images with parallax and applying distortion correction selectively based on reliability, the method addresses memory bandwidth issues in distance measurement, enhancing efficiency and accuracy.

JP7532238B2Active Publication Date: 2024-08-13CANON KK
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
JP2020209189
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2020-02-18
Filing Date
2020-12-17
Publication Date
2024-08-13
Estimated Expiration
2040-12-17

AI Technical Summary

Technical Problem

Existing distance measurement technologies face memory bandwidth shortages due to the need for high accuracy distortion correction, which increases memory bandwidth requirements.

Method used

A method for generating a distance image that corrects distortion in captured images using a pair of images with parallax, reducing memory bandwidth by performing distortion correction on a single distance image instead of each captured image, and selectively applying distortion correction based on image reliability.

Benefits of technology

Reduces memory bandwidth requirements while maintaining accuracy by optimizing distortion correction methods based on image reliability, allowing for more efficient distance measurement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007532238000001
    Figure 0007532238000001
  • Figure 0007532238000002
    Figure 0007532238000002
  • Figure 0007532238000003
    Figure 0007532238000003
Patent Text Reader

Abstract

To reduce a memory band necessary to calculate distance information.SOLUTION: The present invention relates to a generation device for generating distance information showing a distance to an object, and the generation device includes: generation means for generating a distance image on the basis of a pair of taken images having a parallax; and correction means for correcting a distortion in a distance image resulting from an optical system of imaging means which generated a pair of taken images for a region with a reliability of at least a threshold value of the distance image.SELECTED DRAWING: Figure 1
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to a distance measuring technique for calculating a distance to a subject. [Background technology]

[0002] In recent years, distance measurement technology has been used for various purposes such as autonomous driving and FA (Factory Automation), and there are various distance measurement technologies. For example, one distance measurement technology uses images captured by a stereo camera. In this method, a stereo camera is used to simultaneously capture images of an object from different directions using multiple image capture devices, and distance information to the object is calculated based on the parallax of the multiple captured images (Patent Document 1).

[0003] Another distance measurement technology is to arrange pixels (distance measurement pixels) with distance measurement capabilities in some or all of the pixels of an image sensor, and calculate the distance to the subject using a phase difference method (Patent Document 2). In this method, multiple photodiodes are arranged for one distance measurement pixel, and each generates a separate captured image (referred to as image A and image B, respectively), and the distance to the subject is calculated based on the amount of positional deviation of the captured images.

[0004] There are also distance measurement methods that do not use image sensors, such as the Time Of Flight (TOF) method, which measures the distance to a subject by shining light on the subject and detecting the time it takes for the light to reflect back.

[0005] In distance measuring devices using these distance measuring technologies, distortion due to optical factors occurs. For example, in distance measuring devices using an image sensor, distortion occurs in the captured image due to lens distortion aberration, and if a distance image is generated by calculating the distance based on the captured image containing the distortion, the distance image will also be distorted. Therefore, it is common to perform distortion correction on the captured image and generate a distance image based on the image after distortion correction, or to perform distortion correction on the generated distance image.

[0006] There are various methods for distortion correction, but all of these methods require reference to the pixel values ​​of the pre-correction image corresponding to each pixel of the post-correction image and the surrounding pixels. [Prior art documents] [Patent documents]

[0007] [Patent Document 1] JP 2018-105682 A [Patent Document 2] Patent No. 5192096 Summary of the Invention [Problem to be solved by the invention]

[0008] However, the memory bandwidth required when reading pixel values ​​of an uncorrected image from memory for distortion correction increases as the accuracy of the correction method increases, and therefore, when trying to calculate highly accurate distance information, the required memory bandwidth increases, resulting in a memory bandwidth shortage. [Means for solving the problem]

[0009] The present invention is a generating device that generates a distance image representing the distance to a subject, and is characterized by comprising a generating means for generating a distance image based on a pair of captured images having parallax, and a correction means for correcting distortion in the distance image caused by the optical system of the imaging means that generated the pair of captured images, for areas of the distance image where the reliability is above a predetermined threshold. Effect of the Invention

[0010] The present invention can reduce the memory bandwidth required to calculate distance information. [Brief description of the drawings]

[0011] [Figure 1] 1 is a diagram showing the configuration of a distance measuring device according to a first embodiment. [Diagram 2] FIG. 2 is a diagram showing a processing flow in the first embodiment. [Diagram 3] FIG. 2 is a diagram showing an example of a received image in the first embodiment. [Figure 4] 5A to 5C are diagrams illustrating an example of band information necessary for the distortion correction method according to the first embodiment. [Diagram 5] 4A to 4C are diagrams illustrating a distortion correction method according to the first embodiment. [Figure 6] FIG. 11 is a diagram showing the configuration of a distance measuring device in a second embodiment. [Figure 7] FIG. 11 is a diagram showing a processing flow in the second embodiment. [Figure 8] FIG. 11 is a diagram showing the configuration of a distance measuring device in a third embodiment. [Figure 9] FIG. 13 is a diagram illustrating a cache configuration in the third embodiment. [Figure 10] FIG. 13 is a diagram illustrating the reliability in the third embodiment. [Figure 11] 13A to 13C are diagrams illustrating the distortion correction process in the third embodiment. [Figure 12] FIG. 13 is a diagram showing the configuration of a distance measuring device in a fourth embodiment. [Figure 13] 13A and 13B are diagrams illustrating an example of a distortion correction method and bandwidth information of additional processing according to the fourth embodiment. [Figure 14] FIG. 13 is a diagram illustrating the configuration of a distance measuring device in a fifth embodiment. [Figure 15] FIG. 13 is a diagram showing an example of a processing flow in the fifth embodiment. [Figure 16] 13A to 13C are diagrams illustrating an image shape transformation processing method according to the fifth embodiment. [Figure 17] FIG. 13 is a diagram showing the configuration of a distance measuring device according to a sixth embodiment. [Figure 18] FIG. 13 is a diagram showing another example of the configuration of a distance measuring device according to the sixth embodiment. [Figure 19] FIG. 23 is a diagram showing an example of a processing flow in the sixth embodiment. [Figure 20] FIG. 23 is a diagram showing an example of a processing flow in the seventh embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0012] In the following, an embodiment of the distance measuring device of the present invention will be described with reference to the drawings. In the following embodiment, a method of arranging multiple photodiodes for one distance measuring pixel and calculating the distance using a phase difference method and a method using a stereo camera will be described as an example of a distance measuring method, but the distance measuring method to which the present invention can be applied is not limited to the above. The present invention can be applied to all distance measuring devices in which distortion due to an optical system such as TOF occurs. In addition, in this embodiment, the captured image and the distance image are stored in a DRAM (Dynamic Random Access Memory), but other memories may be used. In that case, it is necessary to provide bandwidth information corresponding to the memory in which the distance image is stored as information on the memory bandwidth required for each distortion correction described later.

[0013] (Embodiment 1) A distance measuring device according to a first embodiment of the present invention will be described. In the first embodiment, a plurality of photodiodes are arranged at intervals of several μm for one distance measuring pixel, and a method of calculating distance using a phase difference method is applied to a pair of captured images having parallax generated by an imaging device having at least one common optical system. When two paired captured images are obtained from one optical system in this way, the distortion amounts of the two captured images are close to each other, so it is preferable to first generate a distance image from the two captured images and then perform distortion correction. In this way, it is only necessary to perform distortion correction on one distance image, so that the access bandwidth (DRAM bandwidth) of the DRAM for reading pixel values ​​associated with distortion correction can be reduced compared to the case where distortion correction is performed on each of a pair of captured images.

[0014] Fig. 1 is a hardware configuration diagram of a distance measuring device according to embodiment 1. Reference numeral 100 denotes the distance measuring device of this embodiment, which generates a distance image of a subject that has been subjected to distortion correction. Reference numeral 101 denotes an imaging unit, which captures an image of the subject and generates image data. Reference numeral 102 denotes a distance image generating unit, which receives the image data from the imaging unit 101 and generates a distance image.

[0015] Next, the internal configuration of the imaging unit 101 will be described. Reference numeral 103 denotes a lens that collects light reflected from the subject and guides it to an imaging element 104, which forms an image on the imaging surface. Reference numeral 104 denotes the imaging element, which is an image sensor such as a CMOS sensor or a CCD sensor. The imaging element 104 converts the light received through the lens 103 into an electrical signal. Reference numeral 105 denotes an image transmission unit that transmits the electrical signal generated by the imaging element 104 to the distance image generation unit 102 as image data.

[0016] Next, the internal configuration of the distance image generating unit 102 will be described. An image receiving unit 106 receives image data transmitted from the imaging unit 101. An image correcting unit 107 performs necessary correction processing on the image data received by the image receiving unit 106 as pre-processing for generating a distance image, but does not include distortion correction for correcting distortion in the image data caused by the optical system of the imaging unit 101. A parallax calculating unit 108 calculates parallax for each pixel of the corrected image corrected by the image correcting unit 107. A distance calculating unit 109 converts the parallax data calculated by the parallax calculating unit 108 into a distance image. A DRAM 110 stores the distance image generated by the distance calculating unit 109 in this embodiment. Here, the distance image generated by the distance calculating unit 109 and stored in the DRAM 110 is a distance image before distortion correction in this embodiment. It is also assumed that the DRAM 110 stores information on the coordinate values ​​of the pre-correction image corresponding to each pixel in the post-correction image in distortion correction (hereinafter referred to as coordinate conversion map information). Reference numeral 111 denotes a reliability calculation unit, which calculates reliability for each arbitrary pixel unit in the corrected image corrected by the image correction unit 107. In FIG. 1, the reliability calculation unit 111 is configured to acquire image data via the DRAM 110, but the image data may be acquired directly from the image correction unit 107 without via the DRAM 110. Reference numeral 112 denotes an SRAM, which stores the reliability calculated for each pixel in this embodiment. The reliability may be calculated for each plurality of pixels instead of for each pixel, and the storage destination of the reliability does not necessarily have to be an SRAM but may be other memories. Reference numeral 113 denotes a memory access processing content selection unit, which in this embodiment selects a distortion correction method based on the reliability calculated by the reliability calculation unit 111 and the memory access bandwidth required for each preset distortion correction method. In this embodiment, the selection is made based on the DRAM bandwidth. Reference numeral 114 denotes a distortion correction necessity determination unit, which determines whether or not to perform distortion correction according to the reliability of the pixel of the pre-correction image corresponding to each pixel of the distortion-corrected image. At this time, a coordinate transformation map stored in advance in the DRAM 110 is referenced to obtain the coordinate values ​​of pixels in the pre-correction image that correspond to each pixel in the distortion-corrected image.Reference numeral 115 denotes a distortion correction unit which performs distortion correction on pixels for which distortion correction is determined to be necessary by the distortion correction necessity determination unit 114, using the method selected by the memory access processing content selection unit 113, and outputs the corrected pixel value. Reference numeral 116 denotes a mask unit which sets a predetermined value to pixels of the distortion-corrected image for which distortion correction is determined not to be necessary by the distortion correction necessity determination unit 114, and outputs the mask value.

[0017] Next, each unit will be described in detail with reference to a flowchart. Fig. 2 is a flowchart showing the flow of processing by distance image generating unit 102 in distance measuring device 100 of this embodiment. Note that distance image generating unit 102 can be realized by an information processing device, and the components other than DRAM 110 and SRAM 112 can be realized by one or more processors executing programs. The same applies to the distance image generating units of other embodiments described later.

[0018] In S201, the image receiving unit 106 receives image data from the imaging unit 101. In this embodiment, it is assumed that an image as shown in FIG.

[0019] In S202, the image correction unit 107 performs necessary correction processing other than distortion correction on the received image. Examples of correction processing include scratch correction when the sensor is scratched, and shading correction that corrects brightness unevenness that occurs when brightness decreases with distance from the center of the lens. However, the corrections performed here are not limited to the above.

[0020] In S203, the parallax calculation unit 108 calculates parallax for each pixel of the image corrected in S202. Here, a parallax calculation method called template matching will be described. It is assumed that the imaging unit 101 has an imaging element 104 having multiple photodiodes in one pixel, and one of the captured images (image A, image B) obtained from the multiple photodiodes in one pixel is used as a standard image, and the other is used as a reference image. Then, an area of ​​any size centered on a point of interest in the standard image (called a matching area) is set, and the image of the matching area is moved sequentially in the reference image to identify an area with the highest similarity in the reference image. The distance between the point of interest in the matching area in the standard image and the center point of the area in the reference image with the highest similarity to the matching area is calculated as the parallax. Here, the size of the matching area and the number of movement steps (unit movement amount) of the matching area in the reference image can be set to any value. In addition, any method can be applied to obtain the similarity between images. For example, the Sum of Squared Difference (SSD), which evaluates the similarity based on the sum of squares of differences in pixel values, or the Sum of Absolute Difference (SAD), which evaluates the similarity based on the sum of absolute values ​​of differences in pixel values, can be used.

[0021] In S204, the distance calculation unit 109 calculates the distance for each pixel based on the parallax calculated in S203. The distance is calculated from the parallax according to the principle of triangulation, and a distance image before distortion correction is generated.

[0022] In S205, the reliability calculation unit 111 calculates the reliability for each predetermined pixel unit in the image corrected in S202. In this embodiment, the reliability is calculated in units of one pixel, but the reliability may be calculated in units of any pixel. In this embodiment, the reliability is calculated in units of one bit, but the reliability may be calculated in units of any number of bits. The reliability is calculated based on factors that affect the distance measurement accuracy, but in the calculation of distance using the phase difference method in this embodiment, the reliability is calculated based on the amount of change in contrast. The amount of change in contrast can be calculated from the variance of pixel values ​​of the pixel of interest and its surrounding pixels. In this embodiment, it is assumed that the reliability calculation algorithm is adjusted so that the area 300 (area corresponding to the sky) in FIG. 3(b) is calculated as reliability 0 and the other areas are calculated as reliability 1 for the input image in FIG. 3(a). Here, the threshold is set to 1, and 0 less than the threshold means low reliability, and 1 equal to or greater than the threshold means high reliability.

[0023] In this embodiment, the calculated reliability is stored in a static random access memory (SRAM) in association with the coordinate value so that it can be read out at high speed, but it may be stored in other memory. In this embodiment, the area 300 with a reliability of 0 is approximately 14% of the entire image area.

[0024] In S206, the memory access process content selection unit 113 selects a distortion correction method based on the reliability calculated in S204 and the DRAM bandwidth required for each preset distortion correction method. In this embodiment, the distortion correction method is selected from three distortion correction methods, namely, nearest neighbor, bilinear, and bicubic, according to the ratio of a region with low reliability. However, the types of distortion correction methods are not limited to these. In addition, the method of providing information on the DRAM bandwidth required for each distortion correction method may be any method. For example, an input unit may be prepared by a user, or the information may be stored in a memory such as a DRAM or SRAM in advance. In this embodiment, the bandwidth information is provided as shown in the table in FIG. 4, but this format is merely an example, and any format may be used as long as the bandwidth required for each distortion correction method is known. The column 400 in the table shown in FIG. 4 indicates the type of distortion correction method.

[0025] Here, three distortion correction methods, Nearest Neighbor, Bilinear, and Bicubic, will be explained. Fig. 5(a) is a diagram explaining distortion correction.

[0026] Reference numeral 500 denotes an image after distortion correction, and it is assumed that correction is to be performed on a pixel at a point of interest 503. First, coordinate values ​​504 of a pixel in the pre-correction image corresponding to the point of interest 503 (hereinafter, referred to as pre-correction coordinate values) are referenced. In this embodiment, the pre-correction coordinate values ​​504 are obtained by referring to values ​​corresponding to the post-correction coordinate values ​​stored in advance in the DRAM 110 as a coordinate transformation map 502, but may be stored in a memory other than the DRAM 110. The coordinate transformation map 502 is calculated in advance based on a coordinate transformation formula corresponding to the distortion aberration of the lens 103, but the method of obtaining the pre-correction coordinate values ​​504 is not limited to the above method. The method of obtaining the pre-correction coordinate values ​​504 may be a method of calculating the pre-correction coordinate values ​​504 one by one within the distance measuring device 100 using the above coordinate transformation formula.

[0027] Reference numeral 501 denotes a pre-correction image, and 505 (hereinafter referred to as pre-correction coordinate position) denotes the coordinate position of pre-correction coordinate value 504 corresponding to point of interest 503. However, generally, pre-correction coordinate value 504 obtained by a coordinate conversion formula includes a decimal point. Therefore, in the nearest neighbor method, as shown in FIG. 5B, the pixel value of pixel 508, which is the pixel closest to pre-correction coordinate position 505 in pre-correction image 501, is set as the post-correction pixel value of point of interest 503. On the other hand, in the bilinear method, a value interpolated from pixel values ​​of four pixels 506, 507, 508, and 509 surrounding pre-correction coordinate position 505 in pre-correction image 501 is set as the post-correction pixel value of point of interest 503. Furthermore, in the bicubic method, a value interpolated from pixel values ​​of 16 pixels surrounding pre-correction coordinate position 505 in pre-correction image 501 is set as the post-correction pixel value of point of interest 503. Therefore, in nearest neighbor, only one pixel value needs to be read from the DRAM 110, whereas in bilinear, four pixel values ​​need to be read, and in bicubic, 16 pixel values ​​need to be read, and the DRAM bandwidth increases depending on the type of distortion correction method. On the other hand, the accuracy of distortion correction is higher in bilinear than in nearest neighbor, and higher in bicubic than in bilinear.

[0028] Next, the column 401 in FIG. 4 shows an example of the required bandwidth of the DRAM 110 for each distortion correction method. As described above, bilinear requires reading pixel values ​​of 4 times as many pixels as nearest neighbor, and bicubic requires reading pixel values ​​of 16 times as many pixels as nearest neighbor. Therefore, if all of these pixel values ​​are read from the DRAM 110 every time, the required bandwidth will be 4 times and 16 times, respectively. However, for example, in bilinear, some of the pixel values ​​of the four pre-correction images 501 used in distortion correction of a pixel are likely to be referenced in distortion correction of the adjacent pixel. Therefore, generally, a cache is provided for the DRAM 110, and pixel values ​​read from the DRAM 110 once are temporarily stored in the cache for a predetermined period of time. As a result, when the pixel value of the same pixel is read again within a certain period of time, the DRAM bandwidth is reduced by reading from the cache without accessing the DRAM 110. The amount of bandwidth reduction varies depending on the cache hit rate. In this embodiment, it is assumed that the DRAM 110 is accessed in tile units (area units each consisting of an arbitrary number of pixels vertically and horizontally), and the cache hit rate is estimated from the lens distortion aberration and the pixel area referenced by each distortion correction method. The required bandwidth 401 of the DRAM 110 shown in FIG. 4 is an example of a value calculated based on such an estimation.

[0029] The column 402 indicates the bandwidth increase rate of each distortion correction method when the nearest neighbor is used as a reference. Looking at 402, the bandwidth increase rate of bilinear is 12%, and the bandwidth increase rate of bicubic is 40%. Here, the memory access processing content selection unit 113 first refers to the reliability calculated in S204 and obtains the ratio of the area with a reliability of 0 to the entire image. Here, it is assumed that the ratio is obtained as 14%. Although details will be described later, the area with a reliability of 0 is determined as a pixel that does not require distortion correction in a later step. Therefore, the fact that the area with a reliability of 0 is 14% means that the number of pixels to be corrected for distortion can be reduced by 14%, and accordingly, the required bandwidth for reading pixel values ​​from the DRAM 110 can be reduced by 14%. In other words, when the ratio of the area with a reliability of 0 is 14%, the required bandwidths for nearest neighbor, bilinear, and bicubic are 4.3MB / Frame, 4.8MB / Frame, and 6.0MB / Frame, respectively.

[0030] Next, the bandwidth increase rate of each distortion correction method in FIG. 4 is referred to, and a distortion correction method that can be applied is determined using the reducible bandwidth. In this embodiment, the nearest neighbor required bandwidth of 5.0 MB / Frame when distortion correction is performed on the entire region is set as the maximum allowable bandwidth, and a distortion correction method in which the required bandwidth is equal to or less than the maximum allowable bandwidth (equal to or less than the maximum allowable access bandwidth) is adopted. As described above, when the bandwidth reduction rate is 14%, bilinear is 4.8 MB / Frame and bicubic is 6.0 MB / Frame, so the bilinear distortion correction method, which is the most accurate distortion correction method with a required bandwidth of 5.0 MB / Frame or less, is selected. For example, when the bandwidth reduction rate is less than 10%, the required bandwidth of bilinear exceeds 5.0 MB / Frame, so the nearest neighbor distortion correction method is selected. Also, when the bandwidth reduction rate is 28% or more, the required bandwidth of bicubic is equal to or less than 5.0 MB / Frame, so the bicubic distortion correction method is selected.

[0031] In this manner, in this embodiment, a distortion correction method is selected based on the DRAM bandwidth required for each distortion correction method in an area excluding areas with low reliability as described above and the predetermined maximum allowable bandwidth.

[0032] In S207, the distortion correction necessity determination unit 114 determines whether or not distortion correction is necessary for each pixel of the distance image generated in S204. In S207, first, as in the case of calculating the reliability described above, the pre-correction coordinate value 504 for the pixel of interest in the corrected image is read from the DRAM 110. Next, the reliability corresponding to the pixel closest to the pre-correction coordinate position 505 corresponding to the read pixel of interest is read from the SRAM 112. If the reliability is 0, it is determined that distortion correction is unnecessary and the process proceeds to S209, and if the reliability is 1, it is determined that distortion correction is necessary and the process proceeds to S208.

[0033] Next, in S208, the distortion correction unit 115 performs distortion correction on the pixel of interest for which it was determined in S207 that distortion correction is necessary, using the distortion correction method selected in S206. In this embodiment, the bilinear distortion correction method is selected, so distortion correction is performed bilinearly. At this time, the distortion correction unit 115 receives the pre-correction coordinate values ​​504 read from the DRAM 110 by the distortion correction necessity determination unit 114, so that the distortion correction unit 115 does not need to read the pre-correction coordinate values ​​504 from the DRAM 110.

[0034] On the other hand, in S209, the mask unit 116 assigns a predetermined value to pixels determined in S207 not to require distortion correction without performing distortion correction. Since distortion correction is not performed on pixels determined not to require distortion correction, the process of reading pre-correction pixel values ​​from the DRAM 110 for distortion correction is not required, and the DRAM bandwidth can be reduced. Also, the DRAM bandwidth reduced from the allowable DRAM bandwidth, which is 5.0 MB / Frame in this embodiment, can be used for distortion correction in S208.

[0035] Next, in S210, the distortion corrected pixel values ​​or pixel values ​​masked with a predetermined value are output by the distortion correction unit 115 or the mask unit 116. In this embodiment, the distortion correction unit 115 and the mask unit 116 are configured to output the distortion corrected pixel values ​​or masked pixel values ​​to the outside of the distance measuring device 100, but they may be stored in a memory inside the distance measuring device 100, for example, in the DRAM 110.

[0036] In this manner, in steps S207 to S210, a pixel value for one pixel in the distance image can be generated and output.

[0037] In S211, it is determined whether distortion correction or masking has been performed on all pixels of the distance image, and if any remain, the process returns to S207. By repeatedly performing these steps on all pixels, the distance image after distortion correction can be output.

[0038] Next, in S212, if the image reception has not been stopped based on, for example, a user input, the process returns to S201 and the next image is received. The above-mentioned process is continuously executed until the image reception is stopped.

[0039] In this way, when two captured images are acquired from one optical system, it is preferable to apply this embodiment to a configuration in which a distance image is generated from the two captured images first and then distortion correction is performed. In this way, by performing distortion correction only on one distance image instead of two captured images, the pixel values ​​read out for distortion correction are halved, and the DRAM bandwidth can be reduced. In addition, since distortion correction processing is not performed on areas with low reliability, the DRAM bandwidth can be further reduced. As a result, the distortion correction method for the area to be corrected can be selected according to the amount of bandwidth reduction. This allows the reduced bandwidth to be allocated to distortion correction of the area to be corrected, enabling more accurate distortion correction.

[0040] In addition, in this embodiment, the reliability has two values, 0 and 1, but it may have three or more values. For example, when the reliability has three values, 0, 1, and 2, distortion correction may be not performed for reliability 0, and distortion correction may be performed using different distortion correction methods for reliability 1 and 2.

[0041] (Embodiment 2) In the first embodiment, a distance image is generated before distortion correction, and then distortion correction is performed on the distance image, whereas in the second embodiment, distortion correction is performed before generating the distance image, and then the distance image is generated. In the second embodiment, a distance measuring device using a stereo camera as an imaging device will be described. When capturing images using a plurality of separate optical systems arranged at intervals of several centimeters to several tens of centimeters, as in a stereo camera, the amount of distortion of the captured images differs for each optical system, so that a configuration in which distortion correction is performed on the plurality of captured images before generating a distance image is preferable. Calculating parallax between captured images with different amounts of distortion results in a large error, so a highly accurate distance image can be obtained by first correcting the distortion of the captured images, then calculating the parallax and generating a distance image.

[0042] 6 is a configuration diagram of a distance measuring device according to the second embodiment. Reference numeral 600 denotes a distance measuring device of this embodiment, which generates a distance image of a subject. The distance measuring device 600 includes two image capturing units 601a and 601b, and a distance image generating unit 602. Note that the processing of the image capturing units 601a and 601b is the same as that of the image capturing unit 101 of the first embodiment, so details are omitted.

[0043] The distance image generating unit 602 receives a pair of captured images consisting of image data a and image data b having a predetermined parallax from the two imaging units. The received captured image data is received by two image receiving units 606a and 606b, and then various image corrections not including distortion correction are performed by two image correcting units 607a and 607. The processing by the image receiving units 606a and 606b and the image correcting units 607a and 607 is the same as in the first embodiment, so details are omitted.

[0044] The two image correction units 607a and 607b obtain a pre-distortion-corrected captured image a and a pre-distortion-corrected captured image b, and these pre-distortion-corrected captured images are passed to a DRAM 610 and a reliability calculation unit 611. The two pre-distortion-corrected captured images a and b passed to the DRAM 610 are referenced during distortion correction. The DRAM 610 is also assumed to have coordinate transformation map information for distortion correction stored in advance. Here, since the amounts of distortion of the captured images obtained by the two imaging units are different, two coordinate transformation maps corresponding to the amounts of distortion of each captured image are stored.

[0045] On the other hand, the reliability calculation unit 611 calculates the reliability of each of the two received pre-distortion-corrected captured images. Note that the reliability calculation unit 611 is the same as the reliability calculation unit 111 in the first embodiment, and therefore a detailed description thereof will be omitted. Data of the calculated reliability is stored in the SRAM 612.

[0046] The subsequent processes of the memory access processing content selection unit 613, the distortion correction necessity determination unit 614, the distortion correction unit 615, and the mask unit 616 are performed on two captured images. The processes performed on each captured image by these units are the same as those of the memory access processing content selection unit 113, the distortion correction necessity determination unit 114, the distortion correction unit 115, and the mask unit 116 in the first embodiment, and therefore details are omitted.

[0047] Next, each unit will be described in detail with reference to a flowchart. Fig. 7 is a flowchart showing the flow of processing by the distance image generating unit 602 in the distance measuring device 600 of this embodiment.

[0048] The steps other than S710 are arranged in a different order from the flowchart in Fig. 2, but each step performs the same process as the corresponding step. S701 and S702 correspond to S201 and S202, S703 to S709 correspond to S205 to S211, S711 and S712 correspond to S203 and S204, and S713 corresponds to S212. S710 is added in this embodiment in order to perform distortion correction on the pre-distortion-corrected captured image a and the pre-distortion-corrected captured image b.

[0049] During this processing, by not performing distortion correction in areas with low reliability, as in embodiment 1, the number of pixel values ​​to be read out is reduced, thereby reducing the DRAM bandwidth, and it is possible to perform more accurate distortion correction within the limited maximum allowable bandwidth.

[0050] In this manner, two distortion-corrected images are obtained by performing distortion correction on the captured images obtained from the two imaging units, and a parallax is obtained from these distortion-corrected images by the parallax calculation unit 617, and a distance image is obtained by the distance calculation unit 618. The processing contents of the parallax calculation unit 617 and the distance calculation unit 618 are the same as those of the parallax calculation unit 108 and the distance calculation unit 109 in the first embodiment, and therefore details will be omitted.

[0051] In this way, in a distance measuring device that uses multiple separate optical systems such as a stereo camera to obtain multiple captured images and generate a distance image, the amount of distortion of the captured images differs for each optical system, so it is preferable to perform distortion correction before generating a distance image as in this embodiment. In this way, parallax can be calculated between captured images that have been correctly distortion-corrected, and a highly accurate distance image can be obtained. In addition, by not performing distortion correction in areas with low reliability, the DRAM bandwidth can be reduced, and the distortion correction method to be applied to the area to be corrected can be selected according to the amount of bandwidth reduction. This allows the reduced bandwidth to be allocated to distortion correction in the area to be corrected, enabling more accurate distortion correction.

[0052] (Embodiment 3) In the first embodiment, the reliability is calculated for each pixel, but in the third embodiment, one reliability is generated for each set of pixels according to the cache size. In this way, the cache hit rate can be improved and the DRAM bandwidth can be reduced. In addition, the size of the SRAM for storing the reliability can be reduced. In the third embodiment, as in the first embodiment, multiple photodiodes are arranged for one ranging pixel, and a method of calculating the distance using a phase difference method is applied. For this reason, a configuration is adopted in which distortion correction is performed after a distance image is generated. However, even in the configuration in which a distance image is generated after distortion correction as in the second embodiment, one reliability can be generated for each set of pixels according to the cache size.

[0053] FIG. 8 is a configuration diagram of the third embodiment. In the configuration diagram, a cache 817 has been added to the configuration of FIG. 1. An example of the structure of the cache 817 will be described with reference to FIG. 9. The cache 817 is configured to have a plurality of tile-shaped buffers 900 (hereinafter referred to as tile buffers). Furthermore, one tile buffer can hold data for a total of 16 pixels, 4 pixels vertically and 4 pixels horizontally, and cache replacement is performed in tile buffer units. 901 represents one pixel. Note that the size of 4 pixels vertically and 4 pixels horizontally is just an example, and the vertical and horizontal sizes and the number of tile buffers can be set to any number.

[0054] Next, the processing flow of this embodiment will be described with reference to the flow chart of FIG.

[0055] Since steps S201 to S204 are the same as those in the first embodiment, the details are omitted.

[0056] Next, in S205, the reliability calculation unit 111 calculates the reliability for each pixel size (called tile buffer size) area of ​​one tile buffer in the cache 817. In this embodiment, one reliability is calculated for an area of ​​4 pixels vertically and 4 pixels horizontally. There are various methods for calculating the reliability for each tile buffer size area, but in this embodiment, after once calculating all the reliability for each pixel, if there is even one pixel with a reliability of 1 in the tile buffer size area, the reliability of that area is set to 1. An image of the reliability generated when the input image is as shown in FIG. 3(a) is shown in FIG. 10. One small square area 1000 in FIG. 10 is one tile buffer size area, and one reliability is generated for each of these areas. In this embodiment, the area surrounded by a thick line such as 1001 is an area with a reliability of 0. Here, by calculating the reliability for each tile buffer size, the amount of data of the reliability is reduced, and the SRAM size required to store the reliability can be reduced.

[0057] Since S206 is the same as in the first embodiment, details thereof will be omitted.

[0058] Next, steps S207 to S209 will be described together with reference to FIG. 11. Reference numeral 1100 denotes a post-distortion-correction image, and first, distortion correction is performed on a focus point 1 (1101). A pre-correction coordinate value 1104 at the focus point 1 is read from a coordinate transformation map 1103. Then, the reliability of the tile buffer size area corresponding to the pre-correction coordinate value 1104 is read. Here, the reliability is assumed to be 1. If the nearest neighbor is selected as the distortion correction method, an attempt is made to read from the DRAM 110 the pixel value on the pre-distortion-correction image 1106 that is closest to a pre-distortion-correction coordinate position 1107 corresponding to the pre-correction coordinate value 1104. At this time, if the corresponding pixel value is not stored in the cache 817, data of the tile buffer size area 1109 including the corresponding pixel value is stored in the tile buffer of the cache 817, and the necessary pixel value is read from the tile buffer of the cache 817.

[0059] Next, distortion correction is performed for the point of interest 2 (1102). Here, the reliability of the tile buffer size area corresponding to the pre-correction coordinate value 1105 of the point of interest 2 is read, but since the point of interest 2 is adjacent to the point of interest 1, the tile buffer size area corresponding to the point of interest 1 and the point of interest 2 may be the same. Here, it is assumed that the tile buffer size area corresponding to the point of interest 1 and the point of interest 2 is the same, and the reliability in the same tile buffer size area 1109 as the point of interest 1 is also read for the point of interest 2, and a reliability of 1 is obtained. Since the reliability is 1, the distortion correction unit 115 attempts to read out a pixel value closest to the pre-correction coordinate position 1108 corresponding to the pre-correction coordinate value 1105 in order to perform distortion correction. Here, since the reliability in the same tile buffer size area 1109 as the point of interest 1 is referenced, the pixel value to be read out is also in the same tile buffer size area 1109 as the point of interest. Then, since the tile buffer size area 1109 is already in the tile buffer of the cache 817, it is possible to read pixel values ​​from the cache 817 without accessing the DRAM 110 (a cache hit occurs).

[0060] The nearest neighbor distortion correction method has been described above, but bilinear and bicubic also increase the likelihood of a cache hit because pixel values ​​near the pre-correction coordinate position are read together into the cache 817. In this way, generating reliability for each tile buffer size area of ​​the cache increases the cache hit rate, making it possible to read data from the DRAM efficiently. Also, calculating reliability for each tile buffer size reduces the amount of reliability data, making it possible to reduce the SRAM size required to store the reliability.

[0061] In FIG. 8, the reliability calculation unit 111 acquires image data via the DRAM 110. However, the reliability calculation unit 111 may acquire image data directly from the image correction unit 107 without via the DRAM 110.

[0062] (Embodiment 4) In the first to third embodiments, the DRAM bandwidth required for distortion correction is reduced by not performing distortion correction on pixels with a reliability of 0, and the reduced bandwidth can be used for distortion correction on pixels with high reliability. In the fourth embodiment, an example will be described in which the reduced bandwidth is used to perform additional processing to increase the added value of the distance measuring device.

[0063] Fig. 12 is a configuration diagram of a distance measuring device showing an embodiment of the fourth embodiment. In Fig. 1 (embodiment 1), the distortion correction method was selected by the memory access processing content selection unit 113, and the selection result was passed to the distortion correction unit 115. On the other hand, in Fig. 12 (embodiment 4), the memory access processing content selection unit 1213 selects additional processing other than distortion correction, and therefore does not need to be connected to the distortion correction unit 115. Instead, the additional processing to be executed is selected based on the DRAM bandwidth required for preset distortion correction, the DRAM bandwidth required for the additional processing selected by the memory access processing content selection unit 1213, and the proportion of areas with a reliability of 0.

[0064] Fig. 13(a) shows bandwidth information required for the distortion correction method used. In this embodiment, a bilinear distortion correction method is used, but other distortion correction methods may be used. Next, the percentage of the area stored in the SRAM with a reliability of 0 is calculated. Here, it is assumed that the area with a reliability of 0 is 23%. Then, it is possible to reduce the bandwidth required for the DRAM in bilinear distortion correction by 23% of 5.6MB / Frame (1301), that is, 1.3MB / Frame.

[0065] 13B shows information on additional processes selected by the memory access process content selection unit 1213. Here, two types of additional processes, object recognition process and object tracking process, are written as additional processes 1302, and their required DRAM bandwidths 1303 are 1 MB / Frame and 3 MB / Frame, respectively.

[0066] Next, additional processing that can be executed in the reducible bandwidth is selected. In this embodiment, since the bandwidth can be reduced by 1.3 MB / Frame, only object recognition is selected. If the bandwidth can be reduced by 4 MB / Frame or more, both object recognition and object tracking are selected.

[0067] In this embodiment, there are only two types of candidate additional processes to be selected, but there may be three or more types. Any algorithm may be used to determine which additional process to select. Any method may be used to provide the distortion correction method and DRAM bandwidth information required for the additional process. For example, a user input unit may be prepared so that such information can be obtained from user input, or the information may be stored in advance in a memory such as a DRAM or SRAM. In this embodiment, the bandwidth information is provided in a format as shown in FIGS. 13(a) and (b), but this format is merely an example and another format may be used.

[0068] In this way, the object recognition process selected according to the amount of bandwidth reduction is executed. By combining the object recognition results with the generated distance image, it is possible to link a specific object (person, animal, vehicle, etc.) with the distance information to that object. In addition, by handling the acquired distance information and recognition results in time series across multiple frames, it is possible to calculate the trajectory and speed of the object.

[0069] As described above, by not performing distortion correction in areas with low reliability, the DRAM bandwidth can be reduced, and the reduced bandwidth can be used to execute additional processing to increase the added value of the distance measuring device.

[0070] In FIG. 12, the reliability calculation unit 111 acquires image data via the DRAM 110. However, the reliability calculation unit 111 may acquire image data directly from the image correction unit 107 without via the DRAM 110.

[0071] (Embodiment 5) In the first to fourth embodiments described above, the DRAM bandwidth required for distortion correction is reduced by not performing distortion correction on pixels with a reliability of 0 or pixels with a low reliability when the reliability is multi-valued.

[0072] In contrast, in the fifth embodiment, the DRAM bandwidth used is reduced by using control based on reliability even in processes involving DRAM access other than distortion correction, such as enlarging or reducing the display area, cropping out a partial area, and multi-screen display with multiple areas specified.

[0073] 14 is a diagram showing the configuration of a distance measuring device according to embodiment 5. Functions that overlap with those in the above-described embodiments are given the same reference numerals.

[0074] Reference numeral 1400 denotes a distance measuring device according to this embodiment, which displays a specified image area and generates a distance image of the subject after distortion correction. Reference numeral 1401 denotes a distance image generating unit, which receives image data from the imaging unit 101 and generates a distance image. The distance image generating unit 1401 can output an image (hereinafter referred to as a display image) that has been subjected to processing such as cropping and enlargement / reduction as well as distortion correction on the distance image so that a specified image area of ​​the distance image is output.

[0075] The internal configuration of distance image generation unit 1401 will be described. Image correction unit 107 performs necessary correction processing on image data received by image reception unit 106. For example, image correction unit 107 performs processing to correct uneven brightness caused by peripheral light loss that occurs when passing through lens 103, and processing to correct characteristic variations such as uneven sensitivity for each pixel of image sensor 104. Reference numeral 109 denotes a distance calculation unit that calculates parallax for each pixel of the image corrected by image correction unit 107. Reference numeral 109 denotes a distance calculation unit that converts the parallax data calculated by parallax calculation unit 108 into a distance image. Reference numeral 110 denotes a DRAM that stores the distance image generated by distance calculation unit 109.

[0076] Reference numeral 1402 denotes a reliability calculation unit, which calculates reliability for each arbitrary pixel unit in the image from the image correction unit 107. Reference numeral 112 denotes an SRAM, which stores the reliability calculated for each pixel in this embodiment. The reliability may be calculated for each set of pixels instead of for each pixel, and the reliability does not necessarily have to be stored in an SRAM but may be stored in another memory.

[0077] Reference numeral 1403 denotes a distance image readout determination unit. The unit references information relating to the cropping position and the degree of enlargement / reduction of the distance image corresponding to the display image (hereinafter, display area information) and generates coordinate values ​​of the distance image corresponding to each pixel of the display image. The unit also determines whether to read the distance image from DRAM 110 according to the display area information and the reliability of each pixel of the distance image. When performing distortion correction, the distance image readout determination unit 1403, as in the other embodiments described above, references a coordinate transformation map that associates the coordinate values ​​of the images before and after distortion correction and generates coordinate values ​​of the pre-distortion-corrected image corresponding to each pixel of the post-distortion-corrected image.

[0078] An image shape transformation unit 1404 performs image shape transformation processing on pixels for which distance image read determination unit 1403 has determined that distance image reading is necessary, and outputs the pixel value after image shape transformation. The image shape transformation processing refers to the coordinate values ​​from distance image read determination unit 1403 and reads the corresponding pixel values ​​of the distance image from DRAM 110. The pixel value may be calculated using an interpolation method such as bilinear or bicubic using surrounding pixel values, but in the case of image cropping without scaling, the distance image may be read directly according to the coordinate values. Note that the image shape transformation processing performed by image shape transformation unit 1404 includes distortion correction in addition to cropping and scaling.

[0079] Reference numeral 1405 denotes a masking unit, which sets a predetermined value to a pixel of a display image and outputs the image when the distance image readout determining unit 1403 determines that reading of the distance image is unnecessary.

[0080] The hardware configuration of the distance measuring device according to the fifth embodiment has been described above with reference to FIG.

[0081] The same configuration can be used to perform distortion correction as in the above embodiment. In this case, a coordinate transformation map that associates coordinates before and after distortion correction is stored in advance in the DRAM 110, and coordinate values ​​of pixels in the pre-distortion-corrected image that correspond to each pixel in the post-distortion-corrected image are generated based on the coordinate transformation map. Below, a process flow for performing image shape transformation processing including distortion correction using the coordinate transformation map and display area information will be described with reference to a flowchart.

[0082] 15 is an example of a flowchart showing the flow of processing by the distance image generating unit 1401 in the distance measuring device 1400 of this embodiment. The same functions as those in the previous embodiment are denoted by the same reference numerals.

[0083] Since steps S201 to S204 are the same as those in the above-described embodiment, the description thereof will be omitted.

[0084] In S1501, the reliability calculation unit 1402 calculates the reliability for each predetermined pixel unit in the image corrected in S202. In this embodiment, the reliability is calculated in units of one pixel, but the reliability may be calculated in units of any pixel. In this embodiment, the reliability is calculated in one bit, but the reliability may be calculated in any number of bits. The reliability is calculated based on factors that affect the distance measurement accuracy, but in the calculation of distance using the phase difference method in this embodiment, the reliability is calculated based on the amount of change in contrast. The amount of change in contrast can be calculated from the variance of pixel values ​​of the point of interest and its surrounding pixels. The calculated reliability is stored in an SRAM or the like in association with the coordinates of the image before distortion correction. The processes of S1501 and S203 to S204 are independent and may be processed in parallel, or S1501 may be performed before the process of S203, and the calculated reliability may be stored in the SRAM in advance.

[0085] In S1502, the distance image readout determination unit 1403 references the display area information and generates coordinate values ​​of the post-distortion-correction image corresponding to each pixel of the display image.

[0086] In S1503, distance image read determination unit 1403 refers to the coordinate transformation map and reads from DRAM 110 the coordinate values ​​of the pre-distortion-corrected image that correspond to the coordinate values ​​of the post-distortion-corrected image generated in S1502.

[0087] Here, S1502 and S1503 will be described with reference to Fig. 16. Fig. 16 is a diagram for explaining a method for acquiring coordinate values ​​of an image before distortion correction from coordinate values ​​of a display image 1600 via a distortion-corrected image 1601 in S1502 and S1503 of the image shape transformation processing in embodiment 5. The display image 1600 is displayed by cutting out two image areas (image cut-out area A 1603 and image cut-out area B 1604) in the distortion-corrected image 1601.

[0088] The display area information is information that specifies the coordinate values ​​of each cropped area of ​​the post-distortion-corrected image 1601 in the display image 1600, and may have coordinate values ​​for each pixel of the display image 1600, or may be information that indicates a rectangular area. For example, if the rectangular area is a rectangle, it may be configured to have the start coordinates (X1, Y1) of the upper left vertex and the end coordinates (X2, Y2) of the lower right vertex of the rectangle.

[0089] The distance image read determination unit 1403 first references the display area information in S1502, and obtains a post-distortion-corrected coordinate position 1606 corresponding to a pixel of interest 1605 in the display image 1600. Next, the distance image read determination unit 1403 references the coordinate transformation map in S1503, and generates a pre-distortion-corrected coordinate position 1607 corresponding to the post-distortion-corrected coordinate position 1606. In this way, the distance image read determination unit 1403 can obtain the pre-distortion-corrected coordinate position 1607 corresponding to the pixel of interest 1605 in the display image 1600, i.e., the coordinate values ​​of the pre-distortion-corrected image.

[0090] In S1504, the reliability corresponding to the pixel closest to the read pre-distortion-corrected coordinate position 1607 is read from the SRAM 112. If the reliability is 0, it is determined that reading of the distance image is not necessary, and the process proceeds to S1506. If the reliability is 1, it is determined that reading of the distance image is necessary, and the process proceeds to S1505.

[0091] Next, in S1505, the image shape transformation unit 1404 reads out the pixel value of the pre-distortion correction coordinate position 1607 on the pre-distortion corrected image for which it was determined in S1504 that reading of the distance image is necessary. Then, image shape transformation processing is performed to set the pixel value read out by the image shape transformation unit 1404 as the pixel value of the point of interest 1605 on the display image.

[0092] On the other hand, in S1506, the image shape transformation unit 1404 does not read the pixel value of the pre-distortion correction coordinate position 1607 on the pre-distortion corrected image for which it was determined in S1504 that reading of the distance image is not necessary, and does not perform image shape transformation processing. Instead, the mask unit 1405 performs mask processing to assign a predetermined value to the pixel of the point of interest 1605 on the display image.

[0093] In S211, it is determined whether pixel values ​​have been assigned to all pixels of the display image 1600 by image shape transformation processing or mask processing, and if there are any pixels to which no pixel value has been assigned, the process returns to S1502.

[0094] By repeatedly performing these steps for all pixels of the display image, it is possible to output a display image that has been subjected to distortion correction, image cropping, and enlargement / reduction processing.

[0095] In S212, if the reception of images has not been stopped based on, for example, a user input, the process returns to S201 to receive the next image, and the processes from S202 onwards are executed.

[0096] As described above, according to this embodiment, in addition to distortion correction processing, the DRAM bandwidth used can be reduced by performing control using reliability even in processing involving DRAM access, such as enlarging or reducing the display area, cropping out a partial area, and multi-screen display with multiple areas specified.

[0097] (Embodiment 6) In the sixth embodiment, the DRAM bandwidth used is reduced in the process of detecting a predetermined subject from a captured image and outputting a distance image to the subject.

[0098] 17 is a diagram showing the configuration of a distance measuring device according to embodiment 6. Functions that overlap with those in the above-described embodiments are given the same reference numerals, and description thereof will be omitted.

[0099] An object detection processing unit 1702 receives one of a pair of captured images output from the image correction unit 107, and performs subject recognition and identification processing, such as character recognition of vehicle numbers and signs, and shape recognition of parts, to obtain object position information. There are various methods for recognition and identification processing. A method of calculating the similarity by comparing a pattern with a previously stored object may be used, or the object may be estimated using machine learning that finds and estimates correlations from a large amount of data, or a multi-layered algorithm such as a neural network.

[0100] The object position information generated by the object detection processing unit 1702 is information on coordinates indicating an image area corresponding to a subject to be recognized and identified. 1703 is an SRAM, which in this embodiment stores object position information calculated for each pixel. The object position information may be information indicating a rectangular area including a subject, not for each pixel. For example, if the rectangular area is a rectangle, the start coordinates (X1, Y1) of the upper left vertex of the rectangle and the end coordinates (X2, Y2) of the lower right vertex of the rectangle may be held for each rectangular area. The storage destination for the object position information does not necessarily have to be an SRAM, and may be other memory.

[0101] Reference numeral 1704 denotes a distance image readout determination unit. According to the above-mentioned display area information, object position information on the subject to be identified, and reliability, if there is an image area in the display area corresponding to the subject to be recognized and identified, and the reliability is 1, it is determined that it is necessary to read out the display area in the distance image. If there is no image area corresponding to the subject in the display area, or if the reliability is 0, it is determined that it is not necessary to read out the distance image.

[0102] Next, as another example of this embodiment, a configuration is shown in which object detection is performed using a distortion-corrected image, and a distance image of an image area portion corresponding to the detected subject is output. Fig. 18 shows another configuration of a distance measuring device according to the sixth embodiment, in which an image shape deformation unit for distortion correction is added in front of the object detection processing unit, in addition to the image shape deformation unit 1404. Functions that overlap with those of the embodiment shown in Fig. 17 above are given the same reference numerals, and description thereof is omitted.

[0103] Reference numeral 1803 denotes a DRAM, which stores image data of one of a pair of captured images output from the image correction unit 107. In this embodiment, of image data a and image data b having parallax, image data a is used, and a corrected image obtained by correcting the image data a by the image correction unit 107 is referred to as image data A.

[0104] An image shape transformation unit 1804 generates coordinate values ​​of pixels of the pre-correction image corresponding to each pixel of the distortion-corrected image by referring to a coordinate transformation map stored in advance in the DRAM 1803. The image shape transformation unit 1804 corrects the distortion of image data A according to the coordinate transformation map to generate distortion-corrected image data A'.

[0105] An object detection processing unit 1802 uses the image data A' after distortion correction to perform subject recognition and identification processing, such as character recognition of vehicle numbers and signs, and shape recognition of parts, to obtain object position information. The recognition and identification processing methods are as described above. The object position information may be stored in an SRAM (not shown).

[0106] The DRAM 1803 storing the image data A before distortion correction and the DRAM 110 storing the distance image may be the same DRAM. In this case, the same coordinate transformation map can be referenced. Also, coordinate transformation map information in which coordinate values ​​are set in advance to resize the image data to the size handled by the object detection processing unit 1802 may be stored in the DRAM 1803.

[0107] A distance image readout determination unit 1805 refers to the object position information generated by the object detection processing unit 1802 and the reliability calculated by the reliability calculation unit 1402, and if the image area corresponds to a subject to be recognized and identified and the reliability is 1, it determines that it is necessary to read out the pixel value of the coordinates indicated by the object position information on the distance image.

[0108] FIG. 19 is a flow chart showing an example of a process from distance image read determination by distance image read determination unit 1805 in distance measuring device 1800 of this embodiment to image shape modification of the distance image.

[0109] In S1901, object position information generated by the object detection processing unit 1802 is acquired. The object position information is information indicating the coordinates of an image area corresponding to an object. The object position information may be read from an SRAM (not shown) with 1 bit indicating the presence or absence of an object for each pixel (1 if an object is present, 0 if not), or may be information indicating a rectangular area including the image area corresponding to the object. For example, if the rectangular area is a rectangle, the information has the start coordinates (X1, Y1) of the upper left vertex of the rectangle and the end coordinates (X2, Y2) of the lower right vertex.

[0110] In S1902, the coordinate transformation map of the range image from the DARM 110 is referenced, a pixel of interest is selected from among the pixels corresponding to the coordinates indicated by the object position information, and a pre-distortion-corrected coordinate position corresponding to the selected pixel of interest is generated.

[0111] In S1903, the reliability corresponding to the pixel closest to the read pre-distortion correction coordinate position is read from the SRAM 112. If the reliability is 0, it is determined that reading of the distance image is unnecessary, and the process proceeds to S1907. If the reliability is 1, it is determined that reading of the pixel value of the pixel of interest on the distance image is necessary, and the process proceeds to S1906.

[0112] Next, in S1906, for pixels of interest in the distance image that were determined in S1903 to require reading, the corresponding pixel value in the pre-distortion corrected image is read and image shape is transformed by the image shape transformation unit 1404. On the other hand, in S1905, for pixels that were determined in S1903 not to require reading of the distance image, masking processing is performed by the mask unit 1405 to assign a predetermined value, without reading the pre-distortion corrected image and transforming the image shape.

[0113] In S1908, the pixel values ​​of the distance image processed in S1906 or S1907 are output. By repeatedly executing the processing flow described above with reference to Fig. 19 for all coordinates indicated by the object position information, a distance image for only the subject to be identified is output.

[0114] As described above, according to this embodiment, it is possible to reduce the DRAM bandwidth used in the process of detecting an image area corresponding to a subject within a specified display area and outputting a distance image for only that subject. This is because this embodiment can limit the pixel values ​​of the distance image read from the DRAM by using the object position information and reliability of the subject.

[0115] Even if the object position information of the subject is obtained from outside the distance measuring device, the pixel values ​​of the distance image read from the DRAM can be limited by using the object position information of the subject and the reliability of each pixel as described above. In this embodiment, the object position information is generated, but the object position information may be generated by an external device. For example, the captured image may be output from the image transmission unit 105 or the image correction unit 107 to an external device (such as a GPU), and the distance image read determination units 1705 and 1805 may obtain the detection result of the image area corresponding to the subject on the captured image in the external device as object position information.

[0116] (Embodiment 7) In embodiment 7, the DRAM bandwidth used is reduced in the process of synthesizing two distance images generated by two ranging devices with overlapping ranging areas, i.e., two distance images generated based on captured images with overlapping imaging areas, and outputting a single synthetic distance image.

[0117] FIG. 20 is a diagram showing the configuration of a distance measuring device according to the seventh embodiment.

[0118] Reference numeral 2001 denotes a first imaging unit equipped with a lens and an image sensor, and outputs image data generated by the image sensor.

[0119] Reference numeral 2002 denotes a first captured image processing unit, which receives and processes image data from the first imaging unit 2001, and includes an image correction unit, a parallax calculation unit, and a distance calculation unit. The first captured image processing unit 2002 generates a distance image (distance image 1) using the captured image data, and writes distance image 1 to a DRAM 2007.

[0120] A first reliability calculation unit 2003 calculates the reliability of the distance (reliability 1) based on the image data after image correction from the first captured image processing unit. The method of calculating the reliability is as described in the above embodiment.

[0121] Reference numeral 2004 denotes a second imaging unit equipped with a lens and an image sensor, and outputs image data generated by the image sensor.

[0122] Reference numeral 2005 denotes a second captured image processing unit, and includes an image correction unit, a parallax calculation unit, and a distance calculation unit that receives and processes image data from the second capturing unit 2004. The second captured image processing unit 2005 generates a distance image (distance image 2) using the captured image data, and writes distance image 2 to a DRAM 2007.

[0123] A second reliability calculation unit 2006 calculates the reliability of the distance (reliability 2) based on the image data after image correction from the second captured image processing unit. The method of calculating the reliability is as described in the above embodiment.

[0124] Reference numeral 2008 denotes a distance image readout determination unit. It generates coordinate values ​​of distance image 1 and distance image 2 corresponding to each pixel of the display image. Specifically, it generates the coordinate values ​​of each pixel by referring to a coordinate transformation map that associates the coordinates of the distance images before and after distortion correction corresponding to distance image 1 and distance image 2, which are stored in advance in DRAM 2007. The distance image readout determination unit 2006 obtains the reliability corresponding to the pixel closest to the generated coordinate value from each of the first reliability calculation unit and the second reliability calculation unit.

[0125] If there is an overlapping area between distance image 1 and distance image 2, distance image read determination unit 2008 determines the magnitude of each reliability (high or low reliability) and instructs distance information synthesis unit 2009 to read out the pixel values ​​of the distance image with the higher reliability. If both reliability levels are 0, it is determined that reading of the distance image is unnecessary, and masking unit 2010 performs masking processing (setting a predetermined value to the pixel of the display image and outputting it). Note that if the reliability levels are the same value other than 0, it may be instructed to read out the pixel values ​​of either distance image. However, in such a case, the effects of optical distortion can be reduced by reading out the pixel value of the distance image whose pixel coordinate value for which the reliability has been calculated is closer to the optical axis center of the first imaging unit 2001 or the second imaging unit 2004.

[0126] In response to an instruction from the distance image readout determination unit 2008, the distance information synthesis unit 2009 reads out the distance image generated by either the first imaging unit 2001 and the first captured image processing unit 2002, or the second imaging unit 2004 and the second captured image processing unit 2005. The distance information synthesis unit 2009 may perform interpolation processing to improve image quality as in the above-mentioned embodiment.

[0127] As described above, a hardware configuration of the distance measuring device according to the seventh embodiment has been exemplified as having two image capturing units 2001 and 2004 as shown in FIG. 20, but the same applies to a case where three or more image capturing units are used.

[0128] As described above, according to this embodiment, when distance images from multiple distance measuring cameras are synthesized and displayed, the pixel values ​​of the distance images read from the DRAM are limited based on the reliability of each pixel, thereby reducing the DRAM bandwidth used. When synthesizing the distance images, it is also possible to perform distortion correction to correct optical distortion, which similarly reduces the DRAM bandwidth used. Note that by performing distortion correction on overlapping areas of multiple distance images to be synthesized only on the distance image with the highest reliability, the DRAM bandwidth used can be reduced compared to when distortion correction is performed on all distance images.

[0129] (Other Examples) The present invention can also be realized by a process in which a program for implementing one or more of the functions of the above-described embodiments is supplied to a system or device via a network or a storage medium, and one or more processors in a computer of the system or device read and execute the program. The present invention can also be realized by a circuit (e.g., ASIC) that implements one or more of the functions.

[0130] In the above embodiment, the distance measurement method includes a method in which multiple photodiodes are arranged for one distance measurement pixel and a method in which a stereo camera is used to calculate the distance, and a method in which a stereo camera is used. However, the present invention is not limited to these distance measurement methods, and can also be applied to shape deformation processing when visualizing and displaying distance information obtained by TOF, millimeter wave radar, LiDAR (Light Detection and Ranging), etc. [Explanation of symbols]

[0131] 100 Rangefinder 101 Imaging unit 102 Distance image generation unit 110 DRAM 111 Reliability calculation unit 115 Distortion correction section 1404 Image shape transformation unit 1702 Object detection processing unit

Claims

1. A generating device that generates a distance image representing the distance to the subject, A generation means for generating the distance image based on a pair of captured images having parallax, A correction means for correcting distortion in the distance image caused by the optical system of the imaging means that generated the pair of captured images, in the region of the distance image where the confidence level is above a predetermined threshold, A generating apparatus characterized by comprising the following features.

2. A generating device that generates a distance image representing the distance to the subject, A correction means for correcting distortion in a pair of captured images that have parallax, in a region where the reliability is above a predetermined threshold, caused by the optical system of the imaging means that generated the pair of captured images, A generation means for generating a distance image based on a pair of captured images whose distortion has been corrected by the correction means, A generating apparatus characterized by comprising the following features.

3. The correction means calculates the reliability based on the pixel values ​​of the pixel of interest and the surrounding pixels. The generating apparatus according to claim 1 or 2.

4. The aforementioned reliability is the amount of change in contrast calculated based on the variance of the pixel values ​​of the pixel of interest and the surrounding pixels. The generating apparatus according to any one of claims 1 to 3, characterized in that...

5. The correction means applies different predetermined distortion correction methods according to the proportion of the region where the reliability is below a predetermined threshold. The generating apparatus according to any one of claims 1 to 4.

6. Masking means for setting a predetermined value for pixels in the region where the reliability is less than the predetermined threshold. The generating apparatus according to any one of claims 1 to 5, further comprising:

7. Selection means for selecting a process that involves accessing the storage means to which the access bandwidth is less than or equal to the predetermined access bandwidth, based on a predetermined access bandwidth to the storage means for storing the distance image and the proportion of the region where the reliability is above a predetermined threshold. The generating apparatus according to any one of claims 1 to 6, further comprising:

8. The selection means selects one distortion correction method based on the proportion of the region where the reliability is below a predetermined threshold and the access bandwidth to the storage means required for each of the plurality of predetermined distortion correction methods. The correction means applies the distortion correction method selected by the selection means. The generating apparatus according to feature 7.

9. The selection means selects one of the plurality of predetermined additional processes based on the predetermined access bandwidth, the percentage of the region where the reliability is below a predetermined threshold, the access bandwidth to the storage means required by the selected distortion correction method, and the access bandwidth to the storage means required by the plurality of predetermined additional processes. The generating apparatus according to claim 8.

10. The selection means selects one distortion correction method from a plurality of predetermined distortion correction methods, each of which uses different pixels as references when interpolating pixel values ​​in distortion correction. The generating apparatus according to claim 8 or 9.

11. The storage means includes a buffer capable of storing pixel values ​​for a predetermined number of pixels, and a cache means that performs pixel value swapping on a buffer-by-buffer basis. The correction means calculates the reliability for each pixel corresponding to the buffer and obtains the pixel value to be corrected for distortion from the cache means. The generating apparatus according to any one of claims 7 to 9.

12. The system further includes a means for specifying a portion of the aforementioned distance image as a cropping region, The generation apparatus according to claim 1, characterized in that the correction means corrects distortion based on the cut-out region and the region in which the reliability is above a predetermined threshold.

13. The generation apparatus according to claim 12, characterized in that the cropped region is an image region corresponding to a predetermined object in the captured image.

14. The system further comprises a synthesis means for generating a composite distance image by synthesizing a plurality of distance images having overlapping regions, which are generated based on a plurality of pairs of the aforementioned captured images whose imaging regions overlap. The combining means uses, for the pixel values ​​of the region corresponding to the overlapping region of the combined distance image, the pixel value of the distance image with the highest confidence level in the overlapping region from among the pixel values ​​of the multiple distance images in the overlapping region. The generating apparatus according to any one of claims 1 to 13.

15. The correction means corrects the distortion of the distance image with the highest confidence level in the overlapping region among the regions where the confidence level of each of the multiple distance images is above a threshold. The generating apparatus according to feature 14.

16. A method for generating a distance image that represents the distance to a subject, A generation step of generating the distance image based on a pair of captured images having parallax, A correction step is performed to correct distortion in the distance image caused by the optical system of the imaging means that generated the pair of captured images, for regions of the distance image where the reliability is above a predetermined threshold, A method for generating a product characterized by having the following features.

17. A method for generating a distance image that represents the distance to a subject, A correction step for correcting distortion in a pair of captured images that have parallax, in a region where the reliability is above a predetermined threshold, caused by the optical system of the imaging means that generated the pair of captured images; A generation step that generates a distance image based on a pair of captured images whose distortion has been corrected by the correction step, A method for generating a product characterized by having the following features.

18. On the computer, A method for generating a distance image that represents the distance to a subject, A generation step of generating the distance image based on a pair of captured images having parallax, A correction step is performed to correct distortion in the distance image caused by the optical system of the imaging means that generated the pair of captured images, for regions of the distance image where the reliability is above a predetermined threshold, A program characterized by causing each step of a method having the following characteristics to be performed.

19. On the computer, A method for generating a distance image that represents the distance to a subject, A correction step for correcting distortion in a pair of captured images that have parallax, in a region where the reliability is above a predetermined threshold, caused by the optical system of the imaging means that generated the pair of captured images; A generation step that generates a distance image based on a pair of captured images whose distortion has been corrected by the correction step, A program characterized by causing each step of a method having the following characteristics to be performed.

Citation Information

Patent Citations

  • Funmatsushoketsueikyujishaku no seizohoho

    JP1976092096A

  • Image processing apparatus

    JP2012147281A

  • Camera calibration device, occupant support device and distortion coefficient generating method for camera calibration

    JP2013109416A

  • Stereo camera

    JP2018105682A

  • Image processing apparatus and image processing method

    JP2018195079A