Image correction method and device, computer equipment and storage medium

By combining the feature matching, filtering and color matching technology of close -up and long -view images, the problem of low image correction accuracy in the intelligent fixed loss of the vehicle has been solved, and more accurate vehicle component identification and fixed loss assessment are achieved.

CN119338939APending Publication Date: 2025-01-21PING AN TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411478337.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-21
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

Among the existing intelligent vehicle damage measurement methods, the image correction accuracy is low, resulting in inaccurate vehicle damage assessment.

Method used

By obtaining the close -up image and long -view image of the target vehicle, the feature matching, invalid area filtering and color matching are performed to determine the vehicle component area, and the near -view images are corrected based on the number of color images.

Benefits of technology

It improves the accuracy of image correction, enhances the accuracy of vehicle component recognition, and avoids the inaccurate problem of recognition caused by the division error caused by close -view image, thereby improving the accuracy of vehicle fixed loss.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119338939A_ABST
    Figure CN119338939A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of artificial intelligence and insurance, is applied to the field of smart cities, and relates to an image correction method which comprises the following steps: acquiring a close-shot image and a long-shot image of a target vehicle, and when the close-shot image is matched with the long-shot image, performing invalid area filtering on the close-shot image and the long-shot image to obtain a target vehicle image; and performing color matching on the filtered close-shot image and the long-shot image to determine a matched vehicle part area, and for the vehicle part area, when the mode color of the long-shot image is different from the color of the close-shot image corresponding to the vehicle part, correcting the close-shot image corresponding to the vehicle part area based on the mode color of the long-shot image to obtain a corrected close-shot image corresponding to the vehicle part area. According to the method, the problem of inaccurate vehicle part identification caused by the segmentation error of the close-shot image is effectively avoided, so that the overall precision of close-shot segmentation is improved, meanwhile, the segmentation result of the long-shot image is taken as the correction basis of the close-shot image, the robustness of different image quality and scene change is enhanced, and the accuracy of image correction is further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the fields of artificial intelligence and insurance technology, and in particular to image correction methods, devices, computer equipment and storage media. Background Art

[0002] With the rapid development of intelligent vehicle damage assessment technology, how to accurately assess the degree of vehicle damage has become a technical problem that needs to be solved urgently in the industry. Existing intelligent vehicle damage assessment methods usually rely on image segmentation technology to assess vehicle damage. That is, in vehicle damage assessment, close-range images can provide microscopic details of the vehicle, which are crucial for judging the degree of damage. For example, through close-range images, assessors can clearly observe subtle scratches, dents and other small-scale damage on the surface of the vehicle body. This high-resolution perspective helps to provide more accurate damage analysis. However, the segmentation results of close-range images are often affected by factors such as lighting and angle, resulting in low segmentation accuracy, which increases the difficulty of locating damaged parts.

[0003] Relatively speaking, long-range images have significant advantages in providing a macroscopic view of the vehicle, which enables more accurate segmentation and facilitates rapid identification of the vehicle's overall condition and major damaged areas. However, due to the limited viewing angle, long-range images are difficult to determine the specific damage details of the vehicle, resulting in inaccurate judgment of the degree of damage.

[0004] Therefore, how to comprehensively utilize the advantages and disadvantages of near-view and far-view images to improve the accuracy of image correction has become an important research topic in the current technical field. Summary of the invention

[0005] The purpose of the embodiments of the present application is to provide an image correction method, apparatus, computer device and storage medium to solve the problem of low accuracy of image correction in the related art.

[0006] In order to solve the above technical problems, the present application provides an image correction method, which adopts the following technical solutions:

[0007] Acquire a close-up image and a long-range image of the target vehicle;

[0008] Perform feature matching on the near-view image and the far-view image;

[0009] When the near-view image matches the far-view image, invalid regions of the near-view image and the far-view image are filtered out respectively;

[0010] Performing color matching on the filtered near-view image and the far-view image to determine the matched vehicle component area;

[0011] For the vehicle component region, when the majority color of the distant image is different from the color of the near image corresponding to the vehicle component, the near image corresponding to the vehicle component region is corrected based on the majority color of the distant image.

[0012] Furthermore, the step of performing feature matching on the near-view image and the far-view image specifically includes:

[0013] Converting the near-view image and the far-view image into a first grayscale image and a second grayscale image respectively;

