Vehicle detection method and system based on AI technology

By analyzing the packaging characteristics and spot distribution of the scanned image of the ID, determining the spot suppression parameters and optimizing the image quality, the optical interference problem introduced by the physical ID packaging protection measures is solved, and high-precision automatic identification of ID information is achieved.

CN120472472AActive Publication Date: 2025-08-12SHENZHEN ANCHE TECH
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510953970.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-11
Publication Date
2025-08-12
Estimated Expiration
2045-07-11

AI Technical Summary

Technical Problem

When the existing vehicle detection system faces optical interference introduced by the packaging protection measures of physical documents, it causes the key information area to be unreadable, forcing the system to be demoted to manual intervention, seriously restricting the effectiveness of the entire process automation.

Method used

By obtaining the scanned image of the certificate, analyzing the packaging characteristics and spot distribution of the certificate, determining the spot suppression parameters, optimizing the image and identifying the certificate information based on AI technology, eliminating reflective interference from certificates of different materials, and improving image quality.

Benefits of technology

Effectively eliminate spot interference, improve AI recognition accuracy, reduce recognition error rate, and realize automatic identification of document information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120472472A_ABST
    Figure CN120472472A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of vehicle detection, in particular to a vehicle detection method and system based on an AI technology. The method comprises the following steps: acquiring a certificate scanning image corresponding to a vehicle detection task; analyzing the document scanning image, and determining document packaging characteristics and light spot distribution; determining a light spot suppression parameter according to the certificate packaging characteristics and the light spot distribution; according to the light spot suppression parameter, optimizing the certificate scanning image to obtain an optimized image; and identifying the optimized image based on an AI technology, and determining certificate information. Reflection of certificates made of different materials is specifically eliminated, the image is optimized, and the image quality is improved. After the light spot interference is eliminated, the AI recognition precision is improved, and the recognition error rate is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of vehicle detection technology, and in particular to a vehicle detection method and system based on AI technology. Background Art

[0002] In recent years, artificial intelligence (AI) has achieved significant breakthroughs in vehicle management and intelligent transportation, particularly in automated document recognition. Deep learning-based OCR (optical character recognition) and image processing technologies have gradually replaced traditional manual verification, significantly improving the efficiency and accuracy of vehicle inspections, annual inspections, and traffic violation handling. Existing systems generally support rapid scanning and information extraction of key documents such as driver's licenses and vehicle registration certificates using mobile terminals or dedicated devices, driving the paperless and intelligent development of vehicle management services.

[0003] In real and complex scenarios, the optical interference problem introduced by the packaging protection measures of physical documents (such as leather cases and plastic seals) makes key information areas unreadable, forcing the system to downgrade to manual intervention processing, seriously restricting the efficiency of full-process automation. Summary of the Invention

[0004] This application provides a vehicle detection method and system based on AI technology to solve the above problems.

[0005] In a first aspect, the present application provides a vehicle detection method based on AI technology, the method comprising: Obtain the document scan image corresponding to the vehicle inspection task; Analyze the document scan image to determine the document packaging characteristics and light spot distribution; Determining light spot suppression parameters according to the document packaging characteristics and the light spot distribution; Optimizing the document scan image according to the light spot suppression parameters to obtain an optimized image; The optimized image is identified based on AI technology to determine the document information.

[0006] This solution leverages document packaging characteristics and spot distribution to determine spot suppression parameters, thereby specifically eliminating reflections from documents of different materials, optimizing images, and improving image quality. Eliminating spot interference improves AI recognition accuracy and reduces recognition error rates.

[0007] Optionally, analyzing the document scan image to determine document packaging characteristics and light spot distribution includes: Performing edge detection on the scanned document image, and determining whether there is document packaging based on the edge detection result; If there is a document package, determine the edge gradient distribution of the document scan image and the material of the document package based on the edge detection result; determining a packaging wrinkle density according to the edge gradient distribution; Determining the characteristics of the document packaging according to the material of the document packaging and the density of the packaging wrinkles; According to the material of the certificate packaging, query the preset material optical parameter database to determine the material reflectivity; Analyzing the scanned image of the document to determine the image brightness distribution; The light spot distribution is determined according to the package wrinkle density, the image brightness distribution and the material reflectivity.

[0008] This solution performs edge detection on scanned ID images. Based on the edge detection results, it determines whether ID packaging is present, effectively filtering out unpackaged images and avoiding ineffective processing. If ID packaging is present, the edge gradient distribution of the scanned ID image and the ID packaging material are determined based on the edge detection results to ensure that the reflective behavior of different materials can be distinguished. The packaging wrinkle density is determined based on the edge gradient distribution, reflecting the density of wrinkles on the packaging surface and used to predict light spot tendencies. Based on the ID packaging material and the packaging wrinkle density, the ID packaging characteristics are determined, simplifying adaptation to dynamic packaging changes. Based on the ID packaging material, a database of preset material optical parameters is queried to determine the material reflectivity, reducing real-time computational overhead and providing input for light spot intensity prediction. The scanned ID image is analyzed to determine the image brightness distribution, ensuring that the light spot distribution is consistent with areas of actual brightness anomalies. The light spot distribution is determined based on the packaging wrinkle density, image brightness distribution, and material reflectivity, improving image optimization accuracy.

[0009] Optionally, determining the light spot suppression parameter according to the document packaging characteristics and the light spot distribution includes: Determining the packaging type according to the packaging characteristics of the certificate; Analyzing the light spot distribution and predicting light source position information; Predicting a light spot type according to the light source position information and the package type; A light spot suppression parameter is determined according to the light spot type and the package wrinkle density.

[0010] This solution determines the packaging type based on the document's packaging characteristics, avoiding parameter selection errors caused by packaging type ambiguity. It analyzes the light spot distribution and predicts the light source's position, ensuring real-time adaptation of the light spot to dynamic changes in the light source. It predicts the light spot type based on the light source's position and packaging type, avoiding unstable optimization results caused by type confusion. It also determines light spot suppression parameters based on the light spot type and packaging wrinkle density, improving image optimization and meeting high-precision recognition requirements.

[0011] Optionally, the light spot type includes a reflection light spot and a refraction light spot; and determining the light spot suppression parameter according to the light spot type and the package wrinkle density includes: Obtaining a predefined optical parameter lookup table; the predefined optical parameter lookup table includes a polarization compensation parameter set and a wavelength shift parameter set; Based on the light spot type and the packaging wrinkle density, determining the distribution of the reflected light spot and the distribution of the refracted light spot; Analyzing the distribution of the reflected light spot and the distribution of the refracted light spot to determine the distribution weight of the reflected light spot and the distribution weight of the refracted light spot; If the distribution weight of the reflected light spot is greater than the distribution weight of the refracted light spot, the light spot suppression parameter adopts the polarization compensation parameter set; If the distribution weight of the refraction light spot is greater than or equal to the distribution weight of the reflection light spot, the light spot suppression parameter adopts the wavelength shift parameter set.

[0012] This solution obtains a predefined optical parameter lookup table, which includes a polarization compensation parameter set and a wavelength shift parameter set. This reduces real-time computational overhead and improves processing efficiency. Based on the spot type and the density of the packaging wrinkles, the distribution of the reflected and refracted spots is determined. This prevents global image processing from accidentally affecting valid areas and ensures that information obscured by the spots is not missed in areas with dense wrinkles. The distribution of the reflected and refracted spots is analyzed to determine the distribution weights for the reflected and refracted spots. This accurately reflects the impact of the spot type on the image and prevents under- or over-suppression in information areas due to weight miscalculation. If the distribution weight of the reflected spot is greater than the distribution weight of the refracted spot, the spot suppression parameters use the polarization compensation parameter set to optimize the image brightness distribution and reduce overexposed areas. If the distribution weight of the refracted spot is greater than the distribution weight of the reflected spot, the spot suppression parameters use the wavelength shift parameter set to reduce blur or distortion, preserve the original document texture, enhance image robustness, and prevent residual artifacts after optimization.

[0013] Optionally, optimizing the document scan image according to the light spot suppression parameter to obtain an optimized image includes: Determining the spatial coordinates of the light spot based on the light spot distribution; Determining a light spot intensity value according to the image brightness distribution; generating a binary spot mask according to the spot spatial coordinates and the spot intensity value; Determining a direction of change of wrinkle density according to the package wrinkle density and the edge gradient distribution; Expanding the edge feathering region of the binary spot mask according to the direction of change of the wrinkle density; Based on the expanded binary spot mask and according to the spot suppression parameters, adaptive filtering is performed on the document scan image to obtain an optimized image.

