A powder coating machine vision recognition method based on near-infrared hyperspectrum

CN122821167APending Publication Date: 2026-09-25SHANDONG XINGUANGYUE NEW MATERIALS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611082327.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-21
Publication Date
2026-09-25

AI Technical Summary

Technical Problem

[0004]为了实现上述目的,本发明提供如下技术方案:本发明提供一种基于近红外高光谱的粉末涂料机器视觉识别方法,利用近红外高光谱相机扫描粉末涂料样本获得原始高光谱图像数据,针对每个像素点的光谱反射率曲线提取特征吸收峰位置和特征吸收峰深度,以克服传统视觉方法对粉末涂料不同组分分布区分能力不足的缺陷

Benefits of technology

[0009]针对每个像素点,从包络线去除后的归一化光谱曲线中提取特征吸收峰位置及其深度,并以吸收峰位置波长值为行索引、以深度值为矩阵元素值,构造吸收峰二维分布矩阵。该矩阵将原始高光谱数据中与组分化学键振动直接相关的局部吸收信息进行抽取和重组,摒弃了非吸收波段内大量对组分区分贡献微弱的光谱强度值,使每个像素点的光谱特征被压缩为有序的峰深度序列。此种结构化表达不仅降低了数据维度,更使得不同组分在特定吸收峰深度上的细微差异直接映射为矩阵元素值的差异,为后续梯度分析提供了针对性更强的特征输入。在获得每个像素点的吸收峰二维分布矩阵后,沿矩阵行方向执行一阶差分运算,捕捉同一像素点不同特征吸收峰深度之间的变化模式;同时沿矩阵列方向执行一阶差分运算,获取相邻像素点在同一吸收峰位置处深度的空间变化。将两种差分序列变换至同一维度空间后逐元素叠加,生成梯度差异图谱。行差分可反映不同化学组分在多个特征吸收带深度上的相对构成差异,列差分则突出吸收峰深度随空间位置移动产生的跳变,二者叠加使得组分交界处的信号响应被双维增强,与仅使用单一方向梯度或直接对原始高光谱图像求取空间梯度相比,组分区域的边界轮廓更加完整且连续,细小非主组分区域的分离度得到提升,便于后续连通域标记和区域分析,从而有效区分粉末涂料中不同组分的空间分布。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122821167A_ABST
    Figure CN122821167A_ABST
Patent Text Reader

Abstract

The application discloses a powder coating machine vision identification method based on near-infrared hyperspectrum, and relates to the technical field of powder coating detection and machine vision. The method comprises the following steps: acquiring original hyperspectrum image data generated by scanning a powder coating sample by using a near-infrared hyperspectrum camera; extracting a feature absorption peak position and a feature absorption peak depth corresponding to each pixel point according to a spectral reflectivity curve of each pixel point in the original hyperspectrum image data; taking the feature absorption peak position as a horizontal coordinate index and taking the feature absorption peak depth as a vertical coordinate value to construct an absorption peak two-dimensional distribution matrix of each pixel point; performing a first-order difference operation on the absorption peak two-dimensional distribution matrix in a row direction to obtain a row difference sequence and performing a first-order difference operation in a column direction to obtain a column difference sequence; and superimposing the row difference sequence and the column difference sequence element by element to generate a gradient difference spectrum used for distinguishing different component distributions of the powder coating. The method can effectively highlight the spatial distribution difference of different components of the powder coating.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of powder coating inspection and machine vision technology, specifically to a machine vision recognition method for powder coatings based on near-infrared hyperspectral imaging. Background Technology

[0002] Powder coatings are widely used in industrial production, and the uniformity of their component distribution and the consistency of their formulation directly affect the coating performance. Existing methods for identifying powder coating components largely rely on manual visual inspection or machine vision solutions based on RGB color cameras. These technologies distinguish components by capturing differences in color and texture on the powder surface, but they are difficult to effectively differentiate when different components have similar colors or are metameristic under visible light. Near-infrared hyperspectral imaging technology can simultaneously acquire two-dimensional spatial information of the sample and spectral reflectance data for hundreds of consecutive bands, providing a possibility for identification based on differences in chemical composition. Existing near-infrared hyperspectral powder coating identification methods typically follow the traditional chemometric analysis path, i.e., performing principal component analysis, partial least squares discrimination, or spectral angle mapping on the full-band spectrum of each pixel in the hyperspectral image to generate a classification result map. These methods rely on global spectral features; when the overall spectrum is similar and only specific absorption bands have slight shifts or depth changes, gradient changes at component boundaries are easily smoothed, leading to blurred or discontinuous boundaries between different component regions. Furthermore, directly calculating the spatial gradient from the raw hyperspectral data is significantly affected by noise and redundant bands, making it difficult to accurately delineate the component distribution contours using local details of absorption peak depth changes with spatial location. Therefore, it is necessary to solve how to transform pixel-level absorption peak features in near-infrared hyperspectral images into a spectral representation that can significantly enhance the spatial distribution differences between components, making the boundaries and internal textures of different powder coating components clearly distinguishable. Summary of the Invention

