Image processing method and device, computer device and storage medium

By calculating the error information between the reference image and the initial image, edge extraction and deviation calculation are performed, achieving accurate horizontal correction of moving object images. This solves the problem of inaccurate moving object image processing in existing technologies and improves the accuracy and efficiency of image processing.

CN114820672BActive Publication Date: 2026-04-10SHENZHEN XINLUTONG INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-12
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing image processing methods cannot accurately correct the horizontal alignment of images of moving objects in a timely manner, resulting in low processing accuracy.

Method used

By calculating the error information between the reference image and the initial image, edge extraction of the initial image and edge extraction of the target object are performed. Horizontal correction is then performed using image deviation information to obtain a more accurate target image.

Benefits of technology

It improves the accuracy and efficiency of processing images of moving objects, ensuring the accuracy of moving object recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114820672B_ABST
    Figure CN114820672B_ABST
Patent Text Reader

Abstract

The application relates to an image processing method and device and a computer device. The method comprises the following steps: acquiring an initial image of a moving object and a reference image adjacent to the initial image, calculating an image error between the reference image and the initial image to obtain error information; performing initial image edge extraction on the initial image to obtain initial image edge information, and performing initial object edge extraction based on the error information and the initial image edge information to obtain initial object edge information corresponding to the moving object; performing target object edge extraction based on the initial object edge information to obtain target object edge information corresponding to the moving object; performing image deviation calculation based on the target object edge information to obtain image deviation information corresponding to the initial image, and performing horizontal correction on the initial image by using the image deviation information to obtain a target image corresponding to the initial image. The method can improve the efficiency of image processing.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of computers, and in particular, to an image processing method and device, a computer device, a storage medium, and a computer program product. BACKGROUND

[0002] With the development of the computer industry, motion object recognition devices based on computer technology are widely used, such as the need to recognize the collected images of motion objects. However, in the image collection process, the motion objects in the collected images will have different degrees of tilt, and the images need to be processed for horizontal detection, horizontal correction, etc. The existing image processing method uses the projection value information of the objects in the image to calculate the projection value of the object in different directions by changing the θ angle for correction. However, the existing image processing method can only correct the images of static objects in the application process, and cannot immediately respond to and timely process the collected images of motion objects, resulting in low image processing accuracy. SUMMARY

[0003] Therefore, it is necessary to provide an image processing method, device, computer device, computer readable storage medium, and computer program product that can improve image processing accuracy to solve the above technical problems.

[0004] In a first aspect, the present application provides an image processing method. The method comprises:

[0005] obtaining an initial image of a motion object and a reference image adjacent to the initial image, calculating an image error between the reference image and the initial image to obtain error information;

[0006] performing initial image edge extraction on the initial image to obtain initial image edge information, and performing initial object edge extraction based on the error information and the initial image edge information to obtain initial object edge information corresponding to the motion object;

[0007] performing target object edge extraction based on the initial object edge information to obtain target object edge information corresponding to the motion object;

[0008] performing image deviation calculation based on the target object edge information to obtain image deviation information corresponding to the initial image, and performing horizontal correction on the initial image using the image deviation information to obtain a target image corresponding to the initial image.

[0009] In one embodiment, performing target object edge extraction based on the initial object edge information to obtain target object edge information corresponding to the motion object comprises:

[0010] performing target image edge extraction on the initial image to obtain target image edge information;

[0011] extract target object edge information corresponding to the moving object based on the initial object edge information and the target image edge information.

[0012] In one of the embodiments, the initial object edge information corresponding to the moving object is obtained by performing initial object edge extraction based on the error information and the initial image edge information, including:

[0013] performing AND operation on the error information and the initial image edge information to obtain the initial object edge information corresponding to the moving object;

[0014] extract target object edge information corresponding to the moving object based on the initial object edge information and the target image edge information, including:

[0015] performing AND operation on the initial object edge information and the target image edge information to obtain the target object edge information corresponding to the moving object.

[0016] In one of the embodiments, the image deviation information corresponding to the initial image is obtained by performing image deviation calculation based on the target object edge information, including:

[0017] performing straight line conversion on the target object edge information based on a preset straight line threshold to obtain a straight line set corresponding to the target object edge information;

[0018] calculating horizontal angles corresponding to each straight line in the straight line set, and performing horizontal angle average calculation using the horizontal angles corresponding to each straight line to obtain a current horizontal angle corresponding to the initial image;

[0019] obtaining the image deviation information corresponding to the initial image based on a difference between the current horizontal angle and a preset standard vertical angle.

[0020] In one of the embodiments, the method further includes:

[0021] obtaining historical horizontal angles of each historical straight line corresponding to historical target object edge information in a preset historical time period;

[0022] performing horizontal angle average calculation based on the horizontal angles of each straight line and the historical horizontal angles of each historical straight line to obtain an average horizontal angle corresponding to the initial image;

[0023] obtaining the target image deviation information corresponding to the initial image based on a difference between the average horizontal angle and a preset standard vertical angle.

[0024] In one of the embodiments, the target image corresponding to the initial image is obtained by performing horizontal correction on the initial image using the image deviation information, including:

[0025] When the image deviation information does not reach the preset image deviation threshold, a preset correction parameter corresponding to the image deviation information is obtained based on the image deviation information.

[0026] The initial image is corrected horizontally using the preset correction parameter to obtain a target image.

[0027] In one of the embodiments, after the original image is corrected using the preset correction coefficient to obtain a target image corresponding to the original image, the method further comprises:

[0028] An initial image sequence is obtained.

[0029] Each initial image in the initial image sequence is traversed to obtain a target image sequence corresponding to the initial image sequence.

[0030] Each target image in the target image sequence is sequentially spliced to obtain a target moving object image, and target moving object recognition is performed based on the target moving object image to obtain a target moving object recognition result.

[0031] In a second aspect, the present application further provides an image processing device. The device comprises:

[0032] An error module is configured to obtain an initial image of a moving object and a reference image adjacent to the initial image, calculate an image error between the reference image and the initial image, and obtain error information.

[0033] An initial edge extraction module is configured to perform initial image edge extraction on the initial image to obtain initial image edge information, and perform initial object edge extraction based on the error information and the initial image edge information to obtain initial object edge information corresponding to the moving object.

[0034] A target edge extraction module is configured to perform target object edge extraction based on the initial object edge information to obtain target object edge information corresponding to the moving object.

