Vehicle image stitching method, device, computer equipment and storage medium

By acquiring and dividing vehicle images in real time and determining the stitching parameters in combination with the average displacement, high-precision and low-cost vehicle image stitching are achieved, solving the problems of low stitching accuracy and high cost in traditional methods.

CN114897686BActive Publication Date: 2025-02-07BEIJING SIGNALWAY TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210438629.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-25
Publication Date
2025-02-07
Estimated Expiration
2042-04-25

AI Technical Summary

Technical Problem

The traditional vehicle image stitching method has problems such as low splicing accuracy and high cost, and it is impossible to obtain the precise characteristics of the vehicle in real time.

Method used

By acquiring the vehicle image of the target vehicle in real time, performing slicing processing to determine the target vehicle image, calculating the average displacement between the target vehicle image and the historical vehicle image at the previous moment, determining the stitching starting point and length based on this displacement, and according to the vertical Displacement for image stitching.

Benefits of technology

It improves the real-time and accuracy of vehicle image stitching, and can accurately splice the vehicle when it is not straight-line, reducing costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114897686B_ABST
    Figure CN114897686B_ABST
Patent Text Reader

Abstract

The present application relates to a vehicle image stitching method, device, computer equipment and storage medium. The method includes: acquiring a vehicle image of a target vehicle in real time; obtaining a target vehicle image after segmenting the vehicle image; determining a first average displacement between the target vehicle image and a historical vehicle image at a previous moment; the first average displacement includes a first horizontal displacement and a first vertical displacement; determining a first stitching starting point and a first stitching length of the target vehicle image based on the first horizontal displacement and the image width of the target vehicle image; starting from the first stitching starting point in the target vehicle image, intercepting a first image area with a length of the first stitching length; stitching the first image area with the vehicle stitching image obtained by stitching at the previous moment according to the first vertical displacement to obtain a new vehicle stitching image. The use of this method can improve the real-time performance and accuracy of vehicle image stitching.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing, and in particular to a vehicle image stitching method, device, computer equipment and storage medium. Background Art

[0002] With the cancellation of provincial border toll stations, the Ministry of Transport stipulates that trucks should be charged by weight instead of by vehicle type / axle number. There are more and more highway drivers who evade fees by taking advantage of the inconsistency between the vehicle type / axle number of the passing medium and the actual vehicle type / axle number. Traditional toll stations mainly charge vehicles by analyzing the head of the vehicle, which can no longer meet the actual needs. Among the existing vehicle supervision methods, there are mainly two ways. One is to set up multiple cameras at multiple locations in the lane and splice the images taken by multiple cameras. Due to the inevitable imaging differences between cameras, this method has the defects of low splicing accuracy and high cost. The second is to install a close-up camera on the side of the lane. The close-up camera is close to the lane and is used to capture dynamic images of the vehicle for splicing. Because the camera is on the side of the lane, it cannot obtain accurate vehicle features, which affects the recognition results. Therefore, both have the problem of low real-time and low accuracy in splicing vehicle images. Summary of the invention

[0003] Based on this, it is necessary to provide a vehicle image stitching method, device, computer equipment, and computer-readable storage medium that can improve the real-time and accuracy of vehicle image stitching in order to address the above technical problems.

[0004] In a first aspect, the present application provides a method for stitching vehicle images. The method comprises:

[0005] Acquire vehicle images of target vehicles in real time;

[0006] After segmenting the vehicle image, a target vehicle image is obtained;

[0007] Determine a first average displacement between the target vehicle image and a historical vehicle image at a previous moment; the first average displacement includes a first horizontal displacement and a first vertical displacement;

[0008] Determine a first stitching starting point and a first stitching length of the target vehicle image based on the first horizontal displacement and the image width of the target vehicle image;

[0009] Starting from the first stitching starting point in the target vehicle image, intercepting a first image area having a length of the first stitching length;

[0010] The first image region is spliced ​​with the vehicle spliced ​​image obtained by splicing at a previous moment according to the first vertical displacement to obtain a new vehicle spliced ​​image.

[0011] In one embodiment, before determining the first average displacement between the target vehicle image and the historical vehicle image at the previous moment, the method further includes:

[0012] Performing feature point detection on the target vehicle image and the historical vehicle image at the previous moment to obtain a vehicle feature map and a historical vehicle feature map;

[0013] Matching feature points between the vehicle feature map and the historical vehicle feature map to obtain a feature point matching result;

[0014] Normalizing the vehicle feature map and the historical vehicle feature map according to the feature point matching result to obtain a target vehicle feature map and a target historical vehicle feature map;

[0015] Determining a first average displacement between the target vehicle image and the historical vehicle image at a previous moment includes:

[0016] A first average displacement between the target vehicle feature map and the target historical vehicle feature map is calculated according to the feature point matching result.

[0017] In one embodiment, determining a first stitching starting point and a first stitching length of the target vehicle image based on the first horizontal displacement and the image width of the target vehicle image comprises:

[0018] Determine a first splicing starting point of the target vehicle image by using a preset starting point formula, the first horizontal displacement, and the image width of the target vehicle image;

[0019] The first horizontal displacement is a first splicing length of the target vehicle image.

[0020] In one embodiment, after acquiring the vehicle image of the target vehicle in real time, the method further includes:

[0021] Recognizing the vehicle image in real time;

