A method, device, medium and equipment for generating a reverse auxiliary line

By obtaining coordinate data from the reversing image and using quadratic polynomial fitting and optimization, a reversing guide line that satisfies the optical lens imaging distortion is generated, solving the problem of insufficient accuracy and reliability in the existing technology and realizing the accurate mapping of the reversing guide line.

CN116824529BActive Publication Date: 2026-06-05ZHUHAI SHIXI TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHUHAI SHIXI TECH CO LTD
Filing Date
2023-06-26
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing reversing assist systems suffer from inaccurate and unreliable generation of reversing guide lines, failing to accurately reflect the mapping relationship between pixel coordinates in the image coordinate system and the actual distance.

Method used

By obtaining coordinate data from the reversing image, curve fitting is performed using a quadratic polynomial fitting method to obtain the current sub-auxiliary line, and the target sub-auxiliary line is obtained through optimization processing to satisfy the curve type of optical lens imaging distortion, thus generating the target reversing auxiliary line.

Benefits of technology

It achieves accurate and reliable generation of reversing guide lines, which can accurately reflect the mapping relationship between pixel coordinates on the image coordinate system and the real distance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116824529B_ABST
    Figure CN116824529B_ABST
Patent Text Reader

Abstract

The application discloses a method and device for generating a reverse auxiliary line, a medium and equipment, wherein the method comprises: obtaining a plurality of coordinate data from a reverse image to obtain a coordinate data set corresponding to each position type; performing curve fitting on each coordinate data in the same coordinate data set to obtain a current sub-auxiliary line corresponding to each position type; respectively optimizing each current sub-auxiliary line to obtain a target sub-auxiliary line corresponding to each position type; and generating a target reverse auxiliary line based on each target sub-auxiliary line and the position type of each target sub-auxiliary line. The application selects a plurality of coordinate data from a reverse image, uses each coordinate data to preliminarily fit an auxiliary line to obtain a current sub-auxiliary line of a target position type and a curve type, and respectively optimizes each current sub-auxiliary line, so that a target sub-auxiliary line meeting optical lens imaging distortion is obtained, and the generated target sub-auxiliary line is more accurate and reliable.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of vehicle technology, and in particular to a method, apparatus, medium, and equipment for generating reversing guide lines. Background Technology

[0002] With the continuous improvement of economic level, automobiles, as a means of transportation, have greatly facilitated people's travel and provided convenience for people's lives.

[0003] Current car reversing assist systems typically provide reversing guide lines to remind the driver of the distance between the rear of the vehicle and obstacles.

[0004] However, existing reversing assist systems generate straight reversing assist lines that deviate from the actual reversing distance, failing to accurately reflect the mapping relationship between pixel coordinates in the image coordinate system and the real distance. This results in the generation of assist lines that are not accurate or reliable. Summary of the Invention

[0005] In view of this, the present invention provides a method, apparatus, medium and equipment for generating reversing guide lines, the main purpose of which is to solve the problem that the generation of guide lines is not accurate and reliable enough.

[0006] To address the above problems, this application provides a method for generating reversing guide lines, comprising:

[0007] Obtain coordinate data from the reversing image to obtain a coordinate dataset corresponding to each position type;

[0008] Curve fitting is performed based on the coordinate data in the same coordinate dataset to obtain the current sub-auxiliary line corresponding to each position type;

[0009] Each current sub-auxiliary line is optimized to obtain the target sub-auxiliary line corresponding to each position type;

[0010] Based on each target sub-auxiliary line and the position type of each target sub-auxiliary line, a target reversing auxiliary line is generated.

[0011] Optionally, the step of obtaining several coordinate data from the reversing image to obtain a coordinate dataset corresponding to each position type includes:

[0012] In response to a user's selection of several pixel regions within the reversing image, coordinate data corresponding to each pixel region is obtained;

[0013] Configure a location type for each of the coordinate data to obtain a coordinate dataset corresponding to each location type.

[0014] Optionally, the position types include: a left position type along the vehicle length direction, a right position type along the vehicle length direction, a first position type along the vehicle width direction, a second position type along the vehicle width direction, and a third position type along the vehicle width direction; the distance between the sub-reversing auxiliary lines corresponding to the first position type, the second position type, and the third position type and the rear of the vehicle is different.

[0015] Optionally, the step of performing curve fitting based on coordinate data from the same coordinate dataset to obtain the current sub-auxiliary line corresponding to each position type includes:

[0016] Using the quadratic polynomial fitting method, curve fitting is performed on each coordinate data in the coordinate dataset corresponding to each position type to obtain the current sub-auxiliary line corresponding to each position type.

[0017] Optionally, the step of optimizing each current sub-auxiliary line to obtain the target sub-auxiliary line corresponding to each position type includes:

[0018] Each sub-auxiliary line is optimized based on its current error value until a predetermined optimization stopping condition is met. Then, the current sub-auxiliary line is used as the target sub-auxiliary line to obtain the target sub-auxiliary line corresponding to each position type.

[0019] Optionally, before optimizing the corresponding current sub-auxiliary line based on its current error value, the method further includes: calculating the current error value of each current sub-auxiliary line based on each current sub-auxiliary line and its corresponding coordinate dataset, specifically including:

[0020] Based on the coordinate data in the coordinate dataset corresponding to the current sub-auxiliary line, calculate the distance between each coordinate data and the current sub-auxiliary line;

[0021] The current error value of the current sub-auxiliary line is calculated based on each of the distance values.

[0022] Optionally, the step of optimizing the corresponding current sub-auxiliary line based on the current error value of the current sub-auxiliary line until a predetermined optimization stopping condition is met, and then using the current sub-auxiliary line as the target sub-auxiliary line to obtain the target sub-auxiliary line corresponding to each position type, includes:

[0023] Based at least on the current error value of the current sub-auxiliary line and the predetermined error threshold, determine whether the current sub-auxiliary line meets the optimization stopping condition;