[0035] A correction module is configured to perform image deviation calculation based on the target object edge information to obtain image deviation information corresponding to the initial image, and perform horizontal correction on the initial image using the image deviation information to obtain a target image corresponding to the initial image.

[0036] In a third aspect, the present application further provides a computer device. The computer device comprises a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:

[0037] An initial image of a moving object and a reference image adjacent to the initial image are obtained, an image error between the reference image and the initial image is calculated, and error information is obtained.

[0038] performing initial image edge extraction on the initial image to obtain initial image edge information, and performing initial object edge extraction based on the error information and the initial image edge information to obtain initial object edge information corresponding to the moving object;

[0039] performing target object edge extraction based on the initial object edge information to obtain target object edge information corresponding to the moving object;

[0040] performing image deviation calculation based on the target object edge information to obtain image deviation information corresponding to the initial image, and performing horizontal correction on the initial image using the image deviation information to obtain a target image corresponding to the initial image.

[0041] In a fourth aspect, the present application further provides a computer readable storage medium. The computer readable storage medium has a computer program stored thereon, and the computer program, when executed by a processor, implements the following steps:

[0042] obtaining an initial image of a moving object and a reference image adjacent to the initial image, calculating image error between the reference image and the initial image to obtain error information;

[0043] performing initial image edge extraction on the initial image to obtain initial image edge information, and performing initial object edge extraction based on the error information and the initial image edge information to obtain initial object edge information corresponding to the moving object;

[0044] performing target object edge extraction based on the initial object edge information to obtain target object edge information corresponding to the moving object;

[0045] performing image deviation calculation based on the target object edge information to obtain image deviation information corresponding to the initial image, and performing horizontal correction on the initial image using the image deviation information to obtain a target image corresponding to the initial image.

[0046] In a fifth aspect, the present application further provides a computer program product. The computer program product comprises a computer program, and the computer program, when executed by a processor, implements the following steps:

[0047] obtaining an initial image of a moving object and a reference image adjacent to the initial image, calculating image error between the reference image and the initial image to obtain error information;

[0048] performing initial image edge extraction on the initial image to obtain initial image edge information, and performing initial object edge extraction based on the error information and the initial image edge information to obtain initial object edge information corresponding to the moving object;

[0049] performing target object edge extraction based on the initial object edge information to obtain target object edge information corresponding to the moving object;

[0050] The image deviation information corresponding to the initial image is calculated based on the target object edge information, and the initial image is corrected horizontally using the image deviation information to obtain the target image corresponding to the initial image.

[0051] The image processing method, device, computer device, storage medium and computer program product, by calculating the image error between the reference image and the initial image; then the initial image edge extraction is performed on the initial image, and the obtained initial image edge information is the initial edge information of the initial image. The initial object edge information is obtained by performing initial object edge extraction on the error information and the initial image edge information. The target object edge information obtained by performing target object edge extraction on the initial object edge information is more accurate edge information of the moving object. The image deviation information calculated by the target object edge information is more accurate; further, the initial image is corrected horizontally by the image deviation information, and the target image obtained is also more accurate, thereby improving the accuracy of image processing. BRIEF DESCRIPTION OF DRAWINGS

[0052] Figure 1 It is an application environment diagram of the image processing method in one embodiment;

[0053] Figure 2 It is a flowchart of the image processing method in one embodiment;

[0054] Figure 3 It is a flowchart of target object edge extraction in one embodiment;

[0055] Figure 4 It is a flowchart of calculating image deviation information in one embodiment;

[0056] Figure 5 It is a schematic diagram of image deviation information in one embodiment;

[0057] Figure 6 It is a schematic diagram of image deviation information in another embodiment;

[0058] Figure 7 It is a flowchart of calculating target image deviation information in one embodiment;

[0059] Figure 8 It is a flowchart of initial image horizontal correction in one specific embodiment;

[0060] Figure 9 It is a structure block diagram of the image processing device in one embodiment;

[0061] Figure 10 It is an internal structure diagram of the computer device in one embodiment;

[0062] Figure 11 Figure 1 is a schematic diagram of the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0063] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and not intended to limit the present application.

[0064] The image processing method provided by the embodiments of the present application can be applied to an application environment as shown in Figure 1 . In the application environment, the terminal 102 communicates with the server 104 through a network. The data storage system can store data required to be processed by the server 104. The data storage system can be integrated on the server 104, or placed on a cloud or other network server. The terminal 102 can obtain an initial image of a moving object and a reference image adjacent to the initial image through the server 104, calculate an image error between the reference image and the initial image to obtain error information; the terminal 102 performs initial image edge extraction on the initial image to obtain initial image edge information, and performs initial object edge extraction based on the error information and the initial image edge information to obtain initial object edge information corresponding to the moving object; the terminal 102 performs target object edge extraction based on the initial object edge information to obtain target object edge information corresponding to the moving object; the terminal 102 performs image deviation calculation based on the target object edge information to obtain image deviation information corresponding to the initial image, and performs horizontal correction on the initial image using the image deviation information to obtain a target image corresponding to the initial image. The terminal 102 can be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things device can be a smart speaker, a smart television, a smart air conditioner, a smart vehicle device, etc. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, etc. The server 104 can be implemented by an independent server or a server cluster composed of multiple servers.

[0065] In one embodiment, as shown in Figure 2 , an image processing method is provided. Taking the terminal in Figure 1 as an example, it can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction of the terminal and the server. In the present embodiment, the following steps are included:

[0066] In step 202, an initial image of a moving object and a reference image adjacent to the initial image are obtained, an image error between the reference image and the initial image is calculated, and error information is obtained.

[0067] The moving object refers to an object in motion, including a human body, an object, etc. The initial image refers to an image in an image sequence collected according to a preset frame rate during motion of the moving object. The initial image may have an image content tilt problem when collected. The reference image refers to an image adjacent to the initial image in the collected image sequence. The image error refers to a difference between the initial image and the reference image. The error information refers to information of the difference between the initial image and the reference image, which can be represented by a graph. In an embodiment, the error information can represent a part of the moving object in the initial image that has a motion change compared with the moving object in the reference image.

