Image processing device
By rotating and processing the stereoscopic image in the image processing device and calculating the rotation angle, the problem of low parallax image accuracy in the stereo camera is solved, and the accuracy of the parallax image is improved in the highly staggered configuration of the left camera and the right camera.
Patent Information
- Application Number
- CN202010802386.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2019-10-02
- Filing Date
- 2020-08-11
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2040-08-11
AI Technical Summary
In the existing technology, the accuracy of the parallax image obtained based on the stereo camera is low, especially when the left camera and the right camera are relatively staggered in the height direction, resulting in reduced accuracy of the parallax image.
By introducing a rotation processing unit, a parallax image generation unit and a rotation control unit into the image processing device, the rotation processing unit performs rotation processing on the stereoscopic image to generate a second left image and a second right image, and the parallax image generation unit calculates correspondence based on these images. point, the rotation control unit calculates the angle change amount of the rotation angle, and adjusts the rotation angle in the rotation process so that the positions of the preceding vehicle images of the left image and the right image are substantially the same in the up and down directions.
The accuracy of the parallax image is improved, ensuring that the corresponding points can be accurately detected when the left camera and the right camera are configured in staggered height directions, thus improving the accuracy of generating the parallax image.
Smart Images

Figure CN112601064B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to an image processing device for obtaining a parallax image based on a stereo image. Background Art
[0002] A vehicle such as a car has a device for generating a parallax image including information about parallax based on a stereo image obtained by a stereo camera. For example, Patent Document 1 discloses a distance estimation device that calculates the positional offset between left and right image sensors using monocular motion stereo, and corrects the captured image based on the positional offset, thereby generating a parallax image.
[0003] Prior art literature
[0004] Patent Literature
[0005] Patent Document 1: Japanese Patent Application Publication No. 2015-175635 Summary of the invention
[0006] In an image processing device, it is desired to improve the accuracy of a parallax image, and further improvement of the accuracy is expected.
[0007] It is desirable to provide an image processing device that can improve the accuracy of parallax images.
[0008] An image processing device according to one embodiment of the present disclosure includes a rotation processing unit, a parallax image generating unit, and a rotation control unit. The rotation processing unit is configured to generate a second left image and a second right image by performing a rotation process of rotating a first left image and a first right image included in a stereoscopic image. The parallax image generating unit is configured to calculate, based on the second left image and the second right image, left image points in the second left image and right image points in the second right image that correspond to each other, and generate a parallax image. The rotation control unit is configured to obtain coordinate points representing the relationship between a first position difference in the left-right direction and a second position difference in the up-down direction between a first position and a second position, and to calculate an angular change amount of a rotation angle in the rotation process based on the coordinate points, wherein the first position is the position of a left image point in the second left image, and the second position is the position of a right image point in the second right image.
[0009] According to the image processing device of one embodiment of the present disclosure, it is possible to improve the accuracy of parallax images. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] Figure 1 This is a block diagram showing a configuration example of an image processing device according to an embodiment of the present disclosure.
[0011] Figure 2 It is shown Figure 1 An explanatory diagram of an example of a left image and a right image generated by a stereo camera shown.
[0012] Figure 3 It is shown Figure 1 An explanatory diagram of other examples of left and right images generated by the stereo camera shown.
[0013] Figure 4 It is shown Figure 1 FIG. 2 is an explanatory diagram of an operation example of the rotation processing unit shown in FIG.
[0014] Figure 5 It is shown Figure 1 FIG. 1 is an explanatory diagram of an example of left image points and right image points of corresponding points calculated by a corresponding point calculation unit shown in FIG.
[0015] Figure 6 It is shown Figure 1 Flowchart of an operation example of the rotation control unit shown.
[0016] Figure 7 It is shown Figure 1 An explanatory diagram of an operation example of the rotation control unit shown.
[0017] Figure 8 It is shown Figure 1 Another explanatory diagram of an operation example of the rotation control unit shown.
[0018] (Explanation of Reference Numerals)
[0019] 1…image processing device; 11…stereo camera; 11L…left camera; 11R…right camera; 20…processing unit; 21…rotation processing unit; 22…parallax image generating unit; 23…corresponding point calculating unit; 24…rotation control unit; 25…approximate straight line calculating unit; 26…rotation angle calculating unit; 27…object recognition unit; CP…corresponding point; CPL…left image point; CPR…right image point; LIN…approximate straight line; P…coordinate point; PD…parallax image; PL, PL1…left image; PR, PR1…right image; θ…rotation angle; ΔX, ΔY…coordinate difference; Δθ…angle change. DETAILED DESCRIPTION
[0020] Hereinafter, embodiments of the present disclosure will be described in detail with reference to the accompanying drawings.
[0021] <Implementation Method>
[0022] [Structure example]
[0023] Figure 1 1 is a diagram showing a configuration example of an image processing device 1 according to an embodiment. The image processing device 1 includes a stereo camera 11 and a processing unit 20. The image processing device 1 is mounted on a vehicle 10 such as a car.
[0024] The stereo camera 11 is configured to generate a set of images (left image PL and right image PR) having parallax with each other by photographing the front of the vehicle 10. The stereo camera 11 includes a left camera 11L and a right camera 11R. The left camera 11L and the right camera 11R each include a lens and an image sensor. In this example, the left camera 11L and the right camera 11R are arranged near the upper part of the front windshield of the vehicle 10 at a specified distance in the width direction of the vehicle 10 in the interior of the vehicle 10. The left camera 11L and the right camera 11R perform photographing actions in synchronization with each other. The left camera 11L generates a left image PL, and the right camera 11R generates a right image PR. The left image PL and the right image PR constitute a stereo image PIC. The stereo camera 11 generates a series of stereo images PIC by performing photographing actions at a specified frame rate (e.g., 60 [fps]).
[0025] Figure 2 is a diagram showing an example of a stereoscopic image PIC, Figure 2 (A) shows an example of a left image PL, Figure 2 (B) shows an example of a right image PR. In this example, another vehicle (a preceding vehicle 90) is traveling ahead of the vehicle 10 on the road on which the vehicle 10 is traveling. The left camera 11L generates a left image PL by photographing the preceding vehicle 90, and the right camera 11R generates a right image PR by photographing the preceding vehicle 90. The stereo camera 11 generates a stereo image PIC including such a left image PL and a right image PR.
[0026] The processing unit 20 is configured to recognize an object in front of the vehicle 10 based on the stereo image PIC supplied from the stereo camera 11. In the vehicle 10, for example, based on the information related to the object recognized by the processing unit 20, it is possible to control the driving of the vehicle 10, or display the information related to the recognized object on a monitor. The processing unit 20 is configured by, for example, a CPU (Central Processing Unit) that executes a program, a RAM (Random Access Memory) that temporarily stores processing data, a ROM (Read Only Memory) that stores a program, and the like. The processing unit 20 includes a rotation processing unit 21, a parallax image generating unit 22, a rotation control unit 24, and an object recognition unit 27.
[0027] The rotation processing unit 21 is configured to generate a left image PL1 and a right image PR1 by performing a rotation process of rotating the left image PL and the right image PR included in the stereoscopic image PIC based on the rotation control data CTL supplied from the rotation control unit 24 .
[0028] That is, in the processing unit 20, as described later, the parallax image generating unit 22 detects corresponding points based on the left image PL (left image PL1) and the right image PR (right image PR1), thereby generating the parallax image PD. When the parallax image generating unit 22 generates the parallax image PD in this way, Figure 2 As shown, it is desirable that the vertical positions of the images of the preceding vehicle 90 in the left image PL and the right image PR are substantially equal. However, in the stereo camera 11, the left camera 11L and the right camera 11R may be arranged to be relatively offset in, for example, the height direction.
[0029] Figure 3 1 is a diagram showing an example of a stereoscopic image PIC in a case where the left camera 11L is arranged at a position lower than that of the right camera 11R. Figure 3 (A) shows an example of a left image PL, Figure 3 (B) shows an example of the right image PR. In this way, when the position of the left camera 11L is configured at a position lower than the position of the right camera 11R, as shown in FIG. Figure 3 As shown in FIG. 1 , the position of the image of the preceding vehicle 90 in the left image PL is higher than the position of the image of the preceding vehicle 90 in the right image PR. On the other hand, when the position of the left camera 11L is arranged at a position higher than that of the right camera 11R, Figure 3 In contrast, the position of the image of the preceding vehicle 90 in the left image PL is lower than the position of the image of the preceding vehicle 90 in the right image PR. In this way, when the left camera 11L and the right camera 11R are arranged to be relatively staggered in the height direction, the positions of the images of the preceding vehicle 90 in the left image PL and the right image PR in the vertical direction are also staggered.
[0030] In this way, when the positions of the images of the preceding vehicle 90 in the left image PL and the right image PR in the vertical direction are misaligned, the parallax image generating unit 22 cannot detect the corresponding point of the preceding vehicle 90 based on the left image PL and the right image PR, and as a result, the accuracy of the parallax image PD may be reduced. Therefore, in the image processing device 1, the rotation processing unit 21 rotates the left image PL and the right image PR in the same rotation direction by the same rotation angle θ based on the rotation control data CTL, thereby generating the left image PL1 and the right image PR1. And the parallax image generating unit 22 detects the corresponding point based on the left image PL1 and the right image PR1.
[0031] Figure 4 (A) is a diagram showing a left image PL1 generated by the rotation processing unit 21. Figure 4 (B) is a diagram showing the right image PR1 generated by the rotation processing unit 21. In this example, Figure 3As shown, the position of the image of the preceding vehicle 90 in the left image PL is higher than the position of the image of the preceding vehicle 90 in the right image PR. Figure 4 As shown in FIG. 1 , the rotation processing unit 21 generates the left image PL1 and the right image PR1 by rotating the left image PL and the right image PR clockwise by the rotation angle θ. In this way, the rotation processing unit 21 performs the rotation processing, thereby making the positions of the images of the leading vehicle 90 in the left image PL1 and the right image PR1 substantially the same in the vertical direction (Y direction). Figure 3 In contrast to the case where the position of the image of the preceding vehicle 90 in the left image PL is lower than the position of the image of the preceding vehicle 90 in the right image PR, the rotation processing unit 21 rotates the left image PL and the right image PR counterclockwise, thereby making the position of the image of the preceding vehicle 90 in the left image PL1 and the right image PR1 substantially the same in the up-down direction (Y direction). Thus, the parallax image generating unit 22 can detect corresponding points based on the left image PL1 and the right image PR1, and can generate the parallax image PD based on the detection result.
[0032] The parallax image generating unit 22 ( Figure 1 ) is configured to perform a specified image processing including a stereo matching process and a filter process based on the left image PL1 and the right image PR1 generated by the rotation processing unit 21, thereby generating a parallax image PD. The parallax image PD has a plurality of pixel values. The plurality of pixel values respectively represent values related to the parallax in each pixel. In other words, the plurality of pixel values respectively correspond to the distance to the point corresponding to each pixel in the three-dimensional real space.
[0033] The parallax image generation unit 22 includes a corresponding point calculation unit 23. The corresponding point calculation unit 23 is configured to perform matching processing on the basis of the left image PL1 and the right image PR1 in units of each of the plurality of divided sub-regions S, thereby determining a corresponding point CP including two corresponding image points. Specifically, the corresponding point calculation unit 23 searches for sub-regions SL and SR having the same image pattern among the plurality of sub-regions SL in the left image PL1 and the plurality of sub-regions SR in the right image PR1, thereby determining the left image point CPL and the right image point CPR corresponding to each other as the corresponding point CP. The corresponding point calculation unit 23 may determine the corresponding point CP by, for example, template matching or feature quantity matching based on local feature quantities.
[0034] Figure 5 1 is a diagram showing an example of left image points CPL and right image points CPR constituting one corresponding point CP. Figure 5 In the example, the left image point CPL in the left image PL1 and the right image point CPR in the right image PR1 are overlapped and drawn. Figure 3As shown, the position of the image of the preceding vehicle 90 in the left image PL is higher than the position of the image of the preceding vehicle 90 in the right image PR. In addition, the rotation angle θ is 0 degrees and is not set to an appropriate angle. Therefore, the coordinate position of the left image point CPL in the left image PL1 and the coordinate position of the right image point CPR in the right image PR1 are offset from each other. Specifically, in this example, with the coordinate position of the right image point CPR as a reference, the coordinate position of the left image point CPL is offset by a coordinate difference ΔX in the X direction and by a coordinate difference ΔY in the Y direction.
[0035] The coordinate difference ΔX corresponds to, for example, the parallax between the left image PL1 and the right image PR1 . That is, when the distance to the subject at the corresponding point CP is short, the coordinate difference ΔX becomes large, and when the distance to the subject is long, the coordinate difference ΔX becomes small.
[0036] The coordinate difference ΔY corresponds to the position difference in the up-down direction (Y direction) of the image of the subject corresponding to the point CP in the left image PL1 and the right image PR1. Figure 3 As shown in FIG. 1 , the position of the image of the subject in the left image PL is higher than the position of the image of the subject in the right image PR, so the coordinate difference ΔY is positive, but for example Figure 3 In the opposite case, when the position of the image of the subject in the left image PL is lower than the position of the image of the subject in the right image PR, the coordinate difference ΔY is negative. In addition, when the rotation angle θ is not set to an appropriate angle, the closer the distance to the subject, the greater the absolute value of the coordinate difference ΔY, and the farther the distance to the subject, the smaller the absolute value of the coordinate difference ΔY.
[0037] The rotation control unit 24 is configured to calculate the rotation angle θ in the rotation process of the rotation processing unit 21 based on the data related to the corresponding point CP calculated by the corresponding point calculation unit 23, thereby generating the rotation control data CTL for instructing the rotation processing unit 21 to perform the rotation process. The rotation control unit 24 includes an approximate straight line calculation unit 25 and a rotation angle calculation unit 26.
[0038] The approximate straight line calculation unit 25 is configured to calculate a coordinate point P based on data about the corresponding point CP, wherein the coordinate point P represents the relationship between the coordinate position of the left image point CPL in the left image PL1 and the coordinate position of the right image point CPR in the right image PR1, the coordinate difference ΔX in the left-right direction (X direction) and the coordinate difference ΔY in the up-down direction (Y direction), and calculate an approximate straight line LIN about the coordinate point P based on the coordinate point P.
[0039] The rotation angle calculation unit 26 is configured to calculate the angle change amount Δθ relative to the current rotation angle θ based on the approximate straight line LIN calculated by the approximate straight line calculation unit 25, and to calculate the rotation angle θ by adding the angle change amount Δθ to the current rotation angle θ. The rotation angle calculation unit 26 generates the rotation control data CTL including data related to the calculated rotation angle θ.
[0040] The object recognition unit 27 is configured to recognize an object in front of the vehicle 10 based on the left image PL1, the right image PR1, and the parallax image PD generated by the parallax image generating unit 22. The object recognition unit 27 outputs data on the recognition result.
[0041] According to this configuration, in the image processing device 1, the rotation processing unit 21 performs a rotation process for rotating the left image PL and the right image PR based on the rotation control data CTL, thereby generating the left image PL1 and the right image PR1, and the parallax image generating unit 22 generates the parallax image PD based on the left image PL1 and the right image PR1. The rotation control unit 24 generates the rotation control data CTL based on the data related to the corresponding point CP calculated by the corresponding point calculating unit 23 of the parallax image generating unit 22. Thus, in the image processing device 1, for example, the rotation angle θ can be adjusted so that the position (Y coordinate) in the height direction of the image of the leading vehicle 90 in the left image PL1 and the right image PR1 is substantially the same. The parallax image generating unit 22 can detect the corresponding point CP based on such the left image PL1 and the right image PR1. As a result, in the image processing device 1, the accuracy of the parallax image PD can be improved.
[0042] Here, the rotation processing unit 21 corresponds to a specific example of the “rotation processing unit” in the present disclosure. The parallax image generating unit 22 corresponds to a specific example of the “parallax image generating unit” in the present disclosure. The rotation control unit 24 corresponds to a specific example of the “rotation control unit” in the present disclosure. The stereoscopic image PIC corresponds to a specific example of the “stereoscopic image” in the present disclosure. The left image PL corresponds to a specific example of the “first left image” in the present disclosure. The right image PR corresponds to a specific example of the “first right image” in the present disclosure. The left image PL1 corresponds to a specific example of the “second left image” in the present disclosure. The right image PR1 corresponds to a specific example of the “second right image” in the present disclosure. The left image point CPL corresponds to a specific example of the “left image point” in the present disclosure. The right image point CPR corresponds to a specific example of the “right image point” in the present disclosure. The coordinate difference ΔX corresponds to a specific example of the “first position difference” in the present disclosure. The coordinate difference ΔY corresponds to a specific example of the “second position difference” in the present disclosure. The rotation angle θ corresponds to a specific example of the “rotation angle” in the present disclosure. The angle change amount Δθ corresponds to a specific example of the “angle change amount” in the present disclosure. The approximate straight line LIN corresponds to a specific example of the “approximate straight line” in the present disclosure.
[0043] [Action and function]
[0044] Next, the operation and effect of the image processing device 1 according to the present embodiment will be described.
[0045] (Overall action summary)
[0046] First, refer to Figure 1 , the overall operation outline of the image processing device 1 is described. The stereo camera 11 generates a stereo image PIC including a left image PL and a right image PR by photographing the front of the vehicle 10. In the processing unit 20, the rotation processing unit 21 performs a rotation process for rotating the left image PL and the right image PR included in the stereo image PIC based on the rotation control data CTL, thereby generating a left image PL1 and a right image PR1. The parallax image generating unit 22 performs a designated image process including a stereo matching process and a filter process based on the left image PL1 and the right image PR1 generated by the rotation processing unit 21, thereby generating a parallax image PD. The rotation control unit 24 calculates a rotation angle θ in the rotation process of the rotation processing unit 21 based on data related to the corresponding point CP calculated by the corresponding point calculation unit 23 of the parallax image generating unit 22, thereby generating the rotation control data CTL that instructs the rotation processing unit 21 to perform the rotation process. The object recognition unit 27 recognizes the object in front of the vehicle 10 based on the left image PL1, the right image PR1, and the parallax image PD generated by the parallax image generating unit 22.
[0047] (Detailed actions)
[0048] The rotation control unit 24 calculates the rotation angle θ in the rotation processing of the rotation processing unit 21 based on the data related to the corresponding point CP calculated by the corresponding point calculation unit 23 of the parallax image generation unit 22. Specifically, the approximate line calculation unit 25 obtains a coordinate point P based on the data related to the corresponding point CP, the coordinate point P indicating the relationship between the coordinate position of the left image point CPL in the left image PL1 and the coordinate position of the right image point CPR in the right image PR1, in terms of the coordinate difference ΔX in the left-right direction (X direction) and the coordinate difference ΔY in the up-down direction (Y direction), and calculates the approximate line LIN related to the coordinate point P based on the coordinate point P. Then, the rotation angle calculation unit 26 calculates the angle change Δθ relative to the current rotation angle θ based on the approximate line LIN calculated by the approximate line calculation unit 25, and calculates the rotation angle θ by adding the angle change Δθ to the current rotation angle θ. The operation of the rotation control unit 24 will be described in detail below.
[0049] Figure 6is a diagram showing an operation example of the rotation control unit 24. In this example, each time the corresponding point CP is calculated by the corresponding point calculation unit 23, the rotation control unit 24 calculates the approximate straight line LIN based on the data on the corresponding point CP. Furthermore, the rotation angle calculation unit 26 calculates the rotation angle θ based on the approximate straight line LIN calculated by the approximate straight line calculation unit 25. This operation will be described in detail below.
[0050] First, the approximate straight line calculation unit 25 obtains a coordinate point P based on the data on the corresponding point CP, and updates the plot 100 about the coordinate point P based on the coordinate point P (step S101). Specifically, the approximate straight line calculation unit 25 obtains a coordinate point P that represents the relationship between the coordinate position of the left image point CPL in the left image PL1 and the coordinate position of the right image point CPR in the right image PR1, the coordinate difference ΔX in the left-right direction (X direction) and the coordinate difference ΔY in the up-down direction (Y direction). Then, the approximate straight line calculation unit 25 records the calculated coordinate point P in the plot 100 on which a plurality of coordinate points P calculated in the past are recorded, thereby updating the plot 100.
[0051] Figure 7 1 is a diagram showing a configuration example of a plotting diagram 100. In the plotting diagram 100, the horizontal axis represents the coordinate difference ΔX, and the vertical axis represents the coordinate difference ΔY. Figure 7 In , the dot represents the coordinate point P. For example, these multiple coordinate points P are calculated based on multiple stereo images PIC generated by the stereo camera 11 after the engine of the vehicle 10 is started. In this example, the number of coordinate points P recorded in the plot 100 has an upper limit. When the number of coordinate points P reaches the upper limit and a new coordinate point P is calculated, the oldest coordinate point P is deleted from the plot 100, and the newly calculated coordinate point P is added to the plot 100. In this example, the plot 100 is divided into multiple areas BIN (three areas BIN1 to BIN3 in this example) in the horizontal axis direction. Specifically, area BIN1 is an area where the coordinate difference ΔX is greater than 0 and less than 50, area BIN2 is an area where the coordinate difference ΔX is greater than 50 and less than 100, and area BIN3 is an area where the coordinate difference ΔX is greater than 100 and less than 150.
[0052] Next, the approximate straight line calculation unit 25 calculates the approximate straight line LIN based on the multiple coordinate points P in the plot 100 (step S102). Specifically, in this example, the approximate straight line calculation unit 25 calculates the centroid of the coordinate point P in each of the multiple regions BIN. Specifically, the approximate straight line calculation unit 25 calculates the centroid of the multiple coordinate points P belonging to the region BIN1, calculates the centroid of the multiple coordinate points P belonging to the region BIN2, and calculates the centroid of the multiple coordinate points P belonging to the region BIN3. Then, the approximate straight line calculation unit 25 calculates the approximate straight line LIN based on the centroid in each of the multiple regions BIN using the least squares method. Specifically, the approximate straight line calculation unit 25 calculates the inclination value a and the intercept value b in the linear function such as shown in the following formula EQ1 using the least squares method.
[0053] ΔY=a×ΔX+b…(EQ1)
[0054] The approximate line calculation unit 25 calculates the approximate line LIN in this manner. In this example, the inclination value a and the intercept value b are calculated using the least squares method, but the present invention is not limited thereto, and instead, for example, the intercept value b may be set to 0 (zero) and only the inclination value a may be calculated using the least squares method.
[0055] In addition, in this example, the approximate straight line calculation unit 25 calculates the centroid points in each area of the plurality of area BINs based on the plurality of coordinate points P in the plot 100, and calculates the approximate straight line LIN based on these centroid points, but is not limited to this. Instead, the approximate straight line calculation unit 25 may directly calculate the approximate straight line LIN using the least squares method, for example, based on the plurality of coordinate points P in the plot 100. In this case, the approximate straight line calculation unit 25 may calculate the approximate straight line LIN using the weighted least squares method, for example. Specifically, for example, the weight of a certain coordinate point P may be set according to the number of coordinate points P in the area BIN to which the certain coordinate point P belongs. For example, when the number of coordinate points P in a certain area BIN is large, the weight of the coordinate points P belonging to the area BIN may be small, and when the number of coordinate points P in a certain area BIN is small, the weight of the coordinate points P belonging to the area BIN may be large.
[0056] Figure 7 An example of the calculated approximate straight line LIN is shown in FIG. Figure 7 In the example, the inclination value a of the approximate straight line LIN is positive, the larger the coordinate difference ΔX, the larger the coordinate difference ΔY, and the smaller the coordinate difference ΔX, the smaller the coordinate difference ΔY and approaches 0 (zero). In other words, the closer the distance to the subject at the corresponding point CP, the larger the absolute value of the coordinate difference ΔY, and the farther the distance to the subject, the smaller the coordinate difference ΔY. This indicates that the vertical positions of the images of the subject in the left image PL1 and the right image PR1 are offset, and the rotation angle θ has not been adjusted to an appropriate angle.
[0057] Next, the rotation angle calculation unit 26 adds data (tilt data) related to the tilt value a of the approximate straight line LIN to the tilt list La (step S103). The tilt list La is configured to be able to accumulate a specified amount of tilt data. The amount of tilt data that can be accumulated in the tilt list La has an upper limit. When the amount of tilt data reaches the upper limit and a new approximate straight line LIN is calculated, the oldest tilt data is deleted from the tilt list La, and the tilt data related to the newly calculated approximate straight line LIN is added to the tilt list La.
[0058] Next, the rotation angle calculation unit 26 calculates the variance value A of the inclination values a represented by the plurality of inclination data in the inclination list La (step S104). If the variance value A is greater than the threshold value Ath ("No" in step S105), the process ends. That is, if the variance value A is greater than the threshold value Ath, the inclination values a are dispersed and the accuracy is insufficient, so the rotation angle θ is not calculated and the process ends.
[0059] When the variance value A is smaller than the threshold value Ath (A<Ath) (Yes in step S105 ), the rotation angle calculation unit 26 calculates the average value (inclination average value AVG) of the inclination values a represented by the plurality of inclination data in the inclination list La (step S106 ).
[0060] Then, the rotation angle calculation unit 26 calculates the rotation angle θ by calculating the angle change Δθ relative to the current rotation angle θ based on the tilt average value AVG (step S107). Specifically, the rotation angle calculation unit 26 sets the polarity of the angle change Δθ based on the polarity of the tilt average value AVG. In addition, the rotation angle calculation unit 26 makes the absolute value of the angle change Δθ larger as the absolute value of the tilt average value AVG is larger. Specifically, for example, when the absolute value of the tilt average value AVG is a first value, the rotation angle calculation unit 26 sets the absolute value of the angle change Δθ to a second value, and when the absolute value of the tilt average value AVG is a third value greater than the first value, the rotation angle calculation unit 26 sets the absolute value of the angle change Δθ to a fourth value greater than the second value. Furthermore, the rotation angle calculation unit 26 calculates the rotation angle θ by adding the angle change Δθ to the current rotation angle θ.
[0061] In this way, the rotation control unit 24 calculates the rotation angle θ based on the data about the corresponding point CP, and generates the rotation control data CTL including the data related to the calculated rotation angle θ. The rotation processing unit 21 rotates the left image PL and the right image PR by the rotation angle θ based on the rotation control data CTL, thereby generating the left image PL1 and the right image PR1. The image processing device 1 repeats such processing.
[0062] The image processing device 1 performs negative feedback control on the rotation angle θ by repeating such processing. Through this negative feedback operation, the inclination value a of the approximate straight line LIN in the plot 100 gradually decreases, and finally, for example, Figure 8 As shown in FIG. 1 , the inclination value a of the approximate straight line LIN becomes approximately 0 (zero). As a result, Figure 4 As shown in FIG. 1 , the rotation angle θ is adjusted to an angle such that the positions of the images of the preceding vehicle 90 in the upper and lower directions (Y directions) in the left image PL1 and the right image PR1 are substantially the same. The parallax image generating unit 22 can detect corresponding points CP based on such left image PL1 and right image PR1. As a result, in the image processing device 1, the accuracy of the parallax image PD can be improved.
[0063] In this way, in the image processing device 1, by performing a rotation process of rotating the left image PL and the right image PR included in the stereoscopic image PIC, the left image PL1 and the right image PR1 are generated, and the left image point CPL in the left image PL1 and the right image point CPR in the right image PR1 corresponding to each other are calculated based on the left image PL1 and the right image PR1. As a result, even when the left camera 11L and the right camera 11R are arranged relatively staggered in the height direction, the positions of the image of the leading vehicle 90 in the left image PL1 and the right image PR1 in the up-down direction (Y direction) can be made substantially the same, so that the corresponding point CP can be detected based on the left image PL1 and the right image PR1. As a result, the accuracy of the parallax image PD can be improved.
[0064] In addition, in the image processing device 1, a coordinate point P is obtained, which indicates the relationship between the coordinate position of the left image point CPL in the left image PL1 and the coordinate position of the right image point CPR in the right image PR1, the coordinate difference ΔX in the left-right direction (X direction) and the coordinate difference ΔY in the up-down direction (Y direction), and the angle change amount Δθ of the rotation angle θ in the rotation process is calculated based on the coordinate point P, so that the rotation angle θ can be calculated by a simple method. That is, for example, the following method may be used: based on the corresponding point CP, the relative offset amount in the height direction of the left camera 11L and the right camera 11R is obtained using epipolar geometry, and the left image PL and the right image PR are corrected based on the offset amount. However, in this case, for example, the algorithm may become complicated, resulting in time-consuming processing. On the other hand, in the image processing device 1, the angle change amount Δθ of the rotation angle θ is calculated by performing calculations on a two-dimensional plane using the coordinate difference ΔX and the coordinate difference ΔY, so the rotation angle θ in the rotation process can be calculated by a simple method.
[0065] In addition, the image processing device 1 calculates the angle change amount Δθ based on the inclination value a of the specified amount among the inclination values a obtained each time the approximate straight line LIN is updated. In particular, the image processing device 1 calculates the variance value A of the inclination value a of the specified amount, and when the variance value A is less than the threshold value Ath, the angle change amount Δθ is calculated based on the inclination average value AVG of the inclination value a of the specified amount. Thus, in the image processing device 1, when the inclination value a is dispersed, the angle change amount Δθ is not calculated, so that the rotation angle θ can be calculated with good accuracy, and as a result, the accuracy of the parallax image PD can be improved.
[0066] [Effect]
[0067] In the present embodiment as described above, a left image PL1 and a right image PR1 are generated by performing a rotation process on the left image PL and the right image PR included in the stereoscopic image, and corresponding left image points in the left image PL1 and right image points in the right image PR1 are calculated based on the left image PL1 and the right image PR1, so that the accuracy of the parallax image can be improved.
[0068] In this embodiment, a coordinate point is obtained, which represents the relationship between the coordinate position of the left image point in the left image PL1 and the coordinate position of the right image point in the right image PR1, the coordinate difference in the left-right direction and the coordinate difference in the up-down direction, and the angular change of the rotation angle in the rotation processing is calculated based on the coordinate point, so that the rotation angle can be calculated by a simple method.
[0069] In the present embodiment, the angle change amount is calculated based on a predetermined amount of tilt values among the tilt values obtained each time the approximate straight line is updated, so that the accuracy of the parallax image can be improved.
[0070] As mentioned above, although this technology was demonstrated using embodiment as an example, this technology is not limited to these embodiment etc., and various deformation|transformation is possible.
[0071] For example, in the above-described embodiment, the stereo camera 11 captures the front of the vehicle 10 , but the present invention is not limited thereto, and for example, the stereo camera 11 may capture the side or rear of the vehicle 10 .
[0072] In addition, the effects described in this specification are merely illustrative and are not limiting, and other effects may also be present.
Claims
1. An image processing device comprising: a rotation processing unit that generates a second left image and a second right image by performing a rotation process of rotating a first left image and a first right image included in the stereoscopic image; a parallax image generating unit that calculates left image points in the second left image and right image points in the second right image that correspond to each other based on the second left image and the second right image, and generates a parallax image; and The rotation control unit obtains coordinate points representing the relationship between a first position difference in the left-right direction and a second position difference in the up-down direction between a first position and a second position, and calculates an angular change amount of a rotation angle in the rotation processing based on the coordinate points, wherein the first position is the position of the left image point in the second left image, and the second position is the position of the right image point in the second right image.
2. The image processing device according to claim 1, wherein: The rotation control unit obtains the coordinate point based on each of the plurality of stereoscopic images, and sets the angle change amount based on the plurality of coordinate points.
3. The image processing device according to claim 2, wherein: The rotation control unit calculates an approximate straight line of the plurality of coordinate points when the plurality of coordinate points are arranged by allocating the first position difference to a first direction and the second position difference to a second direction, and calculates the angle change amount based on an inclination value of the approximate straight line.
4. The image processing device according to claim 3, wherein: The rotation control section calculates the angle change amount based on the inclination value of a designated amount among the inclination values obtained each time the approximate straight line is calculated.
5. The image processing device according to claim 4, wherein: The rotation control unit calculates a variance value of the tilt value of the specified amount, When the variance value is smaller than a specified threshold value, the rotation control section calculates the angle change amount based on an inclination average value, the inclination average value being an average value of the inclination values of the specified amount.
6. The image processing device according to claim 5, wherein: The rotation control unit sets the polarity of the angle change amount based on the polarity of the tilt average value.
7. The image processing device according to claim 5 or 6, wherein: When the absolute value of the tilt average value is a first value, the rotation control unit sets the absolute value of the angle change amount to a second value. When the absolute value of the tilt average value is a third value greater than the first value, the rotation control unit sets the absolute value of the angle change amount to a fourth value greater than the second value.