[0022] If the vehicle image is a front image of the vehicle collected when the vehicle starts to enter the detection area, start stitching the front image of the vehicle;

[0023] If the vehicle image is a rear image of a complete vehicle rear, then after the rear image is stitched together, a complete vehicle stitching image of the target vehicle is obtained.

[0024] In one embodiment, the vehicle front image includes a first vehicle front image and a second vehicle front image; and starting to stitch the vehicle front images includes:

[0025] After segmenting the first vehicle front image and the second vehicle front image, a first target vehicle front image and a second target vehicle front image are obtained;

[0026] Determine a second average displacement between the first target vehicle front image and the second target vehicle front image; the second average displacement includes a second horizontal displacement and a second vertical displacement;

[0027] Determine a second stitching starting point and a second stitching length of the second target vehicle front image based on the second horizontal displacement and the image width of the second target vehicle front image;

[0028] Starting from the second stitching starting point in the second target vehicle head image, a second image area having a length of the second stitching length is intercepted;

[0029] splicing the second image area with the first target vehicle front image according to the second vertical displacement to obtain a first vehicle splicing image;

[0030] In one embodiment, the method further comprises:

[0031] Recognizing the complete vehicle splicing image to obtain a recognition result;

[0032] Determining the vehicle type corresponding to the complete vehicle stitching image based on the recognition result;

[0033] Charging information is determined based on the vehicle type.

[0034] In one embodiment, after stitching the first image area with the vehicle stitching image stitched at the last moment according to the first vertical displacement, the method further includes:

[0035] Determine an overlapping area between the first image area and the vehicle stitching image obtained by stitching at a previous moment;

[0036] Acquire a first pixel value of the overlapped area in the first image area and a second pixel value of the overlapped area in the vehicle stitching image obtained by stitching at the last moment;

[0037] Calculating an average pixel value of the first pixel value and the second pixel value;

[0038] The average pixel value is used as the pixel value of the overlapping area.

[0039] In a second aspect, the present application also provides a vehicle image stitching device. The device comprises:

[0040] An acquisition module, used for acquiring a vehicle image of a target vehicle in real time;

[0041] A segmentation module, used for obtaining a target vehicle image after segmenting the vehicle image;

[0042] A first determination module is used to determine a first average displacement between the target vehicle image and the historical vehicle image at a previous moment; the first average displacement includes a first horizontal displacement and a first vertical displacement;

[0043] A second determining module, configured to determine a first splicing starting point and a first splicing length of the target vehicle image based on the first horizontal displacement and an image width of the target vehicle image;

[0044] A cutting module, configured to cut a first image area having a length of the first cutting length from the first cutting starting point in the target vehicle image;

[0045] A stitching module is used to stitch the first image area with the vehicle stitching image stitched at a previous moment according to the first vertical displacement to obtain a new vehicle stitching image.

[0046] In one of the embodiments, the first determination module is further used to perform feature point detection on the target vehicle image and the historical vehicle image at the previous moment to obtain a vehicle feature map and a historical vehicle feature map; match the feature points between the vehicle feature map and the historical vehicle feature map to obtain a feature point matching result; normalize the vehicle feature map and the historical vehicle feature map based on the feature point matching result to obtain a target vehicle feature map and a target historical vehicle feature map; and calculate a first average displacement between the target vehicle feature map and the target historical vehicle feature map based on the feature point matching result.

[0047] In one of the embodiments, the second determination module is further used to determine a first splicing starting point of the target vehicle image by using a preset starting point formula, the first horizontal displacement and the image width of the target vehicle image; the first horizontal displacement is a first splicing length of the target vehicle image.

[0048] In one embodiment, the device further comprises:

[0049] The recognition module is used to recognize the vehicle image in real time; if the vehicle image is a front image collected when entering the detection area, the front image is started to be spliced; if the vehicle image is a rear image of a complete rear of the vehicle, after completing the splicing of the rear image, a complete vehicle spliced ​​image of the target vehicle is obtained.

[0050] In one embodiment, the vehicle front image includes a first vehicle front image and a second vehicle front image; the vehicle front images are started to be spliced, and the splicing module is further used to obtain a first target vehicle front image and a second target vehicle front image after segmenting the first vehicle front image and the second vehicle front image; determine a second average displacement between the first target vehicle front image and the second target vehicle front image; the second average displacement includes a second horizontal displacement and a second vertical displacement; determine a second splicing starting point and a second splicing length of the second target vehicle front image based on the second horizontal displacement and the image width of the second target vehicle front image; start from the second splicing starting point in the second target vehicle front image and intercept a second image area with a length of the second splicing length; splice the second image area with the first target vehicle front image according to the second vertical displacement to obtain a first vehicle splicing image;

[0051] In one embodiment, the device further comprises:

[0052] The third determination module is used to identify the complete vehicle splicing image to obtain a recognition result; determine the vehicle type corresponding to the complete vehicle splicing image based on the recognition result; and determine charging information according to the vehicle type.

[0053] In one embodiment, the device further comprises:

[0054] The overlap processing module is used to determine the overlap area between the first image area and the vehicle stitching image obtained by stitching at the previous moment; obtain the first pixel value of the overlap area in the first image area and the second pixel value of the overlap area in the vehicle stitching image obtained by stitching at the previous moment; calculate the average pixel value of the first pixel value and the second pixel value; and use the average pixel value as the pixel value of the overlap area.