[0068] Specifically, the terminal can obtain the image sequence corresponding to the moving object through a data storage system in the server. The image sequence corresponding to the moving object can be an image sequence collected by a camera device according to a preset frame rate during motion of the moving object. The preset frame rate can be 50 fps (Frames Per Second). Then the camera device uploads the image sequence to the data storage system of the server. The terminal can also directly obtain the collected image sequence from the camera device.

[0069] The terminal obtains the initial image and the reference image adjacent to the initial image from the collected image sequence. The reference image can be a previous frame image of the initial image or a next frame image of the initial image. Preferably, the reference image is the previous frame image of the initial image. Then the terminal can calculate the pixel error between the reference image and the initial image through an inter-frame difference operation mode, and obtain the error information through the pixel error. For example, the error between the pixel value corresponding to each pixel point in the reference image and the pixel value corresponding to each pixel point in the initial image can be calculated, and the error image can be obtained according to the error corresponding to each pixel point. The terminal can also obtain the error information after performing the inter-frame difference operation on the reference image and the initial image, and perform binaryzation processing on the error information to obtain the binaryzation error information.

[0070] In step 204, initial image edge extraction is performed on the initial image to obtain initial image edge information, and initial object edge extraction is performed based on the error information and the initial image edge information to obtain initial object edge information corresponding to the moving object.

[0071] The initial image edge extraction refers to a process of preliminarily extracting edges of objects in the initial image. The initial image includes a moving object region and a background region, and the background region is a region in the initial image other than the moving object region, including objects such as trees, buildings, and the like. The initial image edge information refers to an edge image of all objects including the moving object region and the background region in the initial image. The initial object edge extraction refers to a process of preliminarily extracting edges of the moving object in the moving object region in the initial image. The initial object edge information refers to an image of the edges of the moving object preliminarily extracted from the initial image.

[0072] Specifically, the terminal preliminarily extracts edges of objects in all regions in the initial image to obtain initial image edge information corresponding to the initial image. Then, the terminal preliminarily extracts edges of the moving object in the initial image edge information according to the error information to obtain initial object edge information corresponding to the moving object preliminarily extracted.

[0073] In one specific embodiment, the terminal can preliminarily extract vertical edges of objects in all regions in the initial image to obtain an image of the vertical edges of all objects in the initial image edge information corresponding to the initial image. Then, the terminal preliminarily extracts the vertical edges of the moving object in the initial image edge information according to the error information to obtain a vertical edge image corresponding to the moving object in the initial image edge information.

[0074] Step 206: performing target object edge extraction based on the initial object edge information to obtain target object edge information corresponding to the moving object.

[0075] The target object edge extraction refers to a process of line extraction of edges of the moving object. The target object edge information refers to an image of the line edges of the moving object.

[0076] Specifically, the terminal performs accurate edge extraction based on the edge image of the moving object preliminarily extracted in the initial object edge information to obtain target object edge information corresponding to the moving object, which is more accurate than the initial object edge information.

[0077] Step 208: performing image deviation calculation based on the target object edge information to obtain image deviation information corresponding to the initial image, and performing horizontal correction on the initial image using the image deviation information to obtain a target image corresponding to the initial image.

[0078] The image deviation calculation refers to a process of calculating a tilt angle of the initial image. The image deviation information refers to the tilt angle of the initial image. The target image refers to an image of the initial image after horizontal correction.

[0079] Specifically, the terminal uses the deviation angle of the longitudinal edge line and the horizontal line in the target object edge information to perform image deviation calculation to obtain image deviation information corresponding to the initial image, which represents the deviation angle of the initial image and the horizontal line. The terminal performs rotation correction of the initial image by the corresponding angle according to the image deviation information to obtain a target image after correction of the initial image. Then the terminal can store the target image to the local terminal for subsequent use.

[0080] In the image processing method, the image error between the reference image and the initial image is calculated; then the initial image edge extraction is performed on the initial image. The initial object edge information is obtained by performing initial object edge extraction on the error information and the initial image edge information, which represents the initial edge information of the moving object. The target object edge information obtained by performing target object edge extraction on the initial object edge information is more accurate edge information of the moving object. The image deviation information calculated by the target object edge information is more accurate; further, the target image obtained by performing horizontal correction on the initial image according to the image deviation information is also more accurate. Therefore, the accuracy of image processing is improved.

[0081] In one embodiment, as shown in Figure 3 a flowchart of target object edge extraction is provided; in step 204, target object edge extraction is performed based on the initial object edge information to obtain target object edge information corresponding to the moving object, including:

[0082] In step 302, target image edge extraction is performed on the initial image to obtain target image edge information.

[0083] In step 304, target object edge extraction is performed based on the initial object edge information and the target image edge information to obtain target object edge information corresponding to the moving object.

[0084] The target image edge extraction refers to the process of line extraction of the edges of all objects in the initial image. The target image edge image refers to the line edge image of all objects in the initial image.

[0085] Specifically, the terminal performs line extraction on the edges of all objects in the initial image to obtain target image edge information corresponding to the initial image, which represents the line edge image of all objects in the initial image. The terminal can use the Canny edge detection algorithm to perform line extraction on all objects in the initial image. Then the terminal extracts the same pixels according to the longitudinal edge of the moving object in the initial object edge information and the line edge in the target image edge information to obtain target object edge information corresponding to the moving object, which represents the line edge image of the moving object.

[0086] The terminal can also use the Canny edge detection algorithm to perform line extraction on the edges of the moving object in the initial object edge information, to obtain the target object edge information corresponding to the moving object.

[0087] In this embodiment, the accuracy of extracting the edges of the moving object in the initial image is improved by performing line extraction on the initial object edge information, and the edges of the extracted moving object are more accurate, thereby improving the accuracy of image processing.

[0088] In one embodiment, step 204, performing initial object edge extraction based on the error information and the initial image edge information to obtain initial object edge information corresponding to the moving object, includes:

[0089] performing AND operation on the error information and the initial image edge information to obtain the initial object edge information corresponding to the moving object;

[0090] Step 304, performing target object edge extraction based on the initial object edge information and the target image edge information to obtain target object edge information corresponding to the moving object, includes:

[0091] performing AND operation on the initial object edge information and the target image edge information to obtain the target object edge information corresponding to the moving object.

[0092] The AND operation refers to the operation of extracting the same edge information. The AND operation of the error information and the initial image edge information refers to the process of extracting the same edge information from the error information and the initial image edge information. The AND operation of the initial object edge information and the target image edge information refers to the process of extracting the same edge information from the initial object edge information and the initial object edge information.