[0014] This solution determines the spatial coordinates of the light spot based on its distribution, ensuring that the light spot suppression process targets only interfering areas and preventing global operations from accidentally affecting valid areas of the document, thereby improving the accuracy of local adaptive processing. The light spot intensity value is determined based on the image brightness distribution to avoid over-suppression and loss of image detail. A binary light spot mask is generated based on the spatial coordinates and intensity values to isolate the interfering light spot areas, providing a target area for adaptive filtering and ensuring that processing is limited to the light spot. The direction of wrinkle density variation is determined based on the package wrinkle density and edge gradient distribution, eliminating the dynamic diffusion of light spot within wrinkle areas. This ensures that the feathering process adapts to wrinkle variations and avoids image edge distortion caused by inaccurate feathering. The edge feathering region of the binary light spot mask is expanded based on the direction of wrinkle density variation to eliminate the hard edge effect after light spot suppression, ensuring a natural transition in the optimized image, reducing artifacts, and improving image visual quality. Based on the expanded binary light spot mask and the light spot suppression parameters, adaptive filtering is performed on the scanned document image to produce an optimized image that effectively suppresses light spot while preserving document detail.

[0015] Optionally, determining the packaging wrinkle density according to the edge gradient distribution includes: Determining the distribution characteristics of the certificate information according to the vehicle detection task; Dividing the scanned document image into cells according to the document information distribution characteristics to obtain a plurality of image units; For each image unit, determining the amplitude variance corresponding to the edge gradient change within the image unit according to the edge gradient distribution; For any adjacent image units, analyzing the change rate between the amplitude variances, and determining a high wrinkle change area based on the change rate; The average value of the rate of change and the proportion of the high wrinkle change area to the area of the document scan image are calculated, and the packaging wrinkle density is determined based on the average value of the rate of change and the area proportion.

[0016] Through this solution, the distribution characteristics of document information are determined according to the vehicle detection task, avoiding the waste of resources caused by global operations. According to the distribution characteristics of document information, the document scan image is divided into cells to obtain several image units, simplifying the image structure, improving computational efficiency and facilitating parallel processing. For each image unit, the amplitude variance corresponding to the edge gradient change within the image unit is determined based on the edge gradient distribution, so that the wrinkle analysis has local granularity. For any adjacent image units, the rate of change between the amplitude variances is analyzed, and the high wrinkle change area is determined based on the rate of change, avoiding the redundancy caused by global processing and providing input for the comprehensive calculation of the package wrinkle density. The mean value of the rate of change and the proportion of the high wrinkle change area in the area of the document scan image are calculated. According to the mean value of the rate of change and the area proportion, the package wrinkle density is determined, the robustness of the spot suppression is improved, the image is optimized to retain document details, and the reliability of AI recognition is enhanced.

[0017] Optionally, analyzing the light spot distribution and predicting light source position information includes: Analyzing the light spot distribution to determine a light spot set; Clustering the light spot set to determine a brightness connected domain; determining a plurality of light source clusters according to the brightness connected domain; The weighted centroids of several light source clusters are calculated, and the light source position information is predicted based on the weighted centroids.

[0018] This solution analyzes the light spot distribution, identifies light spot clusters, and locates high-brightness interference areas, ensuring that the light spot distribution characteristics are quantitatively captured. Light spot clusters are clustered to identify brightness connected domains, effectively eliminating noise interference. Based on these brightness connected domains, several light source clusters are identified, improving the robustness and accuracy of the prediction. The weighted centroids of these clusters are calculated and used to predict light source locations, enhancing the optimization of document scanned images.

[0019] Optionally, analyzing the change rate between the amplitude variances and determining a high wrinkle change area according to the change rate includes: Determining the direction angle of the gradient distribution between any adjacent image units according to the edge gradient distribution; Constructing a gradient transfer matrix between image units according to the amplitude variance and the direction angle; According to the gradient transfer matrix, spatially continuous high gradient transition regions are merged to generate high wrinkle change regions.

[0020] This approach uses edge gradient distribution to determine the directional angle between any two adjacent image units, quantifying the spatial evolution of gradient directions between these units. Based on the amplitude variance and directional angle, a gradient transfer matrix is constructed between these units, avoiding the blindness of global thresholding. Based on the gradient transfer matrix, spatially continuous high-gradient transition regions are merged to generate regions of high fold change, eliminating isolated high-value points in the matrix.

[0021] Optionally, determining the distribution of reflected light spots and the distribution of refracted light spots according to the package wrinkle density includes: Determining the light source intensity according to the image brightness distribution and the material reflectivity; Determining the reflection attenuation coefficient and the refraction attenuation coefficient according to the material of the certificate packaging; Predicting a vector from the light source to the document surface based on the light source position information; Determining the distribution of the reflected light spots according to the light source intensity, the vector, the package wrinkle density, and the reflection attenuation coefficient; Determine the refractive index of the material according to the material of the certificate packaging; The distribution of the refraction spot is determined according to the light source intensity, the vector, the packaging wrinkle density, the refraction attenuation coefficient and the material refractive index.

[0022] This solution determines the light source intensity based on the image brightness distribution and material reflectivity, ensuring the accuracy of the light spot distribution prediction and thus reducing the impact of image brightness distortion on light spot modeling. The reflection and refraction attenuation coefficients are determined based on the document packaging material to ensure that the predictions of the reflection and refraction light spots reflect the optical properties of the material. Based on the light source position information, the vector from the light source to the document surface is predicted to describe the incident direction of the light and provide a geometric basis for the calculation of the reflection / refraction angle. Based on the light source intensity, vector, packaging wrinkle density, and reflection attenuation coefficient, the reflection light spot distribution is determined to ensure effective processing of reflection light spots in areas with high packaging wrinkle density. Based on the document packaging material, the material refractive index is determined to reduce prediction errors caused by unknown material refractive properties. Based on the light source intensity, vector, packaging wrinkle density, refraction attenuation coefficient, and material refractive index, the refraction light spot distribution is determined to ensure processing of refraction light spots in the direction of changing packaging wrinkles and avoid residual artifacts from image optimization.

[0023] In a second aspect, the present application provides a vehicle detection system based on AI technology, the system comprising: Image acquisition module, used to obtain the document scan image during vehicle inspection; An image analysis module, configured to analyze the scanned document image and determine the document packaging characteristics and light spot distribution; A suppression parameter determination module, configured to determine a light spot suppression parameter according to the document packaging characteristics and the light spot distribution; An image optimization module, configured to optimize the document scan image according to the light spot suppression parameters to obtain an optimized image; The information determination module is used to identify the optimized image based on AI technology and determine the document information.

[0024] Optionally, when the image analysis module analyzes the scanned document image and determines the document packaging characteristics and light spot distribution, it is used to: perform edge detection on the scanned document image, and determine whether there is document packaging based on the edge detection result; if there is document packaging, determine the edge gradient distribution of the scanned document image and the document packaging material based on the edge detection result; determine the packaging wrinkle density based on the edge gradient distribution; determine the document packaging characteristics based on the document packaging material and the packaging wrinkle density; query a preset material optical parameter database based on the document packaging material to determine the material reflectivity; analyze the scanned document image to determine the image brightness distribution; determine the light spot distribution based on the packaging wrinkle density, the image brightness distribution and the material reflectivity.

[0025] Optionally, when the suppression parameter determination module determines the light spot suppression parameter based on the document packaging characteristics and the light spot distribution, it is used to: determine the packaging type based on the document packaging characteristics; analyze the light spot distribution to predict the light source position information; predict the light spot type based on the light source position information and the packaging type; and determine the light spot suppression parameter based on the light spot type and the packaging wrinkle density.

[0026] Optionally, the spot type includes a reflection spot and a refraction spot; when the suppression parameter determination module determines the spot suppression parameter according to the spot type and the packaging wrinkle density, it is used to: obtain a predefined optical parameter lookup table; the predefined optical parameter lookup table includes a polarization compensation parameter set and a wavelength shift parameter set; based on the spot type and according to the packaging wrinkle density, determine the reflection spot distribution and the refraction spot distribution; analyze the reflection spot distribution and the refraction spot distribution to determine the distribution weight of the reflection spot and the distribution weight of the refraction spot; if the distribution weight of the reflection spot is greater than the distribution weight of the refraction spot, the spot suppression parameter adopts the polarization compensation parameter set; if the distribution weight of the refraction spot is ≥ the distribution weight of the reflection spot, the spot suppression parameter adopts the wavelength shift parameter set.