[0055] In a third aspect, the present application further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.

[0056] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the above method when executed by a processor.

[0057] In a fifth aspect, the present application further provides a computer program product, wherein the computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.

[0058] The above-mentioned vehicle image stitching method, device, computer equipment and storage medium obtain the vehicle image of the target vehicle in real time; obtain the target vehicle image after segmenting the vehicle image; determine the first average displacement between the target vehicle image and the historical vehicle image at the previous moment; the first average displacement includes a first horizontal displacement and a first vertical displacement; determine the first stitching starting point and the first stitching length of the target vehicle image based on the first horizontal displacement and the image width of the target vehicle image; start from the first stitching starting point in the target vehicle image and intercept the first image area with the length of the first stitching length; stitch the first image area with the vehicle stitching image obtained by stitching at the previous moment according to the first vertical displacement to obtain a new vehicle stitching image. The real-time segmentation, interception and stitching processing of the acquired vehicle image is realized, which effectively improves the stitching efficiency of the vehicle image. In addition, the image is stitched according to the determined first horizontal displacement and first vertical displacement, which improves the precision of the vehicle image stitching in the horizontal and vertical directions, so that even if the vehicle is not traveling in a straight line, its vehicle image can be accurately stitched. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] Figure 1 A diagram showing an application environment of a vehicle image stitching method in one embodiment;

[0060] Figure 2 is a schematic flow chart of a method for stitching vehicle images in one embodiment;

[0061] Figure 3 This is an application scenario diagram of a vehicle image stitching method in one embodiment;

[0062] Figure 4 A schematic diagram of a process of performing the first vehicle image stitching step in one embodiment;

[0063] Figure 5 A schematic diagram of a flow chart of overlapping area processing steps in one embodiment;

[0064] Figure 6 is a structural block diagram of a vehicle image stitching device in one embodiment;

[0065] Figure 7 is a structural block diagram of a vehicle image stitching device in another embodiment;

[0066] Figure 8 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0067] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0068] The vehicle image stitching method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown, the terminal 102 communicates with the server 104 through a network. The data storage system can store data that the server 104 needs to process. The data storage system can be integrated on the server 104, or placed on the cloud or other network servers.

[0069] The terminal 102 acquires a vehicle image of a target vehicle in real time; after segmenting the vehicle image, the terminal 102 obtains the target vehicle image; the terminal 102 determines a first average displacement between the target vehicle image and a historical vehicle image at a previous moment; the first average displacement includes a first horizontal displacement and a first vertical displacement; the terminal 102 determines a first splicing starting point and a first splicing length of the target vehicle image based on the first horizontal displacement and an image width of the target vehicle image; the terminal 102 starts from the first splicing starting point in the target vehicle image and intercepts a first image area with a length of the first splicing length; the terminal 102 splices the first image area with the vehicle splicing image spliced ​​at a previous moment according to the first vertical displacement to obtain a new vehicle splicing image.

[0070] The terminal 102 may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, IoT devices, and portable wearable devices. The IoT devices may be smart cameras, smart video cameras, all-in-one machines, smart speakers, smart TVs, smart air conditioners, smart vehicle-mounted devices, etc. The portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc. The server 104 may be implemented as an independent server or a server cluster consisting of multiple servers.

[0071] In one embodiment, Figure 2 As shown, a vehicle image stitching method is provided, and the method is applied to Figure 1 The terminal 102 in the example is used as an example to illustrate, and the following steps are included:

[0072] S202, acquiring a vehicle image of the target vehicle in real time.

[0073] The target vehicle may refer to a vehicle within the detection area of ​​the terminal, for example, the target vehicle may be a vehicle within the capture area of ​​the smart camera. The vehicle image may refer to an image containing part or all of the target vehicle.

[0074] For example, Figure 3The following is an application scenario diagram of a method for splicing vehicle images in an embodiment; as shown in the figure, the terminal can be an all-in-one machine, which includes a front-end sensor and an intelligent processing unit. The front-end sensor can collect vehicle side images at a speed of 50 to 120 frames per second and transmit them to the intelligent processing unit. The intelligent processing unit processes more than 120 frames of vehicle side images per second to achieve the purpose of real-time feature extraction and splicing.

[0075] The integrated machine can be installed on the L-bar at the entrance / exit of the ramp area of ​​the highway service area, such as Figure 3 As shown, the integrated machine is installed perpendicular to the lane, and the installation position is 3 to 4.5 meters away from the detectable (covered) lane, and the height is 5 to 7 meters from the lane ground. The center line of the integrated machine's field of view is perpendicular to the direction of vehicle travel in the lane, the downward viewing angle is 40 to 45 degrees, the left and right field of view angle is 20 degrees, and the upper and lower field of view angle is 150 degrees. After the equipment is installed, it is necessary to use a 1-meter-long ruler to calibrate the scene. Place this ruler at any three positions within the detectable lane and 20 to 200 cm away from the edge of the lane, and mark the number of pixels corresponding to the length of 1 meter in the system. In the imaging screen of the vehicle image obtained by the integrated machine, the picture height of the upper edge of the vehicle image is 0%, and the picture height of the lower edge of the vehicle image is 100%. The picture height of the upper edge of the lane corresponding to the detection area in the vehicle image is between 30% and 60%, and the picture height of the bottom edge of the lane is between 80% and 100%.