[0024] If it is determined that the current sub-auxiliary line does not meet the optimization stopping condition, the coordinate data in the coordinate dataset corresponding to the current sub-auxiliary line are optimized according to the predetermined optimization method to obtain the optimized coordinate dataset, and the current sub-auxiliary line is obtained by refitting based on the coordinate data in the optimized coordinate dataset.

[0025] If the current sub-auxiliary line is determined to meet the optimization stopping condition, the current sub-auxiliary line is taken as the target sub-auxiliary line.

[0026] Optionally, determining whether the current sub-auxiliary line meets the optimization stopping condition based at least on the current error value of the current sub-auxiliary line and a predetermined error threshold includes:

[0027] Compare the current error value with a predetermined error threshold;

[0028] If the current error value is less than or equal to the error threshold, or the number of optimization attempts reaches a predetermined number, it is determined that the optimization stopping condition is met.

[0029] If the current error value is greater than the error threshold and the number of optimization attempts has not reached the predetermined number, it is determined that the optimization stop condition is not met.

[0030] Optionally, the predetermined optimization method includes any one or more of the following methods:

[0031] Based on the Euclidean distance between each coordinate data in the coordinate dataset corresponding to the current sub-auxiliary line, each coordinate data is optimized to obtain an optimized coordinate dataset corresponding to the current sub-auxiliary line.

[0032] And / or, based on the distance between each coordinate data in the coordinate dataset corresponding to the current sub-auxiliary line and the current sub-auxiliary line, optimize each coordinate data to obtain an optimized coordinate dataset corresponding to the current sub-auxiliary line;

[0033] And / or, based on the method of exchanging horizontal and vertical coordinates, perform coordinate transformation on each coordinate data in the coordinate dataset corresponding to the current sub-auxiliary line to obtain an optimized coordinate dataset corresponding to the current sub-auxiliary line.

[0034] To address the aforementioned problems, this application provides a device for generating reversing auxiliary lines, comprising:

[0035] The acquisition module is used to acquire several coordinate data from the reversing image to obtain a coordinate dataset corresponding to each position type;

[0036] The fitting module is used to perform curve fitting based on the coordinate data in the same coordinate dataset to obtain the current sub-auxiliary line corresponding to each position type.

[0037] The optimization module is used to optimize each current sub-auxiliary line to obtain the target sub-auxiliary line corresponding to each position type.

[0038] The generation module is used to generate target reversing auxiliary lines based on each target sub-auxiliary line and the position type of each target sub-auxiliary line.

[0039] To address the aforementioned problems, this application provides a storage medium storing a computer program that, when executed by a processor, implements the steps of the reversing auxiliary line generation method described above.

[0040] To address the aforementioned problems, this application provides an electronic device, comprising at least a memory and a processor, wherein the memory stores a computer program, and the processor, when executing the computer program in the memory, implements the steps of any of the above-described methods for generating reversing auxiliary lines.

[0041] The method, apparatus, medium, and device for generating reversing auxiliary lines in this application select several coordinate data / coordinate points from the reversing image and perform preliminary fitting of auxiliary lines using each coordinate data. This allows for the acquisition of current sub-auxiliary lines of curve type corresponding to each position type. Furthermore, by optimizing each current sub-auxiliary line, a target sub-auxiliary line of curve type that satisfies the optical lens imaging distortion can be obtained. This enables the generated target sub-auxiliary line of curve type to accurately reflect the mapping relationship between pixel coordinates and real distance in the image coordinate system, thus making the generated target sub-auxiliary line more accurate and reliable.

[0042] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description

[0043] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:

[0044] Figure 1 This is a flowchart illustrating a method for generating reversing auxiliary lines according to an embodiment of this application;

[0045] Figure 2 This is a schematic diagram illustrating the positional relationship of coordinate data in a coordinate dataset in an embodiment of this application;

[0046] Figure 3This is a schematic diagram illustrating the optimization process of the reversing auxiliary lines in the embodiments of this application;

[0047] Figure 4 This is a structural block diagram of a device for generating reversing auxiliary lines according to another embodiment of this application;

[0048] Figure 5 This is a structural block diagram of an electronic device according to another embodiment of this application. Detailed Implementation

[0049] Various embodiments and features of this application are described herein with reference to the accompanying drawings.

[0050] It should be understood that various modifications can be made to the embodiments described herein. Therefore, the above description should not be considered as limiting, but merely as an example of embodiments. Other modifications within the scope and spirit of this application will be apparent to those skilled in the art.

[0051] The accompanying drawings, which are included in and form part of this specification, illustrate embodiments of the present application and, together with the general description of the present application given above and the detailed description of the embodiments given below, serve to explain the principles of the present application.

[0052] These and other features of this application will become apparent from the following description of preferred forms of embodiments given as non-limiting examples, with reference to the accompanying drawings.

[0053] It should also be understood that although this application has been described with reference to some specific examples, those skilled in the art can certainly implement many other equivalent forms of this application.

[0054] The above and other aspects, features and advantages of this application will become more apparent when taken in conjunction with the accompanying drawings and in view of the following detailed description.

[0055] Specific embodiments of this application are described thereafter with reference to the accompanying drawings; however, it should be understood that the claimed embodiments are merely examples of this application, which can be implemented in various ways. Well-known and / or repeated functions and structures are not described in detail to avoid unnecessary or redundant details that could obscure the application. Therefore, the specific structural and functional details claimed herein are not intended to be limiting, but merely serve as the basis and representative basis for the claims to teach those skilled in the art to use this application in a variety of substantially any suitable detailed structures.

[0056] This specification may use the phrases “in one embodiment,” “in another embodiment,” “in yet another embodiment,” or “in other embodiments,” all of which may refer to one or more of the same or different embodiments according to this application.

[0057] This application provides a method for generating reversing guide lines, specifically applicable to a reversing assistance system within a vehicle. This system includes at least a camera, a display / touchscreen, and a processor. The method in this embodiment can be specifically applied to the processor within the reversing assistance system. Figure 1 As shown, the method in this embodiment includes the following steps:

[0058] Step S101: Obtain several coordinate data from the reversing image to obtain a coordinate dataset corresponding to each position type;

[0059] In this step, a camera device can be installed at the rear of the vehicle to capture images of the rear scene, thus obtaining a real-time reversing image. Coordinate data can then be obtained from this real-time reversing image, or from historical reversing images. In this step, the position type refers to the type of auxiliary line, including any one or more of the following: left-side position type along the vehicle's length, right-side position type along the vehicle's length, first position type along the vehicle's width, second position type along the vehicle's width, and third position type along the vehicle's width; wherein the distance between the sub-reversing auxiliary lines corresponding to the first, second, and third position types and the rear of the vehicle is different.

[0060] In other words, after obtaining the coordinate data, you can configure the position type for each coordinate data. For example, you can configure the left position type for one coordinate data, the right position type for another coordinate data, and so on, to complete the configuration of the auxiliary line position type for each coordinate data. This way, you can obtain the set of coordinate data corresponding to each position type.

[0061] Step S102: Perform curve fitting based on the coordinate data in the same coordinate dataset to obtain the current sub-auxiliary line corresponding to each position type;

[0062] In the specific implementation of this step, a quadratic polynomial fitting method can be used to perform curve fitting on each coordinate data in the coordinate dataset corresponding to each position type to obtain the current sub-auxiliary line corresponding to each target position type. For example, by performing curve fitting on each coordinate data in the coordinate dataset corresponding to the first position type, the first current sub-auxiliary line corresponding to the first position type can be obtained. Similarly, by performing curve fitting on each coordinate data in the coordinate dataset corresponding to the second position type, the second current sub-auxiliary line corresponding to the second position type can be obtained. Thus, the current sub-auxiliary lines corresponding to each position type can be obtained.

[0063] Step S103: Optimize each current sub-auxiliary line to obtain the target sub-auxiliary line corresponding to each position type;

[0064] In this step, since the current sub-auxiliary line obtained through fitting may contain errors, it needs to be optimized to make the obtained target sub-auxiliary line more accurate and reliable. This ensures the accurate generation of the target reversing auxiliary line based on the target sub-auxiliary line in the subsequent process. Specifically, the optimization process can be based on the error value of the current sub-auxiliary line.

[0065] Step S104: Generate target reversing auxiliary lines based on each target sub-auxiliary line and the position type of each target sub-auxiliary line.

[0066] In this step, after obtaining the target sub-auxiliary lines corresponding to each position type, the target sub-auxiliary lines can be combined to generate the target reversing auxiliary lines.

[0067] The method for generating reversing auxiliary lines in this embodiment selects several coordinate data / coordinate points from the reversing image and performs preliminary fitting of auxiliary lines using each coordinate data. This yields current sub-auxiliary lines of curve type corresponding to each position type. Furthermore, by optimizing each current sub-auxiliary line, a target sub-auxiliary line of curve type that satisfies the optical lens imaging distortion can be obtained. This ensures that the generated target sub-auxiliary line of curve type can accurately reflect the mapping relationship between pixel coordinates and real distance in the image coordinate system, making the generated target sub-auxiliary line more accurate and reliable.

[0068] Based on the above embodiments, another embodiment of this application provides a method for generating reversing auxiliary lines, specifically including the following steps:

[0069] Step S201: In response to the user object selecting several pixel areas within the reversing image, obtain coordinate data corresponding to each pixel area;

[0070] In this step, the reversing image can be a scene image captured by the rear-end camera of the vehicle, containing the target reference object. Specifically, the target reference object can be a pre-marked / arranged n*n grid of squares, or an obstacle object at a certain distance from the rear of the vehicle. For example, 10*10 squares can be drawn on the ground of the designated parking area with each square having a side length of 1 meter, thus obtaining a grid-like target calibration field. The side length of the squares can be set and adjusted according to actual needs. Other examples include obstacles 3 meters or 2.5 meters from the rear of the vehicle, where obstacles can include trees, people, vehicles, signs, traffic cones, etc.

[0071] By displaying the reversing image on a screen / touchscreen, users can quickly determine the target location area on the reversing image corresponding to their desired distance from the rear of the vehicle, based on the actual distance relationship and the position area of ​​the target reference object in the image. Users can then interactively select the pixel area corresponding to the target location on the reversing image, thereby obtaining the coordinate data corresponding to several desired target distances. For example, if the actual distance between the target reference object and the rear of the vehicle is 3 meters, and the user's desired distance between the reversing guide line and the rear of the vehicle is 1.5 meters, the pixel area in the image, slightly towards the target reference object, can be quickly determined as the actual distance of 1.5 meters from the rear of the vehicle in the real-world scenario. The corresponding coordinate data can then be determined based on this pixel area. Similarly, if the user's desired distance between the reversing guide line and the rear of the vehicle is also 3 meters, the coordinate data corresponding to that position / pixel area can be quickly determined based on the position area of ​​the target reference object in the reversing image.

[0072] Step S202: Configure the location type for each of the coordinate data to obtain a coordinate dataset corresponding to each location type;

[0073] In this step, after obtaining several coordinate data points through human-computer interaction, a position type can be configured for each coordinate data point to obtain a coordinate dataset corresponding to each position type. Specifically, the corresponding position type can be configured for each coordinate data point on the type configuration page. That is, each coordinate data point / coordinate point can be numbered according to the order of selection operations, and then the type configuration operation is performed on the coordinate data corresponding to each number in sequence on the type configuration page. For example, for any target coordinate data to be type configured, several position type options (virtual buttons) can be displayed on the type configuration page. Thus, the user can generate selection instructions through single-click, double-click, drag, etc., so that the processor in the reversing assistance system can respond to the selection instructions to configure the corresponding position type for the target coordinate data. Then, the user can trigger the "Next" button to select the next numbered target coordinate data as the target coordinate data to be type configured.

