The present invention relates to an image processing apparatus, an image processing method, a movable apparatus, a storage medium, and the like, for processing distance information of an object.
There is an imaging device that has a sensor in which a plurality of pixel regions having a photoelectric conversion function are two-dimensionally arranged and that can acquire an image signal and distance information in each pixel region. In a solid-state imaging element disclosed in Japanese Patent Laid-Open No. 2007-281296, for some or all of pixels of the imaging device, pixels having a distance measurement function are disposed, and a subject distance is detected on the basis of a phase difference detected on an imaging surface (imaging surface phase difference method).
That is, a positional deviation is calculated on the basis of a correlation between two image signals based on images generated by light beams that have passed through different pupil regions of an imaging optical system of the imaging device, and a distance is acquired on the basis of the positional deviation. The correlation between two image signals is evaluated by using a method such as a region-based matching method of cutting out an image signal included in a predetermined collation region from each image signal and evaluating a correlation.
However, for example, if a subject included in the image signal has little change in contrast, or if an amount of noise included in the image signal is large, a correlation may be erroneously evaluated due to a subject or imaging conditions. If there are more than a certain number of erroneous evaluations of the correlation, there is an error in an amount of positional deviation between two calculated image signals, and the accuracy of an acquired distance may be reduced.
One of the objects of the present invention is to provide an image processing apparatus capable of reducing the influence of a distance variation.
According to one aspect of the present invention, there is provided an image processing apparatus including at least one processor or circuit configured to function as: a boundary detection unit configured to detect a boundary in each divisional region obtained by dividing image information into a plurality of divisional regions on the basis of color information of each pixel of the image information; and a combined distance information determination unit configured to determine combined distance information for each sub-region separated by the boundary in the divisional region on the basis of distance information of each pixel of the image information.
Further features of the present invention will become apparent from the following description of embodiments with reference to the attached drawings.
Hereinafter, with reference to the accompanying drawings, favorable modes of the present invention will be described by using Embodiments. In each diagram, the same reference signs are applied to the same members or elements, and duplicate description will be omitted or simplified. In the following description, an example of a route generation apparatus (electronic apparatus) equipped with an imaging device will be used, but the present invention is not limited to this.
The vehicle 100 further includes a drive unit 170 as a drive control unit for driving the vehicle 100, a memory 190, and the like. The drive unit 170, the memory 190, and the like will be described with reference to
The imaging device 110, the route generation ECU 130, and the like configure a route generation apparatus 150 as an image processing apparatus. A driver 101 can board the vehicle 100, and the driver 101 faces forward in the vehicle 100 (in the advancing direction) when the vehicle 100 is traveling.
The driver 101 can control an operation of the vehicle by operating operation members such as a steering wheel, an accelerator pedal, and a brake pedal of the vehicle 100. The vehicle 100 may have an automated driving function, or may be remotely controlled from the outside.
The imaging device 110 is disposed to capture an image in front of the vehicle 100 (normal advancing direction). As shown in
The imaging device 110 may include an imaging device disposed to image rearward of the vehicle 100 (a reversing direction opposite to the normal traveling direction), or an imaging device disposed to image the side of the vehicle. That is, a plurality of imaging devices 110 may be disposed in the vehicle 100.
The imaging device 110 acquires information regarding a detected object (outside information) and information regarding a distance of the detected object (object distance information), and outputs the information to the route generation ECU 130. The object distance information may be information that can be converted into a distance from a predetermined position of the vehicle 100 to an object by using a predetermined reference table, a predetermined conversion coefficient, or a conversion formula. For example, object distance information in which distances are assigned to predetermined integer values may be sequentially output to the route generation ECU 130.
The imaging device 110 includes, for example, a CMOS image sensor in which a plurality of pixel regions having a photoelectric conversion function are two-dimensionally arranged, and is configured to be able to acquire an object distance according to an imaging surface phase difference method (also called an imaging surface phase difference detection method, an imaging surface phase difference ranging method, and the like). Acquisition of object distance information using the imaging surface phase difference method will be described later.
The radar device 120 is, for example, a millimeter wave radar device that uses electromagnetic waves with wavelengths from the millimeter wave band to the sub-millimeter wave band, and is a detection device that detects an object by emitting electromagnetic waves and receiving reflected waves.
The radar device 120 functions as a fourth distance information acquisition unit configured to acquire distance information (fourth distance information) indicating a distance to an object in a transmission direction of the electromagnetic waves on the basis of the time from irradiation with the electromagnetic waves to reception of the reflected waves and a reception intensity of the reflected waves. The radar device 120 outputs the distance information to the route generation ECU 130.
In First Embodiment, a plurality of radar devices 120 are attached to the vehicle 100. For example, the radar devices 120 are attached to the left and right front sides of the vehicle 100 and to the left and right rear sides of the vehicle 100, respectively.
Each radar device 120 applies electromagnetic waves within a predetermined angular range, and measures a distance from the radar device 120 on the basis of the time from transmission of the electromagnetic waves to reception of the reflected waves and a received intensity of the reflected waves, and generates distance information of the object. In addition to the distance from the radar device 120, the distance information may also include information regarding a reception intensity of the reflected waves and a relative speed of the object.
The measurement instrument group 160 includes, for example, a traveling speed measurement instrument 161, a steering angle measurement instrument 162, and an angular velocity measurement instrument 163, and acquires vehicle information regarding a drive state of the vehicle, such as a traveling speed, a steering angle, and an angular velocity. The traveling speed measurement instrument 161 is a measurement instrument that detects a traveling speed of the vehicle 100. The steering angle measurement instrument 162 is a measurement instrument that detects a steering angle of the vehicle 100.
The angular velocity measurement instrument 163 is a measurement instrument that detects an angular velocity of the vehicle 100 in a turning direction. Each measurement instrument outputs a measurement signal corresponding to a measured parameter to the route generation ECU 130 as vehicle information.
The route generation ECU 130 has a CPU as a computer built thereinto, and generates a travel trajectory of the vehicle 100 and route information regarding the travel trajectory on the basis of measurement signals, outside information, object distance information, distance information, and the like. The route generation ECU 130 outputs the travel trajectory and the route information to the vehicle control ECU 140. Data to be processed or computer programs to be executed by the route generation ECU 130 are stored in a memory 180.
Here, the travel trajectory is information indicating a trajectory (route) through which the vehicle 100 passes. The route information is information (including road information and the like) regarding a route through which the vehicle 100 passes.
The vehicle control ECU 140 has a CPU as a computer built thereinto, and on the basis of the route information and the vehicle information acquired from the measurement instrument group 160, controls the drive unit 170 such that the vehicle 100 will pass through a route corresponding to the route information. Data to be processed and computer programs to be executed by the vehicle control ECU 140 are stored in a memory 190.
The drive unit 170 is a drive member for driving the vehicle, and includes, for example, a power unit (not shown) such as an engine or a motor that generates energy for rotating tires, a steering unit that controls a traveling direction of the vehicle, and the like. The drive unit 170 further includes a gearbox for rotating the tires by using the energy generated by the power unit, a gear control unit for controlling constituents inside the gearbox, a brake unit for performing a braking operation, and the like.
The vehicle control ECU 140 controls the drive unit 170 and adjusts a drive amount, a braking amount, a steering amount, and the like of the vehicle 100 such that the vehicle will pass through the route corresponding to the route information. Specifically, the vehicle control ECU 140 controls the brake, the steering wheel, the gear constituents, and the like to cause vehicle 100 to travel on the route.
The route generation ECU 130 and the vehicle control ECU 140 may have a common CPU and a common memory. An HMI 240 stands for human machine interface for transmitting information to the driver 101.
The HMI 240 includes a visible display and a display control device that generates information to be displayed on the display if the driver 101 is in a driving position. The HMI 240 also includes a device (speaker system) that outputs sound and a sound control device that generates sound data.
The display control device of the HMI 240 displays navigation information on the display on the basis of the route information generated by the route generation ECU 130. The sound control device of the HMI 240 generates sound data for notifying the driver 101 of the route information on the basis of the route information, and outputs the sound data from the speaker system. The sound data is, for example, data for notifying that the vehicle is approaching an intersection where the vehicle is to turn.
However, some or all of the functional blocks may be realized by hardware. As hardware, a dedicated circuit (ASIC), a processor (a reconfigurable processor or a DSP), or the like may be used. The functional blocks shown in
In
In First Embodiment, the imaging optical system 301, the imaging element 302, the image processing unit 310, and the object information generation unit 320 are disposed inside a casing (not shown) of the imaging device 110. Here, the imaging element 302 functions as an imaging unit configured to image a subject and generate image information.
The imaging optical system 301 is an imaging lens of the imaging device 110 and has a function of forming an image (optical image) of a subject on the imaging element 302. The imaging optical system 301 includes a plurality of lens groups, and has an exit pupil at a position away from the imaging element 302 by a predetermined distance.
The imaging element 302 includes a complementary metal oxide semiconductor (CMOS) image sensor or a charge-coupled device (CCD) image sensor, and has a distance measurement function based on the imaging surface phase difference ranging method. The imaging element 302 has a plurality of pixel regions having a photoelectric conversion function and arranged two-dimensionally.
Each pixel region has, for example, two photoelectric conversion portions (a first photoelectric conversion portion and a second photoelectric conversion portion) disposed separately in a row direction. For example, any one of R, G, and B color filters and a microlens are disposed in front of each pixel region.
The imaging element 302 photoelectrically converts a subject image formed on the imaging element 302 via the imaging optical system 301 to generate an image signal based on the subject image, and outputs the image signal to the image processing unit 310. The image signal is a signal based on an output value for each photoelectric conversion portion of the pixel region.
The imaging element 302 separately outputs a first image signal based on the signal output from the first photoelectric conversion portion and a second image signal based on the signal output from the second photoelectric conversion portion. Alternatively, an addition signal obtained by adding the first image signal to the second image signal and the first image signal are separately output to the image processing unit 310.
On the basis of the image signals supplied from the imaging element 302, the image processing unit 310 generates image data having information regarding each color of red, green, and blue for each pixel, and distance image data indicating distance information for each pixel.
The image processing unit 310 includes a developing unit 311 that generates image data on the basis of the image signals supplied from the imaging element 302 and a distance image generation unit 312 that generates distance image data on the basis of the image signals supplied from the imaging element 302. The distance image generation unit 312 functions as a distance equivalent information measurement unit configured to detect distance equivalent information for each pixel in image information.
Processes executed by these constituents will be described later. The image processing unit 310 outputs the image data from the developing unit 311 and the distance image data from the distance image generation unit 312 to the object information generation unit 320.
The object information generation unit 320 has a boundary processing unit 321 for detecting a boundary between a plurality of objects in the image. The boundary processing unit 321 divides the image data from the developing unit 311, for example, into strip-shaped rectangular regions (divisional regions) in the vertical direction of the screen, and further detects a boundary on the basis of a color difference signal (or a color signal) for an image signal in each rectangular region.
When a boundary is detected, changes in luminance information may also be referred to. Here, the boundary processing unit 321 functions as a boundary detection unit configured to divide an image into a plurality of divisional regions extending in a predetermined direction and detects a boundary based on at least color information for the image in each divisional region.
In the object information generation unit 320, by detecting a boundary on the basis of the color difference signal for the image signal in each rectangular region, sub-regions separated by the boundaries within the divisional region are classified (grouped) into three groups such as the sky, a road, and others.
The reason why the boundary processing unit detects a boundary on the basis of the color difference signal for each strip-shaped rectangular region as described above is to facilitate detection of the boundary. In First Embodiment, the predetermined direction in which the strip-shaped rectangular regions (divisional regions) extend is a longitudinal direction (vertical direction) of the screen, but may be a lateral direction (horizontal direction) of the screen.
The object information generation unit 320 has a distance information generation unit 322 that determines and assigns distance information to each group. On the basis of the boundary information from the boundary processing unit 321 and the distance image data (distance equivalent information) from the distance image generation unit 312, the distance information generation unit 322 determines and adds object distance information (combined distance equivalent information) indicating the respective distances of, for example, three sub-regions included in the acquired image.
Here, the distance information generation unit 322 functions as an combined distance equivalent information determination unit configured to determine combined distance equivalent information for each sub-region separated by a boundary in the divisional region on the basis of the distance equivalent information of each pixel in the image information.
As described above, in First Embodiment, detection of a boundary is facilitated by detecting the boundary on the basis of a color difference signal for each strip-shaped rectangular region. Since combined distance equivalent information is determined for, for example, three sub-regions separated by boundaries, the influence of a distance error (variation) occurring in the distance image generation unit 312 can be suppressed.
Although a boundary is detected on the basis of a color difference signal in First Embodiment, the boundary may be detected on the basis of a color signal. A boundary of a target may be detected by referring not only to a color difference signal or a color signal but also to a luminance signal.
In particular, if a distance of an object is acquired by using an imaging device based on the imaging surface phase difference method as in First Embodiment, a distance error (variation) may occur for a distant object due to the relatively short baseline length, but the influence thereof can be considerably suppressed.
The object information generation unit 320 has an object detection unit 323 that performs image recognition on an object. The object detection unit 323 combines image signals of the strip-shaped rectangular regions in which boundaries are set by the boundary processing unit 321 in the horizontal direction of an image, and performs image recognition on, for example, the sky, a road, and other objects included in an acquired image on the basis of the combined images.
Here, the object detection unit 323 detects an object by combining images of a plurality of divisional regions including classified sub-regions.
For example, a group at the bottom of the screen is determined as being a road. Here, the object detection unit 323 functions as a classification unit configured to perform predetermined classification according to combined distance equivalent information of a sub-region for which the combined distance equivalent information has been determined. As described above, the object detection unit 323 of First Embodiment classifies sub-regions as one of three categories such as the sky, a road, and others.
The object detection unit 323 refers to the distance information added to each separated region by the distance information generation unit 322 when performing image recognition on the sky, a road, and other objects. In other words, erroneous recognition can be reduced by recognizing objects that are different in distance from each other by a predetermined distance or more as different objects. It becomes easier to recognize that a group of which a distance is infinite in the upper part of the screen is the sky.
By distinguishing between the sky and the road as described above, it is possible to focus on object recognition for objects other than the sky and the road. The object detection unit 323 can accurately generate outside information indicating information regarding the detected sky, road, and other objects. Here, the outside information is information indicating a position of the detected object in the image, a size such as width and a height, a region, and the like of the detected object. The outside information includes information regarding an attribute and an identification number of the detected object.
The object distance information is linked to information regarding the identification number of the object included in the outside information. The object information generation unit 320 outputs the outside information from the object detection unit 323 and the object distance information from the distance information generation unit 322 to the route generation ECU 130.
The image processing unit 310 and the object information generation unit 320 may be configured by one or more processors included in the imaging device 110. The functions of the image processing unit 310 and the object information generation unit 320 may be realized by one or more processors executing programs read from the memory 340.
The route generation ECU 130 includes a route generation unit 330. The route generation unit 330 generates route information on the basis of the outside information, the object distance information, and the distance information acquired from the radar device 120. Next, a structure and control of each block in the route generation apparatus 150 will be described in detail.
The pixel group 410 includes a green pixel G1 and a green pixel G2 that detect green light, a red pixel R that detects red light, and a blue pixel B that detects blue light. In the pixel group 410, the green pixel G1 and the green pixel G2 are disposed diagonally. Each pixel also has a first photoelectric conversion portion 411 and a second photoelectric conversion portion 412.
The light receiving layer 415 is a photoelectric conversion portion that photoelectrically converts light incident through the light guide layer 414 and outputs the light as an electric signal. The light receiving layer 415 has a first photoelectric conversion portion 411 and a second photoelectric conversion portion 412.
The microlens 413 of the green pixel G1 is disposed such that the exit pupil 501 and the light receiving layer 415 are in an optically conjugate relationship. As a result, a light beam that has passed through a first pupil region 510 that is a partial pupil region of the exit pupil 501 is incident to the first photoelectric conversion portion 411. Similarly, a light beam passing through a second pupil region 520 that is a partial pupil region is incident to the second photoelectric conversion portion 412.
The first photoelectric conversion portion 411 of each pixel photoelectrically converts the received light beam and outputs a signal. A first image signal is generated from signals output from the plurality of first photoelectric conversion portions 411 included in the imaging element 302. The first image signal indicates an intensity distribution of an image (referred to as an A image) formed on the imaging element 302 by a light beam that has mainly passed through the first pupil region 510.
The second photoelectric conversion portion 412 of each pixel photoelectrically converts the received light beam and outputs a signal. A second image signal is generated from signals output from the plurality of second photoelectric conversion portions 412 included in the imaging element 302. The second image signal indicates an intensity distribution of an image (referred to as a B image) formed on the imaging element 302 by a light beam that has mainly passed through the second pupil region 520.
A relative positional deviation amount (hereinafter, referred to as a parallax amount) between the first image signal corresponding to the A image and the second image signal corresponding to the B image is an amount corresponding to a defocus amount. A relationship between the parallax amount and the defocus amount will be described with reference to
From comparison between
Therefore, as will be described later, a parallax amount between the first image signal and the second image signal can be detected according to a region-based matching technique, and the parallax amount can be converted into a defocus amount via a predetermined conversion coefficient. By using an imaging formula for the imaging optical system 301, the defocus amount on the image side can be converted into a distance to an object.
The imaging element 302 may separately output an addition signal (combined signal) of the first image signal and the second image signal, and the first image signal to the image processing unit 310 as described above. In this case, the image processing unit 310 can generate the second image signal from a difference between the addition signal (combined signal) and the first image signal, and can thus acquire the first image signal and the second image signal.
Next, a process performed by the image processing unit 310 will be described.
In step S601, the CPU generates a combined image signal by combining the first image signal and the second image signal input from the imaging element 302. Alternatively, as described above, the addition signal may be read at the stage of reading from the imaging element 302. By combining (adding) the first image signal and the second image signal, it is possible to obtain an image signal based on an image formed by a light beam that has passed through the entire exit pupil 501.
Assuming that a horizontal pixel coordinate of the imaging element 302 is x and a vertical pixel coordinate is y, a combined image signal Im(x,y) of the pixel (x,y) may be represented by the following Expression 1 by using a first image signal Im1(x,y) and a second image signal Im2(x,y).
lm(x,y)=lm1(x,y)+lm2(x,y) (Expression 1)
In step S602, the developing unit 311 executes a correction process for a defective pixel in the combined image signal. The defective pixel is a pixel that cannot output a normal signal in the imaging element 302. Coordinates of the defective pixel are stored in the memory in advance, and the developing unit 311 acquires information indicating the coordinates of the defective pixel of the imaging element 302 from the memory.
The developing unit 311 generates a combined image signal of the defective pixel by using a median filter that replaces the combined image signal with a median value of pixels surrounding the defective pixel. As a method of correcting the combined image signal of the defective pixel, a signal value of the defective pixel may be generated by using and interpolating signal values of the pixels surrounding the defective pixel by using coordinate information of the defective pixel prepared in advance.
In step S603, the developing unit 311 applies a light amount correction process of correcting a reduction in an amount of light around an angle of view caused by the imaging optical system 301 to the combined image signal. The light amount reduction characteristics (relative light amount ratio) around the angle of view caused by the imaging optical system 301 are measured in advance and stored in the memory.
As a method of correcting an amount of light, a relative light amount ratio between angles of view stored in advance may be read from the memory, and an amount of light may be corrected by multiplying the combined image signal by a gain that makes the light amount ratio constant. For example, the developing unit 311 corrects an amount of light by multiplying a combined image signal of each pixel by a gain that increases from the central pixel of the imaging element 302 toward the peripheral pixels.
In step S604, the developing unit 311 performs a noise reduction process on the combined image signal. As a method for reducing noise, noise reduction using a Gaussian filter may be used.
In step S605, the developing unit 311 performs a demosaic process on the combined image signal to acquire red (R), green (G), and blue (B) signals for each pixel, and uses the color signals to generate image data with luminance information for each pixel. As a demosaicing method, a method of interpolating color information for each pixel by using linear interpolation for each color channel may be used.
In step S606, the developing unit 311 performs grayscale correction (gamma correction process) by using a predetermined gamma value. Image data Idc(x,y) of the pixel (x,y) after grayscale correction is represented as in the following Expression 2 by using image data Id(x,y) of the pixel (x,y) before grayscale correction and a gamma value γ.
Idc(x,y)=Id(x,y)γ (Expression 2)
A value prepared in advance may be used as the gamma value γ. The gamma value γ may be determined according to a pixel position. For example, the gamma value γ may be changed for each region obtained by dividing the effective region of the imaging element 302 by a predetermined number of divisions.
In step S607, the developing unit 311 executes a color space conversion process of converting a color space of the image data from an RGB color space to a YUV color space. The developing unit 311 converts the image data corresponding to the luminance of each color of red, green, and blue into a luminance value and a color difference value by using a predetermined coefficient and a color space conversion expression (Expression 3) to convert the color space of the image data from the RGB color space to the YUV color space.
Y(x,y)=ry×IdcR(x,y)+gy×IdcG(x,y)+by×IdcB(x,y) U(x,y)=ru×IdcR(x,y)+gu×IdcG(x,y)+bu×IdcB(x,y) V(x,y)=rv×IdcR(x,y)+gv×IdcG(x,y)+bv×idcB(x,y) (Expression 3)
In Expression 3, IdcR(x,y) indicates red image data value of the pixel (x,y) after grayscale correction. IdcG(x,y) indicates green image data value of the pixel (x,y) after grayscale correction.
IdcB(x,y) indicates blue image data value of the pixel (x,y) after grayscale correction. Y(x,y) indicates a luminance value of the pixel (x,y) obtained through color space conversion. U(x,y) indicates a difference (color difference value) between the luminance value of the pixel (x,y) obtained through color space conversion and a blue component.
V(x,y) indicates a difference (color difference value) between the luminance value of the pixel (x,y) obtained through color space conversion and a red component. Coefficients (ry, gy, gy) are coefficients for obtaining Y(x,y), and coefficients (ru, gu, gu) and (rv, gv, by) are coefficients for calculating color difference values.
In step S608, the developing unit 311 executes correction (distortion correction) for suppressing the influence of distortion aberration caused by the optical characteristics of the imaging optical system 301 on the converted image data. The distortion aberration correction process is performed by geometrically transforming the image data to correct a distortion ratio of the imaging optical system 301.
Geometric deformation is performed by using a polynomial that generates a pixel position before correction from a correct pixel position without distortion aberration. If the pixel position before correction is a decimal number, the nearest pixel may be used after rounding, or linear interpolation may be used.
In step S609, the developing unit 311 outputs the image data to which the distortion aberration correction processing has been applied to the object information generation unit 320. With this, the developing process executed by the developing unit 311 is ended. The flow in
As long as the boundary processing unit 321 or the object detection unit 323 can perform a boundary detection process or an external world recognition process on the basis of image data before various correction processes obtained from the imaging element 302, the developing unit 311 does not have to execute any process in
For example, as long as the boundary processing unit 321 or the object detection unit 323 can detect a boundary or an object within an imaging angle of view on the basis of image data to which the distortion aberration correction process in step S608 is not applied, the process in step S608 may be omitted from the developing process in
The distance information may be a distance value D, or may be a defocus amount ΔL or a parallax amount d used to calculate the distance value, but in First Embodiment, the distance image data will be described as data in which each pixel is associated with the distance value D.
In step S611, the distance image generation unit 312 generates first and second luminance image signals from input image signals. That is, the distance image generation unit 312 generates the first luminance image signal by using the first image signal corresponding to the A image, and generates the second luminance image signal by using the second image signal corresponding to the B image.
In this case, the distance image generation unit 312 multiplies image signal values of the red, green, and blue pixels of each pixel group 410 by predetermined coefficients, respectively, and combines the image signal values to generate a luminance image signal. The distance image generation unit 312 may generate a luminance image signal by performing a demosaic process using linear interpolation, and then multiplying red, green, and blue pixel signals by predetermined coefficients and combining the pixel signals.
In step S612, the distance image generation unit 312 corrects a light amount balance between the first luminance image signal and the second luminance image signal. Correction of the light amount balance is executed by multiplying at least one of the first luminance image signal and the second luminance image signal by a predetermined correction coefficient.
It is assumed that a luminance ratio between the first luminance image signal and the second luminance image signal obtained by applying uniform illumination after adjusting positions of the imaging optical system 301 and the imaging element 302 is measured, and the correction coefficient is calculated in advance such that the luminance ratio is constant and is stored in the memory 340.
The distance image generation unit 312 multiplies at least one of the first luminance image signal and the second luminance image signal by the correction coefficient read from the memory to generate the first image signal and the second image signal to which the light amount balance correction has been applied.
In step S613, the distance image generation unit 312 performs a noise reduction process on the first luminance image signal and the second luminance image signal to which the light amount balance correction is applied. The distance image generation unit 312 applies a low-pass filter that reduces a high spatial frequency band to each luminance image signal to execute the noise reduction process.
The distance image generation unit 312 may use a bandpass filter through which a predetermined spatial frequency band is transmitted. In this case, an effect of reducing the influence of a correction error in the light amount balance correction performed in step S612 can be achieved.
In step S614, the distance image generation unit 312 calculates a parallax amount that is an amount of a relative positional deviation between the first luminance image signal and the second luminance image signal. The distance image generation unit 312 sets a point of interest in a first luminance image corresponding to the first luminance image signal, and sets a collation region centering on the point of interest. Next, the distance image generation unit 312 sets a reference point in a second luminance image corresponding to the second luminance image signal, and sets a reference region centered on the reference point.
The distance image generation unit 312 calculates the degree of correlation between a first luminance image included in the collation region and a second luminance image included in the reference region while sequentially moving the reference point, and sets the reference point having the highest correlation as a corresponding point.
The distance image generation unit 312 uses an amount of a relative positional deviation between the point of interest and the corresponding point as a parallax amount at the point of interest. The distance image generation unit 312 can calculate parallax amounts at a plurality of pixel positions by calculating a parallax amount while sequentially moving the point of interest. The distance image generation unit 312 specifies a value indicating a parallax value for each pixel as described above, and generates parallax image data that is data indicating a parallax distribution.
A well-known method may be used as a method of calculating the degree of correlation used for the distance image generation unit 312 to obtain a parallax amount. The distance image generation unit 312 may use, for example, a method called normalized cross-correlation (NCC) for evaluating normalized cross-correlation between luminance images.
The distance image generation unit 312 may use a method of evaluating the degree of dissimilarity as the degree of correlation. The distance image generation unit 312 may use, for example, sum of absolute difference (SAD) for evaluating a sum of absolute values of differences between luminance images, or sum of squared difference (SSD) for evaluating a sum of squared differences.
In step S615, the distance image generation unit 312 converts the parallax amount of each pixel in the parallax image data into a defocus amount, and acquires the defocus amount of each pixel. The distance image generation unit 312 generates defocus image data indicating the defocus amount of each pixel on the basis of the parallax amount of each pixel in the parallax image data.
The distance image generation unit 312 uses the parallax amount d(x,y) and the conversion coefficient K(x,y) of the pixel (x,y) in the parallax image data to calculate the defocus amount ΔL(x,y) of the pixel (x,y) from the following Expression 4. In the imaging optical system 301, the first light beam 511 and the second light beam 521 are partly cut at peripheral angles of view due to vignetting. Therefore, the conversion coefficient K is a value that depends on an angle of view (pixel position).
ΔL(x,y)=K(x,y)×d(x,y) (Expression 4)
If the imaging optical system 301 has field curvature characteristics in which a focal position changes between the central angle of view and the peripheral angle of view, when a field curvature amount is denoted by Cf, the parallax amount d(x,y) can be converted into the defocus amount ΔL(x,y) by using the following Expression 5.
After alignment of the imaging optical system 301 and the imaging element 302, a relationship between a parallax amount and a distance value to an object is acquired by imaging a chart, so that the conversion coefficient K and the field curvature amount Cf can be acquired. In this case, the field curvature amount Cf depends on an angle of view and is given as a function of a pixel position.
ΔL(x,y)=K(x,y)×d(x,y)×Cf(x,y) (Expression 5)
In step S616, the distance image generation unit 312 converts the defocus amount ΔL(x,y) of the pixel (x,y) into the distance value D(x,y) to the object at the pixel (x,y) to generate distance image data. The defocus amount ΔL is converted by using an imaging relationship of the imaging optical system 301, and thus the distance value D to the object can be calculated.
When a focal length of the imaging optical system 301 is denoted by f, and a distance from an image-side principal point to the imaging element 302 is denoted by Ipp, the defocus amount ΔL(x,y) may be converted into the distance value D(x,y) to the object by using the imaging formula in the following Expression 6.
The focal length f and the distance Ipp from the image-side principal point to the imaging element 302 are constant values regardless of an angle of view, but the present invention is not limited to this. If an imaging magnification of the imaging optical system 301 changes greatly for each angle of view, at least one of the focal length f and the distance Ipp from the image-side principal point to the imaging element 302 may be set to a value that changes for each angle of view.
In step S617, the distance image generation unit 312 outputs the distance image data generated as described above to the object information generation unit 320. Here, through the processes in steps S611 to S617, the distance image generation unit 312 measures distance equivalent information for each pixel according to the phase difference ranging method on the basis of signals from the first photoelectric conversion portion and the second photoelectric conversion portion disposed in a pixel of the imaging unit.
In order to acquire the distance equivalent information, the distance equivalent information may be measured according to the phase difference ranging method on the basis of two image signals from a stereo camera. With this, the distance image data generation process executed by the distance image generation unit 312 is ended. The flow in
The parallax amount d for each pixel, the defocus amount ΔL, and the distance value D from the principal point of the imaging optical system 301 are values that can be converted by using the above-described coefficients and conversion formulas. Therefore, each pixel may include information representing the parallax amount d or the defocus amount ΔL as the distance image data generated by the distance image generation unit 312.
Considering that the object information generation unit 320 calculates a representative value of the distance values D included in an object region, it is desirable to generate the distance image data on the basis of a defocus amount at which a frequency distribution is symmetrical.
As described above, in the process of calculating a parallax amount in step S614, a correlation between the first luminance image and the second luminance image is used to search for a corresponding point. However, if the first image signal contains a lot of noise (for example, noise caused by light shot noise) or if a change in a signal value of a luminance image signal included in a collation region is small, the degree of correlation cannot be evaluated correctly.
In such a case, a parallax amount with a large error may be calculated with respect to a correct parallax amount. If a parallax error is large, an error of the distance value D generated in step S616 is also large.
Therefore, the distance image data generation process performed by the distance image generation unit 312 may include a reliability calculation process for calculating the reliability of a parallax amount (parallax reliability). The parallax reliability is an index indicating to what extent an error is included in a calculated parallax amount.
For example, a ratio of a standard deviation to an average value of signal values included in a collation region may be evaluated as the parallax reliability. If a change in the signal value (so-called contrast) in the collation region is large, the standard deviation increases. If an amount of light incident to a pixel is large, an average value is great. If an amount of light incident to a pixel is large, optical shot noise is large. That is, the average value has a positive correlation with an amount of noise.
A ratio of the average value to the standard deviation (standard deviation/average value) corresponds to a ratio between a magnitude of contrast and an amount of noise. If the contrast is sufficiently large with respect to the amount of noise, it can be estimated that an error in calculating a parallax amount is small. That is, it can be said that as the parallax reliability becomes larger, an error in the calculated parallax amount becomes smaller, and a parallax amount becomes more accurate.
The reliability may be lowered for a pixel with a saturated pixel signal and peripheral pixels thereof. For example, even if there is contrast in the vicinity of a saturated pixel, the texture may not be detected correctly between a standard image and a reference image, and the parallax may not be calculated correctly. Therefore, a pixel signal has a predetermined value or more (saturated), the parallax reliability may be lowered for the periphery of the pixel.
Therefore, in step S614, it is possible to calculate the parallax reliability at each point of interest and generate reliability data representing the likelihood of a distance value for each pixel forming distance image data. The distance image generation unit 312 may output the reliability data to the object information generation unit 320.
Next, a process in which the object information generation unit 320 generates outside information and object distance information on the basis of image data and distance image data will be described with reference to
An operation in each step in the flowcharts of
As shown in
The boundary processing unit 321 further detects a boundary on the basis of a color difference signal (or a color signal) for the image within each strip-shaped rectangular region.
As shown in
In step S7013, the object detection unit 323 performs an object detection process within the strip-shaped rectangular region. The object detection process in step S7013 is a process for classifying the inside of the strip-shaped rectangular region into the sky, a road, and other objects.
Specifically, for example, a color distance (amount of color change) ΔC between two pixels separated by several pixels in the vertical direction of the screen is computed for each pixel sequentially from the upper end of the screen. In step S903, it is determined whether ΔC is more than a predetermined threshold value Th. If Yes, a pixel is set as a distance boundary candidate in step S904. That is, a pixel with a large color change is set as a boundary candidate. That is, a position where the color information changes more than the predetermined threshold value Th is detected as a boundary.
Each strip-shaped rectangular region (divisional region) has a width in a direction (horizontal direction) that intersects the vertical direction (predetermined direction), and has a plurality of pixels in the intersecting direction (horizontal direction). Therefore, the above color information means a representative value obtained on the basis of color information of a plurality of pixels arranged in the horizontal direction. Here, the representative value is calculated by using a median value, an average value, or the like.
On the other hand, if No in step S903, a pixel is set as a non-distance boundary pixel in step S905. In other words, the setting is such that a pixel with a small amount of color change is not a boundary.
In step S906, it is determined whether setting of distance boundary candidates or non-distance boundary candidates has been completed for all pixels in the strip-shaped rectangular region. If No, the flow returns to step S902, and the processes in steps S902 to S906 are repeatedly performed.
If Yes in step S906, in step S907, the distance boundary candidate pixel is provisionally set as a distance boundary. Next, in step S908, if an interval between the distance boundaries is equal to or less than a predetermined value (for example, ten pixels), the boundary setting for that pixel is cancelled.
In step S909, a final distance boundary where the pixels are separated from each other by a predetermined value or more is set. As described above, steps S901 to S909 function as a boundary detection step of dividing the image information into a plurality of divisional regions extending in a predetermined direction, and detecting a boundary based on at least color information for an image in each divisional region.
In step S1002, distance information of each pixel within the distance boundary rectangle is weighted on the basis of the reliability to generate distance equivalent information for each distance boundary rectangle (hereinafter, also referred to as a sub-region). In this case, a reliability representing the likelihood of the distance equivalent information of each pixel may be generated on the basis of the color information, and combined distance equivalent information for each sub-region may be determined on the basis of the distance equivalent information of each pixel that is weighted on the basis of the reliability.
In that case, parallax amounts of a plurality of images obtained from the imaging element are calculated on the basis of the color information, a parallax reliability indicating the likelihood of the parallax amount of each pixel is calculated on the basis of the color information, and the above reliability is generated on the basis of the parallax reliability. In this case, the parallax reliability of pixels in which a luminance value of a plurality of images is equal to or greater than a predetermined value may be calculated to be lower than the parallax reliability of pixels in which a luminance value of the plurality of images is smaller than the predetermined value.
Average height information for each distance boundary rectangle is generated by averaging the heights of pixels within the distance boundary rectangle. The distance equivalent information may be, for example, a median value or a most frequent value of distance information of pixels of which a distance information reliability is equal to or more than a predetermined value in the distance boundary rectangle.
Next, in step S1003, a ratio of pixels of which the distance information reliability is equal to or more than a predetermined value in each distance boundary rectangle is calculated. Alternatively, a statistic value of distance equivalent information or height information (for example, a ratio of pixels below the standard deviation) is calculated for each distance boundary rectangle.
Next, in step S1004, it is determined whether or not the ratio of pixels of which the reliability of distance information is equal to or more than a predetermined value is equal to or higher than a predetermined ratio. If the result is No, in step S1005, information indicating that the reliability of the distance boundary rectangle is low is added to the distance boundary rectangle. On the other hand, if Yes in step S1004, combined distance equivalent information and height information are determined and added to the distance boundary rectangle.
In step S1007, a map having the combined distance equivalent information and the height information is generated for each distance boundary rectangle. Here, steps S1001 to S1007 function as an combined distance equivalent information determination step of determining combined distance equivalent information for each sub-region separated by a boundary in the divisional region on the basis of the distance equivalent information of each pixel in the image information.
Specifically, whether or not the distance is shorter than a distance equivalent to infinity (which may be a predetermined value) is compared with the distance equivalent information within the distance boundary rectangle. If No, a sky region is set in step S1103, and the process returns to step S1102 to continue to determine whether each distance boundary rectangle is the sky, a road, or other objects in sequence from the upper end of the screen.
If Yes in step S1102, the sky region searched for from the upper end of the screen is cut off and enters another object region. Therefore, in step S1104, the pixel is determined as being a boundary between the sky and an object.
Next, in step S1105, an object boundary is searched for from the pixels at the lower end of the strip-shaped rectangular region. In step S1106, for example, average height information of the distance boundary rectangle is compared with a predetermined threshold value. That is, it is determined whether or not a height of the distance boundary rectangle is larger than, for example, a height of a camera installed in the vehicle as a predetermined threshold value.
As the predetermined threshold value, instead of a height of a camera, for example, a median value of height information of pixels in the lower half of the screen may be used. This is because there is a high possibility that the lower half of the screen is occupied by a road.
If No in step S1106, the distance boundary rectangle is lower than the camera position, and thus is set as a road region in step S1107, and the process returns to step S1106 to continue searching from the bottom to the top of the screen. On the other hand, if Yes in step S1106, the distance boundary rectangle is set as a boundary between the road and other objects in step S1108.
In step S1109, for each strip-shaped rectangular region, the distance boundary rectangles in the strip-shaped rectangular region are classified into three categories such as a road, the sky, and other objects. Here, steps S1101 to S1109 function as a classification step of performing predetermined classification according to combined distance equivalent information of sub-regions for which the combined distance equivalent information has been determined. In the embodiment, classification is performed by referring to a height of a sub-region as well.
As described above, for each strip-shaped rectangular region, distance boundary rectangles in the strip-shaped rectangular region are classified into three categories such as a road, the sky, and other objects. After that, in step S702 in
As described above, since the sky, a road, and other objects are classified in advance for each strip-shaped rectangular region, when the strip-shaped rectangular regions are combined in the horizontal direction and object detection is performed, object recognition can be intensively performed on objects other than the sky and a road. Therefore, a load in the image recognition process can be reduced. The object detection unit 323 can accurately generate outside information indicating information regarding the detected sky, road, or other objects.
When object detection is performed, the object detection unit 323 may perform a process of enlarging or reducing a size of image data input from the image processing unit 310 to a size determined from the detection performance and processing time in the object detection process.
The object detection unit 323 generates outside information indicating a position in an image of an object included in the image based on the image data, a size such as a width or a height, region information indicating a region, the type (attribute) of the object, and an identification number (ID number) of the object.
The identification number is identification information for identifying the detected object and is not limited to numbers. The object detection unit 323 detects the type of object existing within the imaging angle of view of the imaging device 110, a position and a size of the object in the image, determines whether the object has already been registered, and adds an identification number to the object.
The object detection unit 323 detects objects from the image 810 and generates outside information indicating the type, an identification number, and region information of each object.
The outside information is generated as a table as shown in Table 1, for example. In the outside information, an object region is defined as a rectangular frame (object frame) surrounding the object. In the outside information, the object region information indicates a shape of a rectangular object frame as upper left coordinates (x0, y0) and lower right coordinates (x1, y1).
In step S702, the object detection unit 323 combines the strip-shaped rectangular regions in the horizontal direction, then executes a process of detecting an object included in the image based on the image data, and detects a region corresponding to the object in the image and the type of the object. The object detection unit 323 may detect a plurality of objects from one image. In this case, the object detection unit 323 specifies the types and regions of the plurality of detected objects.
The object detection unit 323 generates a position and a size (a horizontal width and a vertical height) of the region in the image where the object is detected, and the type of the object as outside information. The types of objects that can be detected by the object detection unit 323 are, for example, vehicles (passenger cars, buses, and trucks), people, animals, motorcycles, and signs.
The object detection unit 323 detects an object and identifies the type of the detected object by comparing a predetermined outline pattern associated with the type of the object in advance with the outline of the object in the image. Although the types of objects detectable by the object detection unit 323 are not limited to those described above, it is desirable from the viewpoint of processing speed to narrow down the number of types of objects to be detected according to a traveling environment of the vehicle 100.
In step S703, the object detection unit 323 tracks an object of which an identification number has already been registered. The object detection unit 323 specifies an object of which an identification number has already been registered among the objects detected in step S702.
An object of which an identification number has been registered is, for example, an object that was detected in the previous object detection process and assigned an identification number. If an object of which an identification number is registered is detected, the object detection unit 323 associates the outside information corresponding to the identification number with information regarding the type and the region of the object acquired in step S702 (updates the outside information).
If it is determined that there is no object of which an identification number is registered in the image information, the object associated with the identification number is considered to have moved (lost) outside the imaging angle of view of the imaging device 110, and tracking of the object is stopped.
In step S704, the object detection unit 323 determines whether each of the objects detected in step S702 is a new object of which an identification number has not been registered. A new identification number is assigned to outside information indicating the type and a region of the object determined as being a new object, and is registered in the outside information.
In step S705, the object detection unit 323 outputs the generated outside information to the route generation apparatus 150 together with information representing time. Thus, the outside information generation process executed by the object detection unit 323 is ended. However, the flow in
In step S1201, the distance information generation unit 322 counts the number N of objects detected by the object detection unit 323, and calculates the number of detected objects Nmax that is a total number of detected objects.
In step S1202, the distance information generation unit 322 sets N to 1 (initialization process). The processes in and after step S1203 are sequentially executed for each object indicated in the outside information. It is assumed that the processes from step S1203 to step S1206 are executed in ascending order of the identification number in the outside information.
In step S1203, the distance information generation unit 322 specifies a rectangular region on the distance image 820 corresponding to the region (object frame) on the image 810 of the N-th object included in the outside information. The distance information generation unit 322 sets a frame (object frame) indicating the outline of the corresponding region on the distance image 820.
In step S1204, the distance information generation unit 322 generates a frequency distribution of distance information of pixels included in the rectangular region of the distance image 820 corresponding to the N-th object. If the information associated with each pixel of the distance image data is the distance value D, a section of the frequency distribution is set such that reciprocals of distances are equally spaced.
If each pixel of the distance image data is associated with a defocus amount or a parallax amount, it is desirable to divide the section of the frequency distribution at equal intervals.
In step S1205, the distance information generation unit 322 sets distance information that appears most frequently from the frequency distribution as object distance information indicating a distance of the N-th object.
As the object distance information, an average value of the distance values included in the region may be calculated and used. An average weighted by using the reliability data may be used when calculating an average value. By setting a larger weight for each pixel as the reliability of a distance value increases, a distance value of an object can be calculated with higher accuracy.
The object distance information is preferably information indicating a distance from a predetermined position of the vehicle 100 to an object in order to facilitate route generation in a route generation process that will be described later. If the distance value D is used as the distance information, since the distance value D indicates a distance from the imaging element 302 to an object, the object distance information may be information indicating a distance from a predetermined position (for example, the front end) of the vehicle 100 to the object, obtained by offsetting the most frequent value by a predetermined amount.
If the defocus amount ΔL is used as the distance information, the defocus amount is converted into a distance from the imaging element 302 by using Expression 6, and is then offset by a predetermined amount to obtain information indicating a distance from a predetermined position of the vehicle 100 to an object.
In step S1206, the distance information generation unit 322 determines whether N+1 is greater than the number of detected objects Nmax. If N+1 is smaller than the number of detected objects Nmax (No in step S1206), the distance information generation unit 322 sets N to N+1 in step S1207, and the process returns to step S1203.
That is, object distance information is extracted for the next object (the N+lth object). If N+1 is greater than the number of detected objects Nmax in step S1206 (Yes in step S1206), the process proceeds to step S1208.
In step S1208, the distance information generation unit 322 outputs the object distance information for each of the Nmax objects to the route generation unit 330 together with information regarding time, and ends the process. These pieces of information are stored in the memory 180. Distance information from the radar device 120 is also stored in the memory 180 together with time information. The flow in
Through the above object distance information generation process, object distance information is generated for each object included in the outside information. In particular, by statistically determining distance information of an object from distance information included in a region of the distance image 820 corresponding to the object detected in the image 810, it is possible to suppress a variation in the distance information for each pixel due to noise, the accuracy of calculation, and the like.
Therefore, it is possible to acquire information indicating a distance of an object with higher accuracy. A method of statistically determining distance information is, as described above, a method of taking the most frequently appearing distance information, average value, median value, and the like from a distribution of the distance information, and various methods may be adopted.
Next, a route information generation process (route generation process) executed by the route generation unit 330 of the route generation ECU 130 will be described. The route information is information including a traveling direction and a speed of the vehicle. It can also be said that route information is driving plan information. The route generation unit 330 outputs the route information to the vehicle control ECU 140. The vehicle control ECU 140 controls a traveling direction or a speed of the vehicle by controlling the drive unit 170 on the basis of the route information.
In First Embodiment, the route generation unit 330 generates route information such that if there is another vehicle (preceding vehicle) in the traveling direction of the vehicle 100, the vehicle is traveling following the preceding vehicle. The route generation unit 330 generates route information such that the vehicle 100 takes an avoidance action not to collide with an object.
For example, if a user issues an instruction for starting the route generation process, the route generation unit 330 starts the flow in
In step S1301, the route generation unit 330 detects objects on a planned travel route of the vehicle 100 from the outside information and the object distance information. The route generation unit 330 compares an azimuth of a planned traveling direction of the vehicle 100 with a position and the type of an object included in the outside information to determine the object on the travel route.
It is assumed that the planned traveling direction of the vehicle 100 is specified on the basis of information (a steering angle, a speed, and the like) regarding the control of the vehicle 100 acquired from the vehicle control ECU 140. The route generation unit 330 determines that there is “no object” on the travel route if no object is detected.
For example, it is assumed that the imaging device 110 acquires the image 810 shown in
In steps S1302 and S1303, the route generation unit 330 determines whether to generate route information for following travel or route information for an avoidance action on the basis of a distance between the vehicle 100 and the object on the travel route and the speed Vc of vehicle 100.
In step S1302, the route generation unit 330 determines whether the distance between the vehicle 100 and the object on the travel route is less than a threshold value Dth. The threshold value Dth is expressed as a function of the traveling speed Vc of the vehicle 100. The higher the traveling speed, the greater the threshold value Dth.
If the route generation unit 330 determines that the distance between the vehicle 100 and the object on the travel route is less than the threshold value Dth (Yes in step S1302), the process proceeds to step S1303. If the route generation unit 330 determines that the distance between the vehicle 100 and the object on the travel route is equal to or more than the threshold value Dth (No in step S1302), the process proceeds to step S1308.
In step S1303, the route generation unit 330 determines whether a relative speed between the vehicle 100 and the object on the travel route is a positive value. The route generation unit 330 acquires an identification number of the object on the travel route from the outside information, and acquires object distance information of the object on the travel route at each time from the outside information acquired during a period a predetermined time before the current time.
The route generation unit 330 calculates the relative speed between the vehicle 100 and the object on the travel route from the acquired object distance information of the object on the travel route for a period up to a predetermined time ago. If the relative speed (a difference between the speed of vehicle 100 and the speed of the object on travel route) is a positive value, this indicates that vehicle 100 and the object on the travel route are approaching.
If the route generation unit 330 determines that the relative speed between the vehicle 100 and the object on the travel route is a positive value (Yes in step S1303), the process proceeds to step S1304. If the route generation unit 330 determines that the relative speed between the vehicle 100 and the object on the travel route is not a positive value (No in step S1303), the process proceeds to step S1308.
Here, if the process proceeds to step S1304, route information for executing an avoidance action is generated. If the process proceeds to step S1308, route information for executing following travel for maintaining the distance to the preceding vehicle is generated.
That is, if the distance between the vehicle 100 and the object on the travel route is less than the threshold value Dth and the relative speed between the vehicle 100 and the object on the travel route is a positive value, the route generation unit 330 executes an avoidance action. On the other hand, if the distance between the vehicle 100 and the object on the travel route is equal to or more than the threshold value Dth, the route generation unit 330 determines that following travel is to be performed.
Alternatively, if the distance between the vehicle 100 and the object on the travel route is less than the threshold value Dth and the relative speed between the vehicle 100 and the object on the travel route is zero or a negative value (if the vehicle is moving away from the object), the route generation unit 330 determines that following travel is to be performed.
If the distance between vehicle 100 and the object on the travel route is less than threshold value Dth obtained from the speed of vehicle 100, and the relative speed between vehicle 100 and the object on the travel route is a positive value, it is considered that there is a high possibility of the vehicle 100 colliding with the object on the travel route.
Therefore, the route generation unit 330 generates route information to take an avoidance action. Otherwise, the route generation unit 330 takes following travel. In addition to the determination described above, it may be determined whether or not the type of object detected on the travel route is a movable apparatus (an automobile, a motorcycle, or the like).
In step S1304, the route generation unit 330 starts a process of generating route information for executing an avoidance action.
In step S1305, the route generation unit 330 acquires information regarding an avoidance space. The route generation unit 330 acquires distance information including a distance from the radar device 120 to an object on the side or rear of the vehicle 100 and prediction information regarding a distance to the object.
On the basis of the distance information (fourth distance information) acquired from the radar device 120, the speed of the vehicle 100, and information indicating a size of the vehicle 100, the route generation unit 330 acquires information indicating a direction and a size of a space to which the vehicle 100 can move around the vehicle 100.
In First Embodiment, the distance information (fourth distance information) acquired from the radar device 120 is used for the avoidance space, but may be used to generate combined distance information of an object.
In step S1306, the route generation unit 330 sets route information for an avoidance action on the basis of the information indicating the direction and the size of the space to which the vehicle 100 can move, the outside information, and the object distance information. The route information for the avoidance action is, for example, information for changing the course of the vehicle 100 to the right while decelerating if there is an avoidable space on the right side of the vehicle 100.
In step S1307, the route generation unit 330 outputs the route information to the vehicle control ECU 140. The vehicle control ECU 140 determines parameters for controlling the drive unit 170 on the basis of the route information, and controls drive unit 170 such that the vehicle 100 will pass through the route indicated by the acquired route information.
Specifically, the vehicle control ECU 140 determines, on the basis of the route information, a steering angle, an accelerator control value, a brake control value, a control signal for gear engagement, a lamp lighting control signal, and the like.
Here, step S1307 functions as a route generation step (route generation unit) of generating route information on the basis of distance information. On the other hand, in step S1308, the route generation unit 330 starts a process of generating route information for executing following driving.
In step S1309, the route generation unit 330 generates route information for the vehicle 100 to follow an object (preceding vehicle) on the travel route. Specifically, the route generation unit 330 generates route information such that a distance (inter-vehicle distance) between the vehicle 100 and the preceding vehicle is maintained within a predetermined range.
For example, if the relative speed between the vehicle 100 and the preceding vehicle is zero or a negative value, or if the inter-vehicle distance is equal to or more than a predetermined distance, the route generation unit 330 generates route information such that a predetermined inter-vehicle distance is maintained through acceleration and deceleration while keeping the traveling direction of the vehicle 100 straight.
The route generation unit 330 generates route information such that the traveling speed of the vehicle 100 does not exceed a predetermined value (for example, a legal speed of the road on which the vehicle 100 is traveling or a set traveling speed based on an instruction from the driver 101). After step S1309, the process proceeds to step S1307, and the vehicle control ECU 140 controls the drive unit 170 on the basis of the generated route information.
Here, the vehicle control ECU 140 functions as a traveling control unit configured to control a travel state on the basis of the route information that is generated by the route generation unit 330 on the basis of information such as a position or a size of an object detected by the object detection unit 323.
Next, in step S1310, it is determined whether or not the user has issued an instruction for ending the route generation process. If Yes, the route information generation process performed by the route generation unit 330 is ended. If No, the process returns to step S1301 to repeatedly execute the process of generating route information.
According to the control described above, by statistically processing distance information within a frame based on a position and a size of an object in an image, the influence of sensor noise or the influence of a local distance error caused by high-luminance reflection from a subject can be reduced, and a distance value to each object can be calculated with high accuracy.
A distance value to each object can be made highly accurate, and a route of the vehicle 100 calculated by the route generation ECU 130 can be calculated with high accuracy, so that the vehicle 100 can travel more stably.
In the above process, a region of an object is shown as a rectangular region (object frame) including the object, but the region of the object may be a region having a shape of the object with an outer circumference of the object in an image as a boundary. In that case, in step S702, the object detection unit 323 stores a region where an object is present in the image 810 in the outside information as a region of the object. For example, the object detection unit 323 can perform region division for each object by identifying attributes for each pixel of image data.
In this case, in steps S1203 and S1204, the distance information generation unit 322 may calculate, for example, a frequency distribution of distance values included in each region shown in
By defining the region of the object as described above, it becomes difficult to include distance information such as the background other than the object in the region. That is, it is possible to reflect the distance information of the object more effectively in the distribution of the distance information within the region. Therefore, the influence of regions other than the object, such as the background and the foreground of the object, can be reduced, and thus a distance value of the object can be calculated with higher accuracy.
Image information and distance image information are sequentially output from the imaging device 110 of First Embodiment. The object detection unit 323 sequentially generates outside information by using image information that is sequentially received. The outside information includes an identification number of an object, and if an object with the same identification number is detected at each of certain time T0 and time T1, a temporal change in distance information of the object, a detected size, or the like can be determined.
Therefore, in the Second Embodiment, the distance information generation unit 322 calculates an average of the distance values D of objects with the same identification number in a predetermined time range. Consequently, a distance variation in the time direction is reduced.
In step S1401, the distance information generation unit 322 sets the most frequently appearing distance information from the frequency distribution generated in step S1204 as object distance information indicating a distance of the N-th object. The distance information generation unit 322 stores (stores) the object distance information together with the identification number and the time in the memory 340.
In step S1402, the distance information generation unit 322 acquires a history of object distance information with the same identification number as the identification number of the N-th object among the pieces of object distance information stored in the memory 340. The distance information generation unit 322 acquires object distance information with the same identification number corresponding to the time a predetermined time before the time corresponding to the latest object distance information.
In step S1403, the distance information generation unit 322 calculates an average value of object distance information included in a time range a predetermined time before the time at which the latest object distance information is acquired, from a history of the object distance information of the object with the same identification number as that of the acquired N-th object. The distance information generation unit 322 calculates, for example, an average value of distance values of four points included in a predetermined time range ΔT in
As described above, the identification number included in the outside information is used to acquire a history of the object distance information (distance value) of the same object, and by taking the time average, it is possible to suppress variations. Even if a road on which the vehicle 100 is traveling changes (for example, a curve, a slope, or a bad road with many unevenness), an average value in the time direction can be calculated while tracking the same object.
Therefore, it is possible to reduce a variation in a distance value due to noise such as light shot noise contained in an image signal while reducing the influence of changes in a travel environment, and to calculate a distance value of an object with higher accuracy. In the Second Embodiment, in order to obtain a similar effect, when acquiring object distance information, object distance information that is averaged over time to some extent may be acquired via a low-pass filter.
In the above First and Second Embodiments, an imaging apparatus that acquires left and right parallax images according to the imaging surface phase difference method via the same optical system in order to acquire distance image data has been described as an example, but a method of acquiring parallax images is not limited to this.
Left and right parallax images may be acquired by a so-called stereo camera that acquires the left and right parallax images with two imaging devices provided left and right with a predetermined distance.
Distance information may be acquired by using a distance measuring device such as LiDAR, and the above distance measurement may be performed by using outside information obtained through image recognition of a captured image obtained from an imaging device.
In the above First and Second Embodiments, the combined distance information may be generated on the basis of histories of at least two of the first to third distance information of the object or a history of the combined distance information. The above embodiments may be combined as appropriate, and include, for example, the following configurations.
In the above embodiments, an example in which the distance calculation device as an electronic device is installed in a vehicle such as an automobile as a movable apparatus has been described. However, the movable apparatus may be any apparatus such as a motorcycle, a bicycle, a wheelchair, a ship, an airplane, a drone, or a mobile robot such as an AGV or an AMR as long as the apparatus is movable.
The distance calculation device as an electronic device of the Present Embodiment is not limited to those mounted on the movable apparatus, and includes a device that acquires an image from a camera or the like mounted on the movable apparatus through communication, and calculates a distance at a position away from the movable apparatus.
While the present invention has been described with reference to exemplary embodiments, it is to be understood that the invention is not limited to the disclosed exemplary embodiments. The scope of the following claims is to be accorded the broadest interpretation to encompass all such modifications and equivalent structures and functions.
As a part or the whole of the control according to the embodiments, a computer program realizing the function of the embodiments described above may be supplied to the image processing apparatus through a network or various storage media. A computer (or a CPU, an MPU, or the like) of the image processing apparatus may be configured to read and execute the program. In such a case, the program and the storage medium storing the program configure the present invention.
This application claims the benefit of Japanese Patent Application No. 2022-082368, filed on May 19, 2022, which is hereby incorporated by reference herein in its entirety.
Number | Date | Country | Kind |
---|---|---|---|
2022-082368 | May 2022 | JP | national |