An artificial intelligence visual inspection method and system based on local binary patterns
By deploying spectral sensor arrays and implementing automated spatial selection logic, the computer vision detection system's lighting adaptability and feature extraction stability problems in complex lighting changes and multi-view environments are solved, and higher recognition accuracy and stereoscopic recognition capabilities are achieved.
Patent Information
- Application Number
- CN202410964100.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-18
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2044-07-18
AI Technical Summary
In complex lighting changes and multi-view environments, existing computer vision detection systems have poor lighting adaptability, unstable feature extraction and insufficient utilization of three-dimensional spatial information.
Deploy a spectral sensor array to capture light intensity and color temperature, perform instantaneous strong light interference removal and temperature compensation, and realize automated space selection logic and target color space conversion. At the same time, through dynamic LBP feature coding and three-dimensional spatial model construction, the characteristics of each perspective are integrated for target recognition.
It improves the recognition stability and accuracy of the visual detection system under extreme lighting conditions, and enhances the stereoscopic recognition capabilities of the detection system and the processing capabilities of the occlusions.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision technology, and in particular to an artificial intelligence vision detection method and system based on local binary patterns. Background Art
[0002] In recent years, with the rapid development of artificial intelligence technology, especially in the field of computer vision, intelligent image recognition and analysis technology has increasingly become the key to promoting the progress of many industries such as industrial automation, medical diagnosis, and security monitoring. Although LBP technology has made remarkable achievements, it still faces many challenges in practical applications, especially in image processing and recognition accuracy under complex lighting environments. Technological innovation is urgently needed to break through the bottleneck of existing technologies. Although most of the current visual detection systems can handle a certain degree of lighting changes, they are often difficult to ensure the stability and accuracy of recognition when faced with extreme lighting conditions and rapidly changing lighting scenes. On the one hand, drastic fluctuations in ambient lighting can cause image signal distortion and affect the reliability of feature extraction. On the other hand, feature descriptions under a single fixed color space lack sufficient adaptability and generalization capabilities when faced with scenes with different color temperatures and light intensities. Summary of the invention
[0003] In view of the above existing problems, the present invention is proposed.
[0004] Therefore, the present invention provides an artificial intelligence visual inspection method, device, computer equipment and storage medium based on local binary patterns to solve the problems of poor lighting adaptability, unstable feature extraction and insufficient utilization of three-dimensional spatial information in artificial intelligence visual inspection under complex lighting changes and multi-view environments.
[0005] In order to solve the above technical problems, the present invention provides the following technical solutions:
[0006] In a first aspect, an embodiment of the present invention provides an artificial intelligence visual detection method based on local binary patterns, which comprises:
[0007] Deploy a spectral sensor array to regularly capture light intensity and color temperature, remove instantaneous strong light interference and perform temperature compensation on the light intensity to determine the current lighting conditions;
[0008] Based on the current lighting conditions, realize the automatic space selection logic and convert to the target color space;
[0009] After adaptive weight allocation of the target color space, dynamic LBP feature encoding is performed and feature extraction is performed to form a feature vector;
[0010] At the same time, all cameras are started to collect image data, geometric transformation is performed on each channel of image data, and depth information is integrated to build a three-dimensional space model;
[0011] The LBP features extracted from each perspective are fused, and the fused feature vectors are used for target recognition and matching using a three-dimensional space model to output the final detection result.
[0012] As a preferred solution of the artificial intelligence visual detection method based on local binary patterns described in the present invention, a spectral sensor array is deployed to capture light intensity and color temperature at regular intervals, and instantaneous strong light interference is removed and temperature compensation is performed on the light intensity to determine the current light conditions. The specific operation steps are as follows:
[0013] Collect historical light intensity data over a period of time, analyze the historical light intensity, and set upper and lower thresholds for light intensity;
[0014] Perform outlier detection on each newly collected light intensity value to remove instantaneous strong light interference;
[0015] Use the current ambient temperature and the original light intensity measurement value without the interference of instantaneous strong light to calculate the compensated light intensity and eliminate the influence of temperature change on the measurement result;
[0016] According to the compensated light intensity, the environment is divided into dark light environment, natural light environment and strong light environment;
[0017] The environment is divided into warm, neutral and cool colors according to color temperature;
[0018] Combined with the classification, the lighting conditions are comprehensively evaluated to determine the current lighting conditions.
[0019] As a preferred solution of the artificial intelligence visual detection method based on local binary patterns of the present invention, wherein: based on the current lighting conditions, the automatic space selection logic is realized and converted to the target color space. The specific steps are as follows:
[0020] When the environment is dim and warm, the RGB color space is converted to the XYZ space through the conversion formula, and then the XYZ space is converted to the Lab space;
[0021] When the environment is natural light and neutral tone, the conversion from RGB space to HSV space is performed by calculating the corresponding HSV value of each pixel's RGB value;
[0022] When the environment is bright and cold, the image is kept in RGB space without conversion.
[0023] As a preferred solution of the artificial intelligence visual detection method based on local binary patterns described in the present invention, wherein: adaptive weight allocation is performed on the target color space, and the specific operation steps are as follows:
[0024] Adjust the pixel weight according to the light intensity and calculate the light intensity adjustment coefficient. The expression is:
[0025]
[0026] Among them, α Lux (Lux) is the light intensity adjustment coefficient. Lux is the light intensity of the current pixel. avg is the average light intensity, γ1 is a parameter that controls the steepness of the nonlinear relationship between light intensity and weight adjustment, γ2 is a parameter that determines the deviation of light intensity from the average value, γ3 is a parameter that adjusts the weight growth rate in high light intensity areas, and γ4 is a parameter that controls the polynomial growth of the high light intensity part;
[0027] According to the color temperature, the color degree weight is adjusted and the color temperature adjustment coefficient is calculated. The expression is:
[0028]
[0029] Among them, β c (T c ) is the color temperature adjustment coefficient, T c is the color temperature of the current pixel, T n is a neutral color temperature, T r is the range of color temperature, δ1 is the color temperature sensitivity, δ2 is the adjustment intensity coefficient, and δ3 is the control color temperature deviation coefficient;
[0030]
[0031] Where LC(i,j) is the local contrast, G(m,n) is the Gaussian kernel function, Z is the normalization constant, k is the neighborhood radius, I(i,j) is the grayscale value of each pixel, i is the row coordinate of the pixel, j is the column coordinate of the pixel, m is the offset along the row direction of the image, and n is the offset along the column direction of the image;
[0032] Taking into account the influence of light intensity and color temperature, the weight value of the pixel is calculated, and the expression is:
[0033]
[0034] Among them, W(i,j) is the final pixel weight, ρ is the parameter of the influence of local contrast on the rate of weight adjustment, and σ is the parameter that determines the attenuation speed;
[0035] Traverse each pixel in the image and generate a weight matrix with the same size as the original image by calculating the weight value of each pixel.
[0036] As a preferred solution of the artificial intelligence visual detection method based on local binary patterns described in the present invention, wherein: dynamic LBP feature encoding is performed and feature extraction is performed to form a feature vector. The specific operation steps are as follows:
[0037] The image is grayed and weighted difference calculation is applied to obtain the weighted local binary pattern value, which is expressed as:
[0038]
[0039] Among them, p c is the center pixel position, LBP w (p c ) is the weighted local binary pattern value, p n is the adjacent pixel, I g (p n ) is the gray value of the adjacent pixel, I g (p c ) is the gray value of the center pixel, n p It is the index variable of the adjacent pixel currently traversed;
[0040] After applying weighted difference calculation to all pixels to obtain weighted local binary pattern values, the frequencies of the weighted LBP codes obtained are statistically analyzed to form a weighted LBP histogram and obtain a feature vector.
[0041] As a preferred solution of the artificial intelligence visual inspection method based on local binary patterns described in the present invention, all cameras are started simultaneously to collect image data, and geometric transformation is performed on each channel of image data. The specific operation steps are as follows:
[0042] All cameras synchronously collect image data and then perform image stitching and calibration;
[0043] Apply the ORB algorithm to the stitched and calibrated image data of each camera to extract the key points of the image;
[0044] Calculate feature description and perform feature matching using the nearest neighbor algorithm;
[0045] The matching point set obtained by feature matching uses the basic matrix calculation method to calculate the relative position between the two cameras;
[0046] Through the direct linear transformation solution, the perspective transformation matrix is calculated to form the geometric alignment between images.
[0047] As a preferred solution of the artificial intelligence visual detection method based on local binary patterns described in the present invention, the image after geometric transformation is integrated with depth information to construct a three-dimensional space model. The specific operation steps are as follows:
[0048] For the geometrically aligned images, a block matching algorithm is used to calculate the disparity map, and the disparity map is converted into a depth map;
[0049] Traverse each pixel of the depth map, and calculate the coordinates of each pixel in three-dimensional space for the depth value, image coordinates and camera parameters of each pixel;
[0050] Add the calculated coordinates of each pixel to the point cloud data and save the color information;
[0051] The Marching Cubes algorithm is used to convert the point cloud data into a triangular mesh, and the mapping algorithm is used to extract the corresponding color information from the two-dimensional image coordinates of each point in the point cloud to construct a three-dimensional space model.
[0052] As a preferred solution of the artificial intelligence visual detection method based on local binary patterns described in the present invention, the LBP features extracted from each viewing angle are fused, the fused feature vectors are identified and matched using a three-dimensional space model, and the final detection result is output. The specific steps are as follows:
[0053] For each image from each perspective, the LBP feature extraction algorithm is applied to calculate the LBP code and convert it into a histogram feature;
[0054] Based on the parameters after geometric transformation, the feature vector of each view is converted from its own image coordinate system to a unified three-dimensional space coordinate system to form feature alignment;
[0055] A deep weighted fusion method is used to fuse the LBP features of each perspective to form a fused feature vector;
[0056] Create a feature database, apply the KD tree search algorithm to perform nearest neighbor search on each feature vector obtained from multi-view fusion in the feature database, and obtain preliminary matching objects;
[0057] For the preliminary matching results, the ICP algorithm is applied to iteratively perform the closest point matching to obtain accurate pose estimation;
[0058] Analyze the depth value of each matching point to identify and eliminate unreasonable matches caused by occlusion;
[0059] Apply deep learning models to classify fused features and further refine the recognition results;
[0060] The output of the deep learning model and the results of the traditional matching algorithm are combined to output the final detection result through a fusion strategy.
[0061] In a second aspect, an embodiment of the present invention provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: when the computer program is executed by the processor, any step of the artificial intelligence visual detection method based on local binary patterns as described in the first aspect of the present invention is implemented.
[0062] In a third aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, it implements any step of the artificial intelligence visual detection method based on local binary patterns as described in the first aspect of the present invention.
[0063] The beneficial effects of the present invention are as follows: by deploying a spectral sensor array to capture light intensity and color temperature in a timely manner, and performing instantaneous strong light interference removal and temperature compensation processing, the false detection or missed detection caused by sudden light changes or temperature fluctuations in the visual detection system is improved, and automatic space selection logic is implemented based on current lighting conditions and converted to the target color space, thereby enhancing color distinction and effective use of information, improving the accuracy and efficiency of target recognition, and adaptively allocating weights to the target color space to dynamically adjust pixel weights, thereby enhancing the detection system's stereo recognition capability and its ability to handle obstructions. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0065] Figure 1 This is a flow chart of the artificial intelligence visual detection method based on local binary patterns in Example 1.
[0066] Figure 2 This is the conversion target color space diagram in Example 1. DETAILED DESCRIPTION
[0067] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the accompanying drawings.
[0068] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0069] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive with other embodiments.
[0070] Example 1, reference Figure 1 and Figure 2 , which is the first embodiment of the present invention, provides an artificial intelligence visual detection method based on local binary patterns, comprising the following steps:
[0071] S1. Deploy a spectral sensor array to regularly capture light intensity and color temperature, remove instantaneous strong light interference and perform temperature compensation on the light intensity to determine the current lighting conditions.
[0072] S1.1. Collect historical light intensity data over a period of time, analyze the historical light intensity, and set upper and lower thresholds of light intensity;
[0073] Perform outlier detection on each newly collected light intensity value to remove instantaneous strong light interference;
[0074] Use the current ambient temperature and the original light intensity measurement value without the interference of instantaneous strong light to calculate the compensated light intensity and eliminate the influence of temperature change on the measurement result;
[0075] According to the compensated light intensity, the environment is divided into dark light environment, natural light environment and strong light environment;
[0076] The environment is divided into warm, neutral and cool colors according to color temperature;
[0077] Combined with the classification results, the lighting conditions are comprehensively evaluated to determine the current lighting conditions.
[0078] S1.1.1. According to the light intensity Lux, the environment is divided into several typical categories, for example:
[0079] Dark light environment: Lux<50lux, soft lighting suitable for reading or resting;
[0080] Natural light environment: 50lux≤Lux<2000lux, daily indoor light or outdoor light on a cloudy day;
[0081] Strong light environment: Lux ≥ 2000 lux, direct sunlight or strong artificial lighting;
[0082] At the same time, the environment is divided into:
[0083] Warm color: Tcolor<4000K, dusk or yellow light bulb;
[0084] Neutral tone: 4000K≤T c ≤6500K, close to natural daylight;
[0085] Cool colors: T c >6500K, midday sunlight or white LED.
[0086] S1.1.2. Combine the classification to generate a comprehensive evaluation index, expressed as:
[0087]
[0088] Among them, I light is the suitability of the current lighting conditions, Lux is the light intensity of the current pixel, T c is the color temperature, α is the weight factor for balancing light intensity, β is the weight factor for balancing color temperature, Lux max is the maximum measured value of light intensity, T max is the maximum measured value of color temperature, T min is the minimum measured value of color temperature, I light The range is between 0 and 1, representing the most unfavorable to the most ideal lighting conditions;
[0089] According to I light A value that determines whether color space conversion is required and to which color space.
[0090] S2. Based on the current lighting conditions, implement automated space selection logic and convert to the target color space.
[0091] S2.1. When the environment is dark and warm, each pixel is independently converted from RGB color space to XYZ space through the conversion formula, and then the XYZ space is converted to Lab space;
[0092] When the environment is natural light and neutral tone, the conversion from RGB space to HSV space is performed by calculating the corresponding HSV value of each pixel's RGB value;
[0093] When the environment is bright and cold, the image is kept in RGB space without conversion.
[0094] S2.1.1, if Lux<50lux and Tcolor<4000K, it is a dark light and warm color environment, use the color conversion algorithm to perform the conversion from RGB to Lab color space;
[0095] First, convert the RGB space to the XYZ color space. The expression is:
[0096]
[0097] Among them, R is the red nonlinear coding value, G is the green nonlinear coding value, and B is the blue nonlinear coding value. The value range is usually 0 to 255. X, Y, and Z correspond to the three components of the CIE XYZ color space, representing the visual brightness and chromaticity properties of the color. n , Y n , Z n Corresponding to the normalization factors of X, Y, and Z, the general values are 95.047, 100, and 108.883, representing the X, Y, and Z values of the D65 standard light source;
[0098] Then, convert the XYZ color space to Lab color space, the expression is:
[0099] L * =116*f(Y / Y n )-16;
[0100] a * =500*(f(X / X n )-f(Y / Y n ));
[0101] b * =200*(f(Y / Y n )-f(Z / Z n ));
[0102] Among them, L * is the brightness component, ranging from 0 to 100, where 0 represents pure black and 100 represents reference white. * is the green-red axis component, positive values tend to be green, negative values tend to be red, indicating the green-red difference of the color, b * It is the yellow-blue axis component, positive values tend to be yellow, negative values tend to be blue, indicating the yellow-blue difference of the color;
[0103] Reason: The Lab color space can better maintain the consistency of color appearance under different lighting and color temperature conditions, and is suitable for low-light and warm environments;
[0104] If 50lux≤Lux≤2000lux and 4000K≤Tcolor≤7000K is a natural light, neutral tone environment, use the color model conversion method to convert the image from RGB to HSV space. The specific steps are as follows:
[0105] Get the RGB value of each pixel from the image and find the maximum value V of the brightness V in the three channels R, G, and B max and minimum value V min ;
[0106] Calculate the saturation S:
[0107] If V = 0, then S = 0, indicating black or white;
[0108] If V>0, calculate the difference diff=V max -V min ,but
[0109] Calculate the hue H:
[0110]
[0111] Reason: In HSV space, hue and saturation are less correlated with light intensity, which helps to accurately distinguish color features in natural light environments;
[0112] If Lux>2000lux or Tcolor>7000K is a strong light or cold color environment, keep the image unchanged in RGB space;
[0113] Reason: In an environment with sufficient lighting and high color temperature, RGB space, as the most commonly used color model, can accurately represent color information without the need for additional conversion.
[0114] S3. After adaptively allocating weights to the target color space, dynamic LBP feature encoding is performed and feature extraction is performed to form a feature vector.
[0115] S3.1. Adaptively weight the target color space. The specific steps are as follows:
[0116] Adjust the pixel weight according to the light intensity and calculate the light intensity adjustment coefficient. The expression is:
[0117]
[0118] Among them, α Lux (Lux) is the light intensity adjustment factor, Lux avgis the average light intensity, γ1 is a parameter that controls the steepness of the nonlinear relationship between light intensity and weight adjustment. If the value of γ1 is large, the light intensity adjustment coefficient will become steeper with small changes in light intensity. If γ1 is small, the weight change will be smoother. The value range of γ1 is usually between 0 and 10, depending on the sensitivity requirements of light changes. γ2 is a parameter that determines the deviation of light intensity from the average value, which is used to control the nonlinear response of weight adjustment when it deviates from the average light intensity. A larger γ2 means that the weight will change more significantly when the light intensity is close to the average light intensity. The value of γ2 can be a value between 1 and 5, depending on the nonlinear response requirements of light intensity changes. γ3 is a parameter that adjusts the weight growth rate in high light intensity areas. The γ3 parameter ensures that under high light intensity, the weight will not grow infinitely, but grow at a certain rate to prevent overly bright areas from having an excessive impact on feature extraction. The value range of γ3 may be between 0 and 1 to maintain a reasonable growth of weights. γ4 is a parameter that controls the polynomial growth of the high light intensity part, which is synchronized with γ3 to ensure that when the light intensity is particularly high, the weight growth conforms to the expected behavior. γ4 is between 0 and 1 to maintain the controllability of weight growth;
[0119] According to the color temperature, the color degree weight is adjusted and the color temperature adjustment coefficient is calculated. The expression is:
[0120]
[0121] Among them, β c (T c ) is the color temperature adjustment coefficient, T c is the color temperature of the current pixel, T n is a neutral color temperature, T r The color temperature range is from 2000K to 10000K, which is used to standardize the color temperature difference, making the calculation of the color temperature adjustment coefficient more universal. δ1 is the color temperature sensitivity, δ2 is the adjustment intensity coefficient, and δ3 is the control color temperature deviation coefficient;
[0122]
[0123] Where LC(i,j) is the local contrast, G(m,n) is the Gaussian kernel function, Z is the normalization constant, k is the neighborhood radius, I(i,j) is the grayscale value of each pixel, i is the row coordinate of the pixel, j is the column coordinate of the pixel, m is the offset along the row direction of the image, and n is the offset along the column direction of the image;
[0124] Taking into account the influence of light intensity and color temperature, the weight value of the pixel is calculated, and the expression is:
[0125]
[0126] Among them, W(i,j) is the final pixel weight, ρ is the parameter of the influence of local contrast on the rate of weight adjustment, and σ is the parameter that determines the attenuation speed;
[0127] Traverse each pixel in the image and generate a weight matrix with the same size as the original image by calculating the weight value of each pixel.
[0128] Perform dynamic LBP feature encoding and feature extraction to form a feature vector. The specific steps are as follows:
[0129] The image is grayed and weighted difference calculation is applied to obtain the weighted local binary pattern value, which is expressed as:
[0130]
[0131] Among them, p c is the center pixel position, LBP w (p c ) is the weighted local binary pattern value, p n is the adjacent pixel, I g (p n ) is the gray value of the adjacent pixel, I g (p c ) is the gray value of the center pixel, n p It is the index variable of the adjacent pixel currently traversed;
[0132] After applying weighted difference calculation to all pixels to obtain weighted local binary pattern values, the frequencies of the weighted LBP codes obtained are statistically analyzed to form a weighted LBP histogram and obtain a feature vector.
[0133] S4. Simultaneously start all cameras to collect image data, perform geometric transformation on each channel of image data and integrate depth information to build a three-dimensional space model.
[0134] S4.1. Start all cameras to collect image data at the same time and perform geometric transformation on each channel of image data. The specific operation steps are as follows:
[0135] All cameras synchronously collect image data and then perform image stitching and calibration;
[0136] Apply the ORB algorithm to the stitched and calibrated image data of each camera to extract the key points of the image;
[0137] Calculate feature description and perform feature matching using the nearest neighbor algorithm;
[0138] The matching point set obtained by feature matching uses the basic matrix calculation method to calculate the relative position between the two cameras;
[0139] Through the direct linear transformation solution, the perspective transformation matrix is calculated to form the geometric alignment between images.
[0140] S4.1.1. The specific parameter settings of the ORB algorithm for key point extraction include the FAST threshold that determines the sensitivity of the FAST algorithm to detect corner points, the number of pyramid layers for using the image pyramid to detect multi-scale features, the number of feature points to be retained in each image pyramid layer, the scale step that controls the scale change between adjacent layers in the image pyramid, the BRIEF descriptor length that determines the length of the descriptor, the number of sampling point pairs that determines the size of the local area of the image used to calculate the BRIEF descriptor, and the rotation invariance of the direction of the feature point when set to true.
[0141] S4.2. Integrate the depth information of the image after geometric transformation and construct a three-dimensional space model. The specific steps are as follows:
[0142] For the geometrically aligned images, a block matching algorithm is used to calculate the disparity map, and the disparity map is converted into a depth map;
[0143] Traverse each pixel of the depth map, and calculate the coordinates of each pixel in three-dimensional space for the depth value, image coordinates and camera parameters of each pixel;
[0144] Add the calculated coordinates of each pixel to the point cloud data and save the color information;
[0145] The Marching Cubes algorithm is adopted, and the point cloud data is smoothed with a filter and converted into a triangular mesh after being simplified by uniform sampling. The mapping algorithm is used to extract the corresponding color information from the two-dimensional image coordinates of each point in the point cloud to construct a three-dimensional space model.
[0146] S5. The LBP features extracted from each perspective are fused, and the fused feature vectors are used for target recognition and matching using a three-dimensional space model to output the final detection result.
[0147] S5.1. For each image from each viewing angle, apply the LBP feature extraction algorithm, calculate the LBP code and convert it into a histogram feature;
[0148] Based on the parameters after geometric transformation, the feature vector of each view is converted from its own image coordinate system to a unified three-dimensional space coordinate system to form feature alignment;
[0149] A deep weighted fusion method is used to fuse the LBP features of each perspective to form a fused feature vector;
[0150] Create a feature database, apply the KD tree search algorithm to perform nearest neighbor search on each feature vector obtained from multi-view fusion in the feature database, and obtain preliminary matching objects;
[0151] For the preliminary matching results, the ICP algorithm is applied to iteratively perform the closest point matching to obtain accurate pose estimation;
[0152] Analyze the depth value of each matching point to identify and eliminate unreasonable matches caused by occlusion;
[0153] Apply deep learning models to classify fused features and further refine the recognition results;
[0154] The output of the deep learning model and the results of the traditional matching algorithm are combined to output the final detection result through a fusion strategy.
[0155] This embodiment also provides a computer device, which is suitable for the case of an artificial intelligence visual detection method based on local binary patterns, including: a memory and a processor; the memory is used to store computer executable instructions, and the processor is used to execute computer executable instructions to implement the artificial intelligence visual detection method based on local binary patterns proposed in the above embodiment.
[0156] The computer device may be a terminal, and the computer device includes a processor, a memory, a communication interface, a display screen and an input device connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device may be a touch layer covering the display screen, or a key, trackball or touchpad provided on the housing of the computer device, or an external keyboard, touchpad or mouse, etc.
[0157] This embodiment also provides a storage medium on which a computer program is stored. When the program is executed by a processor, the artificial intelligence visual detection method based on local binary patterns proposed in the above embodiment is implemented; the storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (Static Random Access Memory, referred to as SRAM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, referred to as EEPROM), erasable programmable read-only memory (Erasable Programmable Read Only Memory, referred to as EPROM), programmable read-only memory (Programmable Red-Only Memory, referred to as PROM), read-only memory (Read-Only Memory, referred to as ROM), magnetic storage, flash memory, disk or optical disk.
[0158] In summary, the present invention deploys a spectral sensor array to capture light intensity and color temperature in a timely manner, removes instantaneous strong light interference and performs temperature compensation processing, thereby improving the visual detection system from false detection or missed detection caused by sudden changes in light or temperature fluctuations, and realizes automatic spatial selection logic based on current lighting conditions and converts it to the target color space, thereby enhancing color distinction and effective use of information, improving the accuracy and efficiency of target recognition, and performing adaptive weight allocation on the target color space to dynamically adjust pixel weights, thereby enhancing the detection system's stereo recognition capability and ability to handle obstructions.
[0159] Example 2
[0160] Referring to Table 1, which is the second embodiment of the present invention, in order to further verify the advancement of the present invention, experimental simulation data of an artificial intelligence visual detection method based on local binary patterns are provided.
[0161] For scenes with changing indoor lighting conditions, rooms with different time periods and lighting settings were selected as test environments to verify the effectiveness of the proposed lighting condition assessment and color space conversion method. Light intensity data (lux) and color temperature data (K) were collected from morning to night every day for a week (a total of 168 hours). The data collection interval was once every 5 minutes, and a high-quality spectral sensor array was used to ensure the accuracy and continuity of the data, as shown in the following table:
[0162] Table 1 Record table of artificial intelligence visual inspection methods
[0163]
[0164]
[0165] In the above data, we first performed an outlier detection and found no light intensity values that exceeded the normal range, so all the original light intensity values were the processed light intensity. Next, we calculated the light intensity after compensation. Since the temperature had little effect on the light intensity in this experiment, the values before and after compensation did not change much. Subsequently, based on the compensated light intensity and color temperature, we classified the environment and calculated the comprehensive evaluation index I at each time point. light .
[0166] At 12:00, the environment is bright and cold, I light The value is 0.87, indicating that the lighting conditions are ideal for high-precision visual inspection without the need for color space conversion. In contrast, at 18:30 and 22:00, the environment is dim and warm, and I light The values are 0.20 and 0.15 respectively, indicating poor lighting conditions. At this time, our method automatically chooses to convert the RGB space to the Lab space to maintain the consistency of color appearance and improve the recognition accuracy in low-light environments. For other time points, such as 08:00 and 01:00, the environment is natural light and neutral tones, and I light The values are 0.42 and 0.35, respectively, which are moderate lighting conditions. In these cases, we convert the RGB space to the HSV space to take full advantage of the space's ability to distinguish color features under natural light.
[0167] The lighting condition assessment system of the present invention can dynamically adapt to different lighting and color temperature conditions, effectively guide the selection of color space, and thus achieve the best visual detection performance in various lighting environments. This reflects the significant advantages in adaptability and environmental adaptability compared to the existing technology, especially when dealing with low light and extreme lighting conditions, through intelligent color conversion strategies, improving recognition accuracy and system stability.
[0168] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.
Claims
1. An artificial intelligence visual inspection method based on local binary patterns, characterized in that: include, Deploy a spectral sensor array to regularly capture light intensity and color temperature, remove instantaneous strong light interference and perform temperature compensation on the light intensity to determine the current lighting conditions; Based on the current lighting conditions, realize the automatic space selection logic and convert to the target color space; After adaptive weight allocation of the target color space, dynamic LBP feature encoding is performed and feature extraction is performed to form a feature vector; At the same time, all cameras are started to collect image data, geometric transformation is performed on each channel of image data, and depth information is integrated to build a three-dimensional space model; The LBP features extracted from each perspective are fused, and the fused feature vectors are used for target recognition and matching using a three-dimensional space model to output the final detection results. The automatic space selection logic is implemented based on the current lighting conditions to convert to the target color space. The specific steps are as follows: When the environment is dim and warm, the RGB color space is converted to the XYZ space through the conversion formula, and then the XYZ space is converted to the Lab space; When the environment is natural light and neutral tone, the conversion from RGB space to HSV space is performed by calculating the corresponding HSV value of each pixel's RGB value; When the environment is bright and cold, the image is kept in RGB space without conversion; Perform adaptive weight allocation on the target color space. The specific steps are as follows: Adjust the pixel weight according to the light intensity and calculate the light intensity adjustment coefficient. The expression is: Among them, α Lux (Lux) is the light intensity adjustment coefficient. Lux is the light intensity of the current pixel. avg is the average light intensity, γ1 is a parameter that controls the steepness of the nonlinear relationship between light intensity and weight adjustment, γ2 is a parameter that determines the deviation of light intensity from the average value, γ3 is a parameter that adjusts the weight growth rate in high light intensity areas, and γ4 is a parameter that controls the polynomial growth of the high light intensity part; According to the color temperature, the color degree weight is adjusted and the color temperature adjustment coefficient is calculated. The expression is: Among them, β c (T c ) is the color temperature adjustment coefficient, T c is the color temperature of the current pixel, T n is a neutral color temperature, T r is the range of color temperature, δ1 is the color temperature sensitivity, δ2 is the adjustment intensity coefficient, and δ3 is the control color temperature deviation coefficient; Where LC(i,j) is the local contrast, G(m,n) is the Gaussian kernel function, Z is the normalization constant, k is the neighborhood radius, I(i,j) is the grayscale value of each pixel, i is the row coordinate of the pixel, j is the column coordinate of the pixel, m is the offset along the row direction of the image, and n is the offset along the column direction of the image; Taking into account the influence of light intensity and color temperature, the weight value of the pixel is calculated, and the expression is: Among them, W(i,j) is the final pixel weight, ρ is the parameter of the influence of local contrast on the rate of weight adjustment, and σ is the parameter that determines the attenuation speed; Traverse each pixel in the image and generate a weight matrix with the same size as the original image by calculating the weight value of each pixel; Perform dynamic LBP feature encoding and feature extraction to form a feature vector. The specific steps are as follows: The image is grayed and weighted difference calculation is applied to obtain the weighted local binary pattern value, which is expressed as: Among them, p c is the center pixel position, LBP w (p c ) is the weighted local binary pattern value, p n is the adjacent pixel, I g (p n ) is the gray value of the adjacent pixel, I g (p c ) is the gray value of the center pixel, n p It is the index variable of the adjacent pixel currently traversed; After applying weighted difference calculation to all pixels to obtain weighted local binary pattern values, the frequencies of the weighted LBP codes obtained are counted to form a weighted LBP histogram and obtain a feature vector; The LBP features extracted from each perspective are fused, and the fused feature vectors are used for target recognition and matching using a three-dimensional space model to output the final detection results. The specific steps are as follows: For each image from each perspective, the LBP feature extraction algorithm is applied to calculate the LBP code and convert it into a histogram feature; Based on the parameters after geometric transformation, the feature vector of each view is converted from its own image coordinate system to a unified three-dimensional space coordinate system to form feature alignment; A deep weighted fusion method is used to fuse the LBP features of each perspective to form a fused feature vector; Create a feature database, apply the KD tree search algorithm to perform nearest neighbor search on each feature vector obtained from multi-view fusion in the feature database, and obtain preliminary matching objects; For the preliminary matching results, the ICP algorithm is applied to iteratively perform the closest point matching to obtain accurate pose estimation; Analyze the depth value of each matching point to identify and eliminate unreasonable matches caused by occlusion; Apply deep learning models to classify fused features and further refine the recognition results; The output of the deep learning model and the results of the traditional matching algorithm are combined to output the final detection result through a fusion strategy.
2. The artificial intelligence visual inspection method based on local binary patterns as claimed in claim 1, characterized in that: The spectral sensor array is deployed to capture the light intensity and color temperature at regular intervals, remove the instantaneous strong light interference and perform temperature compensation on the light intensity, and determine the current light conditions. The specific operation steps are as follows: Collect historical light intensity data over a period of time, analyze the historical light intensity, and set upper and lower thresholds for light intensity; Perform outlier detection on each newly collected light intensity value to remove instantaneous strong light interference; Use the current ambient temperature and the original light intensity measurement value without the interference of instantaneous strong light to calculate the compensated light intensity and eliminate the influence of temperature change on the measurement result; According to the compensated light intensity, the environment is divided into dark light environment, natural light environment and strong light environment; The environment is divided into warm, neutral and cool colors according to color temperature; Combined with the classification, the lighting conditions are comprehensively evaluated to determine the current lighting conditions.
3. The artificial intelligence visual inspection method based on local binary patterns as claimed in claim 2, characterized in that: At the same time, all cameras are started to collect image data, and geometric transformation is performed on each channel of image data. The specific operation steps are as follows: All cameras synchronously collect image data and then perform image stitching and calibration; Apply the ORB algorithm to the stitched and calibrated image data of each camera to extract the key points of the image; Calculate feature description and perform feature matching using the nearest neighbor algorithm; The matching point set obtained by feature matching uses the basic matrix calculation method to calculate the relative position between the two cameras; Through the direct linear transformation solution, the perspective transformation matrix is calculated to form the geometric alignment between images.
4. The artificial intelligence visual inspection method based on local binary patterns as claimed in claim 3, characterized in that: After performing geometric transformation, the image integrates depth information and constructs a three-dimensional space model. The specific steps are as follows: For the geometrically aligned images, a block matching algorithm is used to calculate the disparity map, and the disparity map is converted into a depth map; Traverse each pixel of the depth map, and calculate the coordinates of each pixel in three-dimensional space for the depth value, image coordinates and camera parameters of each pixel; Add the calculated coordinates of each pixel to the point cloud data and save the color information; The Marching Cubes algorithm is used to convert the point cloud data into a triangular mesh, and the mapping algorithm is used to extract the corresponding color information from the two-dimensional image coordinates of each point in the point cloud to construct a three-dimensional space model.
5. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the artificial intelligence visual detection method based on local binary patterns described in any one of claims 1 to 4 are implemented.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the artificial intelligence visual detection method based on local binary patterns described in any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Face recognition method based on adaptive weighting and local characteristic fusion
CN106599870A
Face recognition algorithm and face recognition device adaptive to illumination interference environment
CN112818938A