[0093] Specifically, the edge information can be binary pixel values. Perform AND operation on each binary pixel value in the error information and each binary pixel value in the initial image edge information to obtain the initial object edge information. Perform AND operation on each binary pixel value in the initial object edge information and each binary pixel value in the target image edge information to extract the same binary pixel value and obtain the target object edge information.

[0094] In one specific embodiment, when the terminal detects that the initial image and the parameter image are binary images, it directly performs inter-frame difference operation on the initial image and the parameter image to obtain error information of the image type binary difference image.

[0095] When the terminal detects that the initial image and the parameter image are non-binary images, it performs inter-frame difference operation on the initial image and the parameter image to obtain error information of the non-binary difference image. Then, the non-binary difference image is binarized to obtain error information of the binary difference image.

[0096] The terminal can perform initial image edge extraction on the initial image through a Sobel operator of the longitudinal template, i.e., extract longitudinal edges of all objects in the initial image, to obtain non-binary initial image edge information, and then perform binaryzation processing on the non-binary initial image edge information to obtain binary initial image edge information. The binaryzation processing can be a Wilsh adaptive threshold binaryzation algorithm.

[0097] Then the terminal performs AND operation on the error information of the binary difference image and the binary initial image edge information to obtain initial object edge information corresponding to the moving object. In this embodiment, by performing AND operation on the error information and the initial image edge information, the edge image corresponding to the moving object can be extracted from the target image edge information according to the contour of the moving object in the error information. By performing AND operation on the initial object edge information and the target image edge information, the image of the accurate edge corresponding to the moving object can be extracted from the target image edge information according to the edge image corresponding to the moving object in the initial object edge information. Through the two times of AND operation, the accuracy of the edge of the moving object in the initial image is further improved, thereby improving the accuracy of image processing.

[0098] In one embodiment, as shown in FIG. 8, a flowchart for calculating image deviation information is provided; in step 208, image deviation calculation is performed based on the target object edge information to obtain image deviation information corresponding to the initial image, including: Figure 4

[0099] In step 402, straight line conversion is performed on the target object edge information based on a preset straight line threshold to obtain a straight line set corresponding to the target object edge information.

[0100] In step 404, horizontal angles corresponding to each straight line in the straight line set are calculated, and horizontal angle average calculation is performed using the horizontal angles corresponding to each straight line to obtain a current horizontal angle corresponding to the initial image.

[0101] In step 406, based on a difference between the current horizontal angle and a preset standard vertical angle, image deviation information corresponding to the initial image is obtained.

[0102] ​The preset line threshold refers to a pre-set threshold used to filter out interfering lines in the edge information of the target object. The preset line threshold can be the length of a line representing half the height of a standard object in the image. Line conversion refers to the process of converting edge information in the target object's edge information into a straight line. Horizontal angle refers to the angle of deviation between a straight line and the image's horizontal line. Current horizontal angle refers to the average deviation angle of the horizontal angles corresponding to each straight line. Horizontal angle averaging calculation refers to the process of calculating the average value of the horizontal angles corresponding to each straight line. The preset standard horizontal angle refers to a pre-set angle between the vertical line of the image and the horizontal line of the image, typically 90 degrees.

[0103] Specifically, the terminal can convert the height edge of a car in a pre-set image into a corresponding straight line, and then use half the length of the converted straight line as a preset straight line threshold. The terminal can also directly retrieve the preset straight line threshold from the local storage system. Then, the terminal converts the vertical edges of moving objects in the target object's edge information into corresponding straight lines, using the Hough transform line detection algorithm. Finally, the terminal uses the preset straight line threshold to filter the converted lines, selecting those that meet the threshold as a set of lines.

[0104] The terminal then calculates the deviation angle between each line in the line set and the horizontal line of the image, obtaining the horizontal angle corresponding to each line. These horizontal angles are then summed to obtain the accumulated horizontal angle result. Next, the terminal counts the number of each line and calculates the ratio of the accumulated result to the number of lines, obtaining the current horizontal angle corresponding to the initial image. Finally, the terminal calculates the difference between the current horizontal angle and the preset standard horizontal angle to obtain the image deviation information corresponding to the initial image.

[0105] In one specific embodiment, such as Figure 5 As shown, a schematic diagram of image deviation information is provided; the counterclockwise direction is set as the positive direction, a is the vertical line of the moving object in the image, b is the horizontal line of the moving object, e is the horizontal line of the image, d is the vertical line of the image, A is the current horizontal angle, representing the deviation angle between the vertical line a of the moving object and the horizontal line e of the image, and B is the image deviation information, representing the deviation angle between the horizontal line b of the moving object and the horizontal line of the image.

[0106] Then the terminal calculates the difference between the current horizontal angle A and the preset standard vertical angle to obtain the image deviation information B. The calculation formula is shown in formula (1):

[0107] B = a - 90° (Formula 1)

[0108] B can be positive or negative; B is positive, which means the initial image is tilted to the left, and B is negative, which means the initial image is tilted to the right. For example, A = 80°, B = 80°-90° = -10°, which means the moving object in the initial image is tilted 10° to the right in the vertical direction; A = 130°, B = 130°-90° = 40°, which means the moving object in the initial image is tilted 40° to the left in the vertical direction.

[0109] In another embodiment, as shown in Figure 6 , a schematic diagram for calculating image deviation information is provided; the terminal can calculate the deviation angle of each straight line in the straight line set and the image vertical line to obtain the vertical angle corresponding to each straight line, and then accumulate the vertical deviation angles corresponding to each straight line to obtain the accumulation result of the vertical angle. Then the terminal counts the number of each straight line, and then calculates the ratio of the accumulation result and the number of each straight line to obtain the average vertical deviation angle corresponding to the initial image, which represents the deviation angle of the longitudinal line of the moving object in the initial image and the image vertical line. The terminal takes the average vertical deviation angle as the image deviation information. Then the terminal determines the tilt direction of the moving object according to the quadrant in which the longitudinal line of the moving object is located. In the figure, a is the longitudinal line of the moving object in the image, d is the image vertical line, D is the average vertical deviation angle, which represents the deviation angle between the longitudinal line a of the moving object and the image vertical line d. When the longitudinal line a of the moving object is in the first quadrant, it means that the moving object in the initial image is tilted to the right in the vertical direction; when the longitudinal line a of the moving object is in the second quadrant, it means that the moving object in the initial image is tilted to the left in the vertical direction.