[0076] Specifically, the terminal may start acquiring images in real time in response to an instruction to acquire vehicle images, and when a target vehicle enters a detection area, acquire a vehicle image of the target vehicle in real time.

[0077] In one embodiment, after S202, the terminal can identify the vehicle image in real time; if the vehicle image is a front image collected when entering the detection area, start splicing the front image; if the vehicle image is a complete rear image of the vehicle, after completing the splicing of the rear image, a complete vehicle spliced ​​image of the target vehicle is obtained.

[0078] The detection area may refer to an area that can be detected by the terminal. For example, the detection area may be Figure 3 The integrated machine is perpendicular to the lane, and the left and right field of view angle is 20 degrees, and the upper and lower field of view angle is 150 degrees. The front image can be an image containing part or all of the front of the target vehicle. The rear image can be an image containing part or all of the rear of the target vehicle. The vehicle splicing image can be a spliced ​​vehicle image.

[0079] S204, after segmenting the vehicle image, a target vehicle image is obtained.

[0080] The target vehicle image may be an image obtained by segmenting the vehicle image.

[0081] Specifically, the terminal may segment the vehicle image based on a preset reserved area and a preset segmentation ratio to obtain a target vehicle image. Alternatively, the terminal may segment the vehicle image in response to a selection operation on the reserved area to obtain a target vehicle image, so as to retain the portion of the vehicle image that is close to the terminal.

[0082] The preset reserved area may refer to a preset image area for intercepting the vehicle image. For example, the preset reserved area may be the middle of the vehicle image and occupy 1 / 3 of the total area of ​​the vehicle image. The preset segmentation ratio may refer to a preset ratio of the image width to the image height. For example, the preset segmentation ratio may be 1:3.

[0083] In one embodiment, segmenting the vehicle image based on the preset reserved area and the preset segmentation ratio includes intercepting the preset reserved area corresponding to the vehicle image to obtain a reserved vehicle image, and then adjusting the reserved vehicle image according to the preset segmentation ratio to obtain a target vehicle image. The reserved vehicle image may refer to an image corresponding to the preset reserved area in the vehicle image.

[0084] For example, the preset reserved area is the middle area that occupies 1 / 4 of the total area of ​​the vehicle image, and the preset segmentation ratio is 1:4. The terminal can reserve the middle area of ​​the vehicle image that occupies 1 / 4 of the total area of ​​the vehicle image, and then adjust the vehicle image according to the aspect ratio of 1:4.

[0085] S206, determining a first average displacement between the target vehicle image and the historical vehicle image at the previous moment; the first average displacement includes a first horizontal displacement and a first vertical displacement.

[0086] Among them, the previous moment may refer to the moment corresponding to the previous historical vehicle image relative to the target vehicle image. The historical vehicle image may refer to the vehicle image at the moment before the target vehicle image. The first average displacement includes a first horizontal displacement and a first vertical displacement. The first horizontal displacement may refer to the horizontal displacement between the matching feature points in the target vehicle image and the historical vehicle image at the previous moment. The first vertical displacement refers to the vertical displacement between the matching feature points in the target vehicle image and the historical vehicle image at the previous moment.

[0087] In one embodiment, before S206, the terminal may perform feature point detection on the target vehicle image and the historical vehicle image at the previous moment to obtain a vehicle feature map and a historical vehicle feature map; match the feature points between the vehicle feature map and the historical vehicle feature map to obtain a feature point matching result; normalize the vehicle feature map and the historical vehicle feature map based on the feature point matching result to obtain a target vehicle feature map and a target historical vehicle feature map; and then the terminal calculates a first average displacement between the target vehicle feature map and the target historical vehicle feature map based on the feature point matching result.

[0088] Among them, the feature point may refer to a point with features in the image, for example, the feature point may be a point on the tire of the vehicle in the target vehicle image. The algorithm that can be used for feature point detection is the Scale Invariant Feature Transform (SIFT) algorithm, etc. The vehicle feature map may refer to the feature map generated after the target vehicle image is subjected to feature point detection. The historical vehicle feature map may refer to the feature map generated after the feature point detection of the historical vehicle image at the previous moment. The feature point matching result may refer to the matching result generated after the vehicle feature map and the historical vehicle feature map are subjected to feature point matching. Feature point matching may refer to the process of finding corresponding feature points in the vehicle feature map and the historical vehicle feature map. Normalization may refer to the process of adjusting the distance of the same side of the vehicle in the vehicle feature map and the historical vehicle feature map from the terminal to be consistent. The target vehicle feature map may refer to the vehicle feature map subjected to normalization. The target historical vehicle feature map may refer to the historical vehicle feature map subjected to normalization.

[0089] S208 , determining a first splicing starting point and a first splicing length of the target vehicle image based on the first horizontal displacement and the image width of the target vehicle image.

[0090] The image width may refer to the physical width of the image or the number of pixel columns of the image. For example, if the resolution of image A is 4096*2160, the image width of image A may be 4096. The first splicing starting point may refer to the starting pixel column number of the target vehicle image. The first splicing length may refer to the pixel column number of the target vehicle image for splicing. For example, if the image width of image A is 1080, that is, the number of pixel columns of image A is 1080, the range of the first splicing starting point may be 0 to 1080. The range of the first splicing length may be 0 to 1080.