[0074] The position types include: left position type along the vehicle length direction, right position type along the vehicle length direction, first position type along the vehicle width direction, second position type along the vehicle width direction, and third position type along the vehicle width direction; the distance between the sub-reversing auxiliary line corresponding to the first position type, second position type, and third position type and the rear of the vehicle is different.

[0075] Step S203: Using the quadratic polynomial fitting method, curve fitting is performed on each coordinate data in the coordinate dataset corresponding to each position type to obtain the current sub-auxiliary line corresponding to each position type.

[0076] In this step, after obtaining the coordinate datasets corresponding to each position type, a quadratic polynomial fitting method can be used to fit the coordinate data in the coordinate dataset of the first position type to obtain the current sub-auxiliary line corresponding to the first position type. Similarly, the quadratic polynomial fitting method is used to fit and obtain the current sub-auxiliary line corresponding to the second position type, the third position type, the left position type, and the right position type, thus obtaining the current sub-auxiliary line corresponding to each position type.

[0077] Step S204: Optimize the corresponding current sub-auxiliary line based on the current error value of the current sub-auxiliary line until the predetermined optimization stopping condition is met. Then, take the current sub-auxiliary line as the target sub-auxiliary line to obtain the target sub-auxiliary line corresponding to each position type.

[0078] In the specific implementation process of this step, the error value of each current sub-auxiliary line can be calculated first, and then the corresponding current sub-auxiliary line can be optimized according to the error value. In this way, the target sub-auxiliary line with the curve type that corresponds to each current sub-auxiliary line / position type and conforms to the optical lens imaging distortion can be obtained.

[0079] Step S205: Generate target reversing auxiliary lines based on each target sub-auxiliary line and the position type of each target sub-auxiliary line;

[0080] In this step, after obtaining several target sub-auxiliary lines, each target sub-auxiliary line can be fitted to obtain the target reversing auxiliary line.

[0081] The method for generating reversing guide lines in this embodiment uses a human-computer interaction approach to obtain coordinate datasets corresponding to various position types. This allows for the convenient and quick acquisition of several coordinate datasets used to generate reversing guide lines. Subsequently, target reversing guide lines can be automatically generated based on these coordinate datasets, enabling dynamic adjustment and modification of the reversing guide lines and meeting the personalized setting needs of different users. Simultaneously, by using the coordinate data to perform preliminary fitting of the guide lines, current sub-guide lines of curve type are obtained. Each current sub-guide line is then optimized to obtain target sub-guide lines of curve type that satisfy the optical lens imaging distortion requirements, making the generated target sub-guide lines more accurate and reliable.

[0082] Based on the above embodiments, another embodiment of this application provides a method for generating reversing auxiliary lines. In this embodiment, when responding to a user object selecting several pixel areas within the reversing image and obtaining coordinate data corresponding to each pixel area, that is, when executing step S201, the coordinate data can be obtained in the following two ways:

[0083] Method 1: In response to the user's selection operation of each pixel region in the reversing image based on the target reference object in the reversing image, obtain several pixel regions; obtain the coordinate range of each pixel region, and determine the coordinate data corresponding to each pixel region based on the coordinate range of each pixel region.

[0084] In this method, when the target reference object is an object or a grid-like target calibration field, the pixel area selected by the user may or may not contain grid vertices. Therefore, when it does not contain grid vertices, its coordinate range can be determined based on the selected pixel area, and then the center coordinate point in the coordinate range can be determined as the target coordinate point corresponding to the pixel area. This is how coordinate data is obtained, making the determination of coordinate points / coordinate data more reasonable and accurate.

[0085] Method 2: In response to the user's selection operation of the target reference object in the reversing image and the pixel region within the reversing image, obtain several pixel regions; identify the grid vertices of the target reference object in each pixel region to obtain the coordinate data corresponding to each pixel region.

[0086] In this method, when the target reference object is a grid-shaped target calibration field, the pixel region selected by the user may or may not contain grid vertices. Therefore, when it contains grid vertices, that is, when the pixel region is identified to contain grid vertices, the coordinates of the grid vertices can be further obtained, thereby obtaining the coordinate points corresponding to the pixel region, that is, obtaining the coordinate data corresponding to the pixel region, making the determination of coordinate points / coordinate data more reasonable and accurate.

[0087] In the specific implementation process, after obtaining the pixel region, grid vertex identification can be performed on the target pixel region first. If no grid vertices are identified, the coordinate data corresponding to each pixel region is determined based on the coordinate range of each pixel region. If grid vertices are identified, the coordinate data corresponding to each pixel region is obtained based on the identified grid vertices. By adopting the above method to obtain coordinate data, the acquisition of coordinate data can be made more accurate and reliable, laying the foundation for the subsequent accurate generation of the target reversing auxiliary line based on each coordinate data.

[0088] Based on the above embodiments, another embodiment of this application provides a method for generating reversing auxiliary lines. In this embodiment, when optimizing the corresponding current sub-auxiliary lines based on the current error value of the current sub-auxiliary lines to obtain target sub-auxiliary lines corresponding to each position type, that is, when executing step S204, the following optimization process can be adopted:

[0089] Step S2041: Calculate the current error value of each current sub-auxiliary line based on each current sub-auxiliary line and the coordinate dataset corresponding to each current sub-auxiliary line.

[0090] In this step, the distance between each coordinate data point and the current sub-auxiliary line can be calculated based on the coordinate data in the coordinate dataset corresponding to the current sub-auxiliary line. The current error value of the current sub-auxiliary line can then be calculated based on these distance values. For example, the average distance value can be used as the current error value of the current sub-auxiliary line. Alternatively, the variance or standard deviation of each distance value can be calculated, and this variance or standard deviation can be used as the current error value of the current sub-auxiliary line. By calculating the variance / standard deviation, it can be ensured that the impact of each coordinate data point on the error is basically consistent. For coordinate data points with large errors, this measurement method can accurately delete them, providing a guarantee for the accurate drawing of reversing auxiliary lines.

[0091] Step S2042: Based at least on the current error value of the current sub-auxiliary line and the predetermined error threshold, determine whether the current sub-auxiliary line meets the optimization stopping condition. If the optimization stopping condition is not met, proceed to step S2043; if the optimization stopping condition is met, proceed to step S2044.