[0003] The purpose of this invention is to provide a machine vision recognition method for powder coatings based on near-infrared hyperspectral imaging. This method utilizes the depth of characteristic absorption peaks to construct a structured two-dimensional matrix and generates a difference enhancement spectrum through bidirectional differential superposition operations, thereby achieving fine differentiation of different components in powder coatings.

[0004] To achieve the above objectives, this invention provides the following technical solution: This invention provides a machine vision recognition method for powder coatings based on near-infrared hyperspectral imaging. It utilizes a near-infrared hyperspectral camera to scan powder coating samples to obtain raw hyperspectral image data. For each pixel, the position and depth of characteristic absorption peaks are extracted from the spectral reflectance curve, overcoming the shortcomings of traditional visual methods in distinguishing the distribution of different components in powder coatings. This invention constructs a two-dimensional distribution matrix of absorption peaks for each pixel, using the wavelength corresponding to the characteristic absorption peak position as the row index and the characteristic absorption peak depth as the matrix element value. When the number of characteristic absorption peaks at any pixel differs from the preset standard number of peaks, zero values ​​are filled in as placeholders for missing peaks, forming a uniform matrix representation. This eliminates the influence of differences in the number of absorption peaks between different pixels on subsequent analysis. The two-dimensional distribution matrix of the absorption peak is subjected to first-order difference operations along the row direction to obtain a row difference sequence, and simultaneously, first-order difference operations are performed along the column direction to obtain a column difference sequence. These row and column difference sequences are then transformed into intermediate matrices with the same number of rows and columns, and then superimposed element-wise. The value of each superimposed element is used as the grayscale value of the corresponding pixel in the gradient difference map, generating a gradient difference map that intuitively reflects the spatial distribution differences of different components in the powder coating. This method extracts the absorption peak variation gradient simultaneously in both the spectral and spatial dimensions, effectively enhancing the boundary contrast between different components, resulting in clearer and more accurate component distribution identification.

[0005] As a technical solution of the present invention, the process of extracting the feature absorption peak position and feature absorption peak depth of each pixel preferably includes: performing envelope removal processing on the spectral reflectance curve of each pixel to obtain a normalized spectral curve; on the normalized spectral curve, taking a predetermined number of wavelength points forward and backward respectively with each wavelength point as the center to form a forward window and a backward window; when the reflectance value of the center wavelength point is simultaneously less than the reflectance values ​​of all wavelength points in the forward window and all wavelength points in the backward window, the center wavelength point is marked as a local minimum reflectance point, its wavelength position and reflectance value are recorded, and the wavelength value corresponding to the local minimum point is used as a candidate absorbance point. Peak position: For each candidate absorption peak position, a local maximum of reflectance is found in the adjacent wavelength range to its left as the left reference maximum, and a local maximum of reflectance is found in the adjacent wavelength range to its right as the right reference maximum. The differences between the left and right reference maximums and the reflectance value at the candidate absorption peak position are calculated to obtain the left and right decrease amplitudes. The smaller value is taken as the reflectance decrease amplitude. The candidate absorption peak position with a reflectance decrease amplitude greater than a preset decrease threshold is taken as the characteristic absorption peak position. The difference between the normalized spectral reflectance value at the characteristic absorption peak position and the normalized spectral reflectance value of the adjacent local maximum point is taken as the characteristic absorption peak depth. By removing the envelope and filtering based on the decrease amplitude of the two-sided maximums, small fluctuations and irrelevant absorption features caused by noise can be automatically removed, making the extracted absorption peak position and depth more accurately represent the characteristic spectral response differences of each component in the powder coating.

[0006] In the above scheme, the preferred method is to calculate the difference between the current element value and the previous element value in each row of the row difference sequence, starting from the second element, to form the row difference vector for that row. Then, all row difference vectors are stacked in the original row order to obtain the row difference sequence. Similarly, the column difference sequence is obtained by calculating the difference between the current element value and the previous element value in each column of the two-dimensional distribution matrix of the absorption peak, starting from the second element, to form the column difference vector for that column. All column difference vectors are then stacked in the original column order to obtain the column difference sequence. Row-direction difference operations reflect the depth variation trend of the same absorption peak across different pixels, while column-direction difference operations reflect the depth variation trend of the same pixel across different absorption peak positions. Both describe the spatial and spectral gradient variations of the absorption peak characteristics from different dimensions.

