Panoramic image stitching method, device, storage medium, display method and system
By utilizing lane line feature information and coordinate system fitting technology in articulated vehicles to dynamically adjust image splicing, the problem of poor splicing effects and complex structures of traditional panoramic surround view systems on articulated vehicles is solved, and high-precision, real-time panoramic images are achieved. Splicing reduces costs.
Patent Information
- Application Number
- CN202011207314.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-03
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2040-11-03
AI Technical Summary
It is difficult for traditional panoramic surround view systems to achieve high-precision image stitching on articulated vehicles, resulting in poor stitching effects, complex structures and easy damage, which increases vehicle costs.
By using the left and right cameras in the articulated vehicle to collect external images of the vehicle, extract lane line feature information, build a vehicle coordinate system, fit the lane lines, and dynamically adjust the rotation angle to achieve image splicing and avoid splicing gaps and overlaps.
It achieves high-precision, real-time and stable panoramic image stitching, simplifies the structural design, reduces costs and improves the stitching effect.
Smart Images

Figure CN112348741B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of vehicle panoramic image stitching, and in particular to a panoramic image stitching method, device and storage medium, and a display method and system. Background Art
[0002] The panoramic surround view system consists of a terminal host, a camera and a display screen. The host obtains real-time images from cameras in all directions around the car, and through a series of software algorithm processing technologies such as image distortion correction, image stitching, image fusion, and image perspective transformation, it synthesizes a 2D / 3D panoramic image and outputs it to the central control display screen in the car. The panoramic surround view image perspective can be automatically switched according to the driving status of the car, presenting the driver with a real driving environment. The driver can observe blind spots more directly, thereby improving driving safety.
[0003] Traditional panoramic surround view systems use technology that fixes the relative positions of 4 or more cameras. That is, after the cameras are installed on the vehicle, the relative positions of the cameras will not change as the vehicle travels. Therefore, they are only applicable to passenger cars or vehicles with fixed structure. They cannot be applied to articulated vehicles with dynamically changing structures, such as articulated buses and tractor + trailer combinations, because when articulated vehicles turn, the front and rear carriages will dynamically fold.
[0004] The traditional solution uses an articulated plate angle sensor to detect the turning angle between the front and rear carriages, and uses the turning angle to compensate for the image stitching seam, such as the invention patent with publication number "CN202010207381.6" "A method for implementing a variable-angle panoramic surround view system for articulated engineering vehicles".
[0005] The traditional image stitching method uses hardware sensors, which has poor stitching effects and many disadvantages: first, the additional hinged plate angle sensor is complex in structure, easy to damage, and increases vehicle costs; second, the hinged plate angle sensor is not accurate. As the vehicle ages, it wears out and its accuracy gradually decreases, resulting in poor image stitching effects. Summary of the invention
[0006] In order to solve the above problems, the present invention proposes a panoramic image stitching method, device, storage medium, and display method and system.
[0007] The specific plan is as follows:
[0008] A panoramic image stitching method comprises the following steps:
[0009] S1: The left camera and the right camera on the tractor of the articulated vehicle and the left camera and the right camera on the trailer are used to synchronously capture the external images of the vehicle, and the captured images are respectively subjected to top-down transformation and cropped according to the requirements of the stitching area to generate the left front stitching block image, the left rear stitching block image, the right front stitching block image and the right rear stitching block image, and the lane line feature information in each image is extracted; the rotation angle is initially set to 0;
[0010] S2: constructing a vehicle coordinate system according to the extracted lane line feature information, and fitting the lane lines in the left front splicing block image, the left rear splicing block image, the right front splicing block image, and the right rear splicing block image respectively in the vehicle coordinate system;
[0011] S3: Determine whether the lane lines in the left front mosaic block image and the left rear mosaic block image or the lane lines in the right front mosaic block image and the right rear mosaic block image can be fitted into a curve. If so, proceed to S5; otherwise, proceed to S4;
[0012] S4: in the vehicle coordinate system, according to the left angle between the lane line in the left front mosaic block image and the lane line in the left rear mosaic block image, or calculating the right angle between the lane line in the right front mosaic block image and the lane line in the right rear mosaic block image, rotate the left rear mosaic block image and the right rear mosaic block image according to the size and direction of the left angle or the right angle, and update the rotation angle to the corresponding angle during the rotation, and return to S3;
[0013] S5: Calculate the rotation vector and the rotation angle according to the conventional stitching parameters and the rotation angle of the articulated vehicle in the straight-ahead state; correct the position of the left rear stitching block image, the right rear stitching block image, the rear stitching block image acquired and processed by the rear camera set on the trailer, and the trailer vehicle model in the vehicle coordinate system according to the rotation angle; and stitch the images in combination with the left front stitching block image, the right front stitching block image, and the front stitching block image acquired and processed by the front camera set on the tractor to form a panoramic image.
[0014] Furthermore, the lane line feature information is the lane line coordinate points, which are extracted through a random sampling consensus algorithm.
[0015] Furthermore, the vehicle coordinate system is a rectangular coordinate system with the left front corner of the vehicle as the origin of the vehicle coordinate system, the vehicle forward direction as the vertical coordinate, and the direction parallel to the front of the vehicle to the right as the horizontal coordinate.
[0016] A panoramic image stitching terminal device comprises a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned method in an embodiment of the present invention when executing the computer program.
[0017] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method described above in an embodiment of the present invention are implemented.
[0018] A panoramic image stitching and display method comprises: displaying a vehicle model corresponding to the articulated vehicle corrected according to the method of an embodiment of the present invention and a stitched panoramic image through a display screen installed in the articulated vehicle.
[0019] A panoramic image stitching display system comprises a front camera, a left camera and a right camera arranged on a tractor in an articulated vehicle, a rear camera, a left camera and a right camera arranged on a trailer in the articulated vehicle, a panoramic image stitching terminal device and a display screen installed in the articulated vehicle; the six cameras collect external image information of the articulated vehicle and send it to the panoramic image stitching terminal device; the panoramic image stitching terminal device stitches the images collected by the six cameras into a panoramic image according to the method described in an embodiment of the present invention, calibrates a vehicle model of the articulated vehicle, and then sends the vehicle model and the panoramic image to the display screen for display.
[0020] The present invention adopts the above technical solution, mainly using the left and right cameras installed in the panoramic surround view system to collect the left and right road scene images during the vehicle driving process, and through computer vision and image processing technology, analyze and extract the lane line feature information in the left and right road images in real time, and realize the dynamic splicing of the image at the hinge through lane line curve fitting. The present invention has the advantages of simple implementation, high image splicing gap accuracy, forward-looking, high real-time performance, strong practicality, stability and reliability, no need for additional accessories, and good application value and economic benefits. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 Shown is a flow chart of Embodiment 1 of the present invention.
[0022] Figure 2 FIG. 1 is a schematic diagram of a vehicle coordinate system in Embodiment 1 of the present invention.
[0023] Figure 3 A schematic diagram of six splicing areas in Embodiment 1 of the present invention is shown.
[0024] Figure 4 The figure shows a schematic diagram of a splicing block image obtained when the articulated vehicle turns in the first embodiment of the present invention.
[0025] Figure 5 The figure shows a schematic diagram of the positions of the cameras installed on the articulated vehicle in the fourth embodiment of the present invention. DETAILED DESCRIPTION
[0026] To further illustrate various embodiments, the present invention provides drawings. These drawings are part of the disclosure of the present invention, which are mainly used to illustrate the embodiments and can be used in conjunction with the relevant descriptions in the specification to explain the operating principles of the embodiments. With reference to these contents, ordinary technicians in this field should be able to understand other possible implementations and advantages of the present invention.
[0027] The present invention will now be further described with reference to the accompanying drawings and specific implementation methods.
[0028] Embodiment 1:
[0029] The embodiment of the present invention provides a panoramic image stitching method, such as Figure 1 As shown, the method comprises the following steps:
[0030] S1: The left camera and the right camera on the tractor of the articulated vehicle and the left camera and the right camera on the trailer are used to synchronously capture the external images of the vehicle, and the captured images are respectively subjected to top-down transformation and cropped according to the requirements of the stitching area to generate the left front stitching block image, the left rear stitching block image, the right front stitching block image and the right rear stitching block image, and the lane line feature information in each image is extracted; the rotation angle is initially set to 0.
[0031] In this embodiment, the lane line feature information is set as the lane line coordinate points, which are extracted by a random sample consensus (RANSAC) algorithm.
[0032] S2: construct a vehicle coordinate system according to the extracted lane line feature information, and fit the lane lines in the left front splicing block image, the left rear splicing block image, the right front splicing block image, and the right rear splicing block image respectively in the vehicle coordinate system.
[0033] In this embodiment, the vehicle coordinate system is a rectangular coordinate system with the left front corner of the vehicle as the origin of the vehicle coordinate system (i.e., the intersection of the X-coordinate and the Y-axis coordinate), the vehicle forward direction as the ordinate (Y-axis), and the direction parallel to the front of the vehicle to the right as the abscissa (X-axis). Figure 2 shown.
[0034] The lane line fitting is to connect the lane line coordinate points into a curve. Four lane line curves are generated from the four images. The polynomial equations used for fitting are as follows:
[0035] y1=a n *x n +a n-1 *x n-1 +...a1*x+a0 (1)
[0036] y2=b n *x n +bn-1 *x n-1 +...b1*x+b0 (2)
[0037] y3=c n *x n +c n-1 *x n-1 +...c1*x+c0 (3)
[0038] y4=d n *x n +d n-1 *x n-1 +...d1*x+d0 (4)
[0039] Where: Formulas (1), (2), (3) and (4) represent the lane curve equations of the left front mosaic image, the left rear mosaic image, the right front mosaic image and the right rear mosaic image respectively, a n …a0, b n …b0, c n ...c0 and d n …d0 represents the constant coefficients of the four polynomial methods, n represents the power of the polynomial equation, and n is generally taken as 3.
[0040] S3: judging whether the lane lines in the left front mosaic block image and the left rear mosaic block image or the lane lines in the right front mosaic block image and the right rear mosaic block image can be fitted into a curve by using a polynomial equation; if so, proceeding to S5; otherwise, proceeding to S4;
[0041] It is sufficient to determine one of the left lane line and the right lane line.
[0042] S4: in the vehicle coordinate system, according to the left angle θ between the lane line in the left front mosaic block image and the lane line in the left rear mosaic block image, or calculating the right angle α between the lane line in the right front mosaic block image and the lane line in the right rear mosaic block image, rotate the left rear mosaic block image and the right rear mosaic block image according to the size and direction of the left angle θ or the right angle α, and update the rotation angle to the corresponding angle during the rotation, and return to S3;
[0043] The standard for selecting the left angle θ or the right angle α is to usually select the angle corresponding to the turning side. For example, if turning to the left, the left angle θ is selected.
[0044] S5: Calculate the rotation vector and the rotation angle β according to the conventional stitching parameters and rotation angles of the articulated vehicle in the straight-ahead state; correct the position of the left rear stitching block image, the right rear stitching block image, the rear stitching block image acquired and processed by the rear camera set on the trailer, and the trailer vehicle model in the vehicle coordinate system according to the rotation angle β; and perform image stitching in combination with the left front stitching block image, the right front stitching block image, and the front stitching block image acquired and processed by the front camera set on the tractor to form a panoramic image.
[0045] In this embodiment, after the vehicle is fully assembled and rolled off the assembly line, it enters a panoramic calibration site and is calibrated according to the vehicle form when it is moving straight (i.e., when the rotation angle β between the tractor and the trailer is 0). After calibration, conventional stitching parameters for the vehicle moving straight are generated and stored.
[0046] The six stitching block images are generated by cutting the images according to the stitching area requirements. The six stitching areas are as follows: Figure 3 shown.
[0047] When the articulated truck turns, the relative geometric position of the tractor and trailer changes. The images of the spliced blocks captured by the six cameras are as follows: Figure 4 As shown, before the dynamic stitching correction processing in this embodiment is performed, according to the conventional stitching method when the vehicle is moving straight, the six stitching block images are filled into the conventional stitching block positions when the vehicle is moving straight, and the stitching blocks are staggered and overlapped. At this time, the 360° panoramic view image formed by stitching the six stitching block images is misaligned and incomplete. After adopting the method of this embodiment, the stitching image corresponding to the trailer is rotated, avoiding the situation of stitching block staggering and stitching block overlap, and generating a complete 360° panoramic view image.
[0048] The first embodiment of the present invention has the following beneficial effects:
[0049] 1. It can sense the lane line feature information of the road surface on which the vehicle is traveling in real time, calculate the rotation angle β of the articulated plate in real time, and perform dynamic stitching and correction of the panoramic view system image in real time through the image processing software algorithm without increasing the cost;
[0050] Second: The rotation angle β is calculated by lane line curve fitting, which has high accuracy, is not affected by the age of use, has small image stitching gaps, and has good stitching effect.
[0051] Embodiment 2:
[0052] An embodiment of the present invention provides a panoramic image stitching terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps in the above method embodiment of the first embodiment of the present invention are implemented.
[0053] Further, as an executable solution, the panoramic image stitching terminal device may be a computing device such as a vehicle-mounted computer. The panoramic image stitching terminal device may include, but is not limited to, a processor and a memory. Those skilled in the art may understand that the composition structure of the panoramic image stitching terminal device is merely an example of a panoramic image stitching terminal device and does not constitute a limitation on the panoramic image stitching terminal device. It may include more or less components than the above, or a combination of certain components, or different components. For example, the panoramic image stitching terminal device may also include input and output devices, network access devices, buses, etc., which are not limited in the embodiments of the present invention.
[0054] Further, as an executable solution, the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the panoramic image stitching terminal device, and uses various interfaces and lines to connect various parts of the entire panoramic image stitching terminal device.
[0055] The memory can be used to store the computer program and / or module, and the processor realizes various functions of the panoramic image stitching terminal device by running or executing the computer program and / or module stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system and an application required for at least one function; the data storage area can store data created according to the use of the mobile phone, etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0056] Embodiment three:
[0057] The present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above method in embodiment 1 of the present invention are implemented.
[0058] If the module / unit integrated in the panoramic image stitching terminal device 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 present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device that can carry the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory) and software distribution medium, etc.
[0059] Embodiment 4:
[0060] The present invention also provides a panoramic image stitching display method and display system. The display method is based on the corrected articulated vehicle model and the stitched panoramic image generated in Example 1, and displays the corrected articulated vehicle model and the stitched panoramic image corresponding to the articulated vehicle through a display screen installed in the articulated vehicle.
[0061] The display system includes a front camera, a left camera and a right camera on a tractor in an articulated vehicle, a rear camera, a left camera and a right camera on a trailer in the articulated vehicle, a panoramic image stitching terminal device and a display screen installed in the articulated vehicle; the six cameras collect external image information of the articulated vehicle and send it to the panoramic image stitching terminal device; the panoramic image stitching terminal device stitches the images collected by the six cameras into a panoramic image according to the method described in Example 1, and after correcting the vehicle model, sends the vehicle model and the panoramic image to the display screen for display.
[0062] The camera used in this embodiment is a panoramic surround-view camera, which is installed on all sides of the vehicle, with the optical axis facing the ground and forming a certain angle (such as 45°) with the ground. It can collect real-time images of the vehicle's surroundings, and the camera communicates with the controller in the panoramic image stitching terminal device through a video transmission line (such as LVDS / CVBS communication interface).
[0063] like Figure 5 As shown, the articulated vehicle in this embodiment is composed of a tractor and a trailer. The tractor is equipped with three cameras, namely, a tractor front camera, a tractor left camera and a tractor right camera. After the cameras are fixed, the relative geometric position relationship between the three cameras is fixed during the vehicle driving process. The trailer is equipped with three cameras, namely, a trailer left camera, a trailer right camera and a trailer rear camera. After the cameras are fixed, the relative geometric position relationship between the three cameras is fixed during the vehicle driving process. The tractor and the trailer are connected by an articulated plate shaft. When the vehicle is driving on the road, the tractor and the trailer are dynamically rotating, so the relative geometric position relationship between the three cameras on the tractor and the three cameras on the trailer is also dynamically changing, so the splicing seam between the tractor and the trailer is also dynamically changing. It is necessary to detect the dynamic position relationship between the tractor and the trailer in real time to realize the splicing of the six cameras into a complete 360° panoramic surround image.
[0064] It should be noted that the above-mentioned camera setting is only one implementation method. In actual application, more cameras can be set according to the length of the vehicle, and the images taken by all cameras set on the left side of the tractor are processed and stitched into a left front stitching block image, the images taken by all cameras set on the right side of the tractor are processed and stitched into a right front stitching block image, the images taken by all cameras set on the left side of the trailer are processed and stitched into a left rear stitching block image, and the images taken by all cameras set on the right side of the trailer are processed and stitched into a right rear stitching block image.
[0065] The display screen is a display installed at the center console of the vehicle (usually also called the "central control screen"), which is mainly used to display the generated panoramic image. The display screen communicates with the controller through a video transmission line (such as an LVDS / CVBS communication interface).
[0066] Although the present invention has been specifically shown and described in conjunction with the preferred embodiments, it should be understood by those skilled in the art that various changes may be made to the present invention in form and details without departing from the spirit and scope of the present invention as defined by the appended claims, all of which are within the scope of protection of the present invention.
Claims
1. A panoramic image stitching method, characterized in that: The following steps are involved: S1: The left camera and the right camera on the tractor of the articulated vehicle and the left camera and the right camera on the trailer are used to synchronously capture the external images of the vehicle, and the captured images are respectively subjected to top-down transformation and cropped according to the requirements of the stitching area to generate the left front stitching block image, the left rear stitching block image, the right front stitching block image and the right rear stitching block image, and the lane line feature information in each image is extracted; the rotation angle is initially set to 0; S2: constructing a vehicle coordinate system according to the extracted lane line feature information, and fitting the lane lines in the left front splicing block image, the left rear splicing block image, the right front splicing block image, and the right rear splicing block image respectively in the vehicle coordinate system; S3: Determine whether the lane lines in the left front mosaic block image and the left rear mosaic block image or the lane lines in the right front mosaic block image and the right rear mosaic block image can be fitted into a curve. If so, proceed to S5; Otherwise, go to S4; S4: in the vehicle coordinate system, according to the left angle between the lane line in the left front mosaic block image and the lane line in the left rear mosaic block image, or calculating the right angle between the lane line in the right front mosaic block image and the lane line in the right rear mosaic block image, rotate the left rear mosaic block image and the right rear mosaic block image according to the size and direction of the left angle or the right angle, and update the rotation angle to the corresponding angle during the rotation, and return to S3; S5: Calculate the rotation vector and the rotation angle according to the conventional stitching parameters and the rotation angle of the articulated vehicle in the straight-ahead state; correct the position of the left rear stitching block image, the right rear stitching block image, the rear stitching block image acquired and processed by the rear camera set on the trailer, and the trailer vehicle model in the vehicle coordinate system according to the rotation angle; and stitch the images in combination with the left front stitching block image, the right front stitching block image, and the front stitching block image acquired and processed by the front camera set on the tractor to form a panoramic image.
2. The panoramic image stitching method according to claim 1, characterized in that: The lane line feature information is the lane line coordinate points, which are extracted through a random sampling consensus algorithm.
3. The panoramic image stitching method according to claim 1, characterized in that: The vehicle coordinate system is a rectangular coordinate system with the left front corner of the vehicle as the origin of the vehicle coordinate system, the vehicle's forward direction as the vertical coordinate, and the direction parallel to the front of the vehicle to the right as the horizontal coordinate.
4. A panoramic image stitching terminal device, characterized in that: The method comprises a processor, a memory and a computer program stored in the memory and running on the processor, wherein the processor implements the steps of the method according to any one of claims 1 to 3 when executing the computer program.
5. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 3 are implemented.
6. A panoramic image stitching display method, characterized in that: include: The vehicle model of the articulated vehicle and the spliced panoramic image corrected by the method according to any one of claims 1 to 3 are displayed on a display screen installed in the articulated vehicle.
7. A panoramic image splicing display system, characterized in that: The invention comprises a front camera, a left camera and a right camera arranged on a tractor in an articulated vehicle, a rear camera, a left camera and a right camera arranged on a trailer in the articulated vehicle, a panoramic image stitching terminal device and a display screen installed in the articulated vehicle; the six cameras collect external image information of the articulated vehicle and send it to the panoramic image stitching terminal device; the panoramic image stitching terminal device stitches the images collected by the six cameras into a panoramic image according to any one of the methods described in claims 1 to 3, and after calibrating the vehicle model of the articulated vehicle, sends the vehicle model and the panoramic image to the display screen for display.