[0014] Extracting features and matching the first grayscale image and the second grayscale image to obtain multiple pairs of first matching points;

[0015] If the confidence score corresponding to the first matching point is greater than the preset confidence threshold, it is confirmed that the first matching point is matched successfully.

[0016] Furthermore, when the near-view image matches the far-view image, the steps of filtering out invalid areas of the near-view image and the far-view image respectively include:

[0017] If the number of successfully matched first matching points is greater than or equal to a preset matching number threshold, it is determined that the near-view image matches the far-view image;

[0018] Based on the preset position distance and the preset pixel value, the invalid areas of the matching near-view image and far-view image are filtered out.

[0019] Furthermore, based on the preset position distance and the preset pixel value, the step of filtering out invalid areas of the matching near-view image and distant-view image specifically includes:

[0020] If the distance between the first matching points is less than or equal to the preset position distance, the area corresponding to the first matching points is filtered out;

[0021] After filtering out the area corresponding to the first matching point, if there is a second matching point between the near-view image and the distant-view image, then filtering out the area in the distant-view image whose pixel value is equal to the preset pixel value.

[0022] Furthermore, the near-view image includes near-view segmented images corresponding to a plurality of vehicle components, and the steps of color matching the filtered near-view image with the distant image to determine the matched vehicle component area specifically include:

[0023] Traverse each color of the near-field segmentation image;

[0024] For the matching points of the filtered near-view image and the distant-view image, if the number of matching points corresponding to the same color is greater than or equal to a preset number threshold, it is determined that the area corresponding to the matching points is a vehicle component area.

[0025] Furthermore, before the step of color matching the filtered near-view image with the distant view image to determine the matched vehicle component area, the method further includes:

[0026] The edge pixels of the vehicle component area are processed using the erosion and dilation algorithms.

[0027] Furthermore, after the step of filtering out invalid areas of the matching near-view image and distant-view image based on the preset position distance and the preset pixel value, the method further includes:

[0028] Determine the remaining matching points between the first grayscale image and the second grayscale image after filtering;

[0029] If the number of remaining matching points is greater than the preset matching point threshold, the step of color matching the filtered near-view image with the distant-view image is performed.

[0030] The step of color matching between the near-view image and the distant view image after the elimination.

[0031] In order to solve the above technical problems, the embodiment of the present application further provides an image correction device, which adopts the following technical solution:

[0032] An image acquisition module, used to acquire a near-view image and a far-view image of a target vehicle;

[0033] A feature matching module is used to perform feature matching between a near-view image and a far-view image;

[0034] A region filtering module, used for filtering invalid regions of the near-view image and the far-view image respectively when the near-view image and the far-view image are matched;

[0035] A region matching module is used to perform color matching between the filtered near-view image and the far-view image to determine the matched vehicle component region;

[0036] The image correction module is used to correct the near-view image corresponding to the vehicle component area based on the majority color of the distant image when the majority color of the distant image is different from the color of the near-view image corresponding to the vehicle component.

[0037] In order to solve the above technical problems, an embodiment of the present application further provides a computer device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps of the above image correction method when executing the computer program.

[0038] In order to solve the above technical problems, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above image correction method are implemented.

[0039] Compared with the related art, the embodiments of the present application have the following beneficial effects:

[0040] By acquiring the close-up image and the distant image of the target vehicle, when the close-up image matches the distant image, the invalid regions of the close-up image and the distant image are filtered out respectively, and the filtered close-up image is color matched with the distant image to determine the matched vehicle component region. For the vehicle component region, when the majority color of the distant image is different from the color of the close-up image corresponding to the vehicle component, the close-up image corresponding to the vehicle component region is corrected based on the majority color of the distant image, that is, by filtering out the invalid region and excluding irrelevant feature points, the effective matching in the distant image and the close-up image is ensured. Since the segmentation result of the distant image ( The overall structure of the image can be determined more accurately by matching the distant image with the close-up image, i.e., each vehicle component area. However, the local feature segmentation of the close-up image may be biased. Therefore, the distant image and the close-up image are matched to ensure that the boundaries and positions of each vehicle component area in the close-up image are more accurate, effectively avoiding the problem of inaccurate recognition of vehicle components caused by close-up image segmentation errors, thereby improving the overall accuracy of close-up segmentation. At the same time, the segmentation result of the distant image is used as the basis for correcting the close-up image, i.e., forming a processing method that combines distant and close-up images, thereby enhancing the robustness to different image qualities and scene changes, thereby improving the accuracy of image correction, and thus improving the accuracy of vehicle damage assessment. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0042] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;