[0092] In the specific implementation process of this step, the current error value can be compared with a predetermined error threshold; if the current error value is less than or equal to the error threshold, or the number of optimizations reaches a predetermined number of times, it is determined that the optimization stopping condition is met; if the current error value is greater than the error threshold, and the number of optimizations has not reached the predetermined number of times, it is determined that the optimization stopping condition is not met.

[0093] Step S2043: Optimize each coordinate data in the coordinate dataset corresponding to the current sub-auxiliary line according to the predetermined optimization method to obtain an optimized coordinate dataset, and refit the current sub-auxiliary line based on each coordinate data in the optimized coordinate dataset, and then execute step S2041.

[0094] In the specific implementation of this step, one or more of the following optimization methods can be used to optimize the current sub-auxiliary line:

[0095] Method 1: Based on the Euclidean distance between the coordinate data in the coordinate dataset corresponding to the current sub-auxiliary line, optimize each coordinate data to obtain an optimized coordinate dataset corresponding to the current sub-auxiliary line.

[0096] In this step, for the coordinate dataset corresponding to the current sub-auxiliary line, the Euclidean distance (L2 distance) between each coordinate data in the dataset can be calculated. Based on this Euclidean distance, sparsification is performed on the coordinate data, meaning that only one coordinate data with a similar Euclidean distance is retained, thus obtaining the optimized coordinate dataset corresponding to the current sub-auxiliary line. In other words, for a given coordinate dataset containing coordinate data a, b, c, etc., the positional relationships between these coordinate data can be as follows: Figure 2 As shown, based on the positional relationship of each coordinate data, the Euclidean distance between a and b can be calculated first. Then, based on this Euclidean distance, it can be determined whether the distances between a and b are sufficiently close. If they are close, a can be deleted and b can be kept. Similarly, the Euclidean distances between b and c, and between b and other adjacent coordinate data of c, can be calculated. This allows for sparsification of the coordinate dataset. In practical implementation, each Euclidean distance can be compared with a predetermined Euclidean distance threshold. When the Euclidean distance is less than the threshold, sparsification is performed on the two coordinate data corresponding to that Euclidean distance, deleting one coordinate data and keeping the other.

[0097] Method 2: Based on the distance between each coordinate data in the coordinate dataset corresponding to the current sub-auxiliary line and the current sub-auxiliary line, optimize each coordinate data to obtain an optimized coordinate dataset corresponding to the current sub-auxiliary line.

[0098] In the specific implementation process of this step, for the coordinate dataset corresponding to the current sub-auxiliary line, the vertical distance between each coordinate data in the coordinate dataset and the current sub-auxiliary line can be calculated to obtain the distance value corresponding to each coordinate data. Then, based on each distance value, each coordinate data is filtered to delete coordinate data with a distance value greater than a predetermined distance threshold, thereby obtaining the optimized coordinate dataset after optimization.

[0099] Method 3: Based on the method of exchanging horizontal and vertical coordinates, perform coordinate transformation on each coordinate data in the coordinate dataset corresponding to the current sub-auxiliary line to obtain an optimized coordinate dataset corresponding to the current sub-auxiliary line.

[0100] In this step, for the coordinate dataset corresponding to the current sub-auxiliary line, the horizontal and vertical coordinates of each coordinate data in the dataset can be interchanged. That is, for any coordinate data (a, b), after performing coordinate transformation, transformed coordinate data (b, a) is obtained. This yields the transformed coordinate data corresponding to each coordinate data, allowing for the creation of an optimized coordinate dataset. Subsequently, curve fitting can be performed again based on the coordinate data in the optimized dataset to obtain the current sub-auxiliary line. Following this, the current sub-auxiliary line obtained through refitting is used to calculate the current error value to determine if it is less than or equal to a predetermined error threshold. If it is less than or equal to the predetermined error threshold, the auxiliary line is rotated 90 degrees to obtain the target sub-auxiliary line.

[0101] Step S2044: Use the current sub-auxiliary line as the target sub-auxiliary line;

[0102] Step S2045: Generate target reversing auxiliary lines based on each target sub-auxiliary line and the position type of each target sub-auxiliary line.

[0103] In this embodiment, by using the above-described optimization process to optimize the current sub-auxiliary line, the final optimized target sub-auxiliary line can be more accurate and reliable.

[0104] Based on the above embodiments, taking an arbitrary coordinate dataset as an example, the process of optimizing and obtaining the target sub-auxiliary line is explained, such as... Figure 3 As shown, the specific optimization process is as follows:

[0105] Step 1: Collect and obtain the coordinate dataset.

[0106] Step two: Determine if the data is sufficient. If it is sufficient, proceed to step three; otherwise, determine that the auxiliary line optimization has failed and end the optimization process.

[0107] Step 3: Perform initial fitting of auxiliary lines based on the coordinate data in the coordinate dataset to obtain the current sub-auxiliary lines.

[0108] Step 4: Calculate the error based on the current sub-auxiliary line and each coordinate data to obtain the error value corresponding to the current sub-auxiliary line.

[0109] Step 5: Determine if the error value is less than the predetermined error threshold; if not, proceed to step 6; if less, proceed to step 8.

[0110] Step 6: Determine if the optimization limit has been reached; if the optimization limit has been reached, proceed to Step 9; if the optimization limit has not been reached, proceed to Step 7.

[0111] In this step, the optimization limit can be determined based on the number of optimization attempts. For example, if the number of optimization attempts exceeds the predetermined number of attempts, then the optimization limit can be determined to have been reached.

[0112] Step 7: Determine the corresponding optimization method based on the number of optimizations, optimize each coordinate data in the coordinate dataset to obtain the optimized coordinate dataset, obtain the optimized current sub-auxiliary line, and return to step 4.

