Road segmentation method and device for actively adjusting sight angle of camera
Through the method of reverse projection and dynamically adjusting the camera's line of sight angle, the problem of low road segmentation accuracy in smart cars in complex traffic environments is solved, and more efficient road detection and vehicle motion monitoring is achieved, ensuring safe driving.
Patent Information
- Application Number
- CN202410961892.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-17
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-07-17
AI Technical Summary
In the prior art, in complex traffic environments such as backlight and turnover, the camera's fixed posture cannot accurately divide the road, resulting in a reduced road segmentation accuracy and the driving area where the vehicle's movement state cannot be effectively detected.
By inversely projecting the road image to the road plane coordinate system, road segmentation and evaluation are performed, camera line of sight angle is dynamically adjusted, and the best line of sight angle is selected to improve road segmentation accuracy and detection ability of vehicle motion state.
Under unfavorable conditions such as backlighting and turnover, the performance and accuracy of road segmentation are improved to ensure the safe driving of smart cars.
Smart Images

Figure CN118968285A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of this specification relate to the field of intelligent vehicle driving, and in particular, to a road segmentation method and device for actively adjusting a camera's sight angle. Background Art
[0002] Road segmentation is also known as drivable area detection. Its goal is to use the on-board camera to detect the drivable area of the road that the vehicle is traveling or about to travel, so as to classify each pixel of the image as a drivable area or a non-drivable area. This is a key technology in the field of smart cars. The actual urban traffic environment is extremely complex. In order to achieve stable segmentation of roads by smart cars, it is necessary to overcome a variety of unfavorable factors. In the existing technology, the camera maintains a fixed posture, and it is impossible to accurately segment the road when facing scenes such as backlighting and U-turns. When the vehicle is driving towards the sun, there is a high probability that the camera will be overexposed by direct sunlight or mirror reflection of the road surface, thereby affecting the accuracy of road segmentation. When the vehicle turns or turns around, the camera may move the area of interest that needs to be paid attention to outside the camera's field of view due to the limitation of the camera's field of view. In this case, no matter how high the accuracy of the segmentation is, it is meaningless to the driving task of the smart car.
[0003] Therefore, there is an urgent need for a road segmentation method that can actively adjust the camera's sight angle, thereby improving the performance of road segmentation. Summary of the invention
[0004] The purpose of the embodiments of this specification is to provide a road segmentation method and device for actively adjusting the camera sight angle, so as to actively adjust the camera sight angle, thereby improving the performance of road segmentation.
[0005] To achieve the above-mentioned purpose, on the one hand, an embodiment of the present specification provides a road segmentation method for actively adjusting the sight angle of a camera, wherein the camera is not in the process of adjusting the sight angle in an initial state, and includes:
[0006] S1: Use the camera to collect the road image in front;
[0007] S2: reversely projecting the road image onto a road plane to obtain a top view in a road plane coordinate system;
[0008] S3: performing road segmentation on the top view to obtain a segmented image;
[0009] S4: Evaluating the segmented image according to a preset evaluation standard to obtain an evaluation value of the road image;
[0010] S5: Determine whether the camera is in the process of adjusting the sight angle;
[0011] S51: If not, determining whether the evaluation value of the road image is greater than an evaluation threshold;
[0012] S511: If yes, keep the sight angle of the camera and loop through steps S1-S5;
[0013] S512: if not, setting the camera to be in the process of adjusting the sight angle, actively adjusting the sight angle of the camera to a new candidate sight angle, and looping through steps S1-S5;
[0014] S52: If yes, then
[0015] Actively adjust the sight angle of the camera to a new candidate sight angle, and repeat the steps S1-S5 until there is no new candidate sight angle, and set the sight angle of the camera to be adjusted;
[0016] When the sight line angle of the camera is adjusted, based on evaluation values of the road images corresponding to all candidate sight line angles of the camera, a target sight line angle is selected from all candidate sight line angles;
[0017] The camera is adjusted to the target sight angle, and steps S1-S5 are repeated.
[0018] Preferably, evaluating the segmented image by a preset evaluation standard to obtain an evaluation value of the road image further comprises:
[0019] Extracting features related to road segmentation accuracy in the segmented image;
[0020] Inputting the feature into a pre-trained neural network model, and outputting a first evaluation value for evaluating the road segmentation accuracy;
[0021] Constructing the region of interest of the current vehicle motion state in the vehicle coordinate system;
[0022] Projecting the region of interest onto the camera coordinate system of the current camera to obtain the projected region of interest;
[0023] Calculating a second evaluation value for evaluating the usefulness of the segmented image for the current vehicle motion state according to the position and size of the projected region of interest;
[0024] An evaluation value is calculated based on the first evaluation value and the second evaluation value.
[0025] Preferably, the method for determining the features related to road segmentation accuracy includes:
[0026] The known road image is reversely projected onto the road plane to obtain a known top view in the road plane coordinate system;
[0027] Performing road segmentation on the known top view to obtain a known segmented image, wherein the segmentation accuracy of the known segmented image is a known quantity;
[0028] Acquire several original features related to the road shape in the known segmented image to form an original feature vector;
[0029] The original feature vector is subjected to three-fold dimensionality reduction in sequence to obtain features related to road segmentation accuracy.
[0030] Preferably, the step of sequentially performing three-time dimensionality reduction on the original feature vector to obtain features related to road segmentation accuracy further comprises:
[0031] Standardizing each original feature in the original feature vector to obtain a standardized feature vector;
[0032] The correlation coefficient is used to perform a correlation analysis between every two features in the standardized feature vector. If the correlation coefficient between the two features is greater than the set coefficient, one of the two features is removed to obtain the feature vector after the first dimensionality reduction. The correlation coefficient between any two features in the feature vector after the first dimensionality reduction is not greater than the set coefficient.
[0033] Construct the correlation coefficient matrix between each feature in the feature vector after the first dimensionality reduction;
[0034] Determine the principal component according to the eigenvector of the correlation coefficient matrix and the eigenvector after the first dimensionality reduction by using the principal component analysis method;
[0035] According to the influence degree of each feature in the feature vector after the first dimensionality reduction on the principal component, the feature vector after the first dimensionality reduction is subjected to a second dimensionality reduction to obtain a feature vector after the second dimensionality reduction;
[0036] The segmentation accuracy of the known segmented image is used as the accuracy feature, and the correlation coefficient is used to perform a correlation analysis between each feature in the feature vector after the second dimensionality reduction and the accuracy feature. If the correlation coefficient between the two is greater than the set coefficient, the feature is retained to obtain the feature vector after the third dimensionality reduction;
[0037] The features in the feature vector after the third dimension reduction are used as features related to the road segmentation accuracy.
[0038] Preferably, performing a second dimensionality reduction on the feature vector after the first dimensionality reduction according to the influence of each feature in the feature vector after the first dimensionality reduction on the principal component to obtain the feature vector after the second dimensionality reduction further comprises:
[0039] After sorting the influence of each feature on the principal component in the feature vector after the first dimensionality reduction from large to small, a sorting order of each feature is obtained, wherein the first position of the sorting order is 1, and the increment step of the sorting order is 1;
[0040] Set the initial statistical number to 1;
[0041] Count the cumulative influence of all features whose sorting order is less than or equal to the statistical number on the principal component, and determine whether the cumulative influence reaches the set influence;
[0042] If yes, then all features whose sorting order is less than or equal to the statistical number are taken as new features, and the above statistical cumulative impact degree and judgment steps are stopped;
[0043] If not, the statistical number will be increased by 1, and the above statistical cumulative impact degree and judgment steps will be repeated;
[0044] The new features are used to construct a feature vector after the second dimensionality reduction.
[0045] Preferably, the step of constructing the region of interest of the current vehicle motion state in the vehicle coordinate system further includes:
[0046] According to the coordinate points corresponding to the three preview points of the current vehicle motion state in the vehicle coordinate system, the far coordinate point, the middle coordinate point and the near coordinate point are obtained;
[0047] The three coordinate points are fitted using a cubic spline curve to obtain a spline curve;
[0048] The spline curve is moved left and right along the tangent direction of the mid-coordinate point to obtain left and right boundaries of the region of interest;
[0049] Connect the upper and lower vertices of the left and right boundaries with a straight line to obtain the upper and lower boundaries of the region of interest;
[0050] A closed figure enclosed by the left and right boundaries and the upper and lower boundaries is used as a region of interest of the current vehicle motion state in the vehicle coordinate system.
[0051] Preferably, the calculating of the second evaluation value for evaluating the usefulness of the segmented image for the current vehicle motion state according to the position and size of the projected region of interest further comprises:
[0052] The second evaluation value for evaluating the usefulness of the segmented image for the current vehicle motion state is calculated by the following formula:
[0053]
[0054] Where κ2 is the second evaluation value, A1 is the pixel area of the projected region of interest, A0 is the maximum pixel area obtained after the region of interest is projected to the camera coordinate system corresponding to all different sight angles, and W A is the width of the road image captured by the camera, d R is the distance between the center point of the projected area of interest and the midpoint of the road image, α C is the completeness rate of the region of interest after projection.
[0055] Preferably, the selecting a target sight line angle from all candidate sight line angles based on evaluation values of the road images corresponding to the camera at all candidate sight line angles further comprises:
[0056] Determining a retention area of the sight line angle on a two-dimensional coordinate system according to a threshold value of the first evaluation value and a threshold value of the second evaluation value;
[0057] Using the first evaluation value and the second evaluation value corresponding to each candidate sight line angle of the camera as the horizontal coordinate and the vertical coordinate, respectively, to draw the feature point of each candidate sight line angle on the two-dimensional coordinate system;
[0058] Eliminate the candidate sight line angles whose feature points are outside the retention area to obtain remaining candidate sight line angles;
[0059] The one with the largest evaluation value among the remaining candidate sight line angles is used as the target sight line angle.
[0060] Preferably, the reverse projecting of the road image onto a road plane to obtain a top view in a road plane coordinate system further comprises:
[0061] Inversely projecting the road image onto a road plane to obtain an irregular shape;
[0062] Selecting a rectangular area of a set length and a set width from the irregular figure;
[0063] Setting the rectangular area at a set position and a set angle in a road plane coordinate system;
[0064] The irregular graphics within the rectangular area are pixelated into a top view according to a set ratio.
[0065] Preferably, the candidate sight line angles include: a candidate pitch angle, and a candidate azimuth angle corresponding to the target pitch angle; or a candidate azimuth angle, and a candidate pitch angle corresponding to the target azimuth angle.
[0066] On the other hand, an embodiment of the present specification provides a road segmentation device for actively adjusting the sight angle of a camera, wherein the camera is not in the process of adjusting the sight angle in an initial state, and the device comprises:
[0067] A collection module, used for collecting images of the road ahead using a camera;
[0068] A reverse projection module, used for reversely projecting the road image onto a road plane to obtain a top view in a road plane coordinate system;
[0069] A segmentation module, used for performing road segmentation on the top view to obtain a segmented image;
[0070] An evaluation module, used to evaluate the segmented image according to a preset evaluation standard to obtain an evaluation value of the road image;
[0071] A judging module, used to judge whether the camera is in the process of adjusting the sight angle;
[0072] S51: If not, determining whether the evaluation value of the road image is greater than an evaluation threshold;
[0073] S511: If yes, keep the sight angle of the camera and call the acquisition module cyclically until the judgment
[0074] Modules;
[0075] S512: If not, setting the camera to be in the process of adjusting the sight angle, actively adjusting the sight angle of the camera to a new candidate sight angle, and cyclically calling the acquisition module to the judgment module;
[0076] S52: If yes, then
[0077] Actively adjust the sight angle of the camera to a new candidate sight angle, cyclically call the acquisition module to the judgment module until there is no new candidate sight angle, and set the sight angle of the camera to be adjusted;
[0078] When the sight line angle of the camera is adjusted, based on evaluation values of the road images corresponding to all candidate sight line angles of the camera, a target sight line angle is selected from all candidate sight line angles;
[0079] The camera is adjusted to the target sight angle, and the acquisition module is cyclically called to the judgment module.
[0080] On the other hand, an embodiment of the present specification further provides a computer device, including a memory, a processor, and a computer program stored in the memory, wherein when the computer program is executed by the processor, the instructions according to any one of the methods described above are executed.
[0081] On the other hand, an embodiment of the present specification further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor of a computer device, the computer program executes instructions of any one of the above-described methods.
[0082] It can be seen from the technical solutions provided by the above embodiments of this specification that, through the method of the embodiments of this specification, after the road image is reversely projected onto the road plane coordinate system to obtain a top view, the top view is segmented to obtain a segmented image, and then the segmented image is evaluated to obtain an evaluation value of the road image. The evaluation value is used to evaluate the segmentation accuracy of the segmented image and the usefulness of the segmented image for the vehicle's motion state. When the evaluation value is greater than the evaluation threshold, the camera's sight angle can be maintained. Otherwise, the camera's sight angle needs to be adjusted. During the adjustment, the evaluation value of the camera at the candidate sight angle is obtained in a continuous cycle. Based on this, a suitable target sight angle is selected to ensure the segmentation accuracy of the segmented image and its usefulness for the vehicle's motion state, thereby improving the road segmentation performance under adverse factors such as backlighting and U-turns, and ensuring that smart cars achieve safe driving.
[0083] In order to make the above and other purposes, features and advantages of the present specification more obvious and easy to understand, the following specifically cites preferred embodiments and describes them in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0084] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0085] Figure 1 A schematic diagram showing a flow chart of a road segmentation method for actively adjusting a camera sight angle provided in an embodiment of this specification;
[0086] Figure 2 A schematic diagram of a process of reversely projecting a road image onto a road plane to obtain a top view in a road plane coordinate system is shown in an embodiment of this specification;
[0087] Figure 3 A schematic diagram of a coordinate system provided in an embodiment of this specification is shown;
[0088] Figure 4 A schematic diagram of a process of evaluating a segmented image by a preset evaluation standard to obtain an evaluation value of a road image according to an embodiment of the present specification is shown;
[0089] Figure 5A scanning schematic diagram when the camera sight angle is adjusted provided in an embodiment of this specification is shown;
[0090] Figure 6 A schematic diagram showing a flow chart of a method for determining features related to road segmentation accuracy provided in an embodiment of this specification;
[0091] Figure 7 A schematic diagram of a process of performing three-dimensionality reduction on the original feature vector in sequence to obtain features related to road segmentation accuracy provided by an embodiment of this specification is shown;
[0092] Figure 8 A schematic diagram of a process of performing a second dimensionality reduction on a feature vector after the first dimensionality reduction according to the influence of each feature in the feature vector after the first dimensionality reduction on the principal component provided in an embodiment of this specification is shown;
[0093] Fig. 9 A schematic diagram of a process for constructing an area of interest for a current vehicle motion state in a vehicle coordinate system provided by an embodiment of this specification is shown;
[0094] Fig.10 A schematic diagram of a preview point with a vehicle as a reference object provided in an embodiment of this specification is shown;
[0095] Fig.11 A schematic diagram of a process for selecting a target sight line angle from all candidate sight line angles based on evaluation values of road images corresponding to all candidate sight line angles provided by an embodiment of this specification is shown;
[0096] Fig.12 A schematic diagram showing a holding area provided in an embodiment of this specification is shown;
[0097] Fig.13 A schematic diagram of the module structure of a road segmentation device that actively adjusts the camera sight angle provided in an embodiment of this specification is shown;
[0098] Fig.14 A schematic diagram of the structure of a computer device provided in an embodiment of this specification is shown.
[0099] Description of the accompanying symbols:
[0100] 100. Collection module;
[0101] 200. Back projection module;
[0102] 300, segmentation module;
[0103] 400, evaluation module;
[0104] 500, judgment module;
[0105] 1402. Computer equipment;
[0106] 1404, processor;
[0107] 1406. Memory;
[0108] 1408, driving mechanism;
[0109] 1410, input / output module;
[0110] 1412. Input device;
[0111] 1414. Output device;
[0112] 1416. Presentation equipment;
[0113] 1418. Graphical user interface;
[0114] 1420, network interface;
[0115] 1422, communication link;
[0116] 1424. Communication bus. DETAILED DESCRIPTION
[0117] The following will be combined with the drawings in the embodiments of this specification to clearly and completely describe the technical solutions in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the embodiments of this specification.
[0118] Road segmentation is also known as drivable area detection. Its goal is to use the on-board camera to detect the drivable area of the road that the vehicle is traveling or about to travel, so as to classify each pixel of the image as a drivable area or a non-drivable area. This is a key technology in the field of smart cars. The actual urban traffic environment is extremely complex. In order to achieve stable segmentation of roads by smart cars, it is necessary to overcome a variety of unfavorable factors. In the existing technology, the camera maintains a fixed posture, and it is impossible to accurately segment the road when facing scenes such as backlighting and U-turns. When the vehicle is driving towards the sun, there is a high probability that the camera will be overexposed by direct sunlight or mirror reflection of the road surface, thereby affecting the accuracy of road segmentation. When the vehicle turns or turns around, the camera may move the area of interest that needs to be paid attention to outside the camera's field of view due to the limitation of the camera's field of view. In this case, no matter how high the accuracy of the segmentation is, it is meaningless to the driving task of the smart car.
[0119] In order to solve the above problems, an embodiment of the present specification provides a road segmentation method for actively adjusting the camera sight angle. Figure 1This is a flowchart of a road segmentation method for actively adjusting the camera's sight angle provided in an embodiment of this specification. This specification provides method operation steps as described in the embodiment or flowchart, but more or fewer operation steps may be included based on conventional or non-creative labor. The order of steps listed in the embodiment is only one way of executing the order of many steps and does not represent the only execution order. When the actual system or device product is executed, it can be executed in the order of the method shown in the embodiment or the drawings or in parallel.
[0120] It should be noted that the terms "first", "second", etc. in the description and claims of the embodiments of this specification and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of this specification described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, device, product or equipment that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0121] Reference Figure 1 The embodiment of this specification provides a road segmentation method for actively adjusting the camera sight angle, wherein the camera is not in the sight angle adjustment in the initial state, including:
[0122] S1: Use the camera to collect the road image in front;
[0123] S2: reversely projecting the road image onto a road plane to obtain a top view in a road plane coordinate system;
[0124] S3: performing road segmentation on the top view to obtain a segmented image;
[0125] S4: Evaluating the segmented image according to a preset evaluation standard to obtain an evaluation value of the road image;
[0126] S5: Determine whether the camera is in the process of adjusting the sight angle;
[0127] S51: If not, determining whether the evaluation value of the road image is greater than an evaluation threshold;
[0128] S511: If yes, keep the sight angle of the camera and loop through steps S1-S5;
[0129] S512: if not, setting the camera to be in the process of adjusting the sight angle, actively adjusting the sight angle of the camera to a new candidate sight angle, and looping through steps S1-S5;
[0130] S52: If yes, then
[0131] Actively adjust the sight angle of the camera to a new candidate sight angle, and repeat the steps S1-S5 until there is no new candidate sight angle, and set the sight angle of the camera to be adjusted;
[0132] When the sight line angle of the camera is adjusted, based on evaluation values of the road images corresponding to all candidate sight line angles of the camera, a target sight line angle is selected from all candidate sight line angles;
[0133] The camera is adjusted to the target sight angle, and steps S1-S5 are repeated.
[0134] In the embodiments of this specification, the camera is not in the process of adjusting the sight angle in the initial state, which can be understood as the camera maintaining a fixed sight angle.
[0135] Among them, the camera can be mounted on a position with a wide field of view, such as the top or front end of the vehicle. As the vehicle travels, the camera will continuously collect images of the road ahead. The collected road images are in the camera coordinate system, but the line of sight angle of the camera in the embodiment of this specification can be actively adjusted. This will cause the geometric features of the road image formed for the same road object to change greatly due to the different line of sight angles of the camera, affecting the accuracy of subsequent road segmentation. To avoid the above situation, the road image collected by the camera can be inversely projected onto the road plane through the camera's imaging model to obtain a top view of the road in the road plane coordinate system.
[0136] In the embodiments of this specification, refer to Figure 2 The reverse projection of the road image onto the road plane to obtain a top view in the road plane coordinate system further comprises:
[0137] S101: reversely projecting the road image onto a road plane to obtain an irregular shape;
[0138] S102: Selecting a rectangular area of a set length and a set width from the irregular pattern;
[0139] S103: setting the rectangular area in a road plane coordinate system at a set position and a set angle;
[0140] S104: pixelating the irregular graphics in the rectangular area into a top view according to a set ratio.
[0141] Specifically, refer to Figure 3 , the embodiment of this specification includes a world coordinate system (CS W ), vehicle coordinate system (CS V ), gimbal coordinate system (CS T ), where the gimbal is the supporting device for installing and fixing the camera, and the camera coordinate system (CS A ), road plane coordinate system (CS R ). Among them, CS V At the center of the vehicle's rear axle, CS R With CS V Relatively fixed, and only has translation along the negative direction of the Z axis, and the translation distance is the wheel radius r w Assume that CS R To CS V Transform to T RV , C.S. V To CS T The transformation of T VT , C.S. T To CS A The transformation of T TA , then by CS A To CS R The transformation is:
[0142] T RA =T RV T VT T TA (1)
[0143] Among them, T RV =[1,0,0,0;0,1,0,0;0,0,1,r w ; 0,0,0,1],r w is the wheel radius, T VT After calibration to a known and fixed transformation, T TA It is calculated in real time based on the gimbal angle, gimbal kinematic model, and hand-eye calibration results of the camera and gimbal. RA It can be calculated in real time according to the above formula. In addition, it is assumed that the camera's intrinsic parameter matrix C C The process of reversely projecting the road image onto the road plane is as follows:
[0144]
[0145] Where x1 is the image coordinate of a pixel point on the road image, x1 = (r1, c1, 1), r1 is the number of rows of the pixel point on the road image, c1 is the number of columns, and x R is the coordinate of the next projection point in the road plane coordinate system obtained after reverse projection onto the road plane, z Ris the Z axis of the road plane coordinate system, z R =0 represents the road plane, and λ represents any non-zero natural number. For any pixel point on the image, its intersection with the road plane can be calculated by the above formula, and the corresponding grayscale is assigned to each intersection point. Bilinear interpolation is used to calculate the grayscale value at other non-intersection points to obtain the inverse projection of the active camera image on the road plane.
[0146] The reverse projection of the road image on the road plane is a huge irregular figure, while the general image is a regular rectangle. It is necessary to first convert the irregular figure into a top view, and select a suitable rectangular area from the irregular figure to generate a top view. First, it is necessary to determine the length and width of the rectangle, then determine the position and angle of the rectangle in the road plane coordinate system, and finally pixelate the projection in the rectangular area into a top view according to the set ratio. In the embodiment of this specification, the length of the rectangle used is 43.2m, the width is 21.6m, and the angle of the rectangle is T RA The rotation component along the z-axis of the road plane coordinate system, the position of the rectangle starting point is CS A Vertical projection on the road surface. This rectangle is 0.054×0.054m 2 / pixel ratio to obtain a top view with a size of 800×400 pixels.
[0147] After obtaining the bird's-eye view, the bird's-eye view may be segmented into roads to obtain a segmented image, wherein a segmentation algorithm for road segmentation may adopt a YOLOP algorithm.
[0148] Then the segmented image can be evaluated by the pre-set evaluation criteria to obtain the evaluation value of the road image. Figure 4 , specifically:
[0149] S201: extracting features related to road segmentation accuracy in the segmented image;
[0150] S202: Inputting the feature into a pre-trained neural network model, and outputting a first evaluation value for evaluating road segmentation accuracy;
[0151] S203: constructing a region of interest of the current vehicle motion state in the vehicle coordinate system;
[0152] S204: Projecting the region of interest onto the camera coordinate system of the current camera to obtain the projected region of interest;
[0153] S205: calculating a second evaluation value for evaluating the usefulness of the segmented image for the current vehicle motion state according to the position and size of the projected region of interest;
[0154] S206: Calculate an evaluation value according to the first evaluation value and the second evaluation value.
[0155] The features related to the road segmentation accuracy are input into the pre-trained neural network model to output the first evaluation value for evaluating the road segmentation accuracy. When driving, the driver always tends to pre-aim a distance in the driving direction according to the current driving conditions of the vehicle to make an advance judgment on the driving environment ahead, so as to ensure the safety of driving to the greatest extent. Similarly, the motion state of the vehicle determines the area that needs to be focused on in road segmentation, and the system should give priority to ensuring the segmentation effect of this area. This requires not only to make the first evaluation value as large as possible, but also to meet the detection requirements for key areas. Based on this, the embodiment of this specification proposes to construct a region of interest ROI (i.e., the area that needs to be focused on) of the current vehicle motion state in the vehicle coordinate system. Since the region of interest is in the vehicle coordinate system, the region of interest can be further projected onto the camera coordinate system of the current camera to obtain the projected region of interest, and then the current angle of the camera is evaluated according to its position and size on the image to obtain a second evaluation value to ensure that the region of interest is effectively detected.
[0156] In the embodiment of this specification, it is necessary to further determine whether the camera is in the process of adjusting the sight angle, because in the initial state, the camera is not in the process of adjusting the sight angle, so it will go to the branch of S51 No, that is, determine whether the evaluation value of the road image is greater than the evaluation threshold, wherein the evaluation threshold can be set according to actual conditions. If the evaluation value is greater than the evaluation threshold, it means that the sight angle of the current camera is relatively appropriate and does not need to be adjusted. The sight angle is maintained and steps S1-S5 are looped to perform the next cycle of judgment. If the evaluation value is not greater than the evaluation threshold, it means that the sight angle of the current camera is not appropriate and needs to be adjusted. At this time, it is necessary to first set the camera in the process of adjusting the sight angle, and then actively adjust the camera's sight angle to a new candidate sight angle, and loop steps S1-S5 to perform the next cycle of judgment. During the judgment process of the next cycle, since the camera is in the process of adjusting the sight angle, it will go to the branch of S52 Yes, and actively adjust the camera's sight angle to a new candidate sight angle, and loop steps S1-S5 until there is no new candidate sight angle, and the sight angle adjustment of the camera is set to be completed. After the sight angle adjustment is completed, the camera is not in the process of adjusting the sight angle.
[0157] It should be noted that the candidate sight line angles include: candidate pitch angles, and candidate azimuth angles corresponding to the target pitch angle; or, candidate azimuth angles, and candidate pitch angles corresponding to the target azimuth angle. The target sight line angle is composed of the target pitch angle and the target azimuth angle. In the embodiment of this specification, the rotation range of the pitch angle (along the y-axis) is [-π / 4,0]rad, and the rotation range of the azimuth angle (along the z-axis) is [-π / 2,π / 2]rad. The frame rate of the active camera during scanning is 30FPS. The pitch rotation speed is 15RPM, and the azimuth rotation speed is 30RPM.
[0158] Reference Figure 5 When adjusting the sight angle, you can first scan the pitch angle, and after determining a candidate pitch angle as the target pitch angle, scan the azimuth angle corresponding to the target pitch angle to obtain the target azimuth angle. You can also rotate the azimuth angle, and after determining a candidate azimuth angle as the target azimuth angle, rotate the pitch angle corresponding to the target azimuth angle to obtain the target pitch angle.
[0159] Take rotating on the pitch angle first, determining a candidate pitch angle as the target pitch angle, and then rotating on the azimuth angle corresponding to the target pitch angle to obtain the target azimuth angle as an example: assuming that there are a total of 5 new candidate pitch angles, namely α1 to α5, when actively adjusting the line of sight angle of the camera in the nth cycle, first adjust the line of sight angle to α1, loop S1-S5 steps, and obtain the evaluation value of the road image corresponding to α1, and in the n+1th cycle, adjust the line of sight angle to α2, loop S1-S5 steps, and obtain the evaluation value of the road image corresponding to α2... After the n+4th cycle, the evaluation values of the road images corresponding to α1 to α5 are obtained, and the target pitch angle is selected from α1 to α5 based on the evaluation values corresponding to all candidate pitch angles (α1 to α5).
[0160] The target pitch angle is maintained, and there are a total of 5 new candidate azimuth angles at the target pitch angle, namely β1 to β5. Then, when the sight angle of the camera is actively adjusted in the n+5th cycle, the sight angle is adjusted to β1, and steps S1-S5 are repeated to obtain the evaluation value of the road image corresponding to β1. In the n+6th cycle, the sight angle is adjusted to β2, and steps S1-S5 are repeated to obtain the evaluation value of the road image corresponding to β2. ... After the n+9th cycle, the evaluation values of the road images corresponding to β1 to β5 are obtained. Based on the evaluation values corresponding to all candidate azimuth angles (β1 to β5) at the target pitch angle, the target azimuth angle is selected from β1 to β5. The target pitch angle and target azimuth angle obtained at this time constitute the target sight angle.
[0161] It should be noted that, since the camera's line of sight angle adjustment will not be set as completed until there are no new candidate line of sight angles in step S52, if only the target pitch angle or the target azimuth angle is determined, there are still new candidate line of sight angles: the candidate azimuth angle corresponding to the target pitch angle, or the candidate pitch angle corresponding to the target azimuth angle. At this time, the camera's line of sight angle adjustment will not be set as completed.
[0162] After the camera is adjusted to the target sight line angle, steps S1-S5 are looped. At this time, the camera is not in the sight line angle adjustment process, and a new round of image acquisition is performed.
[0163] In the embodiments of this specification, refer to Figure 6 , the method for determining the features related to road segmentation accuracy includes:
[0164] S301: reversely projecting the known road image onto the road plane to obtain a known top view in the road plane coordinate system;
[0165] S302: performing road segmentation on the known top view to obtain a known segmented image, wherein the segmentation accuracy of the known segmented image is a known quantity;
[0166] S303: Acquire several original features related to the road shape in the known segmented image to form an original feature vector;
[0167] S304: Performing dimensionality reduction three times on the original feature vector in sequence to obtain features related to road segmentation accuracy.
[0168] By analyzing several known samples, the features related to the road segmentation accuracy are determined. The known samples are known road images. The known road images also need to be inversely projected onto the road plane to obtain a known top view in the road plane coordinate system. Then, the road is segmented on the known top view to obtain a known segmented image. The segmentation accuracy of the known segmented image can be calculated using the following formula:
[0169]
[0170] Among them, A CC Represents the segmentation accuracy of the known segmented image, T P represents the true positive, which indicates the number of pixels inside the lane that are correctly segmented, T N represents the true negative, indicating the number of correctly segmented non-lane pixels, and the false negative F N is the number of pixels inside the lane that are incorrectly segmented, and the false positive F P It is the number of non-lane interior pixels that are mistakenly classified as lane pixels.
[0171] The features in the known segmented image can be divided into shape-based features, grayscale-based features, and texture-based features. In the embodiments of this specification, only shape-based features are collected. Shape-based features mainly reflect the contour features and regional features of the known segmented image. Contour features are curves composed of a series of connected points, representing the basic shape of the road. The Halcon feature pool is selected. The feature pool refers to a collection of various artificially designed features. 64 shape-related features are collected to form the feature pool, including features such as regional area, rectangularity, and regional center moment.
[0172] Not all features in the feature pool are related to the quality of road segmentation. Even if they are related, the degree of correlation of each feature may be different. The embodiment of this specification selects features in the feature pool to obtain relatively independent features that can correctly reflect the quality of segmentation results.
[0173] First, each feature in the feature pool is numbered to form an original feature vector: in is the original feature of the i-th dimension, and d0 is the dimension of the original feature, thereby realizing the transformation from feature pool to feature vector. For several known samples, the original feature The sample vector of
[0174] Further, see Figure 7 , the original feature vector is reduced in dimension three times in sequence to obtain the features related to the road segmentation accuracy, including:
[0175] S401: performing standardization processing on each original feature in the original feature vector to obtain a standardized feature vector;
[0176] S402: performing correlation analysis between every two features in the standardized feature vector using the correlation coefficient, and if the correlation coefficient between every two features is greater than a set coefficient, removing one of the two features to obtain a feature vector after the first dimensionality reduction, wherein the correlation coefficient between any two features in the feature vector after the first dimensionality reduction is not greater than the set coefficient;
[0177] S403: constructing a correlation coefficient matrix between each feature in the feature vector after the first dimensionality reduction;
[0178] S404: using a principal component analysis method, determining a principal component according to the eigenvector of the correlation coefficient matrix and the eigenvector after the first dimensionality reduction;
[0179] S405: performing a second dimensionality reduction on the feature vector after the first dimensionality reduction according to the influence of each feature in the feature vector after the first dimensionality reduction on the principal component, to obtain a feature vector after the second dimensionality reduction;
[0180] S406: taking the segmentation accuracy of the known segmented image as the accuracy feature, and performing correlation analysis between each feature in the feature vector after the second dimensionality reduction and the accuracy feature using the correlation coefficient, and if the correlation coefficient between the two is greater than the set coefficient, retaining the feature to obtain the feature vector after the third dimensionality reduction;
[0181] S407: Using the features in the feature vector after the third dimension reduction as features related to road segmentation accuracy.
[0182] The data units and numerical ranges of the original features are different, so it is difficult to compare the features. Standardization can remove the unit restrictions and convert the data into dimensionless pure values, which facilitates the comparison and weighting of features of different units and magnitudes. The standardization formula of the sample vector of the original feature is as follows:
[0183]
[0184] In the formula, Represents the original feature The standardized sample vector is Represents the sample vector The mean of Represents the sample vector The standardized eigenvector is recorded as
[0185] Use the correlation coefficient to analyze the correlation between every two features, and remove one of the two features with a stronger correlation. The correlation coefficient between any two features is:
[0186]
[0187] in, Represents the standardized sample vector The covariance between Represents the standardized sample vector The standard deviation of Represents the standardized sample vector The standard deviation of .
[0188] From i=1 to i=d0, we go through them one by one. For example, the features that are located after it and whose correlation coefficient is greater than the set coefficient are eliminated until the last feature. The feature vector is composed of Dimensionality reduction to The feature vectors with low correlation among the features after the first dimensionality reduction are obtained.
[0189] Using principal component analysis, according to Smaller independent or unrelated features in the original feature vector Most of the variables in the , establish a low-dimensional comprehensive index to describe the feature vector, the principal component in the principal component analysis method is composed of The new features are formed by linear combination or mixing of the features in the embodiment of this specification. In the embodiment of this specification, the principal components are determined by using the eigenvectors of the correlation coefficient matrix between the features and the eigenvectors after the first dimensionality reduction. The corresponding formula is:
[0190]
[0191] where Y M represents the characteristic principal component vector, y i represents the i-th principal component vector, d y represents the number of principal components, It represents the influence matrix of each feature in the eigenvector on the principal component after the first dimensionality reduction, and It is obtained based on the correlation coefficient matrix between each feature in the feature vector after the first dimensionality reduction.
[0192] Specifically, The construction process of is as follows. The correlation coefficient matrix between the features in the feature vector after the first dimensionality reduction is:
[0193]
[0194] in, Representation characteristics The correlation coefficient between are the feature vectors after the first dimensionality reduction. Any two features in. Then calculate the correlation coefficient matrix R M The eigenvalue of and the corresponding eigenvector in,
[0195] The feature vector The vertical arrangement forms a matrix, which is the influence matrix of the features on the principal components.
[0196] In the embodiments of this specification, refer to Figure 8 , performing a second dimensionality reduction on the feature vector after the first dimensionality reduction according to the influence of each feature in the feature vector after the first dimensionality reduction on the principal component, to obtain the feature vector after the second dimensionality reduction further comprises:
[0197] S501: After sorting the influence of each feature on the principal component in the feature vector after the first dimensionality reduction from large to small, a sorting order of each feature is obtained, where the first rank of the sorting order is 1, and the increment step of the sorting order is 1;
[0198] S502: Set the initial statistical number to 1;
[0199] S503: Counting the cumulative influence of all features whose sorting order is less than or equal to the statistical number on the principal component, and determining whether the cumulative influence reaches the set influence;
[0200] S504: If yes, all features whose sorting order is less than or equal to the statistical number are taken as new features, and the above statistical cumulative impact degree and judgment steps are stopped;
[0201] S505: If not, the statistical number is incremented by 1, and the above statistical cumulative impact degree and judgment steps are repeated;
[0202] S506: Using the new features, construct a feature vector after the second dimensionality reduction.
[0203] Furthermore, the influence of each feature in the eigenvector after the first dimensionality reduction on the principal component can be described by the information contribution rate of the eigenvalue. The calculation formula of the information contribution rate is:
[0204]
[0205] Among them, q p is the information contribution rate of the pth feature in the feature vector after the first dimensionality reduction to the principal component, λ p is the correlation coefficient matrix R M The pth eigenvalue of .
[0206] After calculating the influence of each feature on the principal component, the features are sorted from large to small according to the influence, and the sorting order of each feature is obtained, where the first place is 1, and the sorting order increases by 1, that is, the sorting order is 1, 2, 3...
[0207] The initial statistical number is set to 1. Since each feature has a corresponding sorting order, the cumulative influence of all features whose sorting order is less than or equal to the statistical number on the principal component is calculated. In the embodiment of this specification, the cumulative influence can be expressed by the cumulative contribution rate, and the calculation formula is:
[0208]
[0209] When determining whether the cumulative influence degree reaches the set influence degree, that is, determining whether the cumulative contribution rate reaches the set contribution rate. The set contribution rate can be a value close to 1, which is set to 0.95 in the embodiments of this specification. If so, all features with a sorting order less than or equal to the statistical number are used as new features, and the loop of steps S503 - S505 is stopped. If not, the statistical number is incremented by 1, and the loop of steps S503 - S505 is repeated.
[0210] Construct a feature vector after the second dimensionality reduction using the new features
[0211] After obtaining the feature vector after the second dimensionality reduction, the segmentation accuracy of the known segmented image is used as the accuracy feature X k (k = d0 + 1), select d3 (d3 < d2) features most relevant to the segmentation accuracy from to form a feature vector after the third dimensionality reduction Among them, the correlation coefficient can be used to perform a correlation analysis between each feature in the feature vector after the second dimensionality reduction and the accuracy feature. Specifically, the correlation coefficient can be calculated with reference to formula (5).
[0212] Finally, the features in the feature vector after the third dimensionality reduction are used as the features related to the road segmentation accuracy.
[0213] In the embodiments of this specification, with reference to Fig. 9 , the construction of the region of interest of the current vehicle motion state in the vehicle coordinate system further includes:
[0214] S601: Obtain the far coordinate point, the middle coordinate point, and the near coordinate point according to the coordinate points corresponding to the far, middle, and near three preview points of the current vehicle motion state in the vehicle coordinate system;
[0215] S602: Use a cubic spline curve to fit the three coordinate points to obtain a spline curve;
[0216] S603: Move the spline curve left and right along the tangent direction of the middle coordinate point to obtain the left and right boundaries of the region of interest;
[0217] S604: Connect the upper and lower vertices of the left and right boundaries with a straight line to obtain the upper and lower boundaries of the region of interest;
[0218] S605: Use the closed figure enclosed by the left and right boundaries and the upper and lower boundaries as the region of interest of the current vehicle motion state in the vehicle coordinate system.
[0219] In the existing vehicle preview technology, generally only a certain preview point is determined. However, in the actual driving process, the driver should pay attention to not only the information of the preview point, but also an area centered on the preview point. Therefore, in the embodiment of this specification, based on the intermediate preview point, the far preview point and the near preview point are determined, and after further forming a spline curve, the spline curve is moved left and right to obtain the area of interest.
[0220] Assuming that the time coefficient of the middle preview point is c0, the time coefficients of the two preview points are:
[0221]
[0222] Among them, c1 is the preview time coefficient of the near preview point, c2 is the preview time coefficient of the far preview point, c0 is the preview time coefficient of the middle preview point, Δ c is the preview time coefficient interval, c0 and Δ c It can be set according to actual situation.
[0223] Reference Fig.10 , where P1 (P1') is the far preview point, P0 (P0') is the middle preview point, and P2 (P2') is the near preview point. The far, middle and near preview points all take the vehicle as a reference object. By substituting the time coefficients of the far, middle and near preview points into the existing vehicle preview technology, the far coordinate point, middle coordinate point and near coordinate point corresponding to the three preview points in the vehicle coordinate system can be obtained. The existing vehicle preview technology can refer to the contents recorded in the journal paper: "Path Following Control of Autonomous Four-Wheel-Independent-Drive Electric Vehicles via Second-Order Sliding Mode and Nonlinear Disturbance Observer Techniques".
[0224] After fitting the three coordinate points to obtain the spline curve, move the spline curve to the left by d / 2 along the tangent direction of the mid-coordinate point to obtain the left boundary of the region of interest, and move it to the right by d / 2 to obtain the right boundary of the region of interest. Connect the upper vertices of the left and right boundaries with a straight line to obtain the upper boundary of the region of interest, and connect the lower vertices of the left and right boundaries with a straight line to obtain the lower boundary of the region of interest, where d is the width of the vehicle, and the closed figure surrounded by the left and right boundaries and the upper and lower boundaries is the region of interest of the current vehicle motion state in the vehicle coordinate system.
[0225] The region of interest obtained above is in the vehicle coordinate system. The region of interest can be projected onto the camera coordinate system of the current camera to obtain the projected region of interest. Specifically, since the vehicle coordinate system and the road coordinate system only have a translation in the Z direction, the expression in the road coordinate system is consistent with that in the vehicle coordinate system. The region of interest ROI in the vehicle coordinate system can be V Project along its Z axis to the road surface coordinate system to obtain the region of interest ROI in the road surface coordinate system R , and then according to the camera's projection model, the ROI R Project to the camera coordinate system to get the region of interest ROI in the camera coordinate system I , the process is as follows:
[0226]
[0227] in, ROI R Points in the road coordinate system CS R The coordinates below, is the coordinate obtained by projecting the point into the camera coordinate system, in is the number of rows of the point on the road image captured by the camera, is the number of columns.
[0228] Furthermore, it is necessary to calculate a second evaluation value for evaluating the usefulness of the segmented image for the current vehicle motion state according to the position and size of the projected region of interest. I The more pixels there are, the closer the ROI is to the road surface. R The finer the region imaged, the greater the chance of obtaining accurate segmentation. I The closer the center point is to the midpoint of the road image, the more stable the current sight angle is. I When moving, it is less likely to leave the camera's field of view. I Too close to the edge of the road image may cause ROI I Partially missing or even completely missing. In this case, the segmented image obtained by road segmentation cannot be used to guide the operation of the vehicle, so it will lose its reference value.
[0229] According to the above analysis, the second evaluation value for evaluating the usefulness of the segmented image for the current vehicle motion state is calculated by the following formula:
[0230]
[0231] Where κ2 is the second evaluation value, A1 is the pixel area of the projected region of interest, A0 is the maximum pixel area obtained after the region of interest is projected to the camera coordinate system corresponding to all different sight angles, and W A is the width of the road image captured by the camera, d R is the distance between the center point of the projected area of interest and the midpoint of the road image, α C is the completeness rate of the projected region of interest, that is, the projected region of interest ROI I The ratio of the area of the imaged portion of a road image to its total area.
[0232] Finally, the evaluation value is calculated according to the first evaluation value and the second evaluation value, which is specifically calculated by the following formula:
[0233]
[0234] Among them, κ A is the evaluation value, κ 1,0 is the minimum threshold of κ1, κ 2,0 is the minimum threshold of κ2, where κ 1,0 and κ 2,0 It can be set according to actual situation.
[0235] In the process of actively adjusting the camera's line of sight angle, the target pitch angle can be determined first, and then the target azimuth angle under the target pitch angle can be determined to obtain the target line of sight angle. The target azimuth angle can also be determined first, and then the target pitch angle under the target azimuth angle can be determined to obtain the target line of sight angle. Both the above target pitch angle and target azimuth angle need to be determined based on the evaluation values.
[0236] Specifically, refer to Fig.11 The step of selecting a target sight line angle from all candidate sight line angles based on evaluation values of the road images corresponding to all candidate sight line angles of the camera further includes:
[0237] S701: determining a retention area of a sight line angle in a two-dimensional coordinate system according to a threshold of the first evaluation value and a threshold of the second evaluation value;
[0238] S702: Using the first evaluation value and the second evaluation value corresponding to each candidate sight line angle of the camera as the horizontal coordinate and the vertical coordinate, respectively, to draw a feature point of each candidate sight line angle on a two-dimensional coordinate system;
[0239] S703: Eliminate the candidate sight line angles whose feature points are outside the retention area to obtain remaining candidate sight line angles;
[0240] S704: The angle with the largest evaluation value among the remaining candidate sight line angles is used as the target sight line angle.
[0241] The threshold includes the lowest threshold and the highest threshold, where κ 1,0 is the minimum threshold of κ1, κ 2,0 is the minimum threshold of κ2, refer to Fig.12 , where κ 1,0 and k 2,0 The maximum thresholds of k1 and κ2 can be set according to actual conditions, and both are 1.0. The area where the sight line angle is maintained in the two-dimensional coordinate system is the area enclosed by the lowest thresholds of κ1 and k2 and the highest thresholds of κ1 and κ2.
[0242] Each candidate sight angle corresponds to a feature point in the two-dimensional coordinate system. The feature points of some candidate sight angles may be in the preservation area, while the feature points of some candidate sight angles may be outside the preservation area. Fig.12 The trajectory in is the trajectory formed by the feature points. The candidate sight angles outside the retention area are eliminated, and the remaining candidate sight angles are κ A The largest one is the target sight angle.
[0243] It should be noted that the above-mentioned steps S701-S704 are used to further determine the target azimuth angle from the candidate azimuth angles corresponding to the target pitch angle after the target pitch angle has been determined, or to further determine the target pitch angle from the candidate pitch angles corresponding to the target azimuth angle after the target azimuth angle has been determined. Taking the former as an example, the candidate line of sight angles involved in steps S701-S704 are the candidate azimuth angles corresponding to the target pitch angle. Taking the latter as an example, the candidate line of sight angles involved in steps S701-S704 are the candidate pitch angles corresponding to the target azimuth angle.
[0244] Of course, when the former determines the target pitch angle, it is also necessary to determine the target pitch angle from the candidate pitch angles, or when the latter determines the target azimuth angle, it is also necessary to determine the target azimuth angle from the candidate azimuth angles. This process can also be performed with reference to steps S701-S704, except that the candidate line of sight angles involved in steps S701-S704 are candidate pitch angles or candidate azimuth angles. Since the execution logic is similar, this specification embodiment will not be further elaborated on this.
[0245] Through the method of the embodiment of this specification, after the road image is reversely projected onto the road plane coordinate system to obtain a top view, the top view is segmented to obtain a segmented image, and then the segmented image is evaluated to obtain an evaluation value of the road image. The evaluation value is used to evaluate the segmentation accuracy of the segmented image and the usefulness of the segmented image for the vehicle's motion state. When the evaluation value is greater than the evaluation threshold, the camera's sight angle can be maintained, otherwise, the camera's sight angle needs to be adjusted. During the adjustment, the evaluation value of the camera at the candidate sight angle is obtained in a continuous cycle, and a suitable target sight angle is selected based on this to ensure the segmentation accuracy of the segmented image and its usefulness for the vehicle's motion state, thereby improving the road segmentation performance under adverse factors such as backlighting and U-turns, and ensuring that smart cars achieve safe driving.
[0246] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with the relevant laws, regulations and standards of the relevant countries and regions, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0247] This application provides users with corresponding big data analysis (such as personal biometrics, identity data, consumption data, asset data, electronic terminal operation data, etc.) operation entrances for users to choose to agree or reject automated decision-making results; if the user chooses to reject, the expert decision-making process will be entered.
[0248] Based on the above-mentioned method for actively adjusting the camera's sight angle for road segmentation, the embodiment of this specification also provides a corresponding device for actively adjusting the camera's sight angle for road segmentation. The device may include a system (including a distributed system), software (application), module, component, server, client, etc. using the method described in the embodiment of this specification and a device combined with necessary implementation hardware. Based on the same innovative concept, the device in one or more embodiments provided in the embodiment of this specification is as described in the following embodiments. Since the implementation scheme and method for solving the problem of the device are similar, the implementation of the specific device in the embodiment of this specification can refer to the implementation of the aforementioned method, and the repetitions will not be repeated. As used below, the term "unit" or "module" can be a combination of software and / or hardware that implements predetermined functions. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.
[0249] Specifically, Fig.13This is a schematic diagram of the module structure of an embodiment of a road segmentation device for actively adjusting the camera sight angle provided in the embodiment of this specification, referring to Fig.13 As shown, an embodiment of the present specification provides a road segmentation device for actively adjusting the camera's sight angle. In an initial state, the camera is not in the process of adjusting the sight angle. The device includes: an acquisition module 100, a reverse projection module 200, a segmentation module 300, an evaluation module 400, and a judgment module 500.
[0250] The acquisition module 100 is used to acquire the road image ahead by using a camera;
[0251] The reverse projection module 200 is used to reversely project the road image onto a road plane to obtain a top view in a road plane coordinate system;
[0252] A segmentation module 300 is used to perform road segmentation on the top view to obtain a segmented image;
[0253] An evaluation module 400, used to evaluate the segmented image according to a preset evaluation standard to obtain an evaluation value of the road image;
[0254] A determination module 500 is used to determine whether the camera is in the process of adjusting the sight angle;
[0255] S51: If not, determining whether the evaluation value of the road image is greater than an evaluation threshold;
[0256] S511: If yes, keep the sight angle of the camera and call the acquisition module cyclically until the judgment
[0257] Modules;
[0258] S512: If not, setting the camera to be in the process of adjusting the sight angle, actively adjusting the sight angle of the camera to a new candidate sight angle, and cyclically calling the acquisition module to the judgment module;
[0259] S52: If yes, then
[0260] Actively adjust the sight angle of the camera to a new candidate sight angle, cyclically call the acquisition module to the judgment module until there is no new candidate sight angle, and set the sight angle of the camera to be adjusted;
[0261] When the sight line angle of the camera is adjusted, based on evaluation values of the road images corresponding to all candidate sight line angles of the camera, a target sight line angle is selected from all candidate sight line angles;
[0262] The camera is adjusted to the target sight angle, and the acquisition module is cyclically called to the judgment module.
[0263] Reference Fig.14 As shown, based on the above-mentioned road segmentation method for actively adjusting the camera sight angle, a computer device 1402 is also provided in one embodiment of this specification, wherein the above-mentioned method is run on the computer device 1402. The computer device 1402 may include one or more processors 1404, such as one or more central processing units (CPUs) or graphics processing units (GPUs), and each processing unit may implement one or more hardware threads. The computer device 1402 may also include any memory 1406, which is used to store any kind of information such as code, settings, data, etc. In a specific implementation, the computer program on the memory 1406 and can be run on the processor 1404, when the computer program is run by the processor 1404, can execute instructions according to the above method. Non-limitingly, for example, the memory 1406 may include any one or more combinations of the following: any type of RAM, any type of ROM, flash memory device, hard disk, optical disk, etc. More generally, any memory can use any technology to store information. Further, any memory can provide volatile or non-volatile retention of information. Further, any memory can represent a fixed or removable component of the computer device 1402. In one embodiment, when the processor 1404 executes the associated instructions stored in any memory or combination of memories, the computer device 1402 can perform any operation of the associated instructions. The computer device 1402 also includes one or more drive mechanisms 1408 for interacting with any memory, such as a hard disk drive mechanism, an optical disk drive mechanism, etc.
[0264] The computer device 1402 may also include an input / output module 1410 (I / O) for receiving various inputs (via input device 1412) and for providing various outputs (via output device 1414). A specific output mechanism may include a presentation device 1416 and an associated graphical user interface 1418 (GUI). In other embodiments, the input / output module 1410 (I / O), input device 1412, and output device 1414 may not be included, and the computer device 1402 may be used as a computer device in a network. The computer device 1402 may also include one or more network interfaces 1420 for exchanging data with other devices via one or more communication links 1422. One or more communication buses 1424 couple the components described above together.
[0265] The communication link 1422 may be implemented in any manner, for example, through a local area network, a wide area network (e.g., the Internet), a point-to-point connection, etc., or any combination thereof. The communication link 1422 may include any combination of hardwired links, wireless links, routers, gateway functions, name servers, etc. governed by any protocol or combination of protocols.
[0266] Corresponding to the method, an embodiment of the present specification further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above method are executed.
[0267] The embodiments of the present specification also provide a computer-readable instruction, wherein when a processor executes the instruction, the program therein causes the processor to execute the above method.
[0268] The embodiments of the present specification also provide a computer program product, which executes the above method when executed by a processor of a computer device.
[0269] The computer program product described in this specification is a software product that mainly implements the method described in this specification through a computer program.
[0270] It should be understood that in the various embodiments of this specification, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this specification.
[0271] It should also be understood that in the embodiments of this specification, the term "and / or" is only a description of the association relationship of the associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in the embodiments of this specification generally indicates that the associated objects before and after are in an "or" relationship.
[0272] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the embodiments of this specification can be implemented with electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the embodiments of this specification.
[0273] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0274] In the several embodiments provided in this specification, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, or it can be an electrical, mechanical or other form of connection.
[0275] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of this specification.
[0276] In addition, each functional unit in each embodiment of this specification may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0277] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of this specification is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of this specification. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.
[0278] Specific embodiments are used in this specification to illustrate the principles and implementation methods of the embodiments of this specification. The description of the above embodiments is only used to help understand the methods and core ideas of the embodiments of this specification. At the same time, for those skilled in the art, according to the ideas of the embodiments of this specification, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the embodiments of this specification.
Claims
1. A road segmentation method that actively adjusts the camera's sight angle, characterized in that: The camera is not in the viewing angle adjustment state in the initial state, including: S1: Use the camera to collect the road image in front; S2: reversely projecting the road image onto a road plane to obtain a top view in a road plane coordinate system; S3: performing road segmentation on the top view to obtain a segmented image; S4: Evaluating the segmented image according to a preset evaluation standard to obtain an evaluation value of the road image; S5: Determine whether the camera is in the process of adjusting the sight angle; S51: If not, determining whether the evaluation value of the road image is greater than an evaluation threshold; S511: If yes, keep the sight angle of the camera and loop through steps S1-S5; S512: if not, setting the camera to be in the process of adjusting the sight angle, actively adjusting the sight angle of the camera to a new candidate sight angle, and looping through steps S1-S5; S52: If yes, then Actively adjust the sight angle of the camera to a new candidate sight angle, and repeat the steps S1-S5 until there is no new candidate sight angle, and set the sight angle of the camera to be adjusted; When the sight line angle of the camera is adjusted, based on evaluation values of the road images corresponding to all candidate sight line angles of the camera, a target sight line angle is selected from all candidate sight line angles; The camera is adjusted to the target sight angle, and steps S1-S5 are repeated.
2. The method according to claim 1, characterized in that The step of evaluating the segmented image by using a preset evaluation standard to obtain an evaluation value of the road image further includes: Extracting features related to road segmentation accuracy in the segmented image; Inputting the feature into a pre-trained neural network model, and outputting a first evaluation value for evaluating the road segmentation accuracy; Constructing the region of interest of the current vehicle motion state in the vehicle coordinate system; Projecting the region of interest onto the camera coordinate system of the current camera to obtain the projected region of interest; Calculating a second evaluation value for evaluating the usefulness of the segmented image for the current vehicle motion state according to the position and size of the projected region of interest; An evaluation value is calculated based on the first evaluation value and the second evaluation value.
3. The method according to claim 2, characterized in that The method for determining the features related to road segmentation accuracy includes: The known road image is reversely projected onto the road plane to obtain a known top view in the road plane coordinate system; Performing road segmentation on the known top view to obtain a known segmented image, wherein the segmentation accuracy of the known segmented image is a known quantity; Acquire several original features related to the road shape in the known segmented image to form an original feature vector; The original feature vector is subjected to three-fold dimensionality reduction in sequence to obtain features related to road segmentation accuracy.
4. The method according to claim 3, characterized in that The dimensionality reduction of the original feature vector is performed three times in sequence to obtain features related to road segmentation accuracy, which further includes: Standardizing each original feature in the original feature vector to obtain a standardized feature vector; The correlation coefficient is used to perform a correlation analysis between every two features in the standardized feature vector. If the correlation coefficient between the two features is greater than the set coefficient, one of the two features is removed to obtain the feature vector after the first dimensionality reduction. The correlation coefficient between any two features in the feature vector after the first dimensionality reduction is not greater than the set coefficient. Construct the correlation coefficient matrix between each feature in the feature vector after the first dimensionality reduction; Determine the principal component according to the eigenvector of the correlation coefficient matrix and the eigenvector after the first dimensionality reduction by using the principal component analysis method; According to the influence degree of each feature in the feature vector after the first dimensionality reduction on the principal component, the feature vector after the first dimensionality reduction is subjected to a second dimensionality reduction to obtain a feature vector after the second dimensionality reduction; The segmentation accuracy of the known segmented image is used as the accuracy feature, and the correlation coefficient is used to perform a correlation analysis between each feature in the feature vector after the second dimensionality reduction and the accuracy feature. If the correlation coefficient between the two is greater than the set coefficient, the feature is retained to obtain the feature vector after the third dimensionality reduction; The features in the feature vector after the third dimension reduction are used as features related to the road segmentation accuracy.
5. The method according to claim 4, characterized in that The performing a second dimensionality reduction on the feature vector after the first dimensionality reduction according to the influence degree of each feature in the feature vector after the first dimensionality reduction on the principal component to obtain the feature vector after the second dimensionality reduction further comprises: After sorting the influence of each feature on the principal component in the feature vector after the first dimensionality reduction from large to small, a sorting order of each feature is obtained, wherein the first position of the sorting order is 1, and the increment step of the sorting order is 1; Set the initial statistical number to 1; Count the cumulative influence of all features whose sorting order is less than or equal to the statistical number on the principal component, and determine whether the cumulative influence reaches the set influence; If yes, then all features whose sorting order is less than or equal to the statistical number are taken as new features, and the above statistical cumulative impact degree and judgment steps are stopped; If not, the statistical number will be increased by 1, and the above statistical cumulative impact degree and judgment steps will be repeated; The new features are used to construct a feature vector after the second dimensionality reduction.
6. The method according to claim 2, characterized in that The constructing of the region of interest of the current vehicle motion state in the vehicle coordinate system further includes: According to the coordinate points corresponding to the three preview points of the current vehicle motion state in the vehicle coordinate system, the far coordinate point, the middle coordinate point and the near coordinate point are obtained; The three coordinate points are fitted using a cubic spline curve to obtain a spline curve; The spline curve is moved left and right along the tangent direction of the mid-coordinate point to obtain left and right boundaries of the region of interest; Connect the upper and lower vertices of the left and right boundaries with a straight line to obtain the upper and lower boundaries of the region of interest; A closed figure enclosed by the left and right boundaries and the upper and lower boundaries is used as a region of interest of the current vehicle motion state in the vehicle coordinate system.
7. The method according to claim 2, characterized in that: The calculating, according to the position and size of the projected region of interest, a second evaluation value for evaluating the usefulness of the segmented image for the current vehicle motion state further comprises: The second evaluation value for evaluating the usefulness of the segmented image for the current vehicle motion state is calculated by the following formula: Where κ2 is the second evaluation value, A1 is the pixel area of the projected region of interest, A0 is the maximum pixel area obtained after the region of interest is projected to the camera coordinate system corresponding to all different sight angles, and W A is the width of the road image captured by the camera, d R is the distance between the center point of the projected area of interest and the midpoint of the road image, α C is the completeness rate of the region of interest after projection.
8. The method according to claim 2, characterized in that: The selecting a target sight angle from all candidate sight angles based on evaluation values of the road images respectively corresponding to the camera at all candidate sight angles further comprises: Determining a retention area of the sight line angle on a two-dimensional coordinate system according to a threshold value of the first evaluation value and a threshold value of the second evaluation value; Using the first evaluation value and the second evaluation value corresponding to each candidate sight line angle of the camera as the horizontal coordinate and the vertical coordinate, respectively, to draw the feature point of each candidate sight line angle on the two-dimensional coordinate system; Eliminate the candidate sight line angles whose feature points are outside the retention area to obtain remaining candidate sight line angles; The one with the largest evaluation value among the remaining candidate sight line angles is used as the target sight line angle.
9. The method according to claim 1, characterized in that: The reverse projecting of the road image onto the road plane to obtain a top view in the road plane coordinate system further comprises: Inversely projecting the road image onto a road plane to obtain an irregular shape; Selecting a rectangular area of a set length and a set width from the irregular figure; Setting the rectangular area at a set position and a set angle in a road plane coordinate system; The irregular graphics within the rectangular area are pixelated into a top view according to a set ratio.
10. The method according to claim 1, characterized in that The candidate sight line angles include: a candidate pitch angle, and a candidate azimuth angle corresponding to a target pitch angle; or a candidate azimuth angle, and a candidate pitch angle corresponding to a target azimuth angle.
11. A road segmentation device that actively adjusts the camera's sight angle, characterized in that: In the initial state, the camera is not in the process of adjusting the sight angle, and the device comprises: A collection module, used for collecting images of the road ahead using a camera; A reverse projection module, used for reversely projecting the road image onto a road plane to obtain a top view in a road plane coordinate system; A segmentation module, used for performing road segmentation on the top view to obtain a segmented image; An evaluation module, used to evaluate the segmented image according to a preset evaluation standard to obtain an evaluation value of the road image; A judging module, used to judge whether the camera is in the process of adjusting the sight angle; S51: If not, determining whether the evaluation value of the road image is greater than an evaluation threshold; S511: If yes, keep the sight angle of the camera, and call the acquisition module to the judgment module in a loop; S512: If not, setting the camera to be in the process of adjusting the sight angle, actively adjusting the sight angle of the camera to a new candidate sight angle, and cyclically calling the acquisition module to the judgment module; S52: If yes, then Actively adjust the sight angle of the camera to a new candidate sight angle, cyclically call the acquisition module to the judgment module until there is no new candidate sight angle, and set the sight angle of the camera to be adjusted; When the sight line angle of the camera is adjusted, based on evaluation values of the road images corresponding to all candidate sight line angles of the camera, a target sight line angle is selected from all candidate sight line angles; The camera is adjusted to the target sight angle, and the acquisition module is called to the judgment module in a loop.
12. A computer device comprising a memory, a processor, and a computer program stored in the memory, characterized in that: When the computer program is executed by the processor, the computer program executes the instructions of the method according to any one of claims 1 to 10.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor of a computer device, the computer program executes the instructions of the method according to any one of claims 1 to 10.
Citation Information
Patent Citations
An automatic camera calibration method based on enumeration heuristics
CN109544635A
Lane line detection method based on edge features and sliding window
CN111126306A
Line line fitting and tracking method, device and equipment of road and storage medium
CN115471522A
Apparatus for generating top-view image and method thereof
KR1020180065758A
Impact activated triggering mechanism for a camera mounted anywhere in a vehicle
US5596382A