[0007] As a further improvement to the present invention, after generating the gradient difference map, a connected component labeling operation is performed on the map. Specifically, this includes: comparing the grayscale value of each pixel with a preset connectivity threshold, and marking pixels with grayscale values ​​greater than the threshold as foreground points; scanning all foreground points using an eight-neighbor connectivity rule, and grouping interconnected foreground points into the same connected component; tracking the coordinates of the outermost pixels in each connected component, and connecting them sequentially to form a closed polyline as the boundary contour of the connected region. Then, the sum of grayscale values ​​of all pixels within each connected region is calculated, and the connected region with the largest sum of grayscale values ​​is marked as the principal component region, while the remaining connected regions are marked as secondary component regions. The spatial offset of each secondary component region relative to the principal component region is recorded. Using the connected component analysis of the gradient difference map, not only can the dominant principal component region in powder coatings be automatically identified, but the positional relationship of trace secondary components relative to the principal component can also be accurately located, providing a quantitative spatial distribution reference for powder coating formulation uniformity detection and foreign matter identification.

[0008] The technical effects and advantages provided by the present invention in the above technical solution are as follows:

[0009] For each pixel, the position and depth of the characteristic absorption peak are extracted from the normalized spectral curve after removing the envelope. A two-dimensional distribution matrix of absorption peaks is constructed using the wavelength of the absorption peak position as the row index and the depth as the matrix element value. This matrix extracts and reorganizes the local absorption information directly related to the chemical bond vibrations of the components in the original hyperspectral data, discarding a large number of spectral intensity values ​​in non-absorption bands that contribute little to component differentiation. This compresses the spectral features of each pixel into an ordered sequence of peak depths. This structured representation not only reduces the data dimensionality but also allows subtle differences in the depth of specific absorption peaks among different components to be directly mapped to differences in matrix element values, providing more targeted feature inputs for subsequent gradient analysis. After obtaining the two-dimensional distribution matrix of absorption peaks for each pixel, a first-order difference operation is performed along the row direction of the matrix to capture the variation pattern between the depths of different characteristic absorption peaks of the same pixel; simultaneously, a first-order difference operation is performed along the column direction of the matrix to obtain the spatial variation of the depth of adjacent pixels at the same absorption peak position. The two difference sequences are transformed to the same dimensional space and then superimposed element-wise to generate a gradient difference map. Row difference can reflect the relative compositional differences of different chemical components at the depths of multiple characteristic absorption bands, while column difference highlights the jumps in absorption peak depth caused by spatial position movement. The superposition of the two enhances the signal response at the component boundary in two dimensions. Compared with using only a single-direction gradient or directly obtaining the spatial gradient from the original hyperspectral image, the boundary contours of the component regions are more complete and continuous, and the separation of small non-principal component regions is improved, which facilitates subsequent connected domain labeling and region analysis, thereby effectively distinguishing the spatial distribution of different components in powder coatings. Attached Figure Description

[0010] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.

[0011] Figure 1 This is a flowchart of a machine vision recognition method for powder coatings based on near-infrared hyperspectral imaging.

[0012] Figure 2 This is a schematic diagram illustrating the generation of row and column difference sequences of the two-dimensional distribution matrix of absorption peaks;

[0013] Figure 3 This is a flowchart of the gradient difference map generation process;

[0014] Figure 4 This is a schematic diagram of the two-dimensional distribution matrix of the absorption peaks of the pixels. Detailed Implementation

[0015] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0016] See Figure 1 This invention provides a machine vision recognition method for powder coatings based on near-infrared hyperspectral imaging, comprising: acquiring raw hyperspectral image data generated by scanning a powder coating sample with a near-infrared hyperspectral camera; extracting the position and depth of the characteristic absorption peak corresponding to each pixel based on the spectral reflectance curve of each pixel in the raw hyperspectral image data; constructing a two-dimensional distribution matrix of absorption peaks for each pixel using the position of the characteristic absorption peak as the horizontal axis index and the depth of the characteristic absorption peak as the vertical axis value; performing a first-order difference operation on the two-dimensional distribution matrix of absorption peaks in the row direction to obtain a row difference sequence, and then performing a first-order difference operation in the column direction to obtain a column difference sequence; and superimposing the row difference sequence and the column difference sequence element by element to generate a gradient difference map for distinguishing the distribution of different components in the powder coating.

[0017] Example 1:

[0018] In practice, the spectral reflectance curve of each pixel undergoes envelope removal processing to obtain a normalized spectral curve after envelope removal. The envelope removal process employs a continuum removal method, forming an envelope by connecting local maxima on the spectral reflectance curve. Then, the reflectance value at each wavelength point on the spectral reflectance curve is divided by the reflectance value at the corresponding wavelength point on the envelope to obtain the normalized spectral reflectance value. The normalized spectral reflectance values ​​at all wavelength points constitute the normalized spectral curve.