[0027] Optionally, the image optimization module optimizes the document scan image according to the spot suppression parameters, and when obtaining the optimized image, is used to: determine the spot spatial coordinates based on the spot distribution; determine the spot intensity value according to the image brightness distribution; generate a binary spot mask according to the spot spatial coordinates and the spot intensity value; determine the direction of change of the wrinkle density according to the packaging wrinkle density and the edge gradient distribution; expand the edge feathering area of the binary spot mask according to the direction of change of the wrinkle density; based on the expanded binary spot mask, perform adaptive filtering on the document scan image according to the spot suppression parameters to obtain the optimized image.

[0028] Optionally, when the image analysis module determines the packaging wrinkle density based on the edge gradient distribution, it is used to: determine the document information distribution characteristics based on the vehicle detection task; divide the document scan image into cells based on the document information distribution characteristics to obtain a number of image units; for each image unit, determine the amplitude variance corresponding to the edge gradient change within the image unit based on the edge gradient distribution; for any adjacent image units, analyze the change rate between the amplitude variances, and determine the high wrinkle change area based on the change rate; calculate the mean change rate and the proportion of the high wrinkle change area to the area of the document scan image, and determine the packaging wrinkle density based on the mean change rate and the area proportion.

[0029] Optionally, when the suppression parameter determination module analyzes the light spot distribution and predicts the light source position information, it is used to: analyze the light spot distribution to determine a light spot set; cluster the light spot set to determine a brightness connected domain; determine several light source clusters based on the brightness connected domain; calculate the weighted centroids of several light source clusters, and predict the light source position information based on the weighted centroids.

[0030] Optionally, the image analysis module analyzes the rate of change between the amplitude variances, and when determining the high wrinkle change area based on the rate of change, it is used to: determine the directional angle of the gradient distribution between any adjacent image units based on the edge gradient distribution; construct a gradient transfer matrix between image units based on the amplitude variance and the directional angle; and merge spatially continuous high gradient transition areas based on the gradient transfer matrix to generate a high wrinkle change area.

[0031] Optionally, when the suppression parameter determination module determines the distribution of reflected light spots and the distribution of refracted light spots based on the packaging wrinkle density, it is used to: determine the light source intensity based on the image brightness distribution and the material reflectivity; determine the reflection attenuation coefficient and the refraction attenuation coefficient based on the document packaging material; predict the vector from the light source to the document surface based on the light source position information; determine the reflection light spot distribution based on the light source intensity, the vector, the packaging wrinkle density and the reflection attenuation coefficient; determine the material refractive index based on the document packaging material; determine the refraction light spot distribution based on the light source intensity, the vector, the packaging wrinkle density, the refraction attenuation coefficient and the material refractive index. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. 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 labor.

[0033] Figure 1 A schematic diagram of an application scenario provided in one embodiment of the present application; Figure 2 A flowchart of a vehicle detection method based on AI technology provided in one embodiment of the present application; Figure 3 A schematic diagram of the structure of a vehicle detection system based on AI technology provided in one embodiment of the present application. DETAILED DESCRIPTION

[0034] To make the purpose, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0035] In this document, the term "and / or" simply describes a relationship between related objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A exists alone, A and B exist simultaneously, or B exists alone. Furthermore, the character " / " in this document, unless otherwise specified, generally indicates an "or" relationship between the related objects.

[0036] The embodiments of the present application are described in further detail below with reference to the accompanying drawings.

[0037] Existing systems generally support the rapid scanning and information extraction of key documents such as driver's licenses and vehicle registration certificates through mobile terminals or dedicated equipment, which has promoted the paperless and intelligent process of vehicle management services.

[0038] In real and complex scenarios, the optical interference problem introduced by the packaging protection measures of physical documents (such as leather cases and plastic seals) makes key information areas unreadable, forcing the system to downgrade to manual intervention processing, seriously restricting the efficiency of full-process automation.

[0039] Based on this, the present application provides a vehicle detection method and system based on AI technology, which obtains the document scan image corresponding to the vehicle detection task; analyzes the document scan image to determine the document packaging characteristics and light spot distribution; determines the light spot suppression parameters based on the document packaging characteristics and light spot distribution; optimizes the document scan image based on the light spot suppression parameters to obtain an optimized image; and identifies the optimized image based on AI technology to determine the document information. Using the document packaging characteristics and light spot distribution, the light spot suppression parameters are determined to specifically eliminate reflections from documents of different materials, optimize the image, and improve image quality. After eliminating light spot interference, the AI recognition accuracy is improved and the recognition error rate is reduced.

[0040] Figure 1 This is a schematic diagram of an application scenario provided by this application. When using AI technology for vehicle detection, in order to facilitate the identification of ID photos, the method provided by this application is applied.

[0041] Specifically, the method provided in this application is applied to any server. The server interacts with a high-resolution scanner, which acquires a scanned ID image captured in the vehicle detection area. The high-resolution scanner analyzes the scanned ID image, determines the ID packaging characteristics and spot distribution, and then determines spot suppression parameters. The spot suppression parameters are then used to optimize the ID scan image, thereby using AI technology to identify the optimized image and determine the ID information. For specific implementation methods, please refer to the following examples.

[0042] Figure 2 This is a flow chart of a vehicle detection method based on AI technology provided in one embodiment of the present application. The method of this embodiment can be applied to the server in the above scenario. Figure 2 As shown, the method includes: S201, obtaining a scanned image of a certificate corresponding to a vehicle inspection task; The vehicle inspection task may be a task of performing compliance inspection on a vehicle.

[0043] The document scan image may be a digitized image of the document captured by a high-resolution scanner, including features such as anti-counterfeiting textures, printed text, and a transparent packaging layer.

[0044] Specifically, when there is a vehicle detection task, a high-resolution scanner is used to collect a digitized image of the document to obtain a scanned image of the document.

[0045] S202, analyzing the scanned image of the document to determine the document packaging characteristics and light spot distribution; Document packaging features can be the physical properties of the document surface coating (such as thickness, refractive index, texture), which are represented by local gradient features of the image.

[0046] The light spot distribution may be an overexposed area formed by reflection from the packaging film.

[0047] Specifically, light spot interference can obscure document text, necessitating the quantification of the spatial relationship between packaging material characteristics and light spot. Therefore, the Sobel operator is used to calculate the gradient map of the scanned document image and identify high-gradient regions (such as the edge of the film). The mean grayscale variance of these high-gradient regions is then calculated to determine the document packaging characteristics.

[0048] The scanned document image is converted to the HSV space, and the connected domain with high brightness (V>240V) and low saturation (S<10) in the HSV space is extracted. The connected domain is morphologically expanded, and the spot area is marked to obtain the spot distribution.

[0049] S203, determining light spot suppression parameters according to the document packaging characteristics and light spot distribution; The speckle suppression parameters can be used to control the brightness attenuation of the spot area and the neighborhood repair strength.

[0050] Specifically, because the light spot characteristics of different packaging materials vary significantly (e.g., matte film has a dispersed light spot, while glossy film has a concentrated light spot), dynamic suppression parameters must be generated to adapt to different document types. Based on the light spot distribution, the light spot area ratio is calculated. Then, the light spot suppression parameters are calculated based on the average grayscale variance and light spot area ratio obtained in step S202 above.

[0051] S204, optimizing the document scan image according to the light spot suppression parameter to obtain an optimized image; The optimized image may be an image in which key information areas (such as document numbers and seals) are clearly discernible after being processed with spot suppression.

[0052] Specifically, directly using the original image for OCR recognition may result in a high error rate (character loss rate >40% in the spot area), so it is necessary to eliminate reflection interference. In this case, the spot suppression parameters obtained in the above steps are used to optimize the scanned document image to obtain an optimized image.

[0053] S205: Identify and optimize the image based on AI technology to determine the certificate information.

[0054] The certificate information may include structured data such as license plate number, vehicle identification number (VIN), engine number, etc.

[0055] Specifically, AI technology is used to identify and optimize images, output text sequences, and use regular expressions to extract information such as VIN codes from the text sequences to determine the document information.