[0091] Specifically, the terminal may determine a first splicing starting point of the target vehicle image by using a preset starting point formula, a first horizontal displacement, and an image width of the target vehicle image; the first horizontal displacement is a first splicing length of the target vehicle image.

[0092] The preset starting point formula may refer to a formula for calculating the first splicing starting point of the target vehicle image. The preset starting point formula may be Among them, ssx is the first splicing starting point, w is the image width, and dmx is the first horizontal displacement.

[0093] In one embodiment, when the first average displacement is 0, it indicates that the vehicle in the vehicle image is stationary, or when the first average displacement is less than 0, it indicates that the vehicle in the vehicle image is in a reversing state, then the subsequent step of stitching the vehicle images is not performed, and a new vehicle image is acquired for stitching.

[0094] S210 , starting from a first stitching starting point in the target vehicle image, intercepting a first image region having a length equal to a first stitching length.

[0095] The first image region may refer to an image region used for splicing with a vehicle splicing image obtained by splicing at a previous moment.

[0096] S212: splicing the first image region with the vehicle splicing image obtained by splicing at the last moment according to the first vertical displacement to obtain a new vehicle splicing image.

[0097] Specifically, after the terminal moves the first image area according to the first vertical displacement, it splices the first image area with the vehicle splicing image obtained by splicing at the previous moment to obtain a new vehicle splicing image, sets the pixels corresponding to the missing image portion of the vehicle splicing image to the preset pixel value, removes the excess image portion of the vehicle splicing image, and obtains the final vehicle splicing image. The preset pixel value may be a pre-set pixel value, for example, the preset pixel value may be 0.

[0098] For example, when the first vertical displacement is greater than 0, it means that the vehicle moves upward, and the first image area is moved downward by the first vertical displacement relative to the vehicle stitching image obtained by stitching at the previous moment; when the first vertical displacement is less than 0, it means that the vehicle moves downward, and the first image area is moved upward by the first vertical displacement relative to the vehicle stitching image obtained by stitching at the previous moment; when the first vertical displacement is equal to 0, it means that the vehicle has not moved in the vertical direction, and the first image area is directly stitched with the vehicle stitching image obtained by stitching at the previous moment.

[0099] In one embodiment, if the vehicle image is a complete rear image of the vehicle, the corresponding first splicing starting point is The first stitching length is w-1. Starting from the first stitching starting point in the target vehicle image, a first image area with a length of the first stitching length is intercepted, and the first image area is stitched with the vehicle stitching image stitched at the previous moment according to the first vertical displacement to obtain a new vehicle stitching image.

[0100] In one embodiment, after S212, the terminal determines the overlapping area between the first image area and the vehicle stitched image obtained by stitching at the previous moment; obtains the first pixel value of the overlapping area in the first image area, and the second pixel value of the overlapping area in the vehicle stitched image obtained by stitching at the previous moment; calculates the average pixel value of the first pixel value and the second pixel value; and uses the average pixel value as the pixel value of the overlapping area, that is, uses the average pixel value as the pixel value of the overlapping area in the new vehicle stitched image.

[0101] In one embodiment, after S212, the terminal may identify the complete vehicle stitching image to obtain a recognition result; determine the vehicle type corresponding to the complete vehicle stitching image based on the recognition result; and determine the charging information according to the vehicle type.

[0102] The recognition result may be an image of the vehicle in the vehicle stitching image. The vehicle type may refer to the vehicle type corresponding to the vehicle image, for example, the vehicle type may be 1 to 4 passenger cars, 1 to 6 trucks, 1 to 6 special operation vehicles, etc. The charging information may refer to charging related information, and the charging information may include charging amount, charging time, etc.

[0103] For example, the terminal identifies the complete vehicle stitching image B and obtains the identification result of a truck with 5 axles. According to the corresponding transportation charging standards, the corresponding vehicle type is determined as a Class 5 truck based on the vehicle, and then the corresponding charging information is determined.

[0104] In the above-mentioned vehicle image stitching method, the vehicle image of the target vehicle is acquired in real time; after segmenting the vehicle image, the target vehicle image is obtained; the first average displacement between the target vehicle image and the historical vehicle image at the previous moment is determined; the first average displacement includes a first horizontal displacement and a first vertical displacement; the first stitching starting point and the first stitching length of the target vehicle image are determined based on the first horizontal displacement and the image width of the target vehicle image; starting from the first stitching starting point in the target vehicle image, a first image area with a length of the first stitching length is intercepted; according to the first vertical displacement, the first image area is stitched with the vehicle stitching image obtained by stitching at the previous moment to obtain a new vehicle stitching image. The real-time segmentation, interception and stitching processing of the acquired vehicle image is realized, which effectively improves the stitching efficiency of the vehicle image. In addition, the image is stitched according to the determined first horizontal displacement and first vertical displacement, which improves the precision of the vehicle image stitching in the horizontal and vertical directions, so that even if the vehicle is not traveling in a straight line, its vehicle image can be accurately stitched.

[0105] In one embodiment, Figure 4 As shown, the steps for stitching the first vehicle image include:

[0106] S402, after segmenting the first vehicle front image and the second vehicle front image, a first target vehicle front image and a second target vehicle front image are obtained.