[0019] The search for local minima of reflectance is performed on the normalized spectral curve. The method for searching local minima is as follows: on the normalized spectral curve, taking a predetermined number of wavelengths forward from each wavelength point to form a forward window, and a predetermined number of wavelengths backward to form a backward window, both the first and second predetermined numbers are preset positive integers, and they may or may not be equal. When the normalized spectral reflectance value of the center wavelength point is simultaneously less than the normalized spectral reflectance values ​​of all wavelengths in the forward window and less than the normalized spectral reflectance values ​​of all wavelengths in the backward window, the center wavelength point is marked as a local minimum of reflectance. This comparison operation is performed on each wavelength point on the normalized spectral curve to obtain all local minimums of reflectance. The wavelength position and normalized spectral reflectance value of each local minimum of reflectance are recorded. The wavelength values ​​corresponding to all local minimums of reflectance are used as candidate absorption peak positions.

[0020] The candidate absorption peak positions are selected from those whose reflectance decreases by more than a preset threshold as characteristic absorption peak positions. During the selection process, for each candidate absorption peak position, a local maximum of the normalized spectral reflectance value is found in the adjacent wavelength range to the left of the candidate absorption peak position. The point corresponding to the found local maximum is designated as the left reference maximum point, and the corresponding normalized spectral reflectance value is recorded as the left reference maximum. Similarly, a local maximum of the normalized spectral reflectance value is found in the adjacent wavelength range to the right of the candidate absorption peak position. The point corresponding to the found local maximum is designated as the right reference maximum point, and the corresponding normalized spectral reflectance value is recorded as the right reference maximum. The difference between the left reference maximum and the normalized spectral reflectance value at the candidate absorption peak position is calculated to obtain the left decrease amplitude. The difference between the right reference maximum and the normalized spectral reflectance value at the candidate absorption peak position is calculated to obtain the right decrease amplitude. The smaller of the left and right decrease amplitudes is taken as the reflectance decrease amplitude of the candidate absorption peak position. The reflectance decrease amplitude is then compared with the preset threshold. The preset drop threshold is a value pre-set based on the absorption characteristics of the powder coating components in the near-infrared band. Candidate absorption peaks whose reflectance decreases more than the preset drop threshold are marked as characteristic absorption peak positions.

[0021] For each characteristic absorption peak location, calculate the difference between the normalized spectral reflectance value at the characteristic absorption peak location and the normalized spectral reflectance value at the adjacent local maxima. Use this difference as the characteristic absorption peak depth. The adjacent local maxima is taken as the left reference maxima corresponding to the characteristic absorption peak location. The formula for calculating the characteristic absorption peak depth is expressed as:

[0022]

[0023] in, Indicates the depth of the characteristic absorption peak. This represents the left reference maximum corresponding to the location of the characteristic absorption peak. This represents the normalized spectral reflectance value at the location of the characteristic absorption peak. Using the above method, a characteristic absorption peak depth is obtained for each characteristic absorption peak location.

[0024] Example 2:

[0025] In practical implementation, the process of constructing a two-dimensional distribution matrix of absorption peaks for each pixel involves using the wavelength value corresponding to the feature absorption peak position as the row index and the feature absorption peak depth value as the matrix element value. For a single pixel, all feature absorption peak positions extracted from that pixel constitute a set of feature absorption peak positions, and the feature absorption peak depth corresponding to each feature absorption peak position in the set of feature absorption peak positions constitutes a set of feature absorption peak depths. The wavelength value corresponding to each feature absorption peak position in the set of feature absorption peak positions is mapped to a row index in the two-dimensional distribution matrix of absorption peaks, and the row index is denoted as... The characteristic absorption peak depth value corresponding to the position of the characteristic absorption peak in the characteristic absorption peak depth set is taken as the nth value in the matrix. The element values ​​of each row are used to construct the initial two-dimensional matrix.

[0026] The preset number of standard peaks is an integer value determined in advance based on the theoretical number of characteristic absorption peaks of known components in the near-infrared band of the powder coating. For any pixel, the total number of characteristic absorption peak positions in the set of characteristic absorption peak positions for that pixel is counted. When the total number of characteristic absorption peak positions is not equal to the preset number of standard peaks, it indicates that there are row positions in the initial two-dimensional matrix that are not occupied by the wavelength value index corresponding to the characteristic absorption peak position. In the initial two-dimensional matrix, zero values ​​are filled into the row positions corresponding to the unoccupied row indices as placeholder elements for missing peaks. Zero values ​​indicate that there is no valid characteristic absorption peak at the corresponding wavelength position. When the total number of characteristic absorption peak positions is equal to the preset number of standard peaks, all row positions in the initial two-dimensional matrix are occupied by the wavelength value index corresponding to the characteristic absorption peak positions, and no placeholder filling operation is performed.