[0056] This solution leverages document packaging characteristics and spot distribution to determine spot suppression parameters, thereby specifically eliminating reflections from documents of different materials, optimizing images, and improving image quality. Eliminating spot interference improves AI recognition accuracy and reduces recognition error rates.

[0057] In some embodiments, edge detection is performed on the scanned document image, and based on the edge detection results, it is determined whether there is document packaging; if there is document packaging, the edge gradient distribution of the scanned document image and the document packaging material are determined based on the edge detection results; the packaging wrinkle density is determined based on the edge gradient distribution; the document packaging characteristics are determined based on the document packaging material and the packaging wrinkle density; based on the document packaging material, a preset material optical parameter database is queried to determine the material reflectivity; the scanned document image is analyzed to determine the image brightness distribution; and the light spot distribution is determined based on the packaging wrinkle density, the image brightness distribution, and the material reflectivity.

[0058] The edge detection result may be an output result obtained by applying an edge detection algorithm to the scanned document image.

[0059] Document packaging can be protective packaging for documents.

[0060] The edge gradient distribution may be a data set calculated based on the edge detection result, including the gradient magnitude and gradient direction of each edge point in the document scan image.

[0061] The document packaging material can be the physical material type of the document packaging, such as plastic, PVC or silicone.

[0062] The packaging wrinkle density may be the density of wrinkles on the surface of the document packaging.

[0063] The preset material optical parameter database may be a pre-built lookup table storing optical parameters corresponding to different document packaging materials, which is pre-stored in the server and called when used.

[0064] Material reflectivity can be the ability of a material to reflect light.

[0065] The image brightness distribution may be the spatial pattern of the brightness values of each pixel in the document scan image.

[0066] Specifically, an edge detection algorithm is applied to extract edge features (such as edge continuity, sharpness, curvature, etc.) in the scanned document image to determine the edge detection result. Based on the edge detection result, the image edge is checked to see whether it contains additional contours other than the document itself (such as the boundary of a leather case or plastic cover). If such contours are detected (for example, the contour shape is irregular or exceeds the standard size of the document), it is determined that document packaging exists; otherwise, it is determined that it does not exist.

[0067] If there is document packaging, the edge gradient distribution of the document scanned image is statistically analyzed based on the edge detection results, combined with the gradient amplitude (indicating the magnitude of the intensity change, used to distinguish between high gradients of packaging wrinkles and flat areas) and gradient direction (indicating the angle of change, used to assist in analyzing the direction of wrinkles) of each edge point. At the same time, the edge features (such as sharp, continuous edges, and fuzzy edges) are analyzed. For example, sharp and continuous edges correspond to plastic materials, or fuzzy edges correspond to silicone materials. At this time, by collecting typical edge features of common materials (such as plastic and silicone), a preset material feature library is constructed (storing typical edge patterns of different materials for matching edge features to determine the document packaging material). The edge features are matched with the preset material feature library to determine the document packaging material.

[0068] Based on the edge gradient distribution, the image is divided into grids (e.g., 10x10 pixel blocks), and the number of edge pixels within each grid is counted (the total count of edge pixels within the image grid area is used as the basic indicator of packaging wrinkle density). Then, the packaging wrinkle density is determined based on the gradient amplitude weighting (pixels with high gradient amplitude contribute more and indicate significant wrinkles).

[0069] The document packaging characteristics are determined by combining the document packaging material and the packaging wrinkle density using string tags. Based on the document packaging material, a database of preset material optical parameters (stores mappings between material types and reflectivity, used to determine material reflectivity) is accessed, constructed using optical instruments to measure the reflectivity of common materials. This database then determines the material reflectivity. Using spatial statistical methods, the scanned document image is divided into grid areas, and the average brightness of each grid area is calculated (the arithmetic mean of the brightness of all pixels within the image grid area). The average brightness values are then aggregated to generate the image brightness distribution.

[0070] Light spot-prone areas are predicted based on the density of package wrinkles (high wrinkle density corresponds to a high probability of light spot). Image brightness distribution is then combined to identify areas with abnormal brightness (areas with brightness values significantly higher than the average brightness). Material reflectivity is then used to adjust the light spot intensity (the brightness of the light spot in the document scan image; high-reflectivity materials may enhance the light spot intensity) to determine the light spot distribution.

[0071] This solution performs edge detection on scanned ID images. Based on the edge detection results, it determines whether ID packaging is present, effectively filtering out unpackaged images and avoiding ineffective processing. If ID packaging is present, the edge gradient distribution of the scanned ID image and the ID packaging material are determined based on the edge detection results to ensure that the reflective behavior of different materials can be distinguished. The packaging wrinkle density is determined based on the edge gradient distribution, reflecting the density of wrinkles on the packaging surface and used to predict light spot tendencies. Based on the ID packaging material and the packaging wrinkle density, the ID packaging characteristics are determined, simplifying adaptation to dynamic packaging changes. Based on the ID packaging material, a database of preset material optical parameters is queried to determine the material reflectivity, reducing real-time computational overhead and providing input for light spot intensity prediction. The scanned ID image is analyzed to determine the image brightness distribution, ensuring that the light spot distribution is consistent with areas of actual brightness anomalies. The light spot distribution is determined based on the packaging wrinkle density, image brightness distribution, and material reflectivity, improving image optimization accuracy.

[0072] In some embodiments, the packaging type is determined based on the document packaging characteristics; the light spot distribution is analyzed to predict the light source position information; the light spot type is predicted based on the light source position information and the packaging type; and the light spot suppression parameters are determined based on the light spot type and the packaging wrinkle density.

[0073] The packaging type can be the physical structure category of the document packaging, including leather case, plastic seal, etc.

[0074] The light source position information may be a description of the position of the light source during the scanning process.

[0075] The flare type may be a category of physical causes of the flare, including reflection flare and refraction flare.

[0076] Specifically, based on the document packaging characteristics and packaging wrinkle density, preset rules are applied to match the packaging type (mapping rules from document packaging characteristics and packaging wrinkle density to packaging type are stored to determine the packaging type). For example, if the document packaging characteristics are plastic and the packaging wrinkle density is high (indicating dense wrinkles), the packaging type is determined to be a leather case; if the document packaging material is plastic-sealed and the packaging wrinkle density is low (indicating sparse wrinkles), the packaging type is determined to be plastic-sealed.

[0077] Based on the light spot distribution, the center of gravity of the light spot intensity in the scanned document image (the coordinates of the spatial center point of the light spot intensity in the scanned document image) is calculated. Based on this center of gravity, the light source position information is predicted. Based on the light source position information and packaging type, the light spot type is predicted using preset rules (spot type classification rules that store packaging type and light source position information are used to determine the light spot type). For example, if the packaging type is a leather case and the light source position information is small, the light spot type is predicted to be a refractive spot. If the packaging type is a leather case and the light source position information is large, the light spot type is predicted to be a reflective spot. If the packaging type is plastic-sealed (ignoring the light source position information), the light spot type is predicted to be a reflective spot (because the plastic layer is primarily surface reflective).

[0078] Based on the spot type and package wrinkle density, access the preset spot suppression parameter table (which stores parameter sets corresponding to different spot types and wrinkle densities and is used to retrieve spot suppression parameters) to determine the spot suppression parameters (including the polarization compensation parameter set (to suppress reflective spot) and the wavelength shift parameter set (to suppress refractive spot)). For example, if the spot type is reflective and the package wrinkle density is high, select the polarization compensation parameter set; if the spot type is refractive and the package wrinkle density is low, select the wavelength shift parameter set.

[0079] This solution determines the packaging type based on the document's packaging characteristics, avoiding parameter selection errors caused by packaging type ambiguity. It analyzes the light spot distribution and predicts the light source's position, ensuring real-time adaptation of the light spot to dynamic changes in the light source. It predicts the light spot type based on the light source's position and packaging type, avoiding unstable optimization results caused by type confusion. It also determines light spot suppression parameters based on the light spot type and packaging wrinkle density, improving image optimization and meeting high-precision recognition requirements.