[0113] In this step, the coordinate data in the coordinate dataset corresponding to the current sub-auxiliary line are optimized according to the optimization method corresponding to the number of optimizations, resulting in an optimized coordinate dataset. Subsequently, the current sub-auxiliary line can be refitted based on the coordinate data in the optimized coordinate dataset. The optimization methods corresponding to the number of optimizations are as follows:

[0114] The first optimization method, corresponding to the first optimization, involves optimizing each coordinate data point based on the Euclidean distance between them in the coordinate dataset corresponding to the current sub-auxiliary line, to obtain an optimized coordinate dataset corresponding to the current sub-auxiliary line. Specifically, for the coordinate dataset corresponding to the current sub-auxiliary line, the Euclidean distance (L2 distance) between each coordinate data point in the dataset can be calculated. Based on this Euclidean distance, the coordinate data is sparsified, retaining only one of two coordinate data points with similar Euclidean distances. This yields the optimized coordinate dataset. The current sub-auxiliary line can then be refitted based on the coordinate data in this optimized dataset. Finally, the process returns to step four to determine if the current sub-auxiliary line meets the optimization stopping condition.

[0115] The second optimization method, corresponding to the second optimization, involves optimizing each coordinate data point in the optimized coordinate dataset corresponding to the current sub-auxiliary line based on the distance between that coordinate and the current sub-auxiliary line. This yields an optimized coordinate dataset for the current sub-auxiliary line. Specifically, the error value of the coordinate data is determined based on the distance between each coordinate data point and the current auxiliary line. Then, the coordinate data with the largest error value (or coordinate data with an error value greater than a predetermined distance error value) is deleted. This allows the remaining coordinate data to be used to construct the optimized coordinate dataset. Subsequently, the current sub-auxiliary line can be refitted based on the coordinate data in the optimized coordinate dataset.

[0116] The third optimization method, corresponding to the third optimization, involves transforming the coordinates of each data point in the original coordinate dataset to obtain an optimized coordinate dataset corresponding to the current sub-auxiliary line. Subsequently, the current sub-auxiliary line can be refitted based on the transformed coordinate data, and the process returns to step four to determine if the current error value of the sub-auxiliary line is less than or equal to a predetermined error threshold. If it is less than or equal to the predetermined error threshold, the auxiliary line can be rotated 90 degrees to obtain the target sub-auxiliary line. In other words, this optimization method adds the previously deleted coordinate data to the coordinate dataset to obtain the original coordinate dataset, and then transforms the coordinates of each data point in this dataset.

[0117] The fourth optimization method, corresponding to the fourth optimization, involves optimizing each transformed coordinate data point (transformed coordinate data) in the optimized coordinate dataset after the third optimization to obtain an optimized coordinate dataset corresponding to the current sub-auxiliary line. In other words, for the optimized coordinate dataset after the third optimization, the Euclidean distance (L2 distance) between each transformed coordinate data point in the dataset can be calculated, and the transformed coordinate data can be sparsified based on this Euclidean distance to obtain the optimized coordinate dataset after the fourth optimization. The principle of this optimization method is similar to that of the first optimization method and will not be elaborated further here.

[0118] The fifth optimization method, corresponding to the fifth optimization, involves optimizing each transformed coordinate data point (transformed coordinate data) in the optimized coordinate dataset after the fourth optimization, based on the distance between this data and the current sub-auxiliary line. This yields an optimized coordinate dataset corresponding to the current sub-auxiliary line. In other words, for the optimized coordinate dataset after the fourth optimization, the vertical distance between each transformed coordinate data point and the current sub-auxiliary line can be calculated. Based on these distance values, the coordinate data is filtered to obtain the optimized coordinate dataset. The principle of this optimization method is similar to that of the second optimization method and will not be elaborated further here.

[0119] Step 8: Set the current sub-auxiliary line as the target sub-auxiliary line and save it.

[0120] Step 9: End the optimization of the current sub-auxiliary line.

[0121] In this embodiment, for coordinate datasets of each location type, the above optimization steps can be used to optimize the auxiliary lines to generate corresponding target sub-auxiliary lines, thereby obtaining target sub-auxiliary lines corresponding to each location type. Subsequently, the target sub-auxiliary lines can be combined to generate curved target reversing auxiliary lines, solving the problem of inaccurate straight reversing auxiliary lines caused by distortion from wide-angle and other camera imaging.

[0122] Another embodiment of this application provides a reversing guide line generation device, such as... Figure 4 As shown, it includes:

[0123] The acquisition module is used to acquire several coordinate data from the reversing image to obtain a coordinate dataset corresponding to each position type;

[0124] The fitting module is used to perform curve fitting based on the coordinate data in the same coordinate dataset to obtain the current sub-auxiliary line corresponding to each position type.

[0125] The optimization module is used to optimize each current sub-auxiliary line to obtain the target sub-auxiliary line corresponding to each position type.

[0126] The generation module is used to generate target reversing auxiliary lines based on each target sub-auxiliary line and the position type of each target sub-auxiliary line.

[0127] In this embodiment, the acquisition module is specifically used to: respond to a user object selecting a number of pixel regions in the reversing image, obtain coordinate data corresponding to each pixel region; configure a position type for each coordinate data to obtain a coordinate dataset corresponding to each position type.

[0128] In this embodiment, the position types include: left position type along the vehicle length direction, right position type along the vehicle length direction, first position type along the vehicle width direction, second position type along the vehicle width direction, and third position type along the vehicle width direction; the distance between the sub-reversing auxiliary lines corresponding to the first position type, second position type, and third position type and the rear of the vehicle is different.

[0129] In this embodiment, the fitting module is specifically used to: use a quadratic polynomial fitting method to perform curve fitting on each coordinate data in the coordinate dataset corresponding to each position type, and obtain the current sub-auxiliary line corresponding to each position type.

[0130] In this embodiment, the optimization module is specifically used to: optimize the corresponding current sub-auxiliary line based on the current error value of the current sub-auxiliary line until the predetermined optimization stopping condition is met, and then use the current sub-auxiliary line as the target sub-auxiliary line to obtain the target sub-auxiliary line corresponding to each position type.