[0107] The vehicle front image includes a first vehicle front image and a second vehicle front image. The first vehicle front image may refer to the first image containing the vehicle front, and the second vehicle front image may refer to the second image containing the vehicle front. The first target vehicle front image may refer to an image obtained by segmenting the first vehicle front image. The second target vehicle front image may refer to an image obtained by segmenting the second vehicle front image.

[0108] In one embodiment, the terminal may segment the first vehicle front image and the second vehicle front image based on a preset reserved area and a preset segmentation ratio to obtain a first target vehicle front image and a second target vehicle front image. Alternatively, the terminal may segment the first vehicle front image and the second vehicle front image in response to a selection operation on the reserved area to obtain a first target vehicle front image and a second target vehicle front image.

[0109] In one embodiment, segmenting the first vehicle front image and the second vehicle front image based on a preset reserved area and a preset segmentation ratio includes: intercepting the preset reserved area corresponding to the first vehicle front image and the second vehicle front image to obtain the retained vehicle images corresponding to the first vehicle front image and the second vehicle front image, and then adjusting the retained vehicle images according to the preset segmentation ratio to obtain the first target vehicle front image and the second target vehicle front image.

[0110] S404, determining a second average displacement between the first target vehicle front image and the second target vehicle front image; the second average displacement includes a second horizontal displacement and a second vertical displacement.

[0111] The second average displacement includes a second horizontal displacement and a second vertical displacement. The second horizontal displacement may be a horizontal displacement between matching feature points in the second target vehicle front image and the first target vehicle front image. The second vertical displacement may be a vertical displacement between matching feature points in the second target vehicle front image and the first target vehicle front image.

[0112] S406 , determining a second stitching starting point and a second stitching length of the second target vehicle front image based on the second horizontal displacement and the image width of the second target vehicle front image.

[0113] The second splicing starting point may refer to the starting pixel column number of the second target vehicle front image. The second splicing length may refer to the pixel column number of the second target vehicle front image for splicing. For example, the image width of the second target vehicle front image A is 1080, that is, the pixel column number of the second target vehicle front image A is 1080, and the first splicing starting point may range from 0 to 1080. The first splicing length may range from 0 to 1080.

[0114] Specifically, the terminal may determine the second stitching starting point of the second target vehicle front image by using a preset starting point formula, a second horizontal displacement and an image width of the second target vehicle front image; the second horizontal displacement is a second stitching length of the second target vehicle front image.

[0115] S408 , starting from the second stitching starting point in the second target vehicle head image, intercepting a second image area having a length of the second stitching length.

[0116] The second image area may refer to an image area used for splicing with the first target vehicle head image.

[0117] S410: splice the second image area with the first target vehicle front image according to the second vertical displacement to obtain a first vehicle spliced ​​image.

[0118] Specifically, after the terminal moves the second image area according to the second vertical displacement, it splices the second image area with the first target vehicle front image to obtain the first vehicle spliced ​​image, sets the pixels corresponding to the missing image portion of the vehicle spliced ​​image to preset pixel values, removes the excess image portion of the vehicle spliced ​​image, and obtains the final first vehicle spliced ​​image.

[0119] In the present embodiment, after segmenting the first vehicle front image and the second vehicle front image, a first target vehicle front image and a second target vehicle front image are obtained; a second average displacement between the first target vehicle front image and the second target vehicle front image is determined; the second average displacement includes a second horizontal displacement and a second vertical displacement; a second stitching starting point and a second stitching length of the second target vehicle front image are determined based on the second horizontal displacement and the image width of the second target vehicle front image; starting from the second stitching starting point in the second target vehicle front image, a second image area with a length of the second stitching length is intercepted; the second image area is stitched with the first target vehicle front image according to the second vertical displacement to obtain a first vehicle stitching image; the stitching work of the first vehicle stitching image is realized, which makes good preparations for the subsequent vehicle image stitching based on the first vehicle stitching image.

[0120] In one embodiment, Figure 5 As shown, the overlapping area processing steps include:

[0121] S502: Determine an overlapping area between the first image area and the vehicle stitching image obtained by stitching at the last moment.

[0122] The overlapping area may refer to an image area where the first image area and the vehicle stitching image obtained by stitching at the last moment have repeated images.

[0123] Specifically, the terminal may perform image comparison between the first image area and the vehicle stitched image stitched at the last moment to obtain a comparison result, and determine the overlapped area between the first image area and the vehicle stitched image stitched at the last moment according to the comparison result.

[0124] The comparison result may refer to a feature comparison result between the first image region and the vehicle spliced ​​image spliced ​​at the last moment.

[0125] S504, obtaining a first pixel value of an overlapping area in the first image area and a second pixel value of an overlapping area in a vehicle stitching image stitched at a previous moment.

[0126] The first pixel value may refer to the RGB value of the overlapped area in the first image area. The second pixel value may refer to the RGB value of the overlapped area in the vehicle spliced ​​image obtained by splicing at the last moment.

[0127] S506: Calculate an average pixel value of the first pixel value and the second pixel value.

[0128] The formula for calculating the average pixel value can be:

[0129] S508: Taking the average pixel value as the pixel value of the overlapping area.

[0130] Specifically, the terminal may use the average pixel value as the pixel value of the overlapping area in the new vehicle stitching image.