[0027] Through placeholder padding, the matrix corresponding to all pixels has a consistent number of rows, equal to the preset number of standard peaks. The initial two-dimensional matrix after placeholder padding is used as the two-dimensional absorption peak distribution matrix. The number of rows in the absorption peak distribution matrix is ​​equal to the preset number of standard peaks. Each row corresponds to a fixed wavelength index position, and the element value of each row represents the characteristic absorption peak depth of that pixel at that wavelength index position. The element value corresponding to the wavelength index position of a missing peak is zero.

[0028] In some embodiments, the process of constructing the two-dimensional distribution matrix of absorption peaks can be described formally. A preset number of standard peaks is set. The range of row indices obtained by mapping the wavelength values ​​corresponding to the characteristic absorption peak positions is: arrive An integer. For a pixel. Define the two-dimensional distribution matrix of the absorption peak as follows: The matrix has 10 rows. The number of columns is .matrix The Middle The elements of a row are represented as When wavelength index Corresponding to pixel When a characteristic absorption peak position is reached. The value is taken as the characteristic absorption peak depth value; when the wavelength index Not corresponding to a pixel When any characteristic absorption peak position is reached. The value is zero. This construction method can be represented as:

[0029]

[0030] in, Represents the two-dimensional distribution matrix of absorption peaks The Middle The element value of the row; Represents pixels In wavelength index The depth value of the characteristic absorption peak calculated at the corresponding characteristic absorption peak position; The ordinal number of the wavelength index. The range of values ​​is arrive All integers, The preset number of standard peaks; This indicates the spatial coordinates of a pixel in a hyperspectral image.

[0031] See Figure 4The figure shows the two-dimensional distribution matrix curves of the characteristic absorption peak depth versus wavelength for multiple pixels. The horizontal axis represents the wavelength range in nanometers (nm), covering approximately 900nm to 1700nm, while the vertical axis represents the characteristic absorption peak depth, ranging from 0 to 0.1. The different colored curves in the legend correspond to the two-dimensional distribution matrix data of the absorption peaks for pixels (1,1), (1,2), (2,1), (2,2), and (3,3), respectively, demonstrating the distribution of the characteristic absorption peak depth at different wavelength positions for each pixel.

[0032] The curves show that each pixel exhibits distinct characteristic absorption peaks at multiple wavelengths, represented by vertical segments. Differences in peak depth reflect variations in absorption intensity at these wavelengths. Specifically, characteristic absorption peaks appear at wavelengths of approximately 1050nm, 1100nm, 1150nm, 1400nm, 1540nm, and 1650nm, with some peak depths reaching approximately 0.1, indicating significant absorption. The peak depths at the same wavelength vary among different pixels. For example, at 1100nm, the peak depth of pixel (3,3) is slightly higher than other pixels; at 1540nm, the peak depth of pixel (1,2) is significantly higher than other pixels, indicating spatial differences in the component absorption characteristics reflected by different pixels at these wavelengths.

[0033] The characteristic absorption peak positions of each pixel in the figure basically cover the preset standard peak number range, but the peak depth distribution of each pixel shows individual differences, and there are zero or extremely low values ​​near some wavelengths, which is consistent with the description of filling missing peaks with zero values ​​in the matrix construction in Example 2, ensuring that the number of rows of each matrix is ​​consistent.

[0034] Example 3:

[0035] In specific implementation, please refer to Figure 2 The row difference sequence is obtained by performing a first-order difference operation on the two-dimensional distribution matrix of absorption peaks along the row direction. The number of rows in the two-dimensional distribution matrix of absorption peaks is equal to the preset number of standard peaks, and the number of columns in the two-dimensional distribution matrix of absorption peaks is also equal to the preset number of standard peaks. The preset number of standard peaks is denoted as […]. For spatial coordinates The pixel's absorption peak two-dimensional distribution matrix is ​​denoted as Two-dimensional distribution matrix of absorption peaks The Middle Line 1 The element values ​​of a column are denoted as , The range of values ​​is from arrive All integers, The range of values ​​is from arrive All integers.

[0036] For the two-dimensional distribution matrix of absorption peaks The Line, from the first The first line Starting with the first column element, calculate the difference between the current column element value and the previous column element value, and use the calculated difference as the first column element value. The row difference element. The row difference element is calculated as follows:

[0037]

[0038] in, Represents pixels The corresponding row difference sequence of the first Line 1 The row difference element value at the column position; Represents the two-dimensional distribution matrix of absorption peaks The Middle Line 1 The element values ​​of the column; Represents the two-dimensional distribution matrix of absorption peaks The Middle Line 1 The element values ​​of the column; This is the row index, and its value range is... arrive All integers; For column indexes, when calculating row difference elements The range of values ​​is arrive All integers; This is the preset number of standard peaks.