[0131] In this embodiment, the device for generating reversing auxiliary lines further includes a calculation module. The calculation module is used to: calculate the current error value of each current sub-auxiliary line based on each current sub-auxiliary line and the coordinate dataset corresponding to each current sub-auxiliary line; specifically, it is used for:

[0132] Based on the coordinate data in the coordinate dataset corresponding to the current sub-auxiliary line, calculate the distance between each coordinate data and the current sub-auxiliary line; and calculate the current error value of the current sub-auxiliary line based on each distance value.

[0133] In this embodiment, the optimization module is specifically used to: determine whether the current sub-auxiliary line meets the optimization stopping condition based at least on the current error value of the current sub-auxiliary line and a predetermined error threshold; if the current sub-auxiliary line does not meet the optimization stopping condition, optimize each coordinate data in the coordinate dataset corresponding to the current sub-auxiliary line according to a predetermined optimization method to obtain an optimized coordinate dataset, and refit the current sub-auxiliary line based on each coordinate data in the optimized coordinate dataset; if the current sub-auxiliary line meets the optimization stopping condition, use the current sub-auxiliary line as the target sub-auxiliary line.

[0134] In this embodiment, the optimization module is specifically used to: compare the current error value with a predetermined error threshold; determine that the optimization stop condition is met when the current error value is less than or equal to the error threshold or the number of optimizations reaches a predetermined number of times; and determine that the optimization stop condition is not met when the current error value is greater than the error threshold and the number of optimizations has not reached the predetermined number of times.

[0135] In the specific implementation process of this embodiment, the predetermined optimization method includes any one or more of the following methods: based on the Euclidean distance between each coordinate data in the coordinate dataset corresponding to the current sub-auxiliary line, optimize each coordinate data to obtain an optimized coordinate dataset corresponding to the current sub-auxiliary line;

[0136] And / or, based on the distance between each coordinate data in the coordinate dataset corresponding to the current sub-auxiliary line and the current sub-auxiliary line, optimize each coordinate data to obtain an optimized coordinate dataset corresponding to the current sub-auxiliary line;

[0137] And / or, based on the method of exchanging horizontal and vertical coordinates, perform coordinate transformation on each coordinate data in the coordinate dataset corresponding to the current sub-auxiliary line to obtain an optimized coordinate dataset corresponding to the current sub-auxiliary line.

[0138] The reversing auxiliary line generation device in this embodiment selects several coordinate data / coordinate points from the reversing image and performs preliminary fitting of auxiliary lines using each coordinate data. This allows it to obtain current sub-auxiliary lines of the curve type corresponding to each position type. Furthermore, by optimizing each current sub-auxiliary line, it can obtain target sub-auxiliary lines of the curve type that satisfy the optical lens imaging distortion. This ensures that the generated target sub-auxiliary lines of the curve type can accurately reflect the mapping relationship between pixel coordinates and real distance in the image coordinate system. In other words, it makes the generated target sub-auxiliary lines more accurate and reliable.

[0139] Another embodiment of this application provides a storage medium storing a computer program, which, when executed by a processor, implements the following method steps:

[0140] Step 1: Obtain several coordinate data points from the reversing image to obtain a coordinate dataset corresponding to each position type;

[0141] Step 2: Perform curve fitting based on the coordinate data in the same coordinate dataset to obtain the current sub-auxiliary line corresponding to each position type;

[0142] Step 3: Optimize each current sub-auxiliary line to obtain the target sub-auxiliary line corresponding to each position type;

[0143] Step 4: Based on each target sub-auxiliary line and its position type, generate the target reversing auxiliary line.

[0144] The specific implementation process of the above method steps can be found in the embodiment of the above method for generating arbitrary reversing auxiliary lines, which will not be repeated here.

[0145] The storage medium in this application, by selecting several coordinate data / coordinate points from the reversing image and using each coordinate data to perform preliminary fitting of auxiliary lines, can obtain current sub-auxiliary lines of the curve type corresponding to each position type. Furthermore, by optimizing each current sub-auxiliary line, it can obtain target sub-auxiliary lines of the curve type that satisfy the optical lens imaging distortion. This allows the generated target sub-auxiliary lines of the curve type to accurately reflect the mapping relationship between pixel coordinates and real distances in the image coordinate system, that is, to make the generated target sub-auxiliary lines more accurate and reliable.

[0146] Another embodiment of this application provides an electronic device, such as... Figure 5 As shown, it includes at least a memory 1 and a processor 2. The memory 1 stores a computer program, and the processor 2 performs the following method steps when executing the computer program in the memory 1:

[0147] Step 1: Obtain several coordinate data points from the reversing image to obtain a coordinate dataset corresponding to each position type;

[0148] Step 2: Perform curve fitting based on the coordinate data in the same coordinate dataset to obtain the current sub-auxiliary line corresponding to each position type;

[0149] Step 3: Optimize each current sub-auxiliary line to obtain the target sub-auxiliary line corresponding to each position type;

[0150] Step 4: Based on each target sub-auxiliary line and its position type, generate the target reversing auxiliary line.

[0151] The specific implementation process of the above method steps can be found in the embodiment of the above method for generating arbitrary reversing auxiliary lines, which will not be repeated here.

[0152] The electronic device in this application selects several coordinate data / coordinate points from the reversing image and performs preliminary fitting of auxiliary lines using each coordinate data. This allows it to obtain current sub-auxiliary lines of the curve type corresponding to each position type. Furthermore, by optimizing each current sub-auxiliary line, it can obtain target sub-auxiliary lines of the curve type that satisfy the optical lens imaging distortion. This enables the generated target sub-auxiliary lines of the curve type to accurately reflect the mapping relationship between pixel coordinates and real distances in the image coordinate system. In other words, it makes the generated target sub-auxiliary lines more accurate and reliable.

[0153] The above embodiments are merely exemplary embodiments of this application and are not intended to limit this application. The scope of protection of this application is defined by the claims. Those skilled in the art can make various modifications or equivalent substitutions to this application within its substance and scope of protection, and such modifications or equivalent substitutions should also be considered to fall within the scope of protection of this application.