[0110] In this embodiment, by converting the edge information of the target object into straight lines, the initial image can be horizontally detected by the straight line set to obtain the image deviation information corresponding to the initial image, so that the initial image can be corrected according to the image deviation information, and the efficiency of image processing is improved.

[0111] In one embodiment, as shown in Figure 7 , a flowchart for calculating target image deviation information is provided; the method further comprises:

[0112] Step 702, obtaining the historical horizontal angle of each historical straight line corresponding to the historical target object edge information in a preset historical time period;

[0113] Step 704, performing horizontal angle average calculation based on the horizontal angle of each straight line and the historical horizontal angle of each historical straight line to obtain the average horizontal angle corresponding to the initial image;

[0114] Step 706, obtaining the target image deviation information corresponding to the initial image based on the difference between the average horizontal angle and the preset standard vertical angle.

[0115] The preset historical time period is a time period set in advance. The historical target object edge information refers to target object edge information corresponding to the initial image processed in the historical time period. The historical horizontal angle refers to the vertical angle of each straight line corresponding to the historical target object edge information. The average horizontal angle refers to the average value of the horizontal angle of each straight line and the historical horizontal angle of each historical straight line. The target image deviation information refers to the inclination angle of the moving object in the initial image.

[0116] Specifically, the terminal can obtain the historical horizontal angle of each historical straight line corresponding to the historical target object edge information in the historical time period from the local data storage system according to the acquisition time of the initial image. The historical time period can be a time period determined according to the movement speed and length of the moving object, for example, the historical time period can be set to 0.2 seconds. Then the terminal accumulates the horizontal angle of each straight line and the historical horizontal angle of each historical straight line to obtain a horizontal angle accumulation result. The terminal counts the total number of each straight line and each historical straight line, and calculates the ratio of the horizontal angle accumulation result to the total number to obtain the average horizontal angle corresponding to the initial image.

[0117] The terminal calculates the difference between the average horizontal angle and the preset standard vertical angle to obtain the deviation angle of the transverse line of the initial image and the horizontal line of the image.

[0118] In this embodiment, by introducing the historical horizontal angle of each historical straight line corresponding to the historical target object edge information, and performing horizontal angle average calculation on the horizontal angle of each straight line and the historical horizontal angle of each historical straight line, the average horizontal angle corresponding to the initial image obtained is more accurate, and the error caused by single calculation is avoided, thereby improving the accuracy of image processing.

[0119] In one embodiment, step 208, using the image deviation information to perform horizontal correction on the initial image to obtain a target image corresponding to the initial image, comprising:

[0120] When the image deviation information does not reach the preset image deviation threshold, obtaining a corresponding preset correction parameter based on the image deviation information;

[0121] Using the preset correction parameter to perform horizontal correction on the initial image to obtain the target image.

[0122] The preset image deviation threshold is a judgment threshold set in advance for judging whether the initial image is inclined. The preset correction parameter is the most suitable correction parameter for correcting the initial image, which can be obtained from a correction parameter library.

[0123] Specifically, the terminal acquires a preset image deviation threshold, compares the image deviation information with the preset image deviation threshold, and when the image deviation information does not reach the preset image deviation threshold, the terminal determines a range in which the optimal correction parameter is located in the correction parameter library according to the image deviation information. The terminal can determine the range in which the optimal correction parameter is located in a binary search manner, and the correction parameter library has been pre-sequenced according to the angle deviation value, which is one-to-one corresponding to the correction coefficient. Then, according to the image deviation information, each angle deviation value in the range is traversed to determine an angle deviation value that is closest to or the same as the image deviation information, and the correction parameter corresponding to the angle deviation value is taken as the optimal correction parameter. Then, the terminal can configure the optimal correction parameter to the image processing module, so that the image processing module corrects the initial image according to the configured optimal correction parameter to obtain a target image.

[0124] When the terminal detects that the image deviation information reaches the preset image deviation threshold, it indicates that the initial image does not tilt, and no correction is performed on the initial image. The initial image can be directly used for subsequent processing.

[0125] In this embodiment, the optimal correction parameter can be quickly found from the correction parameter library according to the image deviation information, and the initial image is corrected according to the correction parameter, thereby improving the image processing efficiency.

[0126] In one embodiment, after the original image is corrected using the preset correction coefficient to obtain a target image corresponding to the original image, step 208 further includes:

[0127] Acquire an initial image sequence;

[0128] Traverse each initial image in the initial image sequence to obtain a target image sequence corresponding to the initial image sequence;

[0129] Sequentially splice each target image in the target image sequence to obtain a target moving object image, and perform target moving object recognition based on the target moving object image to obtain a target moving object recognition result.

[0130] The initial image sequence refers to each initial image that is continuously acquired and time-continuous in the movement process of the moving object. Different initial images can include different parts of the moving object, for example, a vehicle image sequence obtained from a vehicle head image to a vehicle tail image when the vehicle moves. The target moving object image refers to an image with a complete moving object after splicing

[0131] Specifically, the terminal acquires an initial image sequence, and finds a corresponding target image according to each initial image in the initial image sequence, and then the terminal sequentially splices each target image in sequence order to obtain a target moving object image including a complete moving object, and then can perform subsequent processing such as object recognition on the target moving object image.

[0132] In this embodiment, by splicing the corrected target image, the target moving object image obtained is already a horizontal image, and recognition through the target moving object image can improve the recognition accuracy of the moving object.

[0133] In one specific embodiment, as shown in Figure 8 a flowchart of initial image horizontal correction is provided; the terminal acquires an initial image sequence through an image acquisition unit at a frame rate of 50 fps, then acquires an initial image currently requiring processing from the initial image sequence, and acquires a reference image adjacent to the initial image. The terminal inputs the initial image and the reference image into a difference analysis unit to perform interframe difference operation and binarization processing, and obtains a difference binary image. The terminal inputs the initial image into a vertical edge analysis unit, performs convolution operation on the initial image through a Sobel operator of a horizontal template, and performs binarization processing to obtain a vertical edge binary image. Then the terminal performs AND operation on the difference binary image and the vertical edge binary image to obtain an initial vertical edge image corresponding to a moving object. The terminal performs line edge extraction on the initial vertical edge image using a Canny edge detection algorithm to obtain a more accurate line vertical edge image corresponding to the moving object.

