Method, medium, device and camera for estimating camera elevation angle
By selecting line pairs that meet preset conditions in the vision camera system and calculating the average of their intersection points, the problem of inaccurate camera elevation estimation in the existing technology is solved, and higher-precision elevation estimation and detection accuracy are achieved. Parallel lines for many situations.
Patent Information
- Application Number
- CN202110533904.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-17
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2041-05-17
AI Technical Summary
Existing technology cannot accurately estimate the elevation angle of the camera, which affects the detection effectiveness and accuracy of the vision camera system. Especially in autonomous driving and advanced driver assistance systems, accurate elevation angle estimation is crucial for vehicle range and real-time calibration.
By acquiring all the lines in the image, select line pairs that meet the preset conditions, calculate the average of the vertical positions of their intersection points to determine the best vertical position, and calculate the elevation angle of the camera based on this position, which is obtained using differential operations and threshold processing For ternary edge points, apply Hough transform to obtain positive and negative edge lines, and select the line pair with the largest Hough histogram peak or the smallest width difference for elevation angle estimation.
It achieves higher-precision camera elevation angle estimation, makes up for the shortcomings of elevation angle estimation in the existing technology, is suitable for parallel lines in a variety of situations, and improves the detection accuracy and real-time calibration capabilities of the visual camera system.
Smart Images