Claims

1. A method for generating reversing auxiliary lines, characterized in that, include: Obtain coordinate data from the reversing image to obtain a coordinate dataset corresponding to each position type; Curve fitting is performed based on the coordinate data in the same coordinate dataset to obtain the current sub-auxiliary line corresponding to each position type; Each sub-auxiliary line is optimized based on its current error value until a predetermined optimization stopping condition is met. Then, the current sub-auxiliary line is taken as the target sub-auxiliary line to obtain the target sub-auxiliary line corresponding to each position type. Each optimization process uses any of the following optimization methods: optimization based on Euclidean distance, optimization based on the distance between each coordinate data and the current auxiliary line, and optimization based on the exchange of horizontal and vertical coordinates. Based on each target sub-auxiliary line and the position type of each target sub-auxiliary line, a target reversing auxiliary line is generated.

2. The method as described in claim 1, characterized in that, The step of obtaining several coordinate data from the reversing image to obtain a coordinate dataset corresponding to each position type includes: In response to a user's selection of several pixel regions within the reversing image, coordinate data corresponding to each pixel region is obtained; Configure a location type for each of the coordinate data to obtain a coordinate dataset corresponding to each location type.

3. The method as described in claim 1, characterized in that, The position types include: left position type along the vehicle length direction, right position type along the vehicle length direction, first position type along the vehicle width direction, second position type along the vehicle width direction, and third position type along the vehicle width direction; the distance between the sub-reversing auxiliary line corresponding to the first position type, second position type, and third position type and the rear of the vehicle is different.

4. The method as described in claim 1, characterized in that, The process of performing curve fitting based on coordinate data from the same coordinate dataset to obtain the current sub-auxiliary line corresponding to each position type includes: Using the quadratic polynomial fitting method, curve fitting is performed on each coordinate data in the coordinate dataset corresponding to each position type to obtain the current sub-auxiliary line corresponding to each position type.

5. The method as described in claim 1, characterized in that, Before optimizing the corresponding current sub-auxiliary line based on its current error value, the method further includes: calculating the current error value of each current sub-auxiliary line based on each current sub-auxiliary line and its corresponding coordinate dataset, specifically including: Based on the coordinate data in the coordinate dataset corresponding to the current sub-auxiliary line, calculate the distance between each coordinate data and the current sub-auxiliary line; The current error value of the current sub-auxiliary line is calculated based on each of the distance values.

6. The method as described in claim 1, characterized in that, The process of optimizing the corresponding current sub-auxiliary line based on its current error value until a predetermined optimization stopping condition is met, and then using the current sub-auxiliary line as the target sub-auxiliary line to obtain the target sub-auxiliary line corresponding to each position type, includes: Based at least on the current error value of the current sub-auxiliary line and the predetermined error threshold, determine whether the current sub-auxiliary line meets the optimization stopping condition; If it is determined that the current sub-auxiliary line does not meet the optimization stopping condition, the coordinate data in the coordinate dataset corresponding to the current sub-auxiliary line are optimized according to the predetermined optimization method to obtain the optimized coordinate dataset, and the current sub-auxiliary line is obtained by refitting based on the coordinate data in the optimized coordinate dataset. If the current sub-auxiliary line is determined to meet the optimization stopping condition, the current sub-auxiliary line is taken as the target sub-auxiliary line.

7. The method as described in claim 6, characterized in that, The step of determining whether the current sub-auxiliary line meets the optimization stopping condition, based at least on the current error value of the current sub-auxiliary line and a predetermined error threshold, includes: Compare the current error value with a predetermined error threshold; If the current error value is less than or equal to the error threshold, or the number of optimization attempts reaches a predetermined number, it is determined that the optimization stopping condition is met. If the current error value is greater than the error threshold and the number of optimization attempts has not reached the predetermined number, it is determined that the optimization stop condition is not met.

8. The method as described in claim 6, characterized in that, The predetermined optimization method includes any one or more of the following methods: Based on the Euclidean distance between each coordinate data in the coordinate dataset corresponding to the current sub-auxiliary line, each coordinate data is optimized to obtain an optimized coordinate dataset corresponding to the current sub-auxiliary line. And / or, based on the distance between each coordinate data in the coordinate dataset corresponding to the current sub-auxiliary line and the current sub-auxiliary line, optimize each coordinate data to obtain an optimized coordinate dataset corresponding to the current sub-auxiliary line; And / or, based on the method of exchanging horizontal and vertical coordinates, perform coordinate transformation on each coordinate data in the coordinate dataset corresponding to the current sub-auxiliary line to obtain an optimized coordinate dataset corresponding to the current sub-auxiliary line.

9. A reversing auxiliary line generating device, characterized in that, include: The acquisition module is used to acquire several coordinate data from the reversing image to obtain a coordinate dataset corresponding to each position type; The fitting module is used to perform curve fitting based on the coordinate data in the same coordinate dataset to obtain the current sub-auxiliary line corresponding to each position type. The optimization module is used to optimize the corresponding current sub-auxiliary line based on the current error value of the current sub-auxiliary line until a predetermined optimization stopping condition is met. Then, the current sub-auxiliary line is taken as the target sub-auxiliary line to obtain the target sub-auxiliary line corresponding to each position type. Each optimization process adopts any of the following optimization methods: optimization method based on Euclidean distance, optimization method based on the distance between each coordinate data and the current auxiliary line, and optimization method based on the exchange of horizontal and vertical coordinates. The generation module is used to generate target reversing auxiliary lines based on each target sub-auxiliary line and the position type of each target sub-auxiliary line.

10. A storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the steps of the reversing auxiliary line generation method according to any one of claims 1-8.

11. An electronic device, characterized in that, It includes at least a memory and a processor, wherein the memory stores a computer program, and the processor, when executing the computer program in the memory, implements the steps of the reversing auxiliary line generation method according to any one of claims 1-8.