[0134] The terminal performs straight line conversion on the line vertical edge image using a Hough transform straight line detection algorithm, and performs straight line screening using a preset straight line threshold to obtain a straight line set corresponding to the line vertical edge image. The terminal calculates a horizontal angle corresponding to each straight line in the straight line set, and then acquires a historical horizontal angle of each historical straight line corresponding to historical target object edge information in a preset historical time period. The terminal performs horizontal angle average calculation on the horizontal angle of each straight line and the historical horizontal angle of each historical straight line to obtain an average horizontal angle corresponding to the initial image, and then calculates a difference value between the average horizontal angle and a preset standard vertical angle to obtain target image deviation information corresponding to the initial image.

[0135] The terminal finds optimal correction parameters in a correction parameter library according to the target image deviation information, and configures the optimal correction parameters to an image processing module, so that the image processing module corrects the initial image according to the configured optimal correction parameters to obtain a target image.

[0136] It should be understood that although the steps in the flowcharts involved in the embodiments described above are shown in sequence according to the arrows, the steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, the execution of the steps is not strictly limited in sequence, and the steps can be executed in other orders. Moreover, at least some of the steps in the flowcharts involved in the embodiments described above can include multiple steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of the steps or stages is not necessarily sequential, but can be alternately or alternately executed with at least part of other steps or steps or stages in other steps.

[0137] Based on the same inventive concept, the embodiments of the present application also provide an image processing device for implementing the image processing method described above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so the specific limitations in one or more image processing device embodiments provided below can refer to the limitations of the image processing method described above, which will not be repeated here.

[0138] In one embodiment, as shown in Figure 9 An image processing device 900 is provided, comprising an error module 902, an initial edge extraction module 904, a target edge extraction module 906, and a correction module 908, wherein:

[0139] The error module 902 is configured to obtain an initial image of a moving object and a reference image adjacent to the initial image, calculate an image error between the reference image and the initial image, and obtain error information.

[0140] The initial edge extraction module 904 is configured to perform initial image edge extraction on the initial image to obtain initial image edge information, and perform initial object edge extraction based on the error information and the initial image edge information to obtain initial object edge information corresponding to the moving object.

[0141] The target edge extraction module 906 is configured to perform target object edge extraction based on the initial object edge information to obtain target object edge information corresponding to the moving object.

[0142] The correction module 908 is configured to perform image deviation calculation based on the target object edge information to obtain image deviation information corresponding to the initial image, and perform horizontal correction on the initial image using the image deviation information to obtain a target image corresponding to the initial image.

[0143] In one embodiment, the target edge extraction module 906 comprises:

[0144] an object edge extraction unit, configured to perform target image edge extraction on the initial image to obtain target image edge information;

[0145] perform target object edge extraction based on the initial object edge information and the target image edge information to obtain target object edge information corresponding to the moving object.

[0146] In one embodiment, the initial edge extraction module 904 includes:

[0147] an AND operation unit, configured to perform AND operation on the error information and the initial image edge information to obtain initial object edge information corresponding to the moving object;

[0148] perform AND operation on the initial object edge information and the target image edge information to obtain target object edge information corresponding to the moving object.

[0149] In one embodiment, the correction module 908 includes:

[0150] a conversion unit, configured to perform straight line conversion on the target object edge information based on a preset straight line threshold to obtain a straight line set corresponding to the target object edge information;

[0151] calculate a horizontal angle corresponding to each straight line in the straight line set, and perform horizontal angle average calculation using the horizontal angle corresponding to each straight line to obtain a current horizontal angle corresponding to the initial image;

[0152] obtain image deviation information corresponding to the initial image based on a difference between the current horizontal angle and a preset standard vertical angle.

[0153] In one embodiment, the image processing apparatus 900 further includes:

[0154] a historical information unit, configured to obtain historical horizontal angles of each historical straight line corresponding to historical target object edge information in a preset historical time period;

[0155] perform horizontal angle average calculation based on the horizontal angle of each straight line and the historical horizontal angles of each historical straight line to obtain an average horizontal angle corresponding to the initial image;

[0156] obtain target image deviation information corresponding to the initial image based on a difference between the average horizontal angle and a preset standard vertical angle.

[0157] In one embodiment, the correction module 908 includes:

[0158] a threshold judgment unit, configured to, when the image deviation information does not reach a preset image deviation threshold, obtain a preset correction parameter corresponding to the image deviation information based on the image deviation information; and perform horizontal correction on the initial image using the preset correction parameter to obtain the target image.

[0159] In an embodiment, the image processing apparatus 900 further includes:

[0160] The splicing unit is configured to obtain an initial image sequence, and traverse each initial image in the initial image sequence to obtain a target image sequence corresponding to the initial image sequence.

[0161] The target motion object image is obtained by splicing each target image in the target image sequence in sequence, and target motion object recognition is performed based on the target motion object image to obtain a target motion object recognition result.

[0162] Each module in the image processing apparatus described above can be implemented in whole or in part by software, hardware, and a combination thereof. The modules described above can be embedded in or independent of a processor in a computer device in hardware form, or stored in a memory in a computer device in software form, so as to be called and executed by a processor to perform the operations corresponding to each module.

[0163] In an embodiment, a computer device is provided, which can be a server, and an internal structure diagram of the computer device can be as shown in Figure 10 The computer device includes a processor, a memory, an input / output interface (I / O), and a communication interface. The processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is configured 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, a computer program, and a database. The internal memory provides an environment for running the operating system and the computer program in the non-volatile storage medium. The database of the computer device is configured to store an initial image sequence. The input / output interface of the computer device is configured to exchange information between the processor and external devices. The communication interface of the computer device is configured to communicate with external terminals through a network connection. The computer program is executed by the processor to implement an image processing method.

[0164] In an embodiment, a computer device is provided, which can be a terminal, and an internal structure diagram of the computer device can be as shown in Figure 11The 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 through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is configured 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 running the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is configured to exchange information between the processor and external devices. The communication interface of the computer device is configured to perform wired or wireless communication with external terminals. The wireless communication can be achieved through WIFI, mobile cellular network, NFC (Near Field Communication) or other technologies. The computer program is executed by the processor to implement an image processing method. The display unit of the computer device is configured to form a visually visible picture, which 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 overlaid on the display screen, or a key, trackball or touchpad arranged on the shell of the computer device, or an external keyboard, touchpad or mouse, etc.