[0131] In this embodiment, by determining the overlapped area between the first image area and the vehicle stitched image obtained by stitching at the last moment; obtaining the first pixel value of the overlapped area in the first image area and the second pixel value of the overlapped area in the vehicle stitched image obtained by stitching at the last moment; calculating the average pixel value of the first pixel value and the second pixel value; and using the average pixel value as the pixel value of the overlapped area, the pixel fusion of the vehicle stitched image in the overlapped area is achieved, and the stitching accuracy of the vehicle image is further improved.

[0132] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0133] Based on the same inventive concept, the embodiment of the present application also provides a vehicle image stitching device for implementing the vehicle image stitching method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiment of the vehicle image stitching device provided below can refer to the limitations of the vehicle image stitching method above, and will not be repeated here.

[0134] In one embodiment, Figure 6 As shown, a vehicle image stitching device is provided, comprising: an acquisition module 602, a segmentation module 604, a first determination module 606, a second determination module 608, a capture module 610 and a stitching module 612, wherein:

[0135] An acquisition module 602 is used to acquire a vehicle image of a target vehicle in real time;

[0136] A segmentation module 604 is used to obtain a target vehicle image after segmenting the vehicle image;

[0137] A first determination module 606 is used to determine a first average displacement between the target vehicle image and the historical vehicle image at a previous moment; the first average displacement includes a first horizontal displacement and a first vertical displacement;

[0138] A second determination module 608 is used to determine a first splicing starting point and a first splicing length of the target vehicle image based on the first horizontal displacement and the image width of the target vehicle image;

[0139] A capture module 610 is used to capture a first image region having a first splicing length starting from a first splicing starting point in the target vehicle image;

[0140] The stitching module 612 is used to stitch the first image area with the vehicle stitching image stitched at the last moment according to the first vertical displacement to obtain a new vehicle stitching image.

[0141] In one embodiment, the first determination module 606 is also used to perform feature point detection on the target vehicle image and the historical vehicle image at the previous moment to obtain a vehicle feature map and a historical vehicle feature map; match the feature points between the vehicle feature map and the historical vehicle feature map to obtain a feature point matching result; normalize the vehicle feature map and the historical vehicle feature map based on the feature point matching result to obtain a target vehicle feature map and a target historical vehicle feature map; and calculate the first average displacement between the target vehicle feature map and the target historical vehicle feature map based on the feature point matching result.

[0142] In one embodiment, the second determination module 608 is further used to determine the first splicing starting point of the target vehicle image by using a preset starting point formula, a first horizontal displacement and an image width of the target vehicle image; the first horizontal displacement is a first splicing length of the target vehicle image.

[0143] In one embodiment, the front image of the vehicle includes a first front image of the vehicle and a second front image of the vehicle; the front images of the vehicle are started to be spliced, and the splicing module 612 is further used to obtain a first target front image and a second target front image after segmenting the first front image and the second front image; determine a second average displacement between the first target front image and the second target front image; the second average displacement includes a second horizontal displacement and a second vertical displacement; determine a second splicing starting point and a second splicing length of the second target front image based on the second horizontal displacement and the image width of the second target front image; start from the second splicing starting point in the second target front image, and intercept a second image area with a length of the second splicing length; splice the second image area with the first target front image according to the second vertical displacement to obtain the first vehicle splicing image;

[0144] In one embodiment, Figure 7 As shown, the vehicle image stitching device further includes: a recognition module 614, a coincidence processing module 616 and a third determination module 618, wherein:

[0145] The recognition module 614 is used to recognize the vehicle image in real time; if the vehicle image is a front image collected when entering the detection area, the front image is started to be spliced; if the vehicle image is a complete rear image of the vehicle, after completing the splicing of the rear image, a complete vehicle spliced ​​image of the target vehicle is obtained.

[0146] The overlap processing module 616 is used to determine the overlap area between the first image area and the vehicle stitched image obtained by stitching at the last moment; obtain the first pixel value of the overlap area in the first image area and the second pixel value of the overlap area in the vehicle stitched image obtained by stitching at the last moment; calculate the average pixel value of the first pixel value and the second pixel value; and use the average pixel value as the pixel value of the overlap area.

[0147] The third determination module 618 is used to identify the complete vehicle splicing image to obtain a recognition result; determine the vehicle type corresponding to the complete vehicle splicing image based on the recognition result; and determine the charging information according to the vehicle type.

[0148] In the above embodiment, the vehicle image of the target vehicle is acquired in real time; after segmenting the vehicle image, the target vehicle image is obtained; the first average displacement between the target vehicle image and the historical vehicle image at the previous moment is determined; the first average displacement includes a first horizontal displacement and a first vertical displacement; the first splicing starting point and the first splicing length of the target vehicle image are determined based on the first horizontal displacement and the image width of the target vehicle image; starting from the first splicing starting point in the target vehicle image, a first image area with a length of the first splicing length is intercepted; according to the first vertical displacement, the first image area is spliced ​​with the vehicle splicing image obtained by splicing at the previous moment to obtain a new vehicle splicing image. The real-time segmentation, interception and splicing of the acquired vehicle image is realized, which effectively improves the splicing efficiency of the vehicle image. In addition, the image is spliced ​​according to the determined first horizontal displacement and first vertical displacement, which improves the splicing accuracy of the vehicle image in the horizontal and vertical directions, so that even if the vehicle is not traveling in a straight line, its vehicle image can be accurately spliced.

[0149] Each module in the above-mentioned vehicle image stitching device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.