[0080] In some embodiments, a predefined optical parameter lookup table is obtained; the predefined optical parameter lookup table includes a polarization compensation parameter set and a wavelength shift parameter set; based on the spot type and according to the packaging wrinkle density, the distribution of the reflection spot and the distribution of the refraction spot are determined; the distribution of the reflection spot and the distribution of the refraction spot are analyzed to determine the distribution weight of the reflection spot and the distribution weight of the refraction spot; if the distribution weight of the reflection spot is greater than the distribution weight of the refraction spot, the spot suppression parameter adopts the polarization compensation parameter set; if the distribution weight of the refraction spot is greater than or equal to the distribution weight of the reflection spot, the spot suppression parameter adopts the wavelength shift parameter set.

[0081] The predefined optical parameter lookup table may be a predefined and stored table, which includes a polarization compensation parameter set and a wavelength shift parameter set.

[0082] The polarization compensation parameter set may be a set of predefined parameter values for a polarization compensation strategy.

[0083] The wavelength shift parameter set may be a set of predefined parameter values for a wavelength shift strategy.

[0084] The distribution of the reflected light spots may be the pixel area ratio and the average intensity value of the reflected light spots in the document scan image.

[0085] The distribution of the refracted light spots may be the pixel area ratio and the average intensity value of the refracted light spots in the document scan image.

[0086] The reflected light spot may be a light spot directly reflected from the surface of the document packaging.

[0087] The distribution weight may be a ratio representing the degree of influence of the light spot in the image.

[0088] The refracted light spot may be a light spot formed by the refraction of light through the multi-layer packaging material.

[0089] Specifically, a predefined optical parameter lookup table (used to provide a set of suppression parameters for different light spot types) is obtained through optical physics principles; wherein the predefined optical parameter lookup table includes a polarization compensation parameter set (parameter values used for the polarization compensation strategy, such as intensity values) and a wavelength shift parameter set (parameter values used for the wavelength shift strategy, such as offset).

[0090] Based on the light spot type, an image segmentation algorithm is used to divide the ID card scan image into a reflection light spot area and a refraction light spot area. For example, the reflection light spot area is determined by detecting highlighted reflective pixels (pixels with higher brightness values in the ID card scan image); the refraction light spot area is determined by detecting multi-layer refraction features (features in the ID card scan image formed by the refraction of light through multiple layers of packaging materials (such as the interface between a leather cover and a plastic cover), such as color shift or blurred edges). Then, combined with the packaging wrinkle density adjustment analysis (when the wrinkle density is high, the refraction light spot is increased; when the wrinkle density is low, the reflection light spot is increased), the distribution of the reflection light spot (including the position coordinates, area size, and intensity value of the reflection light spot in the ID card scan image) and the distribution of the refraction light spot (including the position coordinates, area size, and intensity value of the refraction light spot) are determined.

[0091] By counting the pixel area ratio (i.e., the ratio of the total number of pixels in the area covered by the reflection light spot to the total number of pixels in the document scan image) and the average intensity value (the average brightness of all pixels in the area covered by the reflection light spot), the distribution weight of the reflection light spot is determined by applying a weighted formula (such as area ratio multiplied by intensity weight); by counting the pixel area ratio (i.e., the ratio of the total number of pixels in the area covered by the refraction light spot to the total number of pixels in the document scan image) and the average intensity value (the average brightness of all pixels in the area covered by the reflection light spot), the distribution weight of the refraction light spot is determined by applying a weighted formula.

[0092] The distribution weight of the reflected light spot is compared with the distribution weight of the refracted light spot. If the distribution weight of the reflected light spot is greater than the distribution weight of the refracted light spot, the polarization compensation parameter set is retrieved from the predefined optical parameter lookup table, and the speckle suppression parameters are set to the polarization compensation parameter set. If the distribution weight of the refracted light spot is greater than or equal to the distribution weight of the reflected light spot, the wavelength shift parameter set is retrieved from the predefined optical parameter lookup table, and the speckle suppression parameters are set to the wavelength shift parameter set.

[0093] This solution obtains a predefined optical parameter lookup table, which includes a polarization compensation parameter set and a wavelength shift parameter set. This reduces real-time computational overhead and improves processing efficiency. Based on the spot type and the density of the packaging wrinkles, the distribution of the reflected and refracted spots is determined. This prevents global image processing from accidentally affecting valid areas and ensures that information obscured by the spots is not missed in areas with dense wrinkles. The distribution of the reflected and refracted spots is analyzed to determine the distribution weights for the reflected and refracted spots. This accurately reflects the impact of the spot type on the image and prevents under- or over-suppression in information areas due to weight miscalculation. If the distribution weight of the reflected spot is greater than the distribution weight of the refracted spot, the spot suppression parameters use the polarization compensation parameter set to optimize the image brightness distribution and reduce overexposed areas. If the distribution weight of the refracted spot is greater than the distribution weight of the reflected spot, the spot suppression parameters use the wavelength shift parameter set to reduce blur or distortion, preserve the original document texture, enhance image robustness, and prevent residual artifacts after optimization.

[0094] In some embodiments, based on the spot distribution, the spatial coordinates of the spot are determined; according to the image brightness distribution, the spot intensity value is determined; according to the spot spatial coordinates and the spot intensity value, a binary spot mask is generated; according to the package wrinkle density and edge gradient distribution, the direction of change of the wrinkle density is determined; according to the direction of change of the wrinkle density, the edge feathering area of the binary spot mask is expanded; based on the expanded binary spot mask, according to the spot suppression parameters, adaptive filtering is performed on the document scan image to obtain an optimized image.

[0095] The light spot spatial coordinates may be the position information of the light spot in the document scan image.

[0096] The spot intensity value may be the overall brightness level of the spot area.

[0097] The binary spot mask may be a binary image having the same size as the document scan image.

[0098] The direction of wrinkle density change can be the spatial evolution trend of the wrinkles on the document packaging in the image.

[0099] The edge feathering region may be a smooth transition area created by extending the edge of the binary spot mask.

[0100] Specifically, the spot distribution is analyzed and its boundary coordinates (the boundary points of the spot area analyzed from the spot distribution) are extracted to form the spot spatial coordinates. The image brightness distribution is accessed and, combined with the spot spatial coordinates, the average brightness of all pixels within the coordinates is calculated as the spot intensity value.

[0101] Based on the spatial coordinates of the light spot, the pixel area covered by the coordinates is initialized; then, the light spot intensity value is applied for verification (for example, when the light spot intensity value is high, it is determined to be a valid light spot, and when the light spot intensity value is low, the area is adjusted or ignored) to generate the final binary light spot mask.

[0102] Analyze the edge gradient distribution and identify the gradient change trend (such as gradient size and direction). Then, combined with the packaging wrinkle density value (for example, high density or low density), infer the direction of wrinkle density change (only one direction needs to be determined). For example, if the gradient points from the high-density area to the low-density area, the wrinkle density changes from dense to sparse; or if the gradient points from the low-density area to the high-density area, the wrinkle density changes from sparse to dense.

[0103] Identify the edge pixels of the binary spot mask (the pixels located at the boundary of the mask area in the binary spot mask); then, based on the edge pixels and the direction of the wrinkle density change, expand the edge feathering area of the binary spot mask. For example, when the wrinkle density changes from dense to sparse, the feathering width is expanded toward the low-density side (e.g., the feathering radius is increased); when the wrinkle density changes from sparse to dense, the feathering width is expanded toward the high-density side.

[0104] A filtering strategy is selected based on the speckle suppression parameters (the image processing method selected by the speckle suppression parameters includes polarization compensation filtering or wavelength shift filtering). If the speckle suppression parameters are set as the polarization compensation parameter set, polarization compensation filtering is applied (such as adjusting the pixel polarization state and reducing the brightness). If the speckle suppression parameters are set as the wavelength shift parameter set, wavelength shift filtering is applied (such as converting the pixel color and shifting the wavelength value). Each pixel of the scanned document image is traversed, and the expanded binary speckle mask is used as the weight to perform adaptive filtering on the scanned document image to obtain an optimized image.

[0105] This solution determines the spatial coordinates of the light spot based on its distribution, ensuring that the light spot suppression process targets only interfering areas and preventing global operations from accidentally affecting valid areas of the document, thereby improving the accuracy of local adaptive processing. The light spot intensity value is determined based on the image brightness distribution to avoid over-suppression and loss of image detail. A binary light spot mask is generated based on the spatial coordinates and intensity values to isolate the interfering light spot areas, providing a target area for adaptive filtering and ensuring that processing is limited to the light spot. The direction of wrinkle density variation is determined based on the package wrinkle density and edge gradient distribution, eliminating the dynamic diffusion of light spot within wrinkle areas. This ensures that the feathering process adapts to wrinkle variations and avoids image edge distortion caused by inaccurate feathering. The edge feathering region of the binary light spot mask is expanded based on the direction of wrinkle density variation to eliminate the hard edge effect after light spot suppression, ensuring a natural transition in the optimized image, reducing artifacts, and improving image visual quality. Based on the expanded binary light spot mask and the light spot suppression parameters, adaptive filtering is performed on the scanned document image to produce an optimized image that effectively suppresses light spot while preserving document detail.