[0043] Figure 2 is a flow chart of an embodiment of the image correction method of the present application;

[0044] Figure 3 The near-view image, the far-view image and the corresponding segmentation map provided in the embodiment of the present application;

[0045] Figure 4 is a structural schematic diagram of an embodiment of an image correction device according to the present application;

[0046] Figure 5 It is a structural diagram of an embodiment of a computer device according to the present application. DETAILED DESCRIPTION

[0047] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.

[0048] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0049] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.

[0050] like Figure 1 As shown, the system architecture 100 may include a terminal device 101, a network 102 and a server 103. The terminal device 101 may be a laptop 1011, a tablet computer 1012 or a mobile phone 1013. The network 102 is used to provide a medium for a communication link between the terminal device 101 and the server 103. The network 102 may include various connection types, such as wired, wireless communication links or optical fiber cables.

[0051] The user can use the terminal device 101 to interact with the server 103 through the network 102 to receive or send messages, etc. Various communication client applications can be installed on the terminal device 101, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.

[0052] The terminal device 101 can be any electronic device with a display screen and supporting web browsing. In addition to a laptop computer 1011, a tablet computer 1012 or a mobile phone 1013, the terminal device 101 can also be an e-book reader, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 (Moving Picture Experts Group Audio Layer IV), a laptop computer, a desktop computer, etc.

[0053] The server 103 may be a server that provides various services, such as a background server that provides support for a web page displayed on the terminal device 101 .

[0054] It should be noted that the image correction method provided in the embodiment of the present application is generally executed by a server / terminal device, and accordingly, the image correction device is generally arranged in the server / terminal device.

[0055] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0056] Continue to refer Figure 2 , shows a flow chart of an embodiment of the image correction method according to the present application. The image correction method comprises the following steps:

[0057] Step S201, obtaining a near-view image and a far-view image of a target vehicle.