[0165] Those skilled in the art can understand that, Figures 10-11 The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. A specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different component arrangement.

[0166] In one embodiment, a computer device is provided, including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the following steps:

[0167] An initial image of a moving object and a reference image adjacent to the initial image are obtained, an image error between the reference image and the initial image is calculated to obtain error information; initial image edge extraction is performed on the initial image to obtain initial image edge information, and initial object edge extraction is performed based on the error information and the initial image edge information to obtain initial object edge information corresponding to the moving object; target object edge extraction is performed based on the initial object edge information to obtain target object edge information corresponding to the moving object; image deviation calculation is performed based on the target object edge information to obtain image deviation information corresponding to the initial image, and the initial image is corrected horizontally using the image deviation information to obtain a target image corresponding to the initial image.

[0168] In one embodiment, the processor, when executing the computer program, also implements the following steps:

[0169] The target object edge information corresponding to the moving object is obtained based on the initial object edge information, and the target object edge extraction is performed based on the initial object edge information and the target image edge information.

[0170] In one embodiment, the processor, when executing the computer program, also implements the following steps:

[0171] The initial object edge information corresponding to the moving object is obtained based on the error information and the initial image edge information, and the target object edge information corresponding to the moving object is obtained based on the initial object edge information and the target image edge information.

[0172] In one embodiment, the processor, when executing the computer program, also implements the following steps:

[0173] The image deviation information corresponding to the initial image is obtained based on the target object edge information, and the target object edge information is converted into a straight line set corresponding to the target object edge information based on a preset straight line threshold.

[0174] In one embodiment, the processor, when executing the computer program, also implements the following steps:

[0175] The method further includes: obtaining historical horizontal angles of each historical straight line corresponding to the historical target object edge information in a preset historical time period; performing horizontal angle average calculation based on the horizontal angles of each straight line and the historical horizontal angles of each historical straight line to obtain an average horizontal angle corresponding to the initial image; and obtaining the target image deviation information corresponding to the initial image based on a difference between the average horizontal angle and a preset standard vertical angle.

[0176] In one embodiment, the processor, when executing the computer program, also implements the following steps:

[0177] The initial image is horizontally corrected using the image deviation information to obtain a target image corresponding to the initial image, including: when the image deviation information does not reach a preset image deviation threshold, a preset correction parameter corresponding to the image deviation information is obtained; and the initial image is horizontally corrected using the preset correction parameter to obtain the target image.

[0178] In one embodiment, the processor further implements the following steps when executing the computer program:

[0179] After the original image is corrected using the preset correction coefficient to obtain a target image corresponding to the original image, the method further includes: obtaining an initial image sequence; traversing each initial image in the initial image sequence to obtain a target image sequence corresponding to the initial image sequence; sequentially splicing each target image in the target image sequence to obtain a target moving object image; and performing target moving object identification based on the target moving object image to obtain a target moving object identification result.

[0180] In one embodiment, a computer readable storage medium having a computer program stored thereon is provided, and the computer program is executed by a processor to implement the following steps:

[0181] The initial image of the moving object and a reference image adjacent to the initial image are obtained, the image error between the reference image and the initial image is calculated to obtain error information; initial image edge extraction is performed on the initial image to obtain initial image edge information, and initial object edge extraction is performed based on the error information and the initial image edge information to obtain initial object edge information corresponding to the moving object; target object edge extraction is performed based on the initial object edge information to obtain target object edge information corresponding to the moving object; image deviation calculation is performed based on the target object edge information to obtain image deviation information corresponding to the initial image, and the initial image is horizontally corrected using the image deviation information to obtain a target image corresponding to the initial image.

[0182] In one embodiment, the computer program is executed by the processor to further implement the following steps:

[0183] The target object edge extraction based on the initial object edge information to obtain the target object edge information corresponding to the moving object includes: target image edge extraction is performed on the initial image to obtain target image edge information; and the target object edge extraction is performed based on the initial object edge information and the target image edge information to obtain the target object edge information corresponding to the moving object.

[0184] In one embodiment, the computer program is executed by the processor to further implement the following steps:

[0185] The initial object edge information corresponding to the moving object is obtained based on the error information and the initial image edge information, including: performing AND operation on the error information and the initial image edge information to obtain the initial object edge information corresponding to the moving object; and the target object edge information corresponding to the moving object is obtained based on the initial object edge information and the target image edge information, including: performing AND operation on the initial object edge information and the target image edge information to obtain the target object edge information corresponding to the moving object.

[0186] In one embodiment, the computer program, when executed by the processor, further implements the following steps:

[0187] The image deviation information corresponding to the initial image is obtained based on the target object edge information, including: performing straight line conversion on the target object edge information based on a preset straight line threshold to obtain a straight line set corresponding to the target object edge information; calculating a horizontal angle corresponding to each straight line in the straight line set, and performing horizontal angle average calculation using the horizontal angle corresponding to each straight line to obtain a current horizontal angle corresponding to the initial image; and obtaining the image deviation information corresponding to the initial image based on a difference between the current horizontal angle and a preset standard vertical angle.

[0188] In one embodiment, the computer program, when executed by the processor, further implements the following steps:

[0189] The method further includes: obtaining historical horizontal angles of each historical straight line corresponding to the historical target object edge information in a preset historical time period; performing horizontal angle average calculation based on the horizontal angle of each straight line and the historical horizontal angles of each historical straight line to obtain an average horizontal angle corresponding to the initial image; and obtaining the target image deviation information corresponding to the initial image based on a difference between the average horizontal angle and a preset standard vertical angle.

[0190] In one embodiment, the computer program, when executed by the processor, further implements the following steps:

[0191] The initial image is horizontally corrected using the image deviation information to obtain a target image corresponding to the initial image, including: when the image deviation information does not reach a preset image deviation threshold, obtaining a preset correction parameter corresponding to the image deviation information based on the image deviation information; and performing horizontal correction on the initial image using the preset correction parameter to obtain the target image.

[0192] In one embodiment, the computer program, when executed by the processor, further implements the following steps:

[0193] After the original image is corrected using the preset correction coefficient to obtain a target image corresponding to the original image, the method further includes: obtaining an initial image sequence; traversing each initial image in the initial image sequence to obtain a target image sequence corresponding to the initial image sequence; sequentially stitching each target image in the target image sequence to obtain a target moving object image; performing target moving object recognition based on the target moving object image to obtain a target moving object recognition result.

[0194] In an embodiment, a computer program product is provided, including a computer program which, when executed by a processor, implements the steps in any of the above method embodiments.

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

[0196] 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. The computer program can be stored in a non-volatile computer readable storage medium, and when the computer program is executed, the processes of the above-mentioned embodiments of the methods can be included. Any reference to 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 (Read-Only Memory, ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive memory (ReRAM), magnetoresistive random access memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric memory (Ferroelectric Random Access Memory, FRAM), phase change memory (Phase Change Memory, PCM), graphene memory, etc. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, etc. As an illustration but not limitation, RAM can be in various forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., without being limited thereto.

[0197] Any combination of the technical features of the above embodiments can be made. In order to make the description simple, all possible combinations of the technical features in the above embodiments are not described, however, as long as the combination of the technical features does not exist contradictory, it should be considered as the scope of the present application.

[0198] The above embodiments only express several implementation manners of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of the patent of the present application. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are within the scope of protection of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.

Claims

1. An image processing method, characterized by, The method comprises: acquiring an initial image of a moving object and a reference image adjacent to the initial image, calculating an image error between the reference image and the initial image to obtain error information; performing initial image edge extraction on the initial image to obtain initial image edge information, and performing initial object edge extraction based on the error information and the initial image edge information to obtain initial object edge information corresponding to the moving object; performing target object edge extraction based on the initial object edge information to obtain target object edge information corresponding to the moving object; performing image deviation calculation based on the target object edge information to obtain image deviation information corresponding to the initial image, and performing horizontal correction on the initial image using the image deviation information to obtain a target image corresponding to the initial image; wherein the target object edge extraction based on the initial object edge information to obtain the target object edge information corresponding to the moving object comprises: performing target image edge extraction on the initial image to obtain target image edge information; the target image edge extraction refers to a process of performing line extraction on edges of all objects in the initial image; performing target object edge extraction based on the initial object edge information and the target image edge information to obtain the target object edge information corresponding to the moving object; the initial object edge extraction based on the error information and the initial image edge information to obtain the initial object edge information corresponding to the moving object comprises: performing AND operation on the error information and the initial image edge information to obtain the initial object edge information corresponding to the moving object; the target object edge extraction based on the initial object edge information and the target image edge information to obtain the target object edge information corresponding to the moving object comprises: performing AND operation on the initial object edge information and the target image edge information to obtain the target object edge information corresponding to the moving object.

2. The method of claim 1, wherein, the image deviation calculation based on the target object edge information to obtain the image deviation information corresponding to the initial image comprises: performing straight line conversion on the target object edge information based on a preset straight line threshold to obtain a straight line set corresponding to the target object edge information; calculating a horizontal angle corresponding to each straight line in the straight line set, and performing horizontal angle average calculation using the horizontal angle corresponding to each straight line to obtain a current horizontal angle corresponding to the initial image; based on a difference between the current horizontal angle and a preset standard vertical angle, obtaining the image deviation information corresponding to the initial image.

3. The method of claim 2, wherein, The method further comprises: acquiring historical horizontal angles of each historical straight line corresponding to historical target object edge information in a preset historical time period; performing horizontal angle average calculation based on the horizontal angles of the straight lines and the historical horizontal angles of the historical straight lines to obtain an average horizontal angle corresponding to the initial image; based on a difference between the average horizontal angle and a preset standard vertical angle, obtaining target image deviation information corresponding to the initial image.

4. The method of claim 1, wherein, The using the image deviation information to perform horizontal correction on the initial image to obtain a target image corresponding to the initial image comprises: When the image deviation information does not reach a preset image deviation threshold, a preset correction parameter corresponding to the image deviation information is obtained based on the image deviation information; The preset correction parameter is used to perform horizontal correction on the initial image to obtain the target image.

5. The method of claim 4, wherein, After the using the preset correction parameter to perform horizontal correction on the initial image to obtain the target image, the method further comprises: obtaining an initial image sequence; traversing each initial image in the initial image sequence to obtain a target image sequence corresponding to the initial image sequence; sequentially splicing each target image in the target image sequence to obtain a target moving object image, and performing target moving object identification based on the target moving object image to obtain a target moving object identification result.

6. An image processing apparatus characterized by comprising: The device comprises: an error module configured to obtain an initial image of a moving object and a reference image adjacent to the initial image, calculate an image error between the reference image and the initial image, and obtain error information; an initial edge extraction module configured to perform initial image edge extraction on the initial image to obtain initial image edge information, and perform initial object edge extraction based on the error information and the initial image edge information to obtain initial object edge information corresponding to the moving object; a target edge extraction module configured to perform target object edge extraction based on the initial object edge information to obtain target object edge information corresponding to the moving object; a correction module configured to perform image deviation calculation based on the target object edge information to obtain image deviation information corresponding to the initial image, and use the image deviation information to perform horizontal correction on the initial image to obtain a target image corresponding to the initial image; wherein the performing target object edge extraction based on the initial object edge information to obtain target object edge information corresponding to the moving object comprises: performing target image edge extraction on the initial image to obtain target image edge information; the target image edge extraction refers to a line extraction process on edges of all objects in the initial image; performing target object edge extraction based on the initial object edge information and the target image edge information to obtain target object edge information corresponding to the moving object; the performing initial object edge extraction based on the error information and the initial image edge information to obtain initial object edge information corresponding to the moving object comprises: performing AND operation on the error information and the initial image edge information to obtain initial object edge information corresponding to the moving object; the performing target object edge extraction based on the initial object edge information and the target image edge information to obtain target object edge information corresponding to the moving object comprises: performing AND operation on the initial object edge information and the target image edge information to obtain target object edge information corresponding to the moving object. 7.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-6 when the computer program is executed by the processor. The processor executes the computer program to implement the steps of the method in any one of claims 1 to 5.

8. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program, which is executed by a processor, implements the steps of the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Method and device for location of license plate

    CN107368771A

  • Vehicle attribute identification method and device based on neural network, equipment and medium

    CN109635656A