[0039] The first All row difference elements obtained from the first row are arranged in column order to form the second row. The row difference vector, the row difference vector contains Each row difference element. For all By performing the above operations, we can obtain... There are 10 row difference vectors. Stack all the row difference vectors in the original row order of the absorption peak 2D distribution matrix to obtain a row difference sequence. The number of rows in the row difference sequence is 1. The number of columns is .

[0040] Performing a first-order difference operation along the column direction on the two-dimensional distribution matrix of absorption peaks yields a column difference sequence. For the two-dimensional distribution matrix of absorption peaks... The Column, from the first The first of the columns Starting with the nth row element, calculate the difference between the current row element value and the previous row element value, and use the calculated difference as the nth row element value. The column difference element. The first element... All column difference elements obtained from the first column are arranged in row order to form the second column. The column difference vector, the column difference vector contains Each column difference element. For all By performing the above operations, we can obtain... There are column difference vectors. Stacking the column difference vectors of all columns according to the original column order of the absorption peak two-dimensional distribution matrix yields a column difference sequence with rows. The number of columns is .

[0041] Example 4:

[0042] In specific implementation, please refer to Figure 3 The row difference sequence and column difference sequence are element-wise superimposed to generate a gradient difference map to distinguish the distribution of different components in the powder coating. The row difference sequence is derived from the first-order difference operation in the row direction of the two-dimensional distribution matrix of absorption peaks. The number of rows in the row difference sequence is the same as the preset number of standard peaks, and the number of columns is one less than the preset number of standard peaks. The preset number of standard peaks is denoted as . The number of rows in the row difference sequence is The number of columns is The column difference sequence originates from the first-order difference operation in the column direction of the two-dimensional distribution matrix of the absorption peaks. The number of rows in the column difference sequence is one less than the preset number of standard peaks, and the number of columns is the same as the preset number of standard peaks. The number of rows in the column difference sequence is... The number of columns is .

[0043] Transform the row difference sequence and column difference sequence into intermediate matrices with the same number of rows and columns. The intermediate matrix corresponding to the row difference sequence is denoted as the first intermediate matrix, and the intermediate matrix corresponding to the column difference sequence is denoted as the second intermediate matrix. The number of rows and columns of the first intermediate matrix are both set to 1. The number of rows and columns of the second intermediate matrix are also set to... For the row difference sequence of the th row... Line 1 The elements of column 1 are copied to the first intermediate matrix. Line 1 Column position, The range of values ​​is from arrive All integers, The range of values ​​is from arrive All integers. The first intermediate matrix contains the [number] integers. The column elements are filled with zero values, that is, all elements in the first intermediate matrix are filled with zero values. The value is from arrive The line, the first All elements in the column are filled with zeros. For the column difference sequence, the first... Line 1 The elements of column 1 are copied to the second intermediate matrix. Line 1 Column position, The range of values ​​is from arrive All integers, The range of values ​​is from arrive All integers. The second intermediate matrix contains the first... The row elements are filled with zero values, that is, all elements in the second intermediate matrix are filled with zero values. The value is from arrive The column, the first All elements in the row are filled with zero.

[0044] In specific implementation, the first intermediate matrix in the first intermediate matrix Line 1 The element value at the column position is denoted as The second intermediate matrix Line 1 The element value at column position is denoted as At each element position in the intermediate matrix, the corresponding element value in the first intermediate matrix is ​​added to the corresponding element value in the second intermediate matrix to obtain the superimposed element value. The formula for calculating the superimposed element value is:

[0045]

[0046] in, Indicating the gradient difference map, the first... Line 1 The summation of the element values ​​of the column pixels; Represents the first intermediate matrix. Line 1 The element value at the column position comes from the matrix elements after the row difference sequence has been sizing and filled with zeros; Indicates the second intermediate matrix. Line 1 The element value at the column position comes from the matrix element after the column difference sequence has been size-transformed and filled with zeros; For row index, The range of values ​​is from arrive All integers; For column indexes, The range of values ​​is from arrive All integers; The preset number of standard peaks. The superimposed element value calculated at each element position. The gradient difference map is a two-dimensional grayscale image formed by arranging all the superimposed element values ​​in the order of row index and column index, which is the grayscale value of the corresponding pixel in the gradient difference map.

[0047] Example 5:

[0048] In practice, after generating the gradient difference map, a connected component labeling operation is performed on the gradient difference map to extract the boundary contours of all connected regions. For each pixel in the gradient difference map, the gray value of the pixel is obtained and compared with a preset connectivity threshold. The preset connectivity threshold is a fixed value pre-set based on the gray-scale statistical characteristics of the component boundaries in the gradient difference map of the powder coating sample. When the gray value of a pixel is greater than the preset connectivity threshold, the pixel is marked as a foreground point; when the gray value of a pixel is less than or equal to the preset connectivity threshold, the pixel is marked as a background point. After marking all pixels, the eight-neighbor connectivity rule is used to scan all foreground points. The eight-neighbor connectivity rule means that for any foreground point, if there is another foreground point among its eight adjacent pixels (upper, lower, left, right, upper left, upper right, lower left, and lower right), then the two foreground points are considered to be connected. By scanning all foreground points in the gradient difference map, interconnected foreground points are grouped into several connected regions, each consisting of a set of internally interconnected foreground points. For each connected region, the coordinates of the outermost pixel are traced. This is done by starting from a boundary pixel of the connected region and traversing along the boundary in a fixed direction, recording the coordinates of each boundary pixel encountered, until the starting boundary pixel is returned, resulting in a closed sequence of boundary pixel coordinates. Connecting these boundary pixel coordinate sequences sequentially forms a closed polyline; the region enclosed by this polyline is the boundary contour of the connected region.

[0049] Calculate the sum of gray values ​​of all pixels within each connected region. The sum of gray values ​​within a connected region is the cumulative result of the gray values ​​of all pixels contained in that region. Compare the sums of gray values ​​of each connected region and determine the connected region with the largest sum. Mark the connected region with the largest sum as the principal component region. Mark all other connected regions except the principal component regions as secondary component regions.

[0050] For each subcomponent region, calculate its spatial offset relative to the principal component region. The spatial offset is calculated based on the region's centroid coordinates. The horizontal coordinate of the principal component region's centroid is defined as follows: The centroid perpendicular coordinate is . No. The horizontal coordinates of the centroids of each subcomponent region are: The centroid perpendicular coordinate is . No. The spatial offset of each subcomponent region relative to the principal component region is used The calculation formula is as follows:

[0051]

[0052] in: Indicates the first The spatial offset of each sub-component region relative to the principal component region in the horizontal direction; Indicates the first The spatial offset of each sub-component region relative to the principal component region in the vertical direction; Indicates the first The centroid horizontal coordinates of each sub-component region; Indicates the first Vertical coordinates of the centroid of each sub-component region; Indicates the horizontal coordinates of the centroid of the principal component region; This represents the vertical coordinates of the centroid of the principal component region. It also records the spatial offset of each subcomponent region.

[0053] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.

Claims

1. A machine vision recognition method for powder coatings based on near-infrared hyperspectral imaging, characterized in that, include: Acquire raw hyperspectral image data generated by scanning powder coating samples with a near-infrared hyperspectral camera; Based on the spectral reflectance curves of each pixel in the original hyperspectral image data, extract the position and depth of the characteristic absorption peak for each pixel. Using the position of the feature absorption peak as the horizontal axis index and the depth of the feature absorption peak as the vertical axis value, a two-dimensional distribution matrix of the absorption peak of each pixel is constructed. Perform a first-order difference operation on the two-dimensional distribution matrix of the absorption peaks in the row direction to obtain a row difference sequence, and then perform a first-order difference operation in the column direction to obtain a column difference sequence; The row difference sequence and the column difference sequence are superimposed element by element to generate a gradient difference map for distinguishing the distribution of different components in powder coating.

2. The machine vision recognition method for powder coatings based on near-infrared hyperspectral imaging according to claim 1, characterized in that, The process of extracting the feature absorption peak position and feature absorption peak depth corresponding to each pixel includes: The envelope of the spectral reflectance curve of each pixel is removed to obtain the normalized spectral curve after envelope removal. In the normalized spectral curve, search for local minimum points of reflectance, and use the wavelength values ​​corresponding to the local minimum points as candidate absorption peak positions. The candidate absorption peak positions whose reflectance decreases by more than a preset decrease threshold are selected from the candidate absorption peak positions and used as the feature absorption peak positions. The difference between the normalized spectral reflectance value at the location of the characteristic absorption peak and the normalized spectral reflectance value at the adjacent local maximum point is taken as the depth of the characteristic absorption peak.

3. The machine vision recognition method for powder coatings based on near-infrared hyperspectral imaging according to claim 2, characterized in that, The process of searching for the local minimum point of reflectivity includes: On the normalized spectral curve, with each wavelength point as the center, a first predetermined number of wavelength points are taken forward to form a forward window, and a second predetermined number of wavelength points are taken backward to form a backward window. When the reflectance value of the center wavelength point is less than the reflectance values ​​of all wavelength points in the forward window and all wavelength points in the backward window, the center wavelength point is marked as a local minimum reflectance point. Record the wavelength location and reflectance value of each local minimum reflectance point.