Figure CN113658252B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent transportation and image processing technology, and in particular to a method, medium, device and camera for estimating the elevation angle of a camera. Background Art
[0002] At present, vehicles with AD (Autonomous driving) functions or ADAS (Advanced Driver Assistance System) have begun to be launched on the market, greatly promoting the development of intelligent transportation. In the existing technology, sensors supporting AD / ADAS mainly include radar, visual camera system, laser radar, ultrasonic sensor, etc. Among them, the visual camera system is the most widely used because it can obtain two-dimensional image information like human vision. Its typical applications include lane detection, object detection, vehicle detection, pedestrian detection, cyclist detection, etc.
[0003] In various applications, vision camera systems use image processing to extract features (objects or lanes) from captured images, and the corresponding image processing usually consists of two steps:
[0004] 1) Basic process: First, differential processing is applied to the image data, and then threshold processing is applied to the corresponding image to produce a binary or ternary image.
[0005] 2) Object / lane detection process: Estimate the object (or its range) or lane based on binary / ternary images and Hough transform (or pattern matching).
[0006] In this object / lane detection process, the elevation angle of the monocular camera of the visual camera system is very important, and the estimation of the elevation angle will affect the effectiveness or accuracy of the detection. However, the existing technology usually estimates the elevation angle of the camera through the edge line detected by Hough transform, but this solution is not enough to obtain the accurate elevation angle. But with the development of AD / ADAS, accurate elevation angles are increasingly needed to estimate the range of the monocular camera and calibrate the entire visual camera system in real time.
[0007] Therefore, the present invention hereby provides a solution for estimating the exact elevation angle of a camera with higher accuracy. Summary of the invention
[0008] In view of this, the present invention aims to propose a method, medium, device and camera for estimating the elevation angle of a camera, so as to at least partially solve the above technical problems.
[0009] To achieve the above object, the technical solution of the present invention is achieved as follows:
[0010] A method for estimating the elevation angle of a camera, wherein the camera is used to capture an image in front of a vehicle at a preset elevation angle, and the method comprises: obtaining all lines in the image, wherein the lines are lines viewed from the vehicle's viewing angle; selecting a plurality of line pairs from all combinations of the obtained lines; determining the vertical positions of intersections of the selected plurality of line pairs, and calculating the average of all the determined vertical positions as an optimal vertical position; and calculating the elevation angle of the camera based on the optimal vertical position.
[0011] Further, selecting line pairs from all the obtained line combinations includes: selecting line pairs that meet the following first preset condition: at two different test distances, the width difference of the line pairs is less than a preset value, wherein the width difference d is calculated by the following formula:
[0012] d = |width1-width2| / {(width1+width2) / 2}<default value
[0013] Wherein, width1 and width2 are the widths of the line pair at the test distance.
[0014] Furthermore, in the case where there are multiple line pairs that meet the first preset condition, selecting line pairs from all combinations of obtained lines also includes: for the multiple line pairs that meet the first preset condition, selecting the best line pair according to the following second preset condition: among the multiple line pairs, the Hough histogram peak corresponding to the best line pair is the largest, or the width difference corresponding to the best line pair is the smallest.
[0015] Furthermore, the obtaining of all lines in the image includes: applying differential operation and threshold processing to the image and obtaining ternary edge points; applying Hough transform to the ternary edge points to obtain positive edge lines and negative edge lines; and performing line estimation on the positive edge lines and the negative edge lines according to the Hough histogram to obtain all lines corresponding to the positive edge lines and the negative edge lines.
[0016] Furthermore, the method also includes: comparing the preset elevation angle and the calculated elevation angle, and if the difference between the preset elevation angle and the calculated elevation angle is within a preset range, determining the calculated elevation angle as a reliable elevation angle, wherein the camera is used to capture an image in front of the vehicle at the reliable elevation angle rather than the preset elevation angle.
[0017] Compared with the prior art, the method for estimating the elevation angle of a camera described in the present invention has the following advantages: the scheme of the present invention can perform accurate elevation angle estimation, filling the gap in the prior art that there is no accurate method to estimate the elevation angle, and the proposed method for estimating the elevation angle based on parallel line pairs is not limited to lane lines, but can use any parallel lines, and can thus be applicable to a variety of situations.
[0018] Another object of the present invention is to provide a machine-readable storage medium, a camera and a device for estimating the elevation angle of a camera, so as to at least partially solve the above-mentioned technical problem.
[0019] To achieve the above object, the technical solution of the present invention is achieved as follows:
[0020] A machine-readable storage medium stores instructions for causing a machine to execute the above-mentioned method for estimating a camera elevation angle.
[0021] A camera comprises: one or more processors; and a memory for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the above-mentioned method for estimating the elevation angle of the camera.
[0022] A device for estimating the elevation angle of a camera, wherein the camera is used to capture an image in front of a vehicle at a preset elevation angle, and the device comprises: a detection module configured to obtain all lines in the image, wherein the lines refer to lines viewed from the vehicle's viewing angle; and a calculation module. The calculation module is configured to: select multiple line pairs from all combinations of all obtained lines; determine the vertical positions of the intersections of the selected multiple line pairs, and calculate the average of all the determined vertical positions as the optimal vertical position; and calculate the elevation angle of the camera according to the optimal vertical position.
[0023] The advantages of the machine-readable storage medium, camera and device are the same as those of the above-mentioned method for estimating the camera elevation angle over the prior art, which will not be repeated here.
[0024] Other features and advantages of the present invention will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The accompanying drawings constituting a part of the present invention are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the accompanying drawings:
[0026] Figure 1(a) is a schematic diagram of the relationship between a camera and an object;
[0027] FIG1( b ) is a schematic diagram showing that an object in an image moves vertically due to an inaccurate camera elevation angle;
[0028] FIG1( c ) is a schematic diagram showing how the range of an object captured by a camera is calculated based on the relative positions between the camera and the object;
[0029] Figure 1(d)-Figure 1(i) Schematic diagram of the results or principles of each process of estimating the camera elevation angle in the example;
[0030] Figure 2 It is a schematic diagram of the principle of the relationship between horizontal and parallel lines;
[0031] Figure 3(a)-Figure 3(c) It is a schematic diagram of the three relative positions of the intersection points of parallel lines and the horizontal line.
[0032] Figure 4(a)-Figure 4(c) 2 is a schematic diagram showing three examples of estimating a horizontal line using a pair of parallel lines.
[0033] Figure 5 is a flow chart of a method for estimating a camera elevation angle in an embodiment of the present invention;
[0034] Figure 6 is a schematic diagram of a process of obtaining line pairs in a preferred embodiment;
[0035] Figure 7(a)-Figure 7(b) 7 is a schematic diagram showing a process from an original image to a monochrome image, wherein FIG. 7( a ) is an original image, and FIG. 7( b ) is a monochrome image;
[0036] FIG7( c ) is a schematic diagram of a ternary image obtained following FIG7( b );
[0037] FIG7( d ) is a schematic diagram of the Hough lines of the positive edge obtained from FIG7( c );
[0038] FIG7(e) is a schematic diagram showing all the lines obtained by considering FIG7(d);
[0039] FIG7( f) is a schematic diagram showing the calculation of the width between line pairs based on two ranges of 40 [m] and 80 [m];
[0040] Figure 7(g) is a continuation of Figure 7(a)-Figure 7(f) The final line fit and the schematic diagram of the Hough line are obtained;
[0041] Figure 8 is a flow chart of a method for estimating a camera elevation angle in other embodiments of the present invention;
[0042] Figure 9(a)-Figure 9(b)is a schematic diagram of the principle of verifying the accuracy of elevation angle estimation in the first example;
[0043] Figure 10(a)-Figure 10(f) is a schematic diagram of the application process of performing elevation angle estimation in the second example; and
[0044] Fig.11 It is a structural schematic diagram of a device for estimating a camera elevation angle provided by another embodiment of the present invention.
[0045] Description of reference numerals:
[0046] 100, camera; 200, object; 1110, detection module; 1120, calculation module. DETAILED DESCRIPTION
[0047] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.
[0048] The present invention will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.
[0049] Here, the inventive concept of the embodiments of the present invention is first introduced with reference to examples and drawings.
[0050] FIG1( a ) is a schematic diagram showing the relationship between a camera 100 and an object 200 to be captured. Referring to FIG1( a ), the camera 100 is mounted on a vehicle at a height of H. c , the elevation angle of the camera 100 is θ ele , FOV (Field of view) is represented by θ FOV . Figure 1(b) is a schematic diagram of an object 200 in an image that has moved vertically due to an inaccurate camera elevation angle. The left side is a schematic diagram of the object 200 detected when the elevation angle is correct, and the right side is a schematic diagram of the object 200 detected when the elevation angle is incorrect. By observing the relative position of the object 200 and the ground, it is easy to see that the object has obviously moved vertically in the image. It should be noted that in Figure 1(b), the axis m is used to show the vertical position of the object in the image, and the vertical elevation angle error will cause the bottom m position of the object to move. In the following text, m will also be used to represent the elevation angle of the camera.
[0051] against Figure 1(a)-Figure 1(b) It is easy to know that the precise elevation angle of the camera is crucial for object recognition and range detection. Only when the precise elevation angle is obtained can further operations be performed, such as: 1) determining the precise range of the object captured by the camera, such as shown by the distance HH in Figure 1(a); 2) estimating the precise height position of the object, such as shown by the distance H1 in Figure 1(a); 3) real-time calibration angle, such as θ in Figure 1(a) ele With θFOV If the elevation angle is wrong, the range may be wrong. For example, as shown in Figure 1(c), the range is calculated based on the camera height, the bottom position of the object, and the elevation angle (θ ele +dθ(m)). If θ ele If it is wrong, the range xg i will be wrong. Specifically, in Figure 1(c), there is the following equation relationship:
[0052] xg i =-H c tanθ ele-i =-H c tan(θ ele +dθ(m))
[0053] Here, dθ is a function of m.
[0054] Further, Figure 1(d)-Figure 1(i) A typical example of estimating the camera elevation angle is given, which specifically includes the following steps:
[0055] 1) Color and analysis area processing: from the original image (Figure 1(d)) to the monochrome image (Figure 1(e)), where the white frame area in Figure 1(e) is the analysis area. The analysis area refers to the area where image processing is limited, which is a well-known concept to those skilled in the art.
[0056] 2) Secondary sampling: Perform secondary sampling on the analysis area, for example, once every 3 or 4 points.
[0057] 3) Acquisition of ternary image: The ternary image is obtained through Sobel and threshold processing, as shown in Figure 1(f), where the corresponding positive edges and negative edges can be seen.
[0058] 4) Hough transform: Obtain the Hough histogram for positive edges as shown in FIG1( g ).
[0059] 5) Line estimation: It is done based on the Hough histogram as shown in Figure 1(g).
[0060] 6) Determine the vanishing point in the subsampling: Determine the intersection of the estimated lines, as shown in Figure 1(h).
[0061] 7) Determine the vanishing point and elevation angle: After returning all pixels, calculate the vertical position and elevation angle of the vanishing point (on the estimated horizontal line), as shown in Figure 1(i).
[0062] based on Figure 1(d)-Figure 1(i) method, Figure 2 It is a diagram of the principle of the relationship between horizontal lines and parallel lines. The intersection of parallel lines is on the horizon. Figure 2, this aspect may include the following steps:
[0063] Step 1), estimate the lane line through Hough transform. The estimated result is as follows Figure 2 shown.
[0064] Step 2), determine the intersection point of the estimated lane, which is also called the vanishing point, such as Figure 2 As shown, the coordinates of the vanishing point can be expressed as (m, n), where m is the vertical position of the vanishing point and n is the horizontal position of the vanishing point.
[0065] Step 3), convert the vanishing point m to the elevation angle.
[0066] Specifically, the height and FOV of the camera are constant, and the coordinates (m, n) of the vanishing point are uniquely determined by the elevation angle, FOV and height of the camera. Therefore, the elevation angle and the vanishing point are one-to-one corresponding, and the m position of the vanishing point can be corresponded to the elevation angle of the camera.
[0067] More specifically, the relationship between the position m of the vanishing point and the elevation angle of the camera can be described by the following equation (1):
[0068] v=(-m / MM+0.5)*2*tan(FOV / 2);
[0069] angle[radian]=atan(v)+pi / 2; (1)
[0070] Where m, MM, and FOV are the vertical position of the vanishing point, the number of vertical pixels in the image, and the field of view, respectively, angle[radian] represents the elevation angle in radians, and pi is the circumference of a circle.
[0071] However, due to the limited resolution of the Hough transform in angle estimation and position, such a solution cannot provide accurate elevation angles. In addition, such a solution has another problem: it is limited to using only lane lines.
[0072] On this basis, in order to solve the problems existing in the current commonly used solutions for determining the camera elevation angle, the inventor of the present application discovered an important rule in the process of implementing the present application, namely: observe such as Figure 2 In the camera image, the horizontal line distinguishes the aerial and road parts, and any pair of parallel lines on the road should intersect at the horizontal line. For example, the relationship between the intersection of parallel lines and the horizontal line may be as follows: Figure 3(a)-Figure 3(c)There are three cases shown. As shown in Figure 3(a), if the parallel lines intersect below the horizontal line, the parallel lines intersect at a certain point on the road surface, which contradicts that the parallel lines should be parallel on the ground. That is, this situation is not feasible. As shown in Figure 3(b), if the intersection point exists in the air, this contradicts that the intersection point should be on the road surface. That is, as shown in Figure 3(c), there can be no intersection point on the ground or in the air except on the horizontal line. Therefore, the estimation of the horizontal line is crucial.
[0073] Accordingly, Figure 4(a)-Figure 4(c) Three examples of using parallel line pairs to estimate horizontal lines are shown. As shown in Figure 4(a), lane lines can certainly estimate horizontal lines. As shown in Figure 4(b), segmented parallel line pairs can estimate horizontal lines. As shown in Figure 4(c), the combination between curbs and lines can also estimate horizontal lines.
[0074] On this basis, an embodiment of the present invention further provides a method for estimating a camera elevation angle. Figure 5 FIG. 1 is a flow chart of a method for estimating a camera elevation angle according to an embodiment of the present invention. Figure 5 As shown, for the image in front of the vehicle captured by the camera at a preset elevation angle, the method may include the following steps:
[0075] Step S510, obtaining all lines in the image.
[0076] The lines described in the embodiment of the present invention refer to the lines viewed from the vehicle's viewing angle, especially the parallel lines under this viewing angle. However, it should be noted that the "parallel" here is not absolutely parallel, and there may be a certain error. The following will also introduce how to select the best line pair with the best parallelism. The obtained lines are, for example, Figure 4(a)-Figure 4(c) The lines shown in , for example, the segmented parallel line pairs in FIG. 4( b ).
[0077] Figure 6 FIG. 1 is a flow chart of obtaining lines in an image in a preferred embodiment. Figure 6 As shown, the following steps may be included:
[0078] Step S511, applying differential operation and threshold processing to the image and obtaining ternary edge points.
[0079] The process of obtaining the ternary edge points can be referred to Figure 1(d)-Figure 1(i) An example of, for example, includes: performing monochrome processing on the image and determining the analysis area; performing secondary sampling on the image within the analysis area, for example, using one sampling for every 3 or 4 points; performing Sobel edge detection and threshold processing on the image processed as above to obtain positive edge points and negative edge points of the corresponding ternary image.
[0080] Step S512: Apply Hough transform to the ternary edge points to obtain positive edge lines and negative edge lines.
[0081] Step S513: performing line estimation on the positive edge line and the negative edge line according to the Hough histogram to obtain all lines corresponding to the positive edge line and the negative edge line.
[0082] It should be noted that, for the sake of description, the “edge line” will be directly referred to as the “edge” below.
[0083] For steps S511-S513, for example, Figure 7(a)-Figure 7(b) The process from the original image to the monochrome image is shown, wherein FIG7(a) is the original image, FIG7(b) is the monochrome image, and the lower half of FIG7(b) distinguished by the middle white line is the determined analysis area; FIG7(c) is the ternary image obtained from FIG7(b), which shows the positive edge of the left lane, the negative edge of the left lane and the positive edge of the curb; FIG7(d) is the Hough line of the positive edge obtained from FIG7(c); FIG7(e) indicates that all the lines obtained from FIG7(d) will be considered, including lines P1, P2 and N1, where P represents positive and N represents negative, and the three correspond to the positive edge of the left lane, the positive edge of the curb and the negative edge of the left lane in FIG7(c), respectively.
[0084] Furthermore, after all the lines are obtained, any line pair is selected from the combination of all the lines.
[0085] In a preferred embodiment, after step S510, the method preferably includes the following steps S520-S540:
[0086] Step S520: Select multiple line pairs from all the obtained combinations of lines.
[0087] In a preferred embodiment, step S520 may include: selecting a line pair that meets a first preset condition, wherein the first preset condition is described as: at two different test distances, the width difference of the line pair is less than a preset value.
[0088] For example, a preset elevation angle θ may be used. pre 1(a), calculate the widths of all possible line pairs at multiple camera test distances (reference Figure 2 ). As shown in FIG7(f), for the ranges of 40 [m] and 80 [m], the widths between the line pairs can be calculated respectively. If the width difference between the line pairs within the two test distances is small enough (less than a preset value), the line pairs are considered to be parallel (with good parallelism). Specifically, the width difference can be calculated by the following equation (2):
[0089]
[0090] Where width40 indicates the width corresponding to the range of 40 [m], and width80 indicates the width corresponding to the range of 80 [m], and nn indicates the number of line pairs. width40 and width80 are the actual widths [m]. The pixel width is converted to the actual width [m] according to Figure 1(a). For example, Figure 2 As shown, the lane is calculated from the actual width to the pixel width, so the pixel width is estimated from the actual width by performing the inverse calculation.
[0091] Based on equation (2), the first preset condition can be described as follows:
[0092] d = |width1-width2| / {(width1+width2) / 2}<default value
[0093] Wherein, by analogy with formula (2), width1 and width2 are the widths of the line pair at the test distance, and d is the width difference.
[0094] Accordingly, pick up the line pair that meets the first preset condition. However, there may be multiple line pairs that meet the first preset condition. On this basis, in a more preferred embodiment, step S520 may also include: For multiple line pairs that meet the first preset condition, select the best line pair through the following second preset condition. Among them, the second preset condition can be described as: among multiple line pairs, the Hough histogram peak corresponding to the best line pair is the largest, or the width difference corresponding to the best line pair is the smallest (Equation 2). Among them, the best line pair can be understood as the line pair with the best parallelism. Among them, the Hough histogram peak is used to show the reliability of the estimated line. The higher the height of the Hough histogram (indicating frequency, range, angle, etc.), the higher the reliability score of the estimated line; the width difference is used to indicate the reliability of the selected line pair. The smaller the width difference, the higher the reliability of the selected line pair.
[0095] For further example, FIG. 7( g) is a continuation of Figure 7(a)-Figure 7(f) The resulting final line fit is shown with a schematic diagram of the Hough lines, which explicitly shows the available parallel line pairs.
[0096] Step S530, determining the vertical positions of the intersections of the selected line pairs, and calculating the average of all the determined vertical positions as the optimal vertical position.
[0097] For example, let m0 be the vertical position of the vanishing point of the optimal parallel line pair. Then, for the coordinates (mi, ni) of each intersection point, we can take All values of , and calculate their corresponding mi, and then take the average value of all mi as the vertical position m0 of the vanishing point of the best parallel line pair.
[0098] Step S540, calculating the elevation angle of the camera according to the optimal vertical position.
[0099] For example, when the optimal vertical position is known, the elevation angle of the camera can be calculated by equation (1).
[0100] Finally, Figure 5 The steps S510-S540 shown in the figure determine the best vertical position based on the selected multiple line pairs to calculate the camera elevation angle. However, it should be noted that in other embodiments, such as Figure 8 As shown, a unique optimal line pair can also be selected and the camera elevation angle can be directly calculated based on the vertical position of the optimal line pair. For example, after acquiring all the lines of the image, the intersection point (vanishing point) of each line pair is determined as (mi, ni), where Where mi represents the vertical position of the intersection point formed by the i-th line pair, ni represents the horizontal position of the intersection point formed by the i-th line pair, and the best line pair is found. That is, the scheme of FIG. 5 calculates the vertical positions of multiple line pairs, and Figure 8 The solution is to select a unique line pair and calculate its vertical position.
[0101] Finally, Figure 5 Steps S510-S540 shown provide a method of first selecting multiple line pairs and then calculating the best vertical position among the multiple line pairs to calculate the camera elevation angle.
[0102] In a more preferred embodiment, after calculating the elevation angle of the camera, the method may further include:
[0103] Step S550 (not shown in the figure), compare the preset elevation angle with the calculated elevation angle, if the difference between the preset elevation angle and the calculated elevation angle is within a preset range, determine the calculated elevation angle as a reliable elevation angle.
[0104] The camera is used to capture the image in front of the vehicle at the reliable elevation angle rather than the preset elevation angle.
[0105] That is, the preset range is required to be set so that the preset elevation angle is sufficiently close to the calculated elevation angle, and the reliable elevation angle refers to an elevation angle that can be used in subsequent image processing for object detection and ranging.
[0106] Through the above embodiments, it can be known that the line pair for estimating the elevation angle can be a single pair (corresponding to FIG. 8 ) or multiple pairs (corresponding to Figure 5), where multiple pairs are applicable and can make the estimate more reliable.
[0107] The embodiment of the present invention also provides two examples for verifying the accuracy of the above method for estimating the elevation angle of a camera.
[0108] Figure 9(a)-Figure 9(b) 9(a) is a schematic diagram of the principle of verifying the accuracy of the elevation angle estimation in the first example. In this example, the traffic cone is set to 150 [m], and a shot is taken at a virtual window of 150 [m] in FIG9(a). In FIG9(b), the bottom of the traffic cone (i.e., the actual 150 m position) is compared with the bottom of the virtual window (i.e., the 150 m position based on the calculated elevation angle). If the distance between the two is small (optimally, they coincide), it indicates that the estimation of the elevation angle is reasonable.
[0109] Figure 10(a)-Figure 10(f) is a schematic diagram of the application process of estimating the elevation angle in the second example. In the second example, the road surface presents a wet edge line due to rain, snow, etc., which is referred to as the wet edge here. The wet edge is not a lane line on the road surface. Figure 10(a)-Figure 10(b) The process of converting a road surface with a wet edge from an original image to a monochrome image is shown, wherein FIG. 10(a) is the original image, FIG. 10(b) is the monochrome image, and the lower half of FIG. 10(b) separated by the middle horizontal line is the determined analysis area. FIG. 10(c) is a ternary image obtained from FIG. 10(b), including positive and negative edges, wherein the circled portion is the line corresponding to the wet edge. FIG. 10(d) and FIG. 10(e) are respectively the lines of the positive edge and the negative edge obtained from FIG. 10(c), wherein FIG. 10(d) shows four lines of the positive edge, and FIG. 10(e) shows four lines of the negative edge, and thus it can be seen that a total of 8 lines are identified in this example. For the identified 8 lines, the best line pair is selected based on the above scheme, and FIG. 10(f) is a schematic diagram of the final line fitting and the Hough line obtained, which clearly shows that the line pair formed by the wet edge and the right edge is the selected best line pair, and the vanishing point of the line pair is exactly on the horizontal line.
[0110] To sum up, the method for estimating the elevation angle of a camera in an embodiment of the present invention can perform accurate elevation angle estimation, filling the gap in the prior art that there is no accurate method to estimate the elevation angle. Moreover, the method for estimating the elevation angle based on parallel line pairs proposed in an embodiment of the present invention is not limited to lane lines, but can use any parallel lines, and thus can be applicable to a variety of situations.
[0111] Fig.11 FIG. 1 is a schematic diagram of a device for estimating a camera elevation angle provided by another embodiment of the present invention. The device and the above method are based on the same inventive concept. Fig.11As shown, the device includes a detection module 1110 and a calculation module 1120.
[0112] The detection module 1110 is configured to obtain all lines in the image, wherein the lines refer to lines viewed from a vehicle viewing angle.
[0113] In a preferred embodiment, the calculation module 1120 is configured to: select line pairs from all combinations of all obtained lines; determine the vertical positions of the intersections of the selected line pairs, and calculate the average of all the determined vertical positions as the optimal vertical position; and calculate the elevation angle of the camera based on the optimal vertical position.
[0114] Among them, the detection module 1110 is, for example, a perception component and an image processing component in a camera, and the calculation module 1120 is, for example, a processor. For available processors, please refer to the following text and will not be repeated here.
[0115] In addition, more implementation details and effects of the device for estimating the elevation angle of a camera according to an embodiment of the present invention may be referred to the above-mentioned embodiments of the corresponding method, which will not be described in detail here.
[0116] Another embodiment of the present invention further proposes a machine-readable storage medium, on which instructions are stored, and the instructions are used to enable a machine to execute the above-mentioned method for estimating the elevation angle of a camera. The machine-readable storage medium includes, but is not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory (Flash Memory) or other memory technology, read-only compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, tape disk storage or other magnetic storage devices and other media that can store program codes.
[0117] Another embodiment of the present invention further provides a camera, which includes: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the above-mentioned method for estimating the elevation angle of the camera.
[0118] Wherein, the camera is, for example, a monocular camera. The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium. The processor can be a general-purpose processor, a special-purpose processor, a conventional processor, a digital signal processor (DSP), a plurality of microprocessors, one or more microprocessors associated with a DSP core, a controller, a microcontroller, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) circuit, any other type of integrated circuit (IC), a state machine, etc.
[0119] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for estimating a camera elevation angle, characterized in that: The camera is used to capture an image in front of the vehicle at a preset elevation angle, and the method includes: Acquire all lines in the image, wherein the lines refer to lines viewed from a vehicle viewing direction; Selecting a plurality of line pairs from all the obtained combinations of lines, wherein the line pair is any pair of lines on the road surface not limited to a pair of lane lines; Determining vertical positions of intersections of the selected plurality of line pairs and calculating an average of all the determined vertical positions as an optimal vertical position; and Calculating the elevation angle of the camera according to the optimal vertical position; Among them, selecting line pairs from all combinations of obtained lines includes: Select a line pair that meets the following first preset condition: at two different test distances, the width difference of the line pair is less than a preset value, where d is the width difference. The first preset condition is described as follows: d = |width1-width2| / {(width1+width2) / 2}<default value Where width1 and width2 are the widths of the line pair at different test distances; and For multiple line pairs that meet the first preset condition, the best line pair with the best parallelism is selected according to the following second preset condition: among the multiple line pairs, the Hough histogram peak corresponding to the best line pair is the largest, or the width difference corresponding to the best line pair is the smallest.
2. The method according to claim 1, characterized in that The acquiring of all lines in the image comprises: Applying a difference operation and a threshold process to the image and obtaining ternary edge points; Applying Hough transform to the ternary edge points to obtain positive edge lines and negative edge lines; and performing line estimation on the positive edge lines and the negative edge lines according to the Hough histogram to obtain all lines corresponding to the positive edge lines and the negative edge lines.
3. The method according to claim 1, characterized in that The method further comprises: The preset elevation angle is compared with the calculated elevation angle, and if the difference between the preset elevation angle and the calculated elevation angle is within a preset range, the calculated elevation angle is determined as a reliable elevation angle, wherein the camera is used to capture an image in front of the vehicle at the reliable elevation angle rather than the preset elevation angle.
4. A machine-readable storage medium having instructions stored thereon, the instructions being used to enable a machine to execute the method for estimating a camera elevation angle as described in any one of claims 1 to 3.
5. A camera, characterized in that: The camera comprises: one or more processors; a memory for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method for estimating the elevation angle of a camera as described in any one of claims 1 to 3.
6. A device for estimating a camera elevation angle, characterized in that: The camera is used to capture an image in front of the vehicle at a preset elevation angle, and the device includes: A detection module configured to obtain all lines in the image, wherein the lines refer to lines viewed from a vehicle viewing direction; and The computing module is configured as follows: Selecting a plurality of line pairs from all combinations of all obtained lines, wherein the line pair is any pair of lines on the road surface not limited to a pair of lane lines; Determining vertical positions of intersections of the selected plurality of line pairs and calculating an average of all the determined vertical positions as an optimal vertical position; and Calculating the elevation angle of the camera according to the optimal vertical position; The step of selecting line pairs from all combinations of obtained lines by the calculation module includes: Select a line pair that meets the following first preset condition: at two different test distances, the width difference of the line pair is less than a preset value, where d is the width difference. The first preset condition is described as follows: d = |width1-width2| / {(width1+width2) / 2}<default value Where width1 and width2 are the widths of the line pair at different test distances; and For multiple line pairs that meet the first preset condition, the best line pair with the best parallelism is selected according to the following second preset condition: among the multiple line pairs, the Hough histogram peak corresponding to the best line pair is the largest, or the width difference corresponding to the best line pair is the smallest.