[0058] In this embodiment, the electronic device (eg, Figure 1 The server / terminal device shown in the figure can receive the near-view image and the far-view image of the target vehicle through a wired connection or a wireless connection. It should be noted that the above wireless connection method may include but is not limited to 3G / 4G / 5G connection, WiFi connection, Bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection, and other wireless connection methods currently known or to be developed in the future.

[0059] Among them, the distant image and the close-up image are determined based on the viewing angle, distance and coverage of the image shooting. Generally, in the vehicle damage assessment scenario, the close-up image refers to the image taken from a relatively close distance, which usually focuses on the detail image of a certain component or local area to show the slight damage and details of the vehicle, such as scratches on the body, local dents, close-ups of damaged parts such as a door, tire, and headlight, providing higher resolution detail information. The distant image refers to an image taken from a relatively long distance, including the entire vehicle or most areas. The distant image usually has a larger field of view and can fully display the appearance and overall structure of the vehicle. For example, the distant image is used to display the complete outline of the front, rear, side and other areas of the vehicle, which is convenient for the overall segmentation of the vehicle.

[0060] Specifically, the user can log in to the APP on the mobile terminal or the claim system on the web page, and upload the close-up image and the long-range image of the vehicle (i.e., the target vehicle) involved in the traffic accident according to the shooting requirements, such as shooting the overall vehicle structure diagram and the damaged vehicle parts diagram. Or by calling the relevant camera at the location where the traffic accident occurred, the long-range image and the close-up image of the target vehicle collected by the camera are obtained based on the distance from the target vehicle.

[0061] Furthermore, the image segmentation algorithm is used to segment the near-view image and the far-view image to obtain the segmentation map corresponding to each vehicle component. Figure 3 As shown, Figure 3 These are the distant view images, near view images and corresponding segmentation maps provided in the embodiments of the present application, 3-a represents the near view image and the corresponding near view segmentation map, 3-b represents the distant view image and the corresponding distant view segmentation map, and the near view segmentation map and the distant view segmentation map represent different vehicle parts by using different colors.

[0062] Step S202: performing feature matching on the near-view image and the far-view image.

[0063] Specifically, in the feature matching task, the goal is to find corresponding points of the same scene or object between two different images. For distant and close-up images, due to changes in viewing angle or distance, traditional feature matching methods (such as SIFT and ORB) may find it difficult to find stable matching points. Therefore, this embodiment uses Efficient LoFTR (Local Feature Transformer, a deep learning method for image feature matching) to achieve feature matching of distant and close-up images by combining local features of the image with global information.

[0064] Step S203: When the near-view image matches the far-view image, invalid regions are filtered out of the near-view image and the far-view image respectively.

[0065] The invalid area usually refers to the part that does not contain the object of interest, such as background, shadow, noise, mark and watermark.

[0066] Since invalid areas such as the ground and watermarks do not contain information related to vehicle damage, the presence of invalid areas will introduce additional noise, that is, the invalid areas may be mistakenly identified as part of the vehicle, resulting in inaccurate vehicle component areas.

[0067] In this embodiment, invalid area filtering may include but is not limited to one or more combined methods such as color, morphology, geometric features, and deep learning.

[0068] Step S204: color matching is performed between the filtered near-view image and the far-view image to determine the matched vehicle component area.

[0069] Since the same part of the vehicle should maintain the same color in the distant image and the close-up image, color matching can be used to ensure that the part segmentation results in the two images are consistent, thereby eliminating color differences caused by lighting, shadows, or shooting angles.

[0070] In some optional implementations, the near-view image includes near-view segmented images corresponding to a plurality of vehicle components. For example, the step of color matching the filtered near-view image with the far-view image to determine the matched vehicle component region in step S204 specifically includes:

[0071] Traverse each color of the near-field segmentation image;

[0072] For the matching points of the filtered near-view image and the distant-view image, if the number of matching points corresponding to the same color is greater than or equal to a preset number threshold, it is determined that the area corresponding to the matching points is a vehicle component area.

[0073] In this embodiment, different vehicle parts are represented by different colors. Therefore, each color in the near-view segmented image is traversed, for example, the color of the right rear door is represented as 'right_back_cardoor': (20, 152, 220), and the color of the right front door is represented as 'right_front_cardoor': (19, 155, 97).

[0074] For the same color, when the number of matching points on the vehicle parts matched by the near-view segmented image and the far-view image is greater than or equal to a preset number threshold (for example, the preset number threshold is set to 5), it is confirmed that the same vehicle part area is matched. The above color matching process can be performed in the HSV color space.

[0075] In this embodiment, the matched vehicle component area is confirmed by color and matching quantity, so that the matched vehicle component can be quickly located.

[0076] Furthermore, before the step of color matching the filtered near-view image with the far-view image to determine the matched vehicle component region in step S204, the method further includes:

[0077] The edge pixels of the vehicle component area are processed using the erosion and dilation algorithms.

[0078] Since the edge pixels of the segmented image are unstable, for example, the black pixel value is (0,0,0), and the white pixel value is (255,255,255), but the value between black and white may be (13,15,19), and other colors are similar. Therefore, this embodiment uses the corrosion and expansion algorithm of OpenCV for edge processing. The role of corrosion is to reduce the edge of the object in the image and remove the noise or unstable pixel color near the edge. Through corrosion, the edge part of the vehicle part will be compressed, thereby removing the edge pixels with color fluctuations. After corrosion, the expansion operation is performed. The role of expansion is to expand the objects in the image back and restore the area that has been reduced during the corrosion process. This process not only restores the shape of the vehicle part, but also makes the edge of the vehicle part smoother and more unified.

[0079] For example, the expression for inputting a segmented image into OpenCV for erosion and dilation calculation is img0_seg=cv2.dilate(cv2.erode(img0_seg,(10,10)),(10,10)), and the result after erosion and dilation processing may be (3,5,9).

[0080] Furthermore, since dilation erosion can only alleviate the problem of unstable edge pixels, the HSV color channel value of each vehicle component in the segmented image can be used as the upper and lower bounds for region retrieval. In this way, the color fluctuation range can be guaranteed to be more accurate during retrieval, while also avoiding invalid replacement or edge omission caused by unstable edge color. For example, according to the above example (i.e., the color of the right front car door is represented as 'right_front_cardoor': (19,155,97)), the region of the color in the segmented image is retrieved within the range of ±10 in the given color gamut (9,145,87)≤(19,155,97)≤(29,165,107).

[0081] In this embodiment, the edge optimization is performed by the corrosion and expansion algorithm, so that the edge pixel values ​​of the vehicle parts tend to be unified, which effectively solves the problem of missing edge areas. At the same time, by performing color retrieval in the HSV color space, the accurate recognition of the vehicle parts area is enhanced, the invalid replacement or omission caused by the unstable edge color is avoided, and the integrity of the segmented image is ensured.

[0082] Step S205 , for the vehicle component region, when the majority color of the distant image is different from the color of the near image corresponding to the vehicle component, the near image corresponding to the vehicle component region is corrected based on the majority color of the distant image.

[0083] The majority color generally refers to the color that appears most frequently in a specific color data set. In this embodiment, the majority color represents the main color of the vehicle component area and can be used as a criterion for judgment and correction.

[0084] In the distant image, each vehicle component has a specific color range. By counting the color values ​​of the vehicle component area, the mode color of the vehicle component can be obtained, that is, the most common color in the vehicle component area.

[0085] Since the close-up image is a local magnified perspective, although it can provide finer details, it is easily affected by factors such as lighting, angle, and reflection, resulting in inaccurate color recognition when segmenting vehicle parts, and may even misclassify certain areas. For example, shadows may cause colors to darken, or strong light may cause color distortion in reflective areas. When comparing the corresponding vehicle parts areas of the distant image and the close-up image, if it is found that the majority color of the vehicle parts area in the distant image is inconsistent with the color in the corresponding close-up image, it is considered that there is a deviation or error in the segmentation result of the close-up image. When color inconsistency is detected, the color of the corresponding vehicle parts area in the close-up image is replaced with the majority color of the distant image. Through this correction, it can be ensured that the color of the vehicle parts area in the close-up image is more accurate and consistent with the overall color characteristics of the vehicle.

[0086] By acquiring the close-up image and the distant image of the target vehicle, when the close-up image matches the distant image, the invalid regions of the close-up image and the distant image are filtered out respectively, and the filtered close-up image is color matched with the distant image to determine the matched vehicle component region. For the vehicle component region, when the majority color of the distant image is different from the color of the close-up image corresponding to the vehicle component, the close-up image corresponding to the vehicle component region is corrected based on the majority color of the distant image, that is, by filtering out the invalid region and excluding irrelevant feature points, the effective matching in the distant image and the close-up image is ensured. Since the segmentation result of the distant image ( The overall structure of the image can be determined more accurately by matching the distant image with the close-up image, i.e., each vehicle component area. However, the local feature segmentation of the close-up image may be biased. Therefore, the distant image and the close-up image are matched to ensure that the boundaries and positions of each vehicle component area in the close-up image are more accurate, effectively avoiding the problem of inaccurate recognition of vehicle components caused by close-up image segmentation errors, thereby improving the overall accuracy of close-up segmentation. At the same time, the segmentation result of the distant image is used as the basis for correcting the close-up image, i.e., forming a processing method that combines distant and close-up images, thereby enhancing the robustness to different image qualities and scene changes, thereby improving the accuracy of image correction, and thus improving the accuracy of vehicle damage assessment.

[0087] In some optional implementations, the step of performing feature matching on the near-view image and the far-view image in step S202 specifically includes:

[0088] Converting the near-view image and the far-view image into a first grayscale image and a second grayscale image respectively;

[0089] Extracting features and matching the first grayscale image and the second grayscale image to obtain multiple pairs of first matching points;

[0090] If the confidence score corresponding to the first matching point is greater than the preset confidence threshold, it is confirmed that the first matching point is matched successfully.

[0091] In this embodiment, the input distant image and close-up image are converted into a first grayscale image and a second grayscale image, respectively, which can reduce the computational complexity. Furthermore, the first grayscale image and the second grayscale image are input into Efficient LoFTR, and the features corresponding to the respective grayscale images are extracted respectively. Efficient LoFTR generates local features of the image through a deep neural network, and aggregates the global context information of the local features using the Transformer module. This enables Efficient LoFTR to handle matching tasks with larger scale and perspective changes. By using the attention mechanism, Efficient LoFTR finds possible matching feature points in each grayscale image and calculates the similarity between them. For each pair of matching feature points, the EfficientLoFTR model generates a corresponding confidence score to measure the credibility of the match.

[0092] In this embodiment, the preset confidence threshold may be set to 0.6. For example, if the confidence score obtained by matching is greater than 0.6, it is considered that the pixel points corresponding to the near-view image and the distant-view image (ie, the first matching points) are matched successfully.

[0093] In some optional implementations, when the near-view image matches the far-view image in step S203, filtering out invalid regions of the near-view image and the far-view image respectively includes the following steps:

[0094] Step S2031, if the number of first matching points that are successfully matched is greater than or equal to a preset matching number threshold, it is determined that the near-view image matches the far-view image;

[0095] In this embodiment, the preset matching quantity threshold can be determined based on experimental data of the actual damage assessment scenario in step S2032, and invalid areas of the matching close-up image and distant image are filtered out based on the preset position distance and preset pixel value.

[0096] In this embodiment, the invalid area may include but is not limited to the watermark area, the ground or unknown vehicle parts area, etc. Since the location of the watermark is relatively fixed, the watermark area can be filtered out by determining whether the distance between the coordinates of the matching points is within the preset position distance. For example, the preset position distance can be a Manhattan distance of 2. Since the pixel values ​​in the ground area or the unknown vehicle parts area in the grayscale image are fixed, the ground area or the unknown vehicle parts area can be filtered out when the pixel value of the matching point is retrieved to be the preset pixel value. For example, the preset position distance can be 0, that is, the area displayed as black in the grayscale image is filtered out.

[0097] In this embodiment, by setting a matching number threshold, the mismatch of the distant image and the near image due to too few first matching points satisfying the confidence threshold is avoided, so as to improve the matching accuracy between images. Invalid area filtering of matching points based on preset position distance and preset pixel value can automatically remove irrelevant or unreliable areas in the matching process (i.e., invalid areas affected by complex scenes such as illumination changes, large viewing angle differences, noise interference, etc.), enhance robustness and adaptability, and reduce useless data in subsequent processing steps, reduce computational complexity, and reduce storage space consumption, which is particularly important when processing large-scale image data or high-resolution images, and can effectively improve the operating efficiency of the image processing process.

[0098] Further, step S2032 is a step of filtering out invalid areas of the matching near-view image and distant-view image based on the preset position distance and the preset pixel value, which specifically includes:

[0099] If the distance between the first matching points is less than or equal to the preset position distance, the area corresponding to the first matching points is filtered out;

[0100] After filtering out the area corresponding to the first matching point, if there is a second matching point between the near-view image and the distant-view image, then filtering out the area in the distant-view image whose pixel value is equal to the preset pixel value.

[0101] In this embodiment, in order to identify and filter out invalid matches in the watermark area, the Manhattan distance between the first matching points can be used for judgment. The Manhattan distance refers to the sum of the distances between two points in the horizontal and vertical directions. Therefore, the Manhattan distance is calculated based on the coordinates of the first matching point. When the Manhattan distance does not exceed the preset position distance (for example, the preset position distance is 2), the area can be considered as an invalid match of the watermark part and filtered out.

[0102] After filtering out invalid matches of the watermark, if there are still second matching points (i.e., remaining matching points) in the distant image and the near image, further filter out invalid matches of the ground part. Since the distant segmentation result is more accurate, the distant image segmentation result is used as a basis, that is, the invalid matches of the ground part corresponding to the pixel value in the second grayscale image equal to the preset pixel value (e.g., the preset pixel value is 0, i.e., the pixel value 0 represents black, and black represents the ground or unknown parts) are filtered out.

[0103] Through the distance between the first matching points, the invalid areas with relatively fixed positions can be accurately identified and removed to prevent the invalid areas from interfering with the matching of real features. At the same time, the method of filtering out invalid areas based on preset pixel values ​​can accurately filter out areas that are not of concern in the grayscale image (i.e., areas of non-interest, which are generally represented by the same fixed pixel value), thereby further improving the effectiveness of the matching points and the matching accuracy.

[0104] Furthermore, after the step of filtering out invalid areas of the matching near-view image and distant-view image based on the preset position distance and the preset pixel value, the method further includes:

[0105] Determine the remaining matching points between the first grayscale image and the second grayscale image after filtering;

[0106] If the number of remaining matching points is greater than the preset matching point threshold, the step of color matching the filtered near-view image with the distant-view image is performed.

[0107] Exemplarily, the matching point threshold can be set to 20. After removing the invalid area, if the remaining matching points are still greater than the matching point threshold, it means that there is a valid area in the matched grayscale image, that is, there is a vehicle component area, and effective matching of the distant image and the close-up image to the vehicle component is achieved.

[0108] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0109] The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics and other technologies. Artificial intelligence software technology mainly includes computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning. This application can be applied in the field of smart cities, thereby promoting the construction of smart cities.

[0110] This application belongs to the field of smart cities, and this solution can promote the construction of smart cities.

[0111] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0112] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0113] Further references Figure 4 , as a response to the above Figure 2 The present application provides an embodiment of an image correction device, and the embodiment of the device is Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0114] like Figure 4 As shown, the image correction device 400 described in this embodiment includes an image acquisition module 401, a feature matching module 402, a region filtering module 403, a region matching module 404, and an image correction module 405. Among them:

[0115] An image acquisition module 401 is used to acquire a near-view image and a far-view image of a target vehicle;

[0116] A feature matching module 402 is used to perform feature matching on the near-view image and the far-view image;

[0117] The region filtering module 403 is used to filter out invalid regions of the near-view image and the far-view image respectively when the near-view image and the far-view image match each other;

[0118] The region matching module 404 is used to perform color matching between the filtered near-view image and the far-view image to determine the matched vehicle component region;

[0119] The image correction module 405 is used to correct the near-view image corresponding to the vehicle component area based on the majority color of the distant image when the majority color of the distant image is different from the color of the near-view image corresponding to the vehicle component.

[0120] Furthermore, the feature matching module 402 includes:

[0121] An image conversion submodule, used for converting a near-view image and a distant-view image into a first grayscale image and a second grayscale image respectively;

[0122] An extraction and matching submodule, used for performing feature extraction and matching on the first grayscale image and the second grayscale image to obtain a plurality of pairs of first matching points;

[0123] The feature point matching submodule is used to confirm that the first matching point is matched successfully if the confidence score corresponding to the first matching point is greater than a preset confidence threshold.

[0124] Furthermore, the region filtering module 402 includes:

[0125] An image matching submodule, configured to determine that the near-view image matches the far-view image if the number of first matching points that are successfully matched is greater than or equal to a preset matching number threshold;