[0106] In some embodiments, based on the vehicle detection task, the document information distribution characteristics are determined; based on the document information distribution characteristics, the document scan image is divided into cells to obtain a number of image units; for each image unit, based on the edge gradient distribution, the amplitude variance corresponding to the edge gradient change within the image unit is determined; for any adjacent image units, the change rate between the amplitude variances is analyzed, and based on the change rate, the high wrinkle change area is determined; the mean change rate and the proportion of the high wrinkle change area to the area of the document scan image are calculated, and the packaging wrinkle density is determined based on the mean change rate and the area proportion.

[0107] The document information distribution feature may be a spatial position feature of the vehicle document information in the scanned image.

[0108] The image unit may be a sub-region unit formed by dividing the document scan image into cells.

[0109] The edge gradient change may be a change in the gradient amplitude of edge pixels within an image unit.

[0110] The amplitude variance may be a quantitative value of the discrete degree of the edge gradient amplitude within an image unit.

[0111] Any adjacent image cells may be a pair of cells that are spatially adjacent in the cell division.

[0112] The rate of change may be a percentage difference in amplitude variance between adjacent image units.

[0113] The high wrinkle change region may be an image region covered by adjacent cells whose amplitude variance change rate exceeds a preset threshold.

[0114] The change rate mean may be the arithmetic mean of the change rates of all adjacent image units.

[0115] The area ratio may be a percentage of the number of pixels in the high wrinkle change area to the total number of pixels in the document scan image.

[0116] Specifically, according to the vehicle detection task, the predefined document information distribution feature database established based on the document standard format theory (storing the document information distribution features of different document types) is accessed to extract the document information distribution features. For example, the document information distribution features of the driver's license include the owner's name area being located in the upper left corner of the image and the license plate number area being located in the center of the image.