4. The machine vision recognition method for powder coatings based on near-infrared hyperspectral imaging according to claim 2, characterized in that, The process of selecting candidate absorption peak positions whose reflectance decreases by more than a preset decrease threshold as the feature absorption peak positions includes: For each candidate absorption peak position, find the local maximum of reflectance in the wavelength range to its left as the left reference maximum, and find the local maximum of reflectance in the wavelength range to its right as the right reference maximum. The difference between the left reference maximum and the reflectance value at the candidate absorption peak position is calculated to obtain the left decrease magnitude; The difference between the right reference maximum and the reflectance value at the candidate absorption peak position is calculated to obtain the right decrease magnitude; The smaller of the left and right decrease amplitudes is taken as the reflectance decrease amplitude, and the candidate absorption peak positions where the reflectance decrease amplitude is greater than a preset decrease threshold are marked as the characteristic absorption peak positions.

5. The machine vision recognition method for powder coatings based on near-infrared hyperspectral imaging according to claim 1, characterized in that, The process of constructing the two-dimensional distribution matrix of absorption peaks for each pixel includes: An initial two-dimensional matrix is ​​constructed using the wavelength value corresponding to the position of the characteristic absorption peak as the row index and the matrix element value as the depth value of the characteristic absorption peak. When the number of feature absorption peak positions of any pixel is not equal to the preset number of standard peaks, zero values ​​are filled in the corresponding row positions in the initial two-dimensional matrix as placeholder elements for missing peaks. The initial two-dimensional matrix after the placeholder filling is completed is used as the two-dimensional distribution matrix of the absorption peak.

6. The machine vision recognition method for powder coatings based on near-infrared hyperspectral imaging according to claim 1, characterized in that, The process of performing a first-order difference operation on the two-dimensional distribution matrix of the absorption peaks along the row direction to obtain the row difference sequence includes: For each row of the two-dimensional distribution matrix of the absorption peak, starting from the second element of the row, the difference between the current element value and the previous element value is calculated sequentially, and the difference is used as the row difference element of the row. Arrange all the row difference elements obtained in each row in column order to form the row difference vector of that row; Stack the row difference vectors of all rows in the row order of the original matrix to obtain the row difference sequence.

7. The machine vision recognition method for powder coatings based on near-infrared hyperspectral imaging according to claim 1, characterized in that, The process of performing a first-order difference operation on the two-dimensional distribution matrix of the absorption peaks along the column direction to obtain the column difference sequence includes: For each column of the two-dimensional distribution matrix of the absorption peak, starting from the second element of the column, the difference between the current element value and the previous element value is calculated sequentially, and the difference is used as the column difference element of the column. Arrange all the column difference elements obtained from each column in row order to form the column difference vector for that column; Stack the column difference vectors of all columns in the column order of the original matrix to obtain the column difference sequence.

8. The machine vision recognition method for powder coatings based on near-infrared hyperspectral imaging according to claim 1, characterized in that, The process of element-wise superimposing the row difference sequence and the column difference sequence to generate a gradient difference map for distinguishing the distribution of different components in powder coating includes: Transform the row difference sequence and the column difference sequence into an intermediate matrix with the same number of rows and columns; At each element position of the intermediate matrix, the element value at the corresponding position in the row difference sequence is added to the element value at the corresponding position in the column difference sequence to obtain the superimposed element value; The superimposed element value calculated at each element position is used as the gray value of the corresponding pixel in the gradient difference map.

9. The machine vision recognition method for powder coatings based on near-infrared hyperspectral imaging according to claim 1, characterized in that, After generating the gradient difference map, the following steps are also included: Perform a connected component labeling operation on the gradient difference map to extract the boundary contours of all connected regions; Calculate the sum of gray values ​​of all pixels in each connected region, and mark the connected region with the largest sum of gray values ​​as the principal component region; The remaining connected regions other than the primary component region are marked as secondary component regions, and the spatial offset of each secondary component region relative to the primary component region is recorded.

10. The machine vision recognition method for powder coatings based on near-infrared hyperspectral imaging according to claim 9, characterized in that, The process of extracting the boundary contours of all connected regions includes: For each pixel in the gradient difference map, its gray value is compared with a preset connectivity threshold. Pixels with gray values ​​greater than the connectivity threshold are marked as foreground pixels, and the rest are marked as background pixels. All foreground points are scanned using the eight-neighbor connectivity rule, and interconnected foreground points are grouped into the same connectivity domain. For each connected region, trace the coordinates of the outermost pixel in the region, connect the coordinates of the outermost pixel in sequence to form a closed polyline, and use the closed polyline as the boundary contour of the connected region.