[0126] The area filtering submodule is used to filter out invalid areas of the matching near-view image and distant-view image based on a preset position distance and a preset pixel value.

[0127] Furthermore, the region filtering submodule includes:

[0128] A first filtering unit, configured to filter out the area corresponding to the first matching points if the distance between the first matching points is less than or equal to the preset position distance;

[0129] The second filtering unit is used to filter out the area corresponding to the first matching point, if there is a second matching point between the near-view image and the distant-view image, the area whose pixel value is equal to the preset pixel value in the distant-view image.

[0130] Furthermore, the close-up image includes close-up segmented images corresponding to a plurality of vehicle components, and the region matching module 403 includes:

[0131] The image traversal submodule is used to traverse each color of the near-field segmentation image;

[0132] The component determination submodule is used to determine the area corresponding to the matching points of the filtered near-view image and the distant view image as the vehicle component area if the number of matching points corresponding to the same color is greater than or equal to a preset number threshold.

[0133] Furthermore, the image correction device 400 further includes:

[0134] The edge processing module is used to process the edge pixels of the vehicle component area using corrosion and expansion algorithms.

[0135] Furthermore, the image correction device 400 further includes:

[0136] A matching point determination module, used to determine the remaining matching points between the first grayscale image and the second grayscale image after filtering;

[0137] The color matching module is used to execute the step of color matching between the filtered near-view image and the distant-view image if the number of remaining matching points is greater than a preset matching point threshold.

[0138] To solve the above technical problems, the present application also provides a computer device. Figure 5 , Figure 5 This is a basic structural block diagram of the computer device in this embodiment.

[0139] The computer device 5 includes a memory 51, a processor 52, and a network interface 53 that are interconnected through a system bus. It should be noted that the figure only shows a computer device 5 with a memory 51, a processor 52, and a network interface 53, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.

[0140] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.

[0141] The memory 51 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 51 can be an internal storage unit of the computer device 5, such as a hard disk or memory of the computer device 5. In other embodiments, the memory 51 can also be an external storage device of the computer device 5, such as a plug-in hard disk equipped on the computer device 5, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. Of course, the memory 51 can also include both the internal storage unit of the computer device 5 and its external storage device. In this embodiment, the memory 51 is generally used to store the operating system and various application software installed on the computer device 5, such as computer-readable instructions of the image correction method, etc. In addition, the memory 51 can also be used to temporarily store various types of data that have been output or are to be output.

[0142] The processor 52 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 52 is generally used to control the overall operation of the computer device 5. In this embodiment, the processor 52 is used to run computer-readable instructions stored in the memory 51 or process data, such as computer-readable instructions for running the image correction method.