[0117] Based on the information distribution characteristics of the ID card, a finer cell division (e.g., smaller cell size) is used in information-dense areas (areas where key information is concentrated in the ID card scan image, such as the location of the owner's name or license plate number), and a coarser division (e.g., larger cell size) is used in information-sparse areas (areas where key information is less or blank in the ID card scan image), thereby obtaining several image units.

[0118] Traverse each image unit (process each unit one by one); based on the edge gradient distribution, apply the Sobel operator to calculate the edge gradient amplitude of all pixels in each image unit (the brightness change intensity of all pixels in the image unit, used to quantify the gradient amplitude change); from the calculated edge gradient amplitude, extract the gradient amplitude change, and calculate the amplitude variance corresponding to the edge gradient change in the image unit.

[0119] Based on cell division, select pairs of cells that are adjacent to each other, that is, adjacent image cells; for each adjacent image cell, calculate the rate of change of the amplitude variance; at this time, construct a preset threshold (used to compare with the rate of change to determine the area with high wrinkle change) through experimental calibration (such as testing the accuracy of different thresholds for marking wrinkle areas); then, compare the rate of change with the preset threshold. If the rate of change is greater than the preset threshold, it is marked as a area with high wrinkle change.

[0120] The change rates of all adjacent image units are integrated to calculate their mean. The total number of pixels in the high-wrinkle change region is counted, and the total number of pixels in the ID scan image is calculated to determine the area ratio of the high-wrinkle change region to the ID scan image. Based on the mean change rate and area ratio, the packaging wrinkle density is calculated using a linear combination formula.

[0121] Through this solution, the distribution characteristics of document information are determined according to the vehicle detection task, avoiding the waste of resources caused by global operations. According to the distribution characteristics of document information, the document scan image is divided into cells to obtain several image units, simplifying the image structure, improving computational efficiency and facilitating parallel processing. For each image unit, the amplitude variance corresponding to the edge gradient change within the image unit is determined based on the edge gradient distribution, so that the wrinkle analysis has local granularity. For any adjacent image units, the rate of change between the amplitude variances is analyzed, and the high wrinkle change area is determined based on the rate of change, avoiding the redundancy caused by global processing and providing input for the comprehensive calculation of the package wrinkle density. The mean value of the rate of change and the proportion of the high wrinkle change area in the area of the document scan image are calculated. According to the mean value of the rate of change and the area proportion, the package wrinkle density is determined, the robustness of the spot suppression is improved, the image is optimized to retain document details, and the reliability of AI recognition is enhanced.

[0122] In some embodiments, the light spot distribution is analyzed to determine the light spot set; the light spot set is clustered to determine the brightness connected domain; based on the brightness connected domain, several light source clusters are determined; the weighted centroids of the several light source clusters are calculated, and the light source position information is predicted based on the weighted centroids.

[0123] A light spot set may be a collection of several light spot pixel points, including spatial position coordinates and brightness values.

[0124] The brightness connected region can be a spatially continuous region obtained by clustering.

[0125] A light source cluster may be a region in a brightness connected domain whose area is greater than an area threshold.

[0126] The weighted centroid may be the average position of the position coordinates of the pixel points in the light source cluster calculated with the brightness value as the weight.

[0127] Specifically, the pixel points of the light spot distribution are traversed, and according to the preset brightness threshold (used to filter out high-brightness pixels to form a light spot set) set by experimental calibration (testing the impact of different brightness values on the formation of the light spot set), the pixel points with brightness exceeding the preset brightness threshold are filtered out to form a light spot set (including spatial position coordinates and brightness values).

[0128] Based on each pixel in the light spot set, its spatial adjacency (positional proximity between pixels) is checked, and the interconnected pixels are aggregated into an independent area, namely the brightness connected domain.

[0129] Through experimental calibration (testing the impact of different areas on light source cluster identification), an area threshold is set (used to exclude small noise areas in the brightness connected domain to identify light source clusters), and brightness connected domains with too small areas (possibly noise) are excluded; the remaining large brightness connected domains (such as areas with an area larger than the area threshold) are marked as several light source clusters.

[0130] Traverse the pixel points within several light source clusters and perform weighted averaging on the spatial position coordinates of each pixel, where the weight is the brightness value of the pixel, to determine the weighted centroid. Then, based on the weighted centroids of several light source clusters (such as a centroid coordinate sequence), predict the light source position information (i.e., the spatial coordinates of the light source in the document scan image).

[0131] This solution analyzes the light spot distribution, identifies light spot clusters, and locates high-brightness interference areas, ensuring that the light spot distribution characteristics are quantitatively captured. Light spot clusters are clustered to identify brightness connected domains, effectively eliminating noise interference. Based on these brightness connected domains, several light source clusters are identified, improving the robustness and accuracy of the prediction. The weighted centroids of these clusters are calculated and used to predict light source locations, enhancing the optimization of document scanned images.

[0132] In some embodiments, the directional angle of the gradient distribution between any adjacent image units is determined based on the edge gradient distribution; the gradient transfer matrix between image units is constructed based on the amplitude variance and the directional angle; and based on the gradient transfer matrix, spatially continuous high gradient transition areas are merged to generate high wrinkle change areas.

[0133] The direction angle may be the angle difference between the gradient directions of any adjacent image units.

[0134] The gradient transfer matrix may be a two-dimensional matrix used to encode the overall strength of gradient changes between image elements.

[0135] The high gradient transition region may be a region where the element value in the gradient transfer matrix exceeds a preset threshold.

[0136] Specifically, the method traverses adjacent image units in the document scan based on the edge gradient distribution. For each adjacent image unit, the directional angle of the gradient distribution between any two adjacent image units is calculated. For example, an angle close to 0 degrees indicates the same direction, while an angle close to 180 degrees indicates opposite directions. Based on the amplitude variance and directional angle, a weighted combination is used to construct the gradient transfer matrix between the image units.

[0137] Traverse the gradient transfer matrix and screen out high-value elements in the gradient transfer matrix whose element values exceed the preset threshold (critical value for screening high-value elements) set according to experimental calibration (experiment for testing and determining high-value elements). Each high-value element corresponds to a high-gradient transition region. Use connectivity analysis to check the spatial continuity of image units in all high-gradient transition regions (for example, image units that are adjacent in the document scan image are considered continuous). Aggregate spatially continuous units into an independent region, which is the high-fold change region.

[0138] This approach uses edge gradient distribution to determine the directional angle between any two adjacent image units, quantifying the spatial evolution of gradient directions between these units. Based on the amplitude variance and directional angle, a gradient transfer matrix is constructed between these units, avoiding the blindness of global thresholding. Based on the gradient transfer matrix, spatially continuous high-gradient transition regions are merged to generate regions of high fold change, eliminating isolated high-value points in the matrix.

[0139] In some embodiments, the intensity of the light source is determined based on the image brightness distribution and the material reflectivity; the reflection attenuation coefficient and the refraction attenuation coefficient are determined based on the document packaging material; the vector from the light source to the document surface is predicted based on the light source position information; the distribution of the reflected light spot is determined based on the light source intensity, vector, packaging wrinkle density and reflection attenuation coefficient; the refractive index of the material is determined based on the document packaging material; the distribution of the refraction light spot is determined based on the light source intensity, vector, packaging wrinkle density, refraction attenuation coefficient and material refractive index.

[0140] The light source intensity may be the luminous intensity level of the light source.

[0141] The reflection attenuation coefficient may be an attenuation factor of the intensity of reflected light by a material.

[0142] The refractive attenuation coefficient may be the attenuation factor of the intensity of refracted light by a material.

[0143] A light source may be an entity that provides lighting.

[0144] The document surface may be the physical surface area corresponding to the scanned image of the document, including the outer layer of the document packaging material.

[0145] The vector may be a three-dimensional direction vector representing the incident direction of light from the light source position to the document surface.

[0146] The material refractive index may be the refractive index of light when it enters the document packaging material from air.

[0147] Specifically, based on the image brightness distribution and material reflectivity, a predefined optical parameter lookup table is queried to determine the light source intensity. For example, when the light source intensity is proportional to the image brightness distribution but inversely proportional to the material reflectivity (high reflectivity materials will enhance image brightness, so at the same brightness, high reflectivity corresponds to lower light source intensity).

[0148] Based on the document packaging material (for example, a leather case with a flexible plastic film outer layer and a plastic seal inner layer), the reflection attenuation coefficient and refraction attenuation coefficient are retrieved from a predefined optical parameter lookup table. The reflection attenuation coefficient indicates the degree of energy attenuation when light is reflected from the material surface (used to quantify the proportion of energy lost when light is reflected from the material surface), and the refraction attenuation coefficient indicates the degree of energy attenuation when light is refracted within the material (used to quantify the proportion of energy lost when light is refracted internally). For example, for plastic materials, the predefined optical parameter lookup table returns a lower reflection attenuation coefficient (indicating low reflection loss), while for silicone materials, the predefined optical parameter lookup table returns a higher refraction attenuation coefficient (indicating high refraction loss).

[0149] Based on the light source position and the document packaging characteristics, geometric vector calculations are used to predict the vector pointing from the light source to the document surface. This vector, combined with the packaging wrinkle density (higher wrinkle density indicates a more uneven surface), is used to calculate the reflection angle at each point on the surface (for example, wrinkle density is used to adjust direction and simulate surface deformation). The reflection attenuation coefficient, combined with the light source intensity (higher light intensity indicates stronger reflected light), is then applied to calculate the reflected light intensity at each pixel, thereby determining the distribution of the reflected light spot.

[0150] Based on the document packaging material, a predefined optical parameter lookup table is consulted to determine the material's refractive index (the refractive index of light when it enters a material from air, representing the proportional change in the speed of light). Using vectors and the material's refractive index, the refracted light path (the path light travels after being refracted within the material) is calculated. The refracted light intensity at each pixel is calculated by integrating the packaging's wrinkle density (which affects light scattering within the material) and the refractive attenuation coefficient, along with the light source intensity (the higher the light source intensity, the stronger the refracted light), to determine the distribution of the refracted light spot.

[0151] This solution determines the light source intensity based on the image brightness distribution and material reflectivity, ensuring the accuracy of the light spot distribution prediction and thus reducing the impact of image brightness distortion on light spot modeling. The reflection and refraction attenuation coefficients are determined based on the document packaging material to ensure that the predictions of the reflection and refraction light spots reflect the optical properties of the material. Based on the light source position information, the vector from the light source to the document surface is predicted to describe the incident direction of the light and provide a geometric basis for the calculation of the reflection / refraction angle. Based on the light source intensity, vector, packaging wrinkle density, and reflection attenuation coefficient, the reflection light spot distribution is determined to ensure effective processing of reflection light spots in areas with high packaging wrinkle density. Based on the document packaging material, the material refractive index is determined to reduce prediction errors caused by unknown material refractive properties. Based on the light source intensity, vector, packaging wrinkle density, refraction attenuation coefficient, and material refractive index, the refraction light spot distribution is determined to ensure processing of refraction light spots in the direction of changing packaging wrinkles and avoid residual artifacts from image optimization.

[0152] Figure 3A schematic diagram of a vehicle detection system based on AI technology is provided in one embodiment of the present application. Figure 3 As shown, the vehicle detection system 300 based on AI technology of this embodiment includes: an image acquisition module 301, an image analysis module 302, a suppression parameter determination module 303, an image optimization module 304, and an information determination module 305.

[0153] Image acquisition module 301, used to acquire the scanned image of the certificate during vehicle detection; Image analysis module 302, used to analyze the document scan image to determine the document packaging characteristics and light spot distribution; A suppression parameter determination module 303 is configured to determine a light spot suppression parameter according to the document packaging characteristics and the light spot distribution; An image optimization module 304 is configured to optimize the document scan image according to the light spot suppression parameters to obtain an optimized image; The information determination module 305 is used to identify the optimized image based on AI technology and determine the document information.

[0154] Optionally, when the image analysis module 302 analyzes the document scan image and determines the document packaging characteristics and light spot distribution, it is used to: perform edge detection on the document scan image, and determine whether there is document packaging based on the edge detection result; if there is document packaging, determine the edge gradient distribution of the document scan image and the document packaging material based on the edge detection result; determine the packaging wrinkle density based on the edge gradient distribution; determine the document packaging characteristics based on the document packaging material and the packaging wrinkle density; query a preset material optical parameter database based on the document packaging material to determine the material reflectivity; analyze the document scan image to determine the image brightness distribution; and determine the light spot distribution based on the packaging wrinkle density, the image brightness distribution, and the material reflectivity.

[0155] Optionally, when the suppression parameter determination module 303 determines the light spot suppression parameter based on the document packaging characteristics and the light spot distribution, it is used to: determine the packaging type based on the document packaging characteristics; analyze the light spot distribution to predict the light source position information; predict the light spot type based on the light source position information and the packaging type; and determine the light spot suppression parameter based on the light spot type and the packaging wrinkle density.

[0156] Optionally, the spot type includes a reflection spot and a refraction spot; when the suppression parameter determination module 303 determines the spot suppression parameter according to the spot type and the packaging wrinkle density, it is used to: obtain a predefined optical parameter lookup table; the predefined optical parameter lookup table includes a polarization compensation parameter set and a wavelength shift parameter set; based on the spot type and according to the packaging wrinkle density, determine the reflection spot distribution and the refraction spot distribution; analyze the reflection spot distribution and the refraction spot distribution to determine the distribution weight of the reflection spot and the distribution weight of the refraction spot; if the distribution weight of the reflection spot is greater than the distribution weight of the refraction spot, the spot suppression parameter adopts the polarization compensation parameter set; if the distribution weight of the refraction spot is ≥ the distribution weight of the reflection spot, the spot suppression parameter adopts the wavelength shift parameter set.

[0157] Optionally, the image optimization module 304 optimizes the document scan image according to the spot suppression parameters, and when obtaining the optimized image, is used to: determine the spot spatial coordinates based on the spot distribution; determine the spot intensity value according to the image brightness distribution; generate a binary spot mask according to the spot spatial coordinates and the spot intensity value; determine the direction of change of the wrinkle density according to the packaging wrinkle density and the edge gradient distribution; expand the edge feathering area of the binary spot mask according to the direction of change of the wrinkle density; based on the expanded binary spot mask, perform adaptive filtering on the document scan image according to the spot suppression parameters to obtain the optimized image.

[0158] Optionally, when the image analysis module 302 determines the packaging wrinkle density based on the edge gradient distribution, it is used to: determine the document information distribution characteristics based on the vehicle detection task; divide the document scan image into cells based on the document information distribution characteristics to obtain a number of image units; for each image unit, determine the amplitude variance corresponding to the edge gradient change within the image unit based on the edge gradient distribution; for any adjacent image units, analyze the change rate between the amplitude variances, and determine the high wrinkle change area based on the change rate; calculate the mean change rate and the proportion of the high wrinkle change area to the area of the document scan image, and determine the packaging wrinkle density based on the mean change rate and the area proportion.

[0159] Optionally, when the suppression parameter determination module 303 analyzes the light spot distribution and predicts the light source position information, it is used to: analyze the light spot distribution to determine a light spot set; cluster the light spot set to determine a brightness connected domain; determine several light source clusters based on the brightness connected domain; calculate the weighted centroids of several light source clusters, and predict the light source position information based on the weighted centroids.

[0160] Optionally, the image analysis module 302 analyzes the rate of change between the amplitude variances, and when determining the high wrinkle change area based on the rate of change, it is used to: determine the directional angle of the gradient distribution between any adjacent image units based on the edge gradient distribution; construct a gradient transfer matrix between image units based on the amplitude variance and the directional angle; and merge spatially continuous high gradient transition areas based on the gradient transfer matrix to generate a high wrinkle change area.

[0161] Optionally, when the suppression parameter determination module 303 determines the distribution of reflected light spots and the distribution of refracted light spots based on the packaging wrinkle density, it is used to: determine the light source intensity based on the image brightness distribution and the material reflectivity; determine the reflection attenuation coefficient and the refraction attenuation coefficient based on the document packaging material; predict the vector from the light source to the document surface based on the light source position information; determine the reflection light spot distribution based on the light source intensity, the vector, the packaging wrinkle density and the reflection attenuation coefficient; determine the material refractive index based on the document packaging material; determine the refraction light spot distribution based on the light source intensity, the vector, the packaging wrinkle density, the refraction attenuation coefficient and the material refractive index.

[0162] The system of this embodiment can be used to execute the method of any of the above embodiments. Its implementation principles and technical effects are similar and will not be described in detail here.

Claims

1. A vehicle detection method based on AI technology, characterized in that: include: Obtain the document scan image corresponding to the vehicle inspection task; Analyze the document scan image to determine the document packaging characteristics and light spot distribution; Determining light spot suppression parameters according to the document packaging characteristics and the light spot distribution; Optimizing the document scan image according to the light spot suppression parameters to obtain an optimized image; The optimized image is identified based on AI technology to determine the document information.

2. The method according to claim 1, characterized in that The analyzing the document scanned image to determine the document packaging characteristics and light spot distribution includes: Performing edge detection on the scanned document image, and determining whether there is document packaging based on the edge detection result; If there is a document package, determine the edge gradient distribution of the document scan image and the material of the document package based on the edge detection result; determining a packaging wrinkle density according to the edge gradient distribution; Determining the characteristics of the document packaging according to the material of the document packaging and the density of the packaging wrinkles; According to the material of the certificate packaging, query the preset material optical parameter database to determine the material reflectivity; Analyzing the scanned image of the document to determine the image brightness distribution; The light spot distribution is determined according to the package wrinkle density, the image brightness distribution and the material reflectivity.

3. The method according to claim 2, characterized in that The step of determining the light spot suppression parameter according to the document packaging characteristics and the light spot distribution includes: Determining the packaging type according to the packaging characteristics of the certificate; Analyzing the light spot distribution and predicting light source position information; Predicting a light spot type according to the light source position information and the package type; A light spot suppression parameter is determined according to the light spot type and the package wrinkle density.

4. The method according to claim 3, characterized in that The light spot type includes a reflection light spot and a refraction light spot; and determining the light spot suppression parameter according to the light spot type and the package wrinkle density includes: Obtaining a predefined optical parameter lookup table; the predefined optical parameter lookup table includes a polarization compensation parameter set and a wavelength shift parameter set; Based on the light spot type and the packaging wrinkle density, determining the distribution of the reflected light spot and the distribution of the refracted light spot; Analyzing the distribution of the reflected light spot and the distribution of the refracted light spot to determine the distribution weight of the reflected light spot and the distribution weight of the refracted light spot; If the distribution weight of the reflected light spot is greater than the distribution weight of the refracted light spot, the light spot suppression parameter adopts the polarization compensation parameter set; If the distribution weight of the refraction light spot is greater than or equal to the distribution weight of the reflection light spot, the light spot suppression parameter adopts the wavelength shift parameter set.

5. The method according to claim 2, characterized in that Optimizing the document scan image according to the light spot suppression parameter to obtain an optimized image includes: Determining the spatial coordinates of the light spot based on the light spot distribution; Determining a light spot intensity value according to the image brightness distribution; generating a binary spot mask according to the spot spatial coordinates and the spot intensity value; Determining a direction of change of wrinkle density according to the package wrinkle density and the edge gradient distribution; Expanding the edge feathering region of the binary spot mask according to the direction of change of the wrinkle density; Based on the expanded binary spot mask and according to the spot suppression parameters, adaptive filtering is performed on the document scan image to obtain an optimized image.

6. The method according to claim 2, characterized in that Determining the packaging wrinkle density according to the edge gradient distribution includes: Determining the distribution characteristics of the certificate information according to the vehicle detection task; Dividing the scanned document image into cells according to the document information distribution characteristics to obtain a plurality of image units; For each image unit, determining the amplitude variance corresponding to the edge gradient change within the image unit according to the edge gradient distribution; For any adjacent image units, analyzing the change rate between the amplitude variances, and determining a high wrinkle change area based on the change rate; The average value of the rate of change and the proportion of the high wrinkle change area to the area of the document scan image are calculated, and the packaging wrinkle density is determined based on the average value of the rate of change and the area proportion.

7. The method according to claim 3, characterized in that The analyzing the light spot distribution and predicting the light source position information includes: Analyzing the light spot distribution to determine a light spot set; Clustering the light spot set to determine a brightness connected domain; determining a plurality of light source clusters according to the brightness connected domain; The weighted centroids of several light source clusters are calculated, and the light source position information is predicted based on the weighted centroids.

8. The method according to claim 6, characterized in that Analyzing the change rate between the amplitude variances and determining a high wrinkle change area according to the change rate includes: Determining the direction angle of the gradient distribution between any adjacent image units according to the edge gradient distribution; Constructing a gradient transfer matrix between image units according to the amplitude variance and the direction angle; According to the gradient transfer matrix, spatially continuous high gradient transition regions are merged to generate high wrinkle change regions.

9. The method according to claim 4, characterized in that Determining the distribution of reflected light spots and refracted light spots according to the package wrinkle density includes: Determining the light source intensity according to the image brightness distribution and the material reflectivity; Determining the reflection attenuation coefficient and the refraction attenuation coefficient according to the material of the certificate packaging; Predicting a vector from the light source to the document surface based on the light source position information; Determining the distribution of the reflected light spots according to the light source intensity, the vector, the package wrinkle density, and the reflection attenuation coefficient; Determine the refractive index of the material according to the material of the certificate packaging; The distribution of the refraction spot is determined according to the light source intensity, the vector, the packaging wrinkle density, the refraction attenuation coefficient and the material refractive index.

10. A vehicle detection system based on AI technology, characterized in that: The method as claimed in any one of claims 1 to 9 comprises: Image acquisition module, used to obtain the document scan image during vehicle inspection; An image analysis module, configured to analyze the scanned document image and determine the document packaging characteristics and light spot distribution; A suppression parameter determination module, configured to determine a light spot suppression parameter according to the document packaging characteristics and the light spot distribution; An image optimization module, configured to optimize the document scan image according to the light spot suppression parameters to obtain an optimized image; The information determination module is used to identify the optimized image based on AI technology and determine the document information.

Citation Information

Patent Citations

  • Method for removing edge reflection light spots in electroplated workpiece surface defect visual inspection

    CN112927189A

  • Image processing method and device, equipment and storage medium

    CN116245769A

  • Method for detecting fluorescent adhesive spots in images of identity documents in UV spectrum

    RU2814914C1