A vehicle detection method and system based on AI technology
By analyzing the packaging features and spot distribution of scanned document images, spot suppression parameters were determined, image quality was optimized, and the optical interference problem introduced by physical document packaging protection measures was solved, achieving efficient automated recognition of document information.
Patent Information
- Application Number
- CN202510953970.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-11
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2045-07-11
AI Technical Summary
Existing vehicle inspection systems suffer from optical interference introduced by the packaging and protection measures of physical documents, which renders critical information areas unreadable. This forces the system to be downgraded to manual intervention, severely limiting the efficiency of the entire process automation.
By acquiring scanned images of documents, analyzing the characteristics of document packaging and the distribution of light spots, determining light spot suppression parameters, optimizing the scanned images of documents, eliminating light spot interference, improving image quality, and enhancing AI recognition accuracy.
It effectively eliminates light spot interference, improves AI recognition accuracy, reduces recognition error rate, and realizes automated recognition of document information.
Smart Images

Figure CN120472472B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of vehicle inspection technology, and in particular to a vehicle inspection method and system based on AI technology. Background Technology
[0002] In recent years, artificial intelligence technology has made significant breakthroughs in vehicle management and intelligent transportation, especially in the area of 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 inspection, annual inspection, and traffic violation processing. Existing systems generally support rapid scanning and information extraction of key documents such as driver's licenses and vehicle registration certificates via mobile terminals or dedicated equipment, promoting the paperless and intelligent transformation of vehicle management services.
[0003] In real-world, complex scenarios, the optical interference introduced by the packaging and protection measures of physical documents (such as leather cases and plastic seals) can render critical information areas unreadable, forcing the system to be downgraded to manual intervention and severely restricting the efficiency of the entire 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] Firstly, this application provides a vehicle detection method based on AI technology, the method comprising:
[0006] Obtain scanned images of the documents corresponding to the vehicle inspection task;
[0007] Analyze the scanned image of the document to determine the document packaging features and light spot distribution;
[0008] Based on the characteristics of the document packaging and the distribution of the light spot, determine the light spot suppression parameters;
[0009] Based on the light spot suppression parameters, the scanned image of the document is optimized to obtain an optimized image;
[0010] The optimized image is identified using AI technology to determine the document information.
[0011] This solution utilizes the characteristics of document packaging and the distribution of light spots to determine light spot suppression parameters, thereby specifically eliminating reflections from documents of different materials, optimizing images, and improving image quality. Eliminating light spot interference improves AI recognition accuracy and reduces the error rate.
[0012] Optionally, analyzing the scanned image of the document to determine the document packaging features and light spot distribution includes:
[0013] Edge detection is performed on the scanned image of the document, and the presence of document packaging is determined based on the edge detection results;
[0014] If document packaging exists, the edge gradient distribution of the scanned document image and the material of the document packaging are determined based on the edge detection results.
[0015] The packaging pleat density is determined based on the edge gradient distribution;
[0016] The characteristics of the document packaging are determined based on the material of the document packaging and the density of the packaging pleats;
[0017] Based on the document packaging material, the material reflectivity is determined by querying a preset material optical parameter database.
[0018] Analyze the scanned image of the document to determine the image brightness distribution;
[0019] The light spot distribution is determined based on the packaging fold density, the image brightness distribution, and the material reflectivity.
[0020] This solution performs edge detection on scanned ID card images. Based on the edge detection results, it determines whether document packaging is present, effectively filtering out images without packaging and avoiding invalid processing. If document packaging is present, the edge detection results determine the edge gradient distribution of the scanned image and the packaging material, ensuring differentiation of the reflective behavior of different materials. The edge gradient distribution determines the packaging wrinkle density, reflecting the density of wrinkles on the packaging surface, used to predict light spot tendency. Based on the packaging material and wrinkle density, the document packaging characteristics are determined, simplifying adaptation to dynamic packaging changes. Based on the document packaging material, a preset material optical parameter database is consulted to determine the material reflectivity, reducing real-time computation overhead and providing input for light spot intensity prediction. The scanned ID card image is analyzed to determine the image brightness distribution, ensuring the light spot distribution is consistent with actual brightness anomaly areas. Based on the packaging wrinkle density, image brightness distribution, and material reflectivity, the light spot distribution is determined, improving the accuracy of image optimization.
[0021] Optionally, determining the light spot suppression parameters based on the document packaging features and the light spot distribution includes:
[0022] Based on the characteristics of the document packaging, determine the packaging type;
[0023] Analyze the light spot distribution to predict the light source location information;
[0024] Predict the light spot type based on the light source location information and the packaging type;
[0025] The light spot suppression parameters are determined based on the light spot type and the packaging fold density.
[0026] This solution determines the packaging type based on the characteristics of the document packaging, avoiding parameter selection errors caused by ambiguous packaging types. It analyzes the light spot distribution and predicts the light source position information, ensuring real-time adaptation of the light spot to dynamic changes in the light source. Based on the light source position information and packaging type, it predicts the light spot type, avoiding unstable optimization results due to type confusion. Based on the light spot type and packaging wrinkle density, it determines the light spot suppression parameters to improve image optimization and meet high-precision recognition requirements.
[0027] Optionally, the light spot type includes reflected light spots and refracted light spots; determining the light spot suppression parameters based on the light spot type and the packaging wrinkle density includes:
[0028] Obtain a predefined optical parameter lookup table; the predefined optical parameter lookup table includes a polarization compensation parameter set and a wavelength offset parameter set.
[0029] Based on the light spot type, and according to the packaging wrinkle density, the distribution of reflected light spots and the distribution of refracted light spots are determined;
[0030] Analyze 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;
[0031] If the distribution weight of the reflected light spot is greater than the distribution weight of the refracted light spot, then the light spot suppression parameter adopts the polarization compensation parameter set;
[0032] If the distribution weight of the refracted light spot is greater than or equal to the distribution weight of the reflected light spot, then the light spot suppression parameter adopts the wavelength offset parameter set.
[0033] This solution utilizes a predefined optical parameter lookup table, including polarization compensation parameter sets and wavelength shift parameter sets, to avoid real-time computation overhead and improve processing efficiency. Based on the spot type and the density of packaging wrinkles, the distribution of reflected and refracted spots is determined, preventing global image processing from mistakenly damaging effective areas and ensuring that information obscured by spots is not missed in densely wrinkled areas. The distribution of reflected and refracted spots is analyzed to determine their distribution weights, accurately reflecting the impact of spot type on the image and preventing insufficient or excessive suppression in information areas due to weight miscalculation. If the distribution weight of reflected spots > the distribution weight of refracted spots, the polarization compensation parameter set is used for spot suppression to optimize image brightness distribution and reduce overexposed areas. If the distribution weight of refracted spots is equal to or greater than the distribution weight of reflected spots, the wavelength shift parameter set is used for spot suppression to reduce blur or distortion, preserve the original texture of the document, enhance image robustness, and prevent residual artificial traces after optimization.
[0034] Optionally, optimizing the scanned image of the document based on the light spot suppression parameters to obtain an optimized image includes:
[0035] Based on the light spot distribution, determine the spatial coordinates of the light spot;
[0036] Determine the spot intensity value based on the image brightness distribution;
[0037] A binary spot mask is generated based on the spot spatial coordinates and the spot intensity value;
[0038] The direction of wrinkle density variation is determined based on the packaging wrinkle density and the edge gradient distribution;
[0039] Based on the direction of the change in wrinkle density, the edge feathering region of the binarized spot mask is expanded;
[0040] Based on the extended binarized spot mask, adaptive filtering is performed on the scanned image of the document according to the spot suppression parameters to obtain an optimized image.
[0041] This scheme determines the spatial coordinates of the light spot based on its distribution, ensuring that light spot suppression processing targets only the interfering area, avoiding accidental damage to the valid area of the document during global operations, 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 leading to loss of image details. A binarized light spot mask is generated based on the light spot spatial coordinates and intensity value to isolate the interfering area and provide a target region for adaptive filtering, ensuring that processing only affects the light spot. The direction of change in fold density is determined based on the packaging fold density and edge gradient distribution, eliminating the dynamic diffusion problem of the light spot in the packaging fold area, ensuring that feathering processing can adapt to fold changes, and avoiding image edge distortion caused by inaccurate feathering. The edge feathering area of the binarized light spot mask is expanded according to the direction of fold density change to eliminate the hard boundary effect after light spot suppression, ensuring a natural transition in the optimized image, reducing artificial traces, and improving the visual quality of the image. Based on the expanded binarized light spot mask, adaptive filtering is performed on the document scan image according to the light spot suppression parameters to obtain an optimized image that effectively suppresses light spots while preserving document details.
[0042] Optionally, determining the packaging pleat density based on the edge gradient distribution includes:
[0043] Based on the vehicle inspection task, determine the distribution characteristics of the document information;
[0044] Based on the distribution characteristics of the document information, the scanned image of the document is divided into cells to obtain several image units;
[0045] For each image unit, the magnitude variance corresponding to the edge gradient change within the image unit is determined based on the edge gradient distribution.
[0046] For any adjacent image units, analyze the rate of change between the amplitude variances, and determine the high-wrinkle variation region based on the rate of change;
[0047] Calculate the mean rate of change and the area ratio of high-wrinkle change regions to the scanned image of the document. Determine the packaging wrinkle density based on the mean rate of change and the area ratio.
[0048] This solution determines the distribution characteristics of document information based on the vehicle inspection task, avoiding resource waste caused by global operations. Based on these characteristics, the scanned document image is divided into cell 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 unit is determined based on the edge gradient distribution, providing local granularity for wrinkle analysis. For any adjacent image units, the rate of change between amplitude variances is analyzed. Based on this rate of change, high-wrinkle variation regions are identified, avoiding redundancy caused by global processing and providing input for the comprehensive calculation of packaging wrinkle density. The mean rate of change and the area ratio of high-wrinkle variation regions in the scanned document image are calculated. Based on the mean rate of change and area ratio, the packaging wrinkle density is determined, improving the robustness of spot suppression, optimizing image preservation of document details, and enhancing the reliability of AI recognition.
[0049] Optionally, analyzing the light spot distribution and predicting the light source location information includes:
[0050] Analyze the light spot distribution to determine the light spot set;
[0051] Cluster the light spot set to determine the brightness connected components;
[0052] Based on the brightness connectivity region, several light source clusters are determined;
[0053] Calculate the weighted centroid of several light source clusters, and predict the light source position information based on the weighted centroid.
[0054] This scheme analyzes the light spot distribution, identifies light spot sets, locates high-brightness interference areas, and ensures that the light spot distribution characteristics are quantified and captured. Clustering the light spot sets determines the brightness connectivity domains, effectively eliminating noise interference. Based on the brightness connectivity domains, several light source clusters are identified, improving the robustness and accuracy of prediction. The weighted centroids of these light source clusters are calculated, and based on these weighted centroids, the light source location information is predicted, enhancing the optimization effect of document scanning images.
[0055] Optionally, analyzing the rate of change between the amplitude variances and determining the high-wrinkle variation region based on the rate of change includes:
[0056] Based on the edge gradient distribution, determine the directional angle between the gradient distributions of any adjacent image units;
[0057] Based on the amplitude variance and the directional angle, a gradient transition matrix between image units is constructed;
[0058] Based on the gradient transition matrix, spatially continuous high gradient transition regions are merged to generate highly folded change regions.
[0059] This scheme determines the directional angle of the gradient distribution between any two adjacent image units based on the edge gradient distribution, quantifying the spatial evolution differences in gradient directions between image units. Based on the amplitude variance and directional angle, a gradient transfer matrix between image units is constructed, avoiding the blindness of global thresholding. Based on the gradient transfer matrix, spatially continuous high-gradient transition regions are merged to generate highly wrinkled change regions, eliminating isolated high-value points in the matrix.
[0060] Optionally, determining the distribution of reflected light spots and refracted light spots based on the packaging pleat density includes:
[0061] The light source intensity is determined based on the image brightness distribution and the material reflectivity;
[0062] Based on the material of the document packaging, determine the reflection attenuation coefficient and the refraction attenuation coefficient;
[0063] Based on the light source position information, predict the vector from the light source to the surface of the document;
[0064] The distribution of reflected light spots is determined based on the light source intensity, the vector, the packaging pleat density, and the reflection attenuation coefficient.
[0065] Determine the refractive index of the material based on the packaging material of the document;
[0066] The distribution of the refracted light spot is determined based on the light source intensity, the vector, the packaging pleat density, the refractive attenuation coefficient, and the material refractive index.
[0067] This solution determines the light source intensity based on image brightness distribution and material reflectivity, ensuring the accuracy of light spot distribution prediction and reducing the impact of image brightness distortion on light spot modeling. Based on the document packaging material, it determines the reflection attenuation coefficient and refraction attenuation coefficient, ensuring that the predicted reflected and refracted light spots reflect the material's optical properties. Based on the light source position information, it predicts the vector from the light source to the document surface, describing the incident direction of the light and providing a geometric basis for calculating the reflection / refraction angle. Based on the light source intensity, vector, packaging wrinkle density, and reflection attenuation coefficient, it determines the distribution of reflected light spots, ensuring effective handling of reflected light spots in high-density areas of packaging wrinkles. Based on the document packaging material, it determines the material's refractive index, reducing 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, it determines the distribution of refracted light spots, ensuring that refracted light spots are handled under varying packaging wrinkle directions, avoiding residual manual traces from image optimization.
[0068] Secondly, this application provides a vehicle detection system based on AI technology, the system comprising:
[0069] The image acquisition module is used to acquire scanned images of vehicle documents during vehicle inspection;
[0070] The image analysis module is used to analyze the scanned image of the document to determine the document packaging features and light spot distribution;
[0071] The suppression parameter determination module is used to determine the light spot suppression parameters based on the characteristics of the document packaging and the light spot distribution.
[0072] The image optimization module is used to optimize the scanned image of the document according to the light spot suppression parameters to obtain an optimized image;
[0073] The information determination module is used to identify the optimized image based on AI technology and determine the document information.
[0074] Optionally, when the image analysis module analyzes the scanned image of the document to determine the document packaging features and spot distribution, it is used to: perform edge detection on the scanned image of the document; determine whether document packaging exists based on the edge detection results; if document packaging exists, determine the edge gradient distribution and document packaging material of the scanned image of the document based on the edge detection results; determine the packaging wrinkle density based on the edge gradient distribution; determine the document packaging features 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 image of the document to determine the image brightness distribution; and determine the spot distribution based on the packaging wrinkle density, the image brightness distribution, and the material reflectivity.
[0075] 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 and 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 fold density.
[0076] Optionally, the light spot type includes reflected light spots and refracted light spots; when the suppression parameter determination module determines the light spot suppression parameter based on the light 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 light spot type and the packaging wrinkle density, determine the distribution of reflected light spots and the distribution of refracted light spots; analyze the distribution of reflected light spots and the distribution of refracted light spots to determine the distribution weight of reflected light spots and the distribution weight of refracted light spots; if the distribution weight of reflected light spots > the distribution weight of refracted light spots, then the light spot suppression parameter adopts the polarization compensation parameter set; if the distribution weight of refracted light spots ≥ the distribution weight of reflected light spots, then the light spot suppression parameter adopts the wavelength shift parameter set.
[0077] Optionally, when the image optimization module optimizes the document scan image according to the spot suppression parameters to obtain the optimized image, it is used to: determine the spatial coordinates of the spot based on the spot distribution; determine the spot intensity value according to the image brightness distribution; generate a binarized spot mask according to the spot spatial coordinates and the spot intensity value; determine the direction of change of the fold density according to the packaging fold density and the edge gradient distribution; expand the edge feathering region of the binarized spot mask according to the direction of change of the fold density; and perform adaptive filtering on the document scan image based on the expanded binarized spot mask and the spot suppression parameters to obtain the optimized image.
[0078] 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 cell units based on the document information distribution characteristics to obtain several 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 rate of change between the amplitude variances, and determine the high wrinkle change region based on the rate of change; calculate the mean rate of change and the area ratio of the high wrinkle change region to the document scan image, and determine the packaging wrinkle density based on the mean rate of change and the area ratio.
[0079] Optionally, when the suppression parameter determination module analyzes the light spot distribution and predicts the light source location information, it is used to: analyze the light spot distribution and determine the light spot set; cluster the light spot set and determine the brightness connected component; determine several light source clusters based on the brightness connected component; calculate the weighted centroid of the several light source clusters, and predict the light source location information based on the weighted centroid.
[0080] Optionally, when the image analysis module analyzes the rate of change between the amplitude variances and determines the high-wrinkle change region 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 transition matrix between image units based on the amplitude variance and the directional angle; and merge spatially continuous high gradient transition regions based on the gradient transition matrix to generate a high-wrinkle change region.
[0081] Optionally, when the suppression parameter determination module determines the distribution of reflected light spots and 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 distribution of reflected light spots 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; and determine the distribution of refracted light spots based on the light source intensity, the vector, the packaging wrinkle density, the refraction attenuation coefficient, and the material refractive index. Attached Figure Description
[0082] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0083] Figure 1 This is a schematic diagram illustrating an application scenario provided in one embodiment of this application;
[0084] Figure 2 A flowchart illustrating a vehicle detection method based on AI technology, provided as an embodiment of this application;
[0085] Figure 3 This is a schematic diagram of a vehicle detection system based on AI technology, provided as an embodiment of this application. Detailed Implementation
[0086] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0087] Furthermore, the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article, unless otherwise specified, generally indicates that the preceding and following related objects have an "or" relationship.
[0088] The embodiments of this application will now be described in further detail with reference to the accompanying drawings.
[0089] Existing systems generally support rapid scanning and information extraction of key documents such as driver's licenses and vehicle registration certificates via mobile terminals or dedicated equipment, promoting the paperless and intelligent process of vehicle management services.
[0090] In real-world, complex scenarios, the optical interference introduced by the packaging and protection measures of physical documents (such as leather cases and plastic seals) can render critical information areas unreadable, forcing the system to be downgraded to manual intervention and severely restricting the efficiency of the entire process automation.
[0091] Based on this, this application provides a vehicle detection method and system based on AI technology, which acquires scanned images of documents corresponding to vehicle detection tasks; analyzes the scanned images to determine document packaging features and spot distribution; determines spot suppression parameters based on document packaging features and spot distribution; optimizes the scanned images based on spot suppression parameters to obtain optimized images; and identifies the optimized images using AI technology to determine document information. By utilizing document packaging features and spot distribution to determine spot suppression parameters, reflections from documents of different materials are specifically eliminated, images are optimized, and image quality is improved. Eliminating spot interference improves AI recognition accuracy and reduces the recognition error rate.
[0092] Figure 1 This application provides an illustration of an application scenario. When using AI technology for vehicle detection, the method provided in this application is applied to facilitate the recognition of document photos.
[0093] Specifically, the method provided in this application can be applied to any server. The server interacts with a high-resolution scanner to acquire scanned images of documents taken in the vehicle detection area. The scanned images are analyzed to determine document packaging features and spot distribution, thereby determining spot suppression parameters. These parameters are then used to optimize the scanned images, and AI technology is used to recognize and optimize the images to determine document information. Specific implementation details can be found in the following embodiments.
[0094] Figure 2 This is a flowchart illustrating a vehicle detection method based on AI technology, provided as an embodiment of this application. The method of this embodiment can be applied to the server in the above scenario. Figure 2 As shown, the method includes:
[0095] S201. Obtain scanned images of the documents corresponding to the vehicle inspection task;
[0096] Vehicle inspection tasks can be tasks that involve conducting compliance checks on vehicles.
[0097] Scanned images of documents can be digital images of documents captured by a high-resolution scanner, and may include features such as anti-counterfeiting textures, printed text, and transparent packaging layers.
[0098] Specifically, when there is a vehicle inspection task, a high-resolution scanner is used to acquire digital images of the documents to obtain scanned images of the documents.
[0099] S202. Analyze the scanned image of the document to determine the characteristics of the document packaging and the distribution of light spots;
[0100] The packaging features of the document can be the physical properties of the coating on the document surface (such as thickness, refractive index, texture), which can be characterized by local gradient features of the image.
[0101] The distribution of light spots can be overexposed areas formed by the reflection of the encapsulation film.
[0102] Specifically, light spot interference can obscure the text information on documents, necessitating the quantification of the spatial relationship between packaging material characteristics and light spots. Therefore, the Sobel operator is used to calculate the gradient map of the scanned document image to identify high-gradient regions (such as the edges of the laminate). The average gray-level variance of high-gradient regions is then statistically analyzed to determine the document packaging features.
[0103] The scanned image of the document is converted to HSV space. Connected components that exhibit high brightness (V>240V) and low saturation (S<10) in HSV space are extracted. Morphological dilation is performed on the connected components to mark the spot regions and obtain the spot distribution.
[0104] S203. Determine the light spot suppression parameters based on the characteristics of the document packaging and the light spot distribution;
[0105] The light spot suppression parameter can control the brightness attenuation of the light spot area and the intensity of neighborhood repair.
[0106] Specifically, due to the significant differences in the light spot characteristics of different packaging materials (e.g., the light spot is dispersed in matte film and concentrated in glossy film), it is necessary to dynamically generate suppression parameters to adapt to different document types. At this point, the light spot area ratio is calculated based on the light spot distribution, and then the light spot suppression parameters are calculated based on the average grayscale variance and the light spot area ratio obtained in step S202 above.
[0107] S204. Optimize the scanned image of the document based on the spot suppression parameters to obtain the optimized image;
[0108] An optimized image can be an image in which key information areas (such as ID numbers and seals) are clearly distinguishable after light spot suppression processing.
[0109] Specifically, directly using the original image for OCR recognition may result in a high error rate (character loss rate in the glare area >40%), therefore, it is necessary to eliminate reflection interference. In this case, the glare suppression parameters obtained in the above steps are used to optimize the scanned document image, resulting in an optimized image.
[0110] S205. Based on AI technology, identify and optimize images to determine document information.
[0111] Document information can include structured data such as license plate number, vehicle identification number (VIN), and engine number.
[0112] Specifically, the system uses AI technology to recognize and optimize images, outputs text sequences, and uses regular expressions to extract information such as the VIN code from the text sequences, thereby determining the document information.
[0113] This solution utilizes the characteristics of document packaging and the distribution of light spots to determine light spot suppression parameters, thereby specifically eliminating reflections from documents of different materials, optimizing images, and improving image quality. Eliminating light spot interference improves AI recognition accuracy and reduces the error rate.
[0114] In some embodiments, edge detection is performed on the scanned image of the document, and the presence of document packaging is determined based on the edge detection results. If document packaging exists, the edge gradient distribution of the scanned image and the material of the document packaging are determined based on the edge detection results. The packaging wrinkle density is determined based on the edge gradient distribution. The document packaging features are determined based on the document packaging material and the packaging wrinkle density. The material reflectivity is determined by querying a preset material optical parameter database based on the document packaging material. The image brightness distribution is determined by analyzing the scanned image of the document. The light spot distribution is determined based on the packaging wrinkle density, the image brightness distribution, and the material reflectivity.
[0115] Edge detection results can be the output obtained by applying an edge detection algorithm to a scanned image of an ID card.
[0116] Document packaging can be protective packaging for documents.
[0117] Edge gradient distribution can be a dataset calculated based on edge detection results, including the gradient magnitude and gradient direction of each edge point in the scanned document image.
[0118] The packaging material for documents can be physical materials such as plastic, PVC, or silicone.
[0119] Packaging pleat density refers to the density of pleats on the surface of document packaging.
[0120] The preset material optical parameter database can be a pre-built lookup table storing the optical parameters corresponding to different document packaging materials. It is stored in the server and called when needed.
[0121] Material reflectivity refers to a material's ability to reflect light.
[0122] Image brightness distribution can be a spatial pattern of the brightness values of each pixel in a scanned document image.
[0123] Specifically, edge detection algorithms are applied to extract edge features (such as edge continuity, sharpness, curvature, etc.) from the scanned image of the document to determine the edge detection results. Based on the edge detection results, it is checked whether the image edge contains additional contours that are not part of the document itself (such as the boundary of a leather case or plastic seal). 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.
[0124] If document packaging exists, the edge gradient distribution of the scanned document image is statistically analyzed based on the edge detection results, combining the gradient magnitude (representing the magnitude of intensity change, used to distinguish high gradient areas of packaging folds from flat areas) and gradient direction (representing the angle of change, used to assist in analyzing the direction of folds) of each edge point. At the same time, edge features (such as sharp, continuous, and blurred edges) are analyzed. For example, sharp and continuous edges correspond to plastic materials, or blurred edges correspond to silicone materials. Then, a preset material feature library is constructed by collecting typical edge features of common materials (such as plastic and silicone) (storing typical edge patterns of different materials, used to match edge features to determine the document packaging material). The edge features are then matched with the preset material feature library to determine the document packaging material.
[0125] Based on the edge gradient distribution, the image is divided into grids (e.g., 10x10 pixel blocks), and the number of edge pixels in each grid is counted (the total count of edge pixels within the image grid area serves as a basic indicator of packaging wrinkle density). Then, the packaging wrinkle density is determined by weighting the gradient magnitude (pixels with higher gradient magnitudes contribute more and indicate significant wrinkles).
[0126] The document packaging material and pleat density are combined using string tags to determine the document packaging characteristics. Based on the document packaging material, a preset material optical parameter database (which stores the mapping relationship between material type and reflectivity, used to determine material reflectivity) is accessed to determine the material reflectivity. Using spatial statistical methods, the scanned document image is divided into grid regions, and the average brightness of each grid region (the arithmetic mean of the brightness of all pixels within the image grid region) is calculated. The average brightness values are then aggregated to generate the image brightness distribution.
[0127] Predicting areas prone to light spots based on packaging wrinkle density (high wrinkle density areas correspond to high light spot probability), identifying areas with abnormal brightness (areas with brightness values significantly higher than the average brightness) by combining image brightness distribution; and adjusting the light spot intensity using material reflectivity (the brightness intensity of the light spot in the document scanning image, high reflectivity materials may enhance the light spot intensity), thereby determining the light spot distribution.
[0128] This solution performs edge detection on scanned ID card images. Based on the edge detection results, it determines whether document packaging is present, effectively filtering out images without packaging and avoiding invalid processing. If document packaging is present, the edge detection results determine the edge gradient distribution of the scanned image and the packaging material, ensuring differentiation of the reflective behavior of different materials. The edge gradient distribution determines the packaging wrinkle density, reflecting the density of wrinkles on the packaging surface, used to predict light spot tendency. Based on the packaging material and wrinkle density, the document packaging characteristics are determined, simplifying adaptation to dynamic packaging changes. Based on the document packaging material, a preset material optical parameter database is consulted to determine the material reflectivity, reducing real-time computation overhead and providing input for light spot intensity prediction. The scanned ID card image is analyzed to determine the image brightness distribution, ensuring the light spot distribution is consistent with actual brightness anomaly areas. Based on the packaging wrinkle density, image brightness distribution, and material reflectivity, the light spot distribution is determined, improving the accuracy of image optimization.
[0129] In some embodiments, the packaging type is determined based on the characteristics of the document packaging; the light spot distribution is analyzed to predict the light source location information; the light spot type is predicted based on the light source location information and the packaging type; and the light spot suppression parameters are determined based on the light spot type and the packaging fold density.
[0130] Packaging type can be the physical structure category of document packaging, including leather sleeves, plastic seals, etc.
[0131] Light source position information can be a description of the position of the light source during the scanning process.
[0132] The type of light spot can be a category of the physical cause of the light spot, including reflected light spots and refracted light spots.
[0133] Specifically, based on the characteristics and pleat density of the document packaging, a preset rule is applied to match the packaging type (a mapping rule from document packaging characteristics and pleat density to packaging type is used to determine the packaging type). For example, if the document packaging is plastic and has a high pleat density (indicating dense pleats), the packaging type is determined to be a leather case; if the document packaging material is plastic seal and has a low pleat density (indicating sparse pleats), the packaging type is determined to be plastic seal.
[0134] Based on the light spot distribution, calculate the centroid of the light spot intensity distribution in the scanned document image (coordinates of the spatial center point of the light spot intensity in the scanned document image); based on the centroid, predict the light source position information. Based on the light source position information and packaging type, apply preset rules to predict the light spot type (a light spot type classification rule that stores packaging type and light source position information is 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 predicted light spot type is a refracted light spot; if the packaging type is a leather case and the light source position information is large, the predicted light spot type is a reflected light spot; if the packaging type is plastic sealed (light source position information is not considered), the predicted light spot type is a reflected light spot (because the plastic sealing layer mainly reflects surface light).
[0135] Based on the spot type and packaging wrinkle density, access the preset spot suppression parameter table (which stores parameter sets corresponding to different spot types and wrinkle densities for retrieving spot suppression parameters) to determine the spot suppression parameters (including polarization compensation parameter set (suppressing reflected spots) and wavelength shift parameter set (suppressing refracted spots)). For example, if the spot type is a reflected spot and the packaging wrinkle density is high, then select the polarization compensation parameter set; if the spot type is a refracted spot and the packaging wrinkle density is low, then select the wavelength shift parameter set.
[0136] This solution determines the packaging type based on the characteristics of the document packaging, avoiding parameter selection errors caused by ambiguous packaging types. It analyzes the light spot distribution and predicts the light source position information, ensuring real-time adaptation of the light spot to dynamic changes in the light source. Based on the light source position information and packaging type, it predicts the light spot type, avoiding unstable optimization results due to type confusion. Based on the light spot type and packaging wrinkle density, it determines the light spot suppression parameters to improve image optimization and meet high-precision recognition requirements.
[0137] 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 reflected and refracted spots is determined; the distribution of reflected and refracted spots is analyzed to determine the distribution weights of reflected and refracted spots; if the distribution weight of reflected spots > the distribution weight of refracted spots, then the spot suppression parameter adopts the polarization compensation parameter set; if the distribution weight of refracted spots ≥ the distribution weight of reflected spots, then the spot suppression parameter adopts the wavelength shift parameter set.
[0138] A predefined optical parameter lookup table can be a predefined and stored table containing a set of polarization compensation parameters and a set of wavelength offset parameters.
[0139] A polarization compensation parameter set can be a predefined set of parameter values used for polarization compensation strategies.
[0140] The wavelength offset parameter set can be a predefined set of parameter values used for wavelength offset strategies.
[0141] The distribution of reflected light spots can be measured by the percentage of pixel area and average intensity value of the reflected light spots in the scanned document image.
[0142] The distribution of refracted light spots can be measured by the percentage of pixel area and the average intensity value of the refracted light spots in the scanned image of the document.
[0143] Reflected light spots can be light spots formed by direct reflection from the surface of the document packaging.
[0144] Distribution weights can represent the proportion of the influence of light spots in an image.
[0145] A refracted light spot can be a light spot formed by light being refracted through multiple layers of packaging material.
[0146] Specifically, a predefined optical parameter lookup table is obtained through optical physics principles (used to provide a set of suppression parameters for different spot types); the predefined optical parameter lookup table includes a polarization compensation parameter set (parameter values for polarization compensation strategies, such as intensity values) and a wavelength shift parameter set (parameter values for wavelength shift strategies, such as shift amount).
[0147] Based on the type of light spot, an image segmentation algorithm is used to divide the scanned document image into reflected light spot regions and refracted light spot regions. For example, reflected light spot regions are determined by detecting bright reflected pixels (pixels with high brightness values in the scanned document image); refracted light spot regions are determined by detecting multi-layer refraction features (features formed by light refraction through multiple layers of packaging material (such as the interface between the leather case and the plastic seal) in the scanned document image, such as color shift or blurred edges). Then, combined with packaging wrinkle density adjustment analysis (increasing refracted light spots when the wrinkle density is high; increasing reflected light spots when the wrinkle density is low), the distribution of reflected light spots (including the position coordinates, area size, and intensity value of reflected light spots in the scanned document image) and the distribution of refracted light spots (including the position coordinates, area size, and intensity value of refracted light spots) are determined.
[0148] The distribution weight of reflected light spots is determined by statistically analyzing the pixel area ratio (i.e., the proportion of the total number of pixels in the area covered by reflected light spots to the total number of pixels in the scanned document image) and the average intensity value (the average brightness of all pixels in the area covered by reflected light spots), and then applying a weighted formula (such as area ratio multiplied by intensity weight). Similarly, the distribution weight of refracted light spots is determined by statistically analyzing the pixel area ratio (i.e., the proportion of the total number of pixels in the area covered by refracted light spots to the total number of pixels in the scanned document image) and the average intensity value (the average brightness of all pixels in the area covered by reflected light spots), and then applying a weighted formula.
[0149] The distribution weights of the reflected light spot and the refracted light spot are compared. If the distribution weight of the reflected light spot is greater than that of the refracted light spot, the polarization compensation parameter set is retrieved from the predefined optical parameter lookup table, and the light spot suppression parameter is set to the polarization compensation parameter set. If the distribution weight of the refracted light spot is equal to or greater than that of the reflected light spot, the wavelength shift parameter set is retrieved from the predefined optical parameter lookup table, and the light spot suppression parameter is set to the wavelength shift parameter set.
[0150] This solution utilizes a predefined optical parameter lookup table, including polarization compensation parameter sets and wavelength shift parameter sets, to avoid real-time computation overhead and improve processing efficiency. Based on the spot type and the density of packaging wrinkles, the distribution of reflected and refracted spots is determined, preventing global image processing from mistakenly damaging effective areas and ensuring that information obscured by spots is not missed in densely wrinkled areas. The distribution of reflected and refracted spots is analyzed to determine their distribution weights, accurately reflecting the impact of spot type on the image and preventing insufficient or excessive suppression in information areas due to weight miscalculation. If the distribution weight of reflected spots > the distribution weight of refracted spots, the polarization compensation parameter set is used for spot suppression to optimize image brightness distribution and reduce overexposed areas. If the distribution weight of refracted spots is equal to or greater than the distribution weight of reflected spots, the wavelength shift parameter set is used for spot suppression to reduce blur or distortion, preserve the original texture of the document, enhance image robustness, and prevent residual artificial traces after optimization.
[0151] In some embodiments, the spatial coordinates of the light spot are determined based on the light spot distribution; the intensity value of the light spot is determined based on the image brightness distribution; a binarized light spot mask is generated based on the spatial coordinates and intensity value of the light spot; the direction of change of the wrinkle density is determined based on the packaging wrinkle density and edge gradient distribution; the edge feathering region of the binarized light spot mask is expanded based on the direction of change of the wrinkle density; and adaptive filtering is performed on the document scanning image based on the expanded binarized light spot mask and the light spot suppression parameters to obtain an optimized image.
[0152] The spatial coordinates of the light spot can be the location information of the light spot in the scanned image of the document.
[0153] The light spot intensity value can be the overall brightness level of the light spot area.
[0154] The binarized spot mask can be a binary image with the same size as the scanned image of the ID card.
[0155] The direction of change in fold density can be seen as the spatial evolution trend of folds in document packaging in an image.
[0156] The edge feathering region can be a smooth transition region created by extending the edge of the binarized spot mask.
[0157] Specifically, the distribution of the light spot is analyzed, and its boundary coordinates (the boundary points of the light spot region resolved from the light spot distribution) are extracted to form the spatial coordinates of the light spot. The image brightness distribution is accessed, and combined with the spatial coordinates of the light spot, the average brightness of all pixels within that coordinate range is calculated as the light spot intensity value.
[0158] 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 (e.g., if the light spot intensity value is high, it is determined to be a valid light spot, and if the light spot intensity value is low, the area is adjusted or ignored), and the final binarized light spot mask is generated.
[0159] Analyze the edge gradient distribution to identify gradient change trends (such as gradient magnitude and direction); then, combine the packaging fold density value (e.g., high density or low density) to infer the direction of fold density change (only one direction needs to be determined). For example, if the gradient points from a high-density area to a low-density area, the fold density change direction is from dense to sparse; or if the gradient points from a low-density area to a high-density area, the fold density change direction is from sparse to dense.
[0160] Identify the edge pixels of the binarized spot mask (pixels located at the boundary of the mask region in the binarized spot mask); then, based on the edge pixels and combined with the direction of wrinkle density change, expand the edge feathering region of the binarized spot mask. For example, when the wrinkle density change direction is from dense to sparse, the feathering width is expanded towards the low-density side (e.g., the feathering radius is increased); when the wrinkle density change direction is from sparse to dense, the feathering width is expanded towards the high-density side.
[0161] The filtering strategy is selected based on the spot suppression parameters (image processing methods for spot suppression parameter selection, including polarization compensation filtering or wavelength shift filtering). If the spot suppression parameters are a set of polarization compensation parameters, polarization compensation filtering is applied (e.g., adjusting pixel polarization state to reduce brightness); if the spot suppression parameters are a set of wavelength shift parameters, wavelength shift filtering is applied (e.g., converting pixel color to shift wavelength value). Each pixel of the scanned ID card image is traversed, and the expanded binarized spot mask is used as a weight to perform adaptive filtering on the scanned ID card image to obtain an optimized image.
[0162] This scheme determines the spatial coordinates of the light spot based on its distribution, ensuring that light spot suppression processing targets only the interfering area, avoiding accidental damage to the valid area of the document during global operations, 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 leading to loss of image details. A binarized light spot mask is generated based on the light spot spatial coordinates and intensity value to isolate the interfering area and provide a target region for adaptive filtering, ensuring that processing only affects the light spot. The direction of change in fold density is determined based on the packaging fold density and edge gradient distribution, eliminating the dynamic diffusion problem of the light spot in the packaging fold area, ensuring that feathering processing can adapt to fold changes, and avoiding image edge distortion caused by inaccurate feathering. The edge feathering area of the binarized light spot mask is expanded according to the direction of fold density change to eliminate the hard boundary effect after light spot suppression, ensuring a natural transition in the optimized image, reducing artificial traces, and improving the visual quality of the image. Based on the expanded binarized light spot mask, adaptive filtering is performed on the document scan image according to the light spot suppression parameters to obtain an optimized image that effectively suppresses light spots while preserving document details.
[0163] In some embodiments, based on the vehicle inspection task, the distribution characteristics of document information are determined; based on the distribution characteristics of document information, the scanned image of the document is divided into cells to obtain several 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 rate of change between amplitude variances is analyzed, and based on the rate of change, high-wrinkle change areas are determined; the mean rate of change and the area ratio of high-wrinkle change areas to the scanned image of the document are calculated, and based on the mean rate of change and the area ratio, the packaging wrinkle density is determined.
[0164] The distribution characteristics of document information can be the spatial location characteristics of vehicle document information in the scanned image.
[0165] An image unit can be a sub-region unit formed by dividing a scanned image of an ID card into cells.
[0166] Edge gradient change can be the change in gradient magnitude of edge pixels within an image unit.
[0167] Amplitude variance can be a quantification of the dispersion of edge gradient magnitudes within an image cell.
[0168] Any adjacent image unit can be a pair of units that are spatially adjacent in the cell division.
[0169] The rate of change can be the percentage difference in amplitude variance between adjacent image units.
[0170] A high-wrinkle variation region can be an image region covered by adjacent units whose amplitude variance change rate exceeds a preset threshold.
[0171] The mean rate of change can be the arithmetic mean of the rates of change of all adjacent image units.
[0172] The area ratio can be the percentage of pixels in highly wrinkled areas out of the total number of pixels in the scanned document image.
[0173] Specifically, based on the vehicle inspection task, the system accesses a predefined database of document information distribution features (which stores the distribution features of document information for different document types) established according to the document standard format theory, and extracts the document information distribution features. For example, the document information distribution features of a driver's license include the vehicle 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.
[0174] Based on the distribution characteristics of document information, finer cell divisions (e.g., smaller cell sizes) are used in information-dense areas (areas where key information is concentrated in the document scan image, such as the location of the vehicle owner's name or license plate number), while coarser divisions (e.g., larger cell sizes) are used in information-sparse areas (areas with less key information or blank areas in the document scan image), thereby obtaining several image units.
[0175] Traverse each image unit (processing unit by unit); based on the edge gradient distribution, apply the Sobel operator to calculate the edge gradient magnitude of all pixels in each image unit (the intensity of brightness change of all pixels in the image unit, used to quantify the gradient magnitude change); extract the gradient magnitude change from the calculated edge gradient magnitude, and calculate the magnitude variance corresponding to the edge gradient change in the image unit.
[0176] Based on cell division, select adjacent cell pairs (vertical or horizontal) to form adjacent image cells. For each adjacent image cell, calculate the rate of change of amplitude variance. At this point, construct a preset threshold (used to compare with the rate of change to determine high-wrinkle change areas) through experimental calibration (e.g., testing the accuracy of different thresholds for marking wrinkled areas). Then, compare the rate of change with the preset threshold. If the rate of change > the preset threshold, it is marked as a high-wrinkle change area.
[0177] The rate of change of all adjacent image units is integrated, and their average rate of change is calculated. The total number of pixels in the high-wrinkle change region is counted, and the total number of pixels in the ID card scan image is calculated to determine the area ratio of the high-wrinkle change region in the ID card scan image. Based on the average rate of change and the area ratio, the packaging wrinkle density is calculated using a linear combination formula.
[0178] This solution determines the distribution characteristics of document information based on the vehicle inspection task, avoiding resource waste caused by global operations. Based on these characteristics, the scanned document image is divided into cell 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 unit is determined based on the edge gradient distribution, providing local granularity for wrinkle analysis. For any adjacent image units, the rate of change between amplitude variances is analyzed. Based on this rate of change, high-wrinkle variation regions are identified, avoiding redundancy caused by global processing and providing input for the comprehensive calculation of packaging wrinkle density. The mean rate of change and the area ratio of high-wrinkle variation regions in the scanned document image are calculated. Based on the mean rate of change and area ratio, the packaging wrinkle density is determined, improving the robustness of spot suppression, optimizing image preservation of document details, and enhancing the reliability of AI recognition.
[0179] In some embodiments, the distribution of light spots is analyzed to determine a set of light spots; the set of light spots 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.
[0180] A light spot set can be a collection of several light spot pixels, including spatial location coordinates and brightness values.
[0181] A luminance-connected region can be a spatially continuous region obtained through clustering.
[0182] A cluster of light sources can be a region in the luminance connected domain whose area is greater than the area threshold.
[0183] The weighted centroid can be the average position of the pixel coordinates within the light source cluster, weighted by the brightness value.
[0184] Specifically, the pixels in the light spot distribution are traversed, and according to the preset brightness threshold set by the experimental calibration (testing the effect of different brightness values on the formation of light spot set), pixels with brightness exceeding the preset brightness threshold are selected to form light spot set (including spatial location coordinates and brightness value).
[0185] Based on each pixel in the light spot set, its spatial adjacency (positional proximity between pixels) is checked, and interconnected pixels are aggregated into an independent region, namely the luminance connectivity region.
[0186] By setting an area threshold through experimental calibration (testing the effect of different areas on the identification of light source clusters), small noise regions in the luminance connected domain are excluded to identify light source clusters. Luminance connected domains with too small an area (which may be noise) are excluded; while the remaining large luminance connected domains (such as regions with an area greater than the area threshold) are marked as several light source clusters.
[0187] The system iterates through the pixels within several light source clusters and calculates a weighted average of the spatial coordinates of each pixel, where the weight is the brightness value of the pixel, thereby determining the weighted centroid. Then, based on the weighted centroids of several light source clusters (such as a centroid coordinate sequence), the system predicts the light source position information (i.e., the spatial coordinates of the light source in the scanned document image).
[0188] This scheme analyzes the light spot distribution, identifies light spot sets, locates high-brightness interference areas, and ensures that the light spot distribution characteristics are quantified and captured. Clustering the light spot sets determines the brightness connectivity domains, effectively eliminating noise interference. Based on the brightness connectivity domains, several light source clusters are identified, improving the robustness and accuracy of prediction. The weighted centroids of these light source clusters are calculated, and based on these weighted centroids, the light source location information is predicted, enhancing the optimization effect of document scanning images.
[0189] In some embodiments, the directional angle of the gradient distribution between any adjacent image units is determined based on the edge gradient distribution; a gradient transfer matrix between image units is constructed based on the amplitude variance and the directional angle; and spatially continuous high gradient transition regions are merged based on the gradient transfer matrix to generate a highly wrinkled change region.
[0190] The directional angle can be the angle difference between the gradient directions of any adjacent image units.
[0191] The gradient transition matrix can be a two-dimensional matrix used to encode the overall intensity of gradient changes between image units.
[0192] A high gradient transition region can be a region in the gradient transition matrix where the element value exceeds a preset threshold.
[0193] Specifically, based on the edge gradient distribution, adjacent image units in the scanned document image are traversed. 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 that the directions are the same, and an angle close to 180 degrees indicates that the directions are opposite. Based on the amplitude variance and the directional angle, a gradient transition matrix between image units is constructed using a weighted combination method.
[0194] Traverse the gradient transition matrix and filter out high-value elements whose values exceed a preset threshold (a critical value used to filter high-value elements) set according to experimental calibration (an experiment to determine 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 a document scan image are considered continuous). Aggregate spatially continuous units into an independent region, which is the high-wrinkle change region.
[0195] This scheme determines the directional angle of the gradient distribution between any two adjacent image units based on the edge gradient distribution, quantifying the spatial evolution differences in gradient directions between image units. Based on the amplitude variance and directional angle, a gradient transfer matrix between image units is constructed, avoiding the blindness of global thresholding. Based on the gradient transfer matrix, spatially continuous high-gradient transition regions are merged to generate highly wrinkled change regions, eliminating isolated high-value points in the matrix.
[0196] In some embodiments, the light source intensity is determined based on the image brightness distribution and material reflectivity; the reflection attenuation coefficient and 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 reflected light spots 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; and the distribution of refracted light spots is determined based on the light source intensity, vector, packaging wrinkle density, refraction attenuation coefficient, and material refractive index.
[0197] Light source intensity can be the level of luminous intensity of a light source.
[0198] The reflection attenuation coefficient can be the attenuation factor of a material on the intensity of reflected light.
[0199] The refractive attenuation coefficient can be the attenuation factor of a material on the intensity of refracted light.
[0200] A light source can be an entity that provides illumination.
[0201] The surface of a document can be the physical surface area corresponding to the scanned image of the document, including the outer layer of the document's packaging material.
[0202] A vector can be a three-dimensional direction vector representing the direction of light incident from the position of the light source to the surface of the document.
[0203] The refractive index of a material can be the refractive index of light as it travels from the air into the packaging material of a document.
[0204] Specifically, based on the image brightness distribution and material reflectivity, a predefined optical parameter lookup table is consulted to determine the light source intensity. For example, the light source intensity is directly proportional to the image brightness distribution but inversely proportional to the material reflectivity (high reflectivity materials will enhance image brightness, so for the same brightness, high reflectivity corresponds to lower light source intensity).
[0205] Based on the material of the document packaging (e.g., the outer layer of the leather case is a flexible plastic film, and the inner layer is a plastic seal), the reflection attenuation coefficient and refraction attenuation coefficient are retrieved from a predefined optical parameter lookup table. The reflection attenuation coefficient represents 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 represents the degree of energy attenuation when light is refracted inside the material (used to quantify the proportion of energy lost when light is refracted inside the material). For example, for plastic materials, the predefined optical parameter lookup table returns a lower reflection attenuation coefficient (indicating less reflection loss), while for silicone materials, the predefined optical parameter lookup table returns a higher refraction attenuation coefficient (indicating greater refraction loss).
[0206] Based on the light source location information and document packaging features, a vector pointing from the light source to the document surface is predicted using geometric vector calculation. Using this vector, combined with the packaging wrinkle density (higher wrinkle density indicates a less smooth surface), the reflection angle at each point on the surface is calculated (for example, wrinkle density is used to adjust direction and simulate surface deformation). Applying a reflection attenuation coefficient, combined with the light source intensity (higher light source intensity indicates stronger reflected light), the reflected light intensity of each pixel is calculated, thereby determining the distribution of the reflected light spot.
[0207] Based on the material of the document packaging, a predefined optical parameter lookup table is consulted to determine the material's refractive index (i.e., the refractive index of light entering the material from air, representing the proportion of change in the speed of light). Using vectors and the material's refractive index, the refracted light path (the propagation path of light after refraction within the material) is calculated. Integrating the packaging pleat density (pleat density 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), the refracted light intensity of each pixel is calculated, thereby determining the distribution of the refracted light spot.
[0208] This solution determines the light source intensity based on image brightness distribution and material reflectivity, ensuring the accuracy of light spot distribution prediction and reducing the impact of image brightness distortion on light spot modeling. Based on the document packaging material, it determines the reflection attenuation coefficient and refraction attenuation coefficient, ensuring that the predicted reflected and refracted light spots reflect the material's optical properties. Based on the light source position information, it predicts the vector from the light source to the document surface, describing the incident direction of the light and providing a geometric basis for calculating the reflection / refraction angle. Based on the light source intensity, vector, packaging wrinkle density, and reflection attenuation coefficient, it determines the distribution of reflected light spots, ensuring effective handling of reflected light spots in high-density areas of packaging wrinkles. Based on the document packaging material, it determines the material's refractive index, reducing 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, it determines the distribution of refracted light spots, ensuring that refracted light spots are handled under varying packaging wrinkle directions, avoiding residual manual traces from image optimization.
[0209] Figure 3This application provides a schematic diagram of the structure of a vehicle detection system based on AI technology, as shown in the embodiment below. Figure 3 As shown, the vehicle detection system 300 based on AI technology in 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.
[0210] Image acquisition module 301 is used to acquire document scan images during vehicle inspection;
[0211] Image analysis module 302 is used to analyze the scanned image of the document to determine the document packaging features and light spot distribution;
[0212] The suppression parameter determination module 303 is used to determine the light spot suppression parameter based on the characteristics of the document packaging and the light spot distribution;
[0213] Image optimization module 304 is used to optimize the scanned image of the document according to the light spot suppression parameters to obtain an optimized image;
[0214] The information determination module 305 is used to identify the optimized image based on AI technology and determine the document information.
[0215] Optionally, when the image analysis module 302 analyzes the scanned image of the document to determine the document packaging features and spot distribution, it is used to: perform edge detection on the scanned image of the document; determine whether document packaging exists based on the edge detection results; if document packaging exists, determine the edge gradient distribution and document packaging material of the scanned image of the document based on the edge detection results; determine the packaging wrinkle density based on the edge gradient distribution; determine the document packaging features 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 image of the document to determine the image brightness distribution; and determine the spot distribution based on the packaging wrinkle density, the image brightness distribution, and the material reflectivity.
[0216] 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 and 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 fold density.
[0217] Optionally, the light spot type includes reflected light spots and refracted light spots; when the suppression parameter determination module 303 determines the light spot suppression parameter according to the light 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 light spot type and the packaging wrinkle density, determine the distribution of reflected light spots and the distribution of refracted light spots; analyze the distribution of reflected light spots and the distribution of refracted light spots to determine the distribution weight of reflected light spots and the distribution weight of refracted light spots; if the distribution weight of reflected light spots > the distribution weight of refracted light spots, then the light spot suppression parameter adopts the polarization compensation parameter set; if the distribution weight of refracted light spots ≥ the distribution weight of reflected light spots, then the light spot suppression parameter adopts the wavelength shift parameter set.
[0218] Optionally, when the image optimization module 304 optimizes the document scan image according to the spot suppression parameters to obtain the optimized image, it is used to: determine the spatial coordinates of the spot 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 fold density according to the packaging fold density and the edge gradient distribution; expand the edge feathering region of the binary spot mask according to the direction of change of the fold density; and perform adaptive filtering on the document scan image based on the expanded binary spot mask and the spot suppression parameters to obtain the optimized image.
[0219] 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 cell units based on the document information distribution characteristics to obtain several 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 rate of change between the amplitude variances, and determine the high wrinkle change region based on the rate of change; calculate the mean rate of change and the area ratio of the high wrinkle change region to the document scan image, and determine the packaging wrinkle density based on the mean rate of change and the area ratio.
[0220] Optionally, when the suppression parameter determination module 303 analyzes the light spot distribution and predicts the light source location information, it is used to: analyze the light spot distribution and determine the light spot set; cluster the light spot set and determine the brightness connected component; determine several light source clusters based on the brightness connected component; calculate the weighted centroid of the several light source clusters, and predict the light source location information based on the weighted centroid.
[0221] Optionally, when the image analysis module 302 analyzes the rate of change between the amplitude variances and determines the high-wrinkle change region 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 transition matrix between image units based on the amplitude variance and the directional angle; and merge spatially continuous high gradient transition regions based on the gradient transition matrix to generate a high-wrinkle change region.
[0222] 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 distribution of reflected light spots 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; and determine the distribution of refracted light spots based on the light source intensity, the vector, the packaging wrinkle density, the refraction attenuation coefficient, and the material refractive index.
[0223] The system in this embodiment can be used to execute the methods of any of the above embodiments, and its implementation principle and technical effect are similar, so they will not be described again here.
Claims
1. A vehicle detection method based on AI technology, characterized in that, include: Obtain scanned images of the documents corresponding to the vehicle inspection task; Analyze the scanned image of the document to determine the document packaging features and light spot distribution; Based on the document packaging features and the light spot distribution, light spot suppression parameters are determined; the document packaging features are the physical properties of the document surface coating, which are characterized by local gradient features of the image. Based on the light spot suppression parameters, the scanned image of the document is optimized to obtain an optimized image; The optimized image is identified using AI technology to determine the document information. The step of determining the light spot suppression parameters based on the characteristics of the document packaging and the light spot distribution includes: Based on the characteristics of the document packaging, determine the packaging type; Analyze the light spot distribution to predict the light source location information; Predict the light spot type based on the light source location information and the packaging type; The light spot types include reflected light spots and refracted light spots; a predefined optical parameter lookup table is obtained; the predefined optical parameter lookup table includes a polarization compensation parameter set and a wavelength offset parameter set; Based on the light spot type, the distribution of reflected light spots and the distribution of refracted light spots are determined according to the packaging wrinkle density; Analyze 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, then the light spot suppression parameter adopts 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, then the light spot suppression parameter adopts the wavelength offset parameter set.
2. The method according to claim 1, characterized in that, The analysis of the scanned image of the document to determine the document packaging features and light spot distribution includes: Edge detection is performed on the scanned image of the document, and the presence of document packaging is determined based on the edge detection results; If document packaging exists, the edge gradient distribution of the scanned document image and the material of the document packaging are determined based on the edge detection results. The packaging pleat density is determined based on the edge gradient distribution; The characteristics of the document packaging are determined based on the material of the document packaging and the density of the packaging pleats; Based on the document packaging material, the material reflectivity is determined by querying a preset material optical parameter database. Analyze the scanned image of the document to determine the image brightness distribution; The light spot distribution is determined based on the packaging fold density, the image brightness distribution, and the material reflectivity.
3. The method according to claim 2, characterized in that, The step of optimizing the scanned image of the document based on the light spot suppression parameters to obtain an optimized image includes: Based on the light spot distribution, determine the spatial coordinates of the light spot; Determine the spot intensity value based on the image brightness distribution; A binary spot mask is generated based on the spot spatial coordinates and the spot intensity value; The direction of wrinkle density variation is determined based on the packaging wrinkle density and the edge gradient distribution; Based on the direction of the change in wrinkle density, the edge feathering region of the binarized spot mask is expanded; Based on the extended binarized spot mask, adaptive filtering is performed on the scanned image of the document according to the spot suppression parameters to obtain an optimized image.
4. The method according to claim 2, characterized in that, Determining the packaging pleat density based on the edge gradient distribution includes: Based on the vehicle inspection task, determine the distribution characteristics of the document information; Based on the distribution characteristics of the document information, the scanned image of the document is divided into cells to obtain several image units; For each image unit, the magnitude variance corresponding to the edge gradient change within the image unit is determined based on the edge gradient distribution. For any adjacent image units, analyze the rate of change between the amplitude variances, and determine the high-wrinkle variation region based on the rate of change; Calculate the mean rate of change and the area ratio of high-wrinkle change regions to the scanned image of the document. Determine the packaging wrinkle density based on the mean rate of change and the area ratio.
5. The method according to claim 1, characterized in that, The analysis of the light spot distribution and prediction of the light source location information includes: Analyze the light spot distribution to determine the light spot set; Cluster the light spot set to determine the brightness connected components; Based on the brightness connectivity region, several light source clusters are determined; Calculate the weighted centroid of several light source clusters, and predict the light source position information based on the weighted centroid.
6. The method according to claim 4, characterized in that, The analysis of the rate of change between the amplitude variances, and the determination of high-wrinkle variation regions based on the rate of change, includes: Based on the edge gradient distribution, determine the directional angle between the gradient distributions of any adjacent image units; Based on the amplitude variance and the directional angle, a gradient transition matrix between image units is constructed; Based on the gradient transition matrix, spatially continuous high gradient transition regions are merged to generate highly folded change regions.
7. The method according to claim 2, characterized in that, The step of determining the distribution of reflected light spots and refracted light spots based on the density of packaging pleats includes: The light source intensity is determined based on the image brightness distribution and the material reflectivity; Based on the material of the document packaging, determine the reflection attenuation coefficient and the refraction attenuation coefficient; Based on the light source position information, predict the vector from the light source to the surface of the document; The distribution of reflected light spots is determined based on the light source intensity, the vector, the packaging pleat density, and the reflection attenuation coefficient. Determine the refractive index of the material based on the packaging material of the document; The distribution of the refracted light spot is determined based on the light source intensity, the vector, the packaging pleat density, the refractive attenuation coefficient, and the material refractive index.
8. A vehicle detection system based on AI technology, characterized in that, Applied to the method as described in any one of claims 1-7, comprising: The image acquisition module is used to acquire scanned images of vehicle documents during vehicle inspection; The image analysis module is used to analyze the scanned image of the document to determine the document packaging features and light spot distribution; The suppression parameter determination module is used to determine the light spot suppression parameters based on the characteristics of the document packaging and the light spot distribution. The image optimization module is used to optimize the scanned image of the document 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