[0143] The network interface 53 may include a wireless network interface or a wired network interface. The network interface 53 is generally used to establish a communication connection between the computer device 5 and other electronic devices.

[0144] The present application also provides another embodiment, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions can be executed by at least one processor to enable the at least one processor to perform the steps of the image correction method as described above.

[0145] The non-Company software tools or components appearing in the embodiments of this application are merely examples and do not represent actual use.

[0146] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0147] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.

Claims

1. An image correction method, characterized in that: The steps include: Acquire a close-up image and a long-range image of the target vehicle; Performing feature matching on the near-view image and the far-view image; When the near-view image matches the far-view image, filtering out invalid areas of the near-view image and the far-view image respectively; Performing color matching on the filtered near-view image and the far-view image to determine the matched vehicle component area; For the vehicle component region, when the majority color of the distant image is different from the color of the near-view image corresponding to the vehicle component, the near-view image corresponding to the vehicle component region is corrected based on the majority color of the distant image.

2. The image correction method according to claim 1, characterized in that: The step of performing feature matching on the near-view image and the far-view image specifically includes: Converting the near-view image and the far-view image into a first grayscale image and a second grayscale image respectively; Extracting features and matching the first grayscale image and the second grayscale image to obtain multiple pairs of first matching points; If the confidence score corresponding to the first matching point is greater than a preset confidence threshold, it is confirmed that the first matching point is matched successfully.

3. The image correction method according to claim 2, characterized in that: The step of filtering out invalid areas of the near-view image and the far-view image respectively when the near-view image matches the far-view image specifically comprises: If the number of the first matching points that are successfully matched is greater than or equal to a preset matching number threshold, it is determined that the near-view image matches the far-view image; Based on the preset position distance and the preset pixel value, invalid areas of the matching near-view image and the distant-view image are filtered out.

4. The image correction method according to claim 3, characterized in that: The step of filtering out invalid areas of the matching near-view image and the distant-view image based on the preset position distance and the preset pixel value specifically includes: If the distance between the first matching points is less than or equal to the preset position distance, filtering out the area corresponding to the first matching points; After filtering out the area corresponding to the first matching point, if there is a second matching point between the near-view image and the distant-view image, then filtering out the area in the distant-view image whose pixel value is equal to the preset pixel value.

5. The image correction method according to claim 1, characterized in that: The near-view image includes near-view segmented images corresponding to a plurality of vehicle components, and the step of color matching the filtered near-view image with the distant image to determine the matched vehicle component area specifically includes: Traversing each color of the near-view segmented image; For the matching points of the filtered near-view image and the distant-view image, if the number of the matching points corresponding to the same color is greater than or equal to a preset number threshold, it is determined that the area corresponding to the matching points is the vehicle component area.

6. The image correction method according to any one of claims 1 to 5, characterized in that: Before the step of color matching the filtered near-view image with the distant view image to determine the matched vehicle component area, the method further includes: The edge pixels of the vehicle component area are processed using corrosion and expansion algorithms.

7. The image correction method according to any one of claims 2 to 4, characterized in that: After the step of filtering out invalid areas of the matching near-view image and the distant-view image based on the preset position distance and the preset pixel value, the method further includes: Determine remaining matching points between the first grayscale image and the second grayscale image after filtering; If the number of the remaining matching points is greater than the preset matching point threshold, the step of color matching the filtered near-view image with the distant-view image is performed.

8. An image correction device, characterized in that: include: An image acquisition module, used to acquire a near-view image and a far-view image of a target vehicle; A feature matching module, used for performing feature matching on the near-view image and the far-view image; A region filtering module, used for filtering invalid regions of the near-view image and the far-view image respectively when the near-view image matches the far-view image; A region matching module is used to perform color matching between the filtered near-view image and the far-view image to determine the matched vehicle component region; The image correction module is used to correct the near-view image corresponding to the vehicle component area based on the majority color of the distant image when the majority color of the distant image is different from the color of the near-view image corresponding to the vehicle component.

9. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores computer-readable instructions, and the processor implements the steps of the image correction method according to any one of claims 1 to 7 when executing the computer-readable instructions.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the image correction method according to any one of claims 1 to 7 are implemented.