[0150] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 8As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface, the display unit and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a method for splicing vehicle images is implemented. The display unit of the computer device is used to form a visually visible image, and can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse, etc.

[0151] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0152] In one embodiment, a computer device is provided, including a memory and a processor. A computer program is stored in the memory, and the above embodiments are implemented when the processor executes the computer program.

[0153] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the above embodiments are implemented.

[0154] In one embodiment, a computer program product is provided, including a computer program, and the computer program implements the above embodiments when executed by a processor.

[0155] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0156] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0157] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0158] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A vehicle image stitching method, characterized in that: The method comprises: Acquire vehicle images of target vehicles in real time; After segmenting the vehicle image, a target vehicle image is obtained; Performing feature point detection on the target vehicle image and the historical vehicle image at the previous moment to obtain a vehicle feature map and a historical vehicle feature map; matching feature points between the vehicle feature map and the historical vehicle feature map to obtain a feature point matching result; performing normalization processing on the vehicle feature map and the historical vehicle feature map according to the feature point matching result to obtain a target vehicle feature map and a target historical vehicle feature map; Calculating a first average displacement between the target vehicle feature map and the target historical vehicle feature map according to the feature point matching result; the first average displacement includes a first horizontal displacement and a first vertical displacement; Determine a first stitching starting point and a first stitching length of the target vehicle image based on the first horizontal displacement and the image width of the target vehicle image; Starting from the first stitching starting point in the target vehicle image, intercepting a first image area having a length of the first stitching length; The first image region is spliced ​​with the vehicle spliced ​​image obtained by splicing at a previous moment according to the first vertical displacement to obtain a new vehicle spliced ​​image.

2. The method according to claim 1, characterized in that The determining a first stitching starting point and a first stitching length of the target vehicle image based on the first horizontal displacement and the image width of the target vehicle image comprises: Determine a first splicing starting point of the target vehicle image by using a preset starting point formula, the first horizontal displacement, and the image width of the target vehicle image; The first horizontal displacement is a first splicing length of the target vehicle image.

3. The method according to claim 1, characterized in that After acquiring the vehicle image of the target vehicle in real time, the method further includes: Recognizing the vehicle image in real time; If the vehicle image is a front image of the vehicle collected when the vehicle starts to enter the detection area, start stitching the front image of the vehicle; If the vehicle image is a rear image of a complete vehicle rear, then after the rear image is stitched together, a complete vehicle stitching image of the target vehicle is obtained.

4. The method according to claim 3, characterized in that The vehicle front image includes a first vehicle front image and a second vehicle front image; and starting to stitch the vehicle front images includes: After segmenting the first vehicle front image and the second vehicle front image, a first target vehicle front image and a second target vehicle front image are obtained; Determine a second average displacement between the first target vehicle front image and the second target vehicle front image; the second average displacement includes a second horizontal displacement and a second vertical displacement; Determine a second stitching starting point and a second stitching length of the second target vehicle front image based on the second horizontal displacement and the image width of the second target vehicle front image; Starting from the second stitching starting point in the second target vehicle head image, a second image area having a length of the second stitching length is intercepted; The second image area is spliced ​​with the first target vehicle front image according to the second vertical displacement to obtain a first vehicle spliced ​​image.

5. The method according to claim 3, characterized in that: The method further comprises: Recognizing the complete vehicle splicing image to obtain a recognition result; Determining the vehicle type corresponding to the complete vehicle stitching image based on the recognition result; Charging information is determined based on the vehicle type.

6. The method according to any one of claims 1 to 5, characterized in that: After stitching the first image area with the vehicle stitching image stitched at the last moment according to the first vertical displacement, the method further includes: Determine an overlapping area between the first image area and the vehicle stitching image obtained by stitching at a previous moment; Acquire a first pixel value of the overlapped area in the first image area and a second pixel value of the overlapped area in the vehicle stitching image obtained by stitching at the last moment; Calculating an average pixel value of the first pixel value and the second pixel value; The average pixel value is used as the pixel value of the overlapping area.

7. A vehicle image splicing device, characterized in that: The device comprises: An acquisition module, used for acquiring a vehicle image of a target vehicle in real time; A segmentation module, used for obtaining a target vehicle image after segmenting the vehicle image; A first determination module is used to perform feature point detection on the target vehicle image and the historical vehicle image at the previous moment to obtain a vehicle feature map and a historical vehicle feature map; match the feature points between the vehicle feature map and the historical vehicle feature map to obtain a feature point matching result; normalize the vehicle feature map and the historical vehicle feature map according to the feature point matching result to obtain a target vehicle feature map and a target historical vehicle feature map; calculate a first average displacement between the target vehicle feature map and the target historical vehicle feature map according to the feature point matching result; the first average displacement includes a first horizontal displacement and a first vertical displacement; A second determining module, configured to determine a first splicing starting point and a first splicing length of the target vehicle image based on the first horizontal displacement and an image width of the target vehicle image; A cutting module, configured to cut a first image area having a length of the first cutting length from the first cutting starting point in the target vehicle image; A stitching module is used to stitch the first image area with the vehicle stitching image stitched at a previous moment according to the first vertical displacement to obtain a new vehicle stitching image.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, 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 6 are implemented.

10. A computer program product, comprising 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 6 are implemented.

Citation Information

Patent Citations

  • Video image lateral fusion splicing method, electronic equipment and storage medium

    CN112969037A