Inorganic acid finished product quality detection method based on machine vision
By acquiring bubble image sequences under stirring and entrainment conditions, extracting the center coordinates and radius of the bubbles, and calculating the second-order anisotropy coefficient of the structural ring, the problem of optical artifact interference in the prior art is solved, and high-precision quality detection of inorganic acid products is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-04
- Publication Date
- 2026-03-10
AI Technical Summary
Existing machine vision inspection methods cannot accurately distinguish between optical artifacts and decomposition gases in inorganic acid products under complex imaging conditions, resulting in unstable quality judgment and failing to meet the requirements of high-precision quality inspection.
By acquiring bubble image sequences under stirring and entrainment conditions, the set of bubble center coordinates and average radius are extracted, the structural ring wave number and the second-order anisotropy coefficient of the structural ring are calculated, the orientation order of the bubble group is identified using frequency domain signals, and quality detection is performed in combination with preset thresholds.
It achieves millisecond-level high-sensitivity online detection of inorganic acid products under non-contact conditions, identifies gas decomposition and merging failures, and improves the accuracy and stability of detection.
Smart Images

Figure CN121639638A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of quality detection, more particularly, it relates to a quality detection method for inorganic acid finished product based on machine vision. BACKGROUND
[0002] Inorganic acid (especially nitric acid) is a basic raw material in chemical production, and the quality of its finished product is directly related to the safety and efficiency of the subsequent process. During the storage and filling of high-concentration inorganic acid, due to the difference in thermal stability, some finished products are prone to decomposition reaction. For example, the decomposition of concentrated nitric acid produces nitrogen dioxide gas, which accumulates in the headspace above the liquid, not only changing the appearance color of the product, but also indicating a decrease in product purity. Currently, industrial sites mainly rely on manual visual inspection or basic machine vision systems to inspect the appearance of finished products to remove unqualified products that have decomposed or smoked.
[0003] However, the existing machine vision detection method has significant limitations. The traditional detection logic is usually based on the absolute numerical value of the color space, that is, whether there is a decomposition gas is determined by counting whether the pixels in the region of interest are yellow or red. This method is more sensitive to the environment, and fluctuations in lighting on the production line, uneven thickness of the container wall, stains on the back light panel or edge dark corner effect of the camera lens will introduce non-uniform brightness distribution or color deviation in the image. Simple color thresholding algorithms are prone to misjudgment of these optical artifacts as colored gas, or to drown out the thin real gas signal in strong light, which cannot meet the high-precision quality inspection requirements.
[0004] Specifically, the prior art ignores the distribution pattern of the gas in space. The real decomposition gas, affected by the diffusion law and chemical equilibrium, presents a specific nonlinear decay pattern in the process of diffusing upward from the liquid surface. Shadows, gradual changes in illumination or lens distortion usually exhibit linear or low-order smooth transitions. Due to the lack of analytical ability of the prior art for this distribution pattern, only isolated readings of pixel points or simple linear slopes are used for judgment, which makes it difficult for the system to distinguish between optical darkness and chemical color in the mathematical level, and thus it is difficult to achieve stable quality judgment under complex imaging conditions. SUMMARY
[0005] The present application provides a quality detection method for inorganic acid finished product based on machine vision, which solves the technical problems raised in the background art.
[0006] The present application provides a quality detection method for inorganic acid finished product based on machine vision, which includes: Obtaining a bubble image sequence of the liquid to be tested under stirring and entrainment conditions, and extracting a set of center coordinates and an average radius of the bubbles; determine the structure ring wave number in the frequency domain according to the average radius, the structure ring wave number corresponding to the spatial characteristic scale of the close contact pairing of the bubbles; Based on the central coordinate set, the second-order angular harmonic normalized amplitude of the structure factor at the structure ring wave number is calculated to obtain the structure ring second-order anisotropy coefficient, which is used to represent the orientation order degree of the bubble group in the stirring flow field; The structure ring second-order anisotropy coefficient is compared with the preset quality threshold value to obtain the quality detection result of the inorganic acid product.
[0007] In an embodiment of the present application, the micro-thin liquid film discharge behavior which is difficult to directly measure is converted into a macroscopic image frequency domain with a very structural ring second-order anisotropy signal by utilizing the kinetic inhibition effect of inorganic acid strong electrolyte on bubble coalescence, combining the shearing orientation effect of the stirring flow field; the signal is not disturbed by the random fluctuations of the absolute number of bubbles or light intensity, and can identify the coalescence failure caused by insufficient acid concentration or too many impurities, realizing millisecond high-sensitivity online detection of the micro-physicochemical properties of inorganic acid products under non-contact working conditions. BRIEF DESCRIPTION OF DRAWINGS
[0008] Figure 1 is a two-dimensional structure factor thermogram comparison chart of the present application; Figure 2 is a flow chart of an inorganic acid product quality detection method based on machine vision of the present application. DETAILED DESCRIPTION
[0009] The subject matter described herein will now be discussed with reference to example implementations. It should be understood that discussions of these implementations are merely provided to enable those skilled in the art to better understand and utilize the subject matter described herein, and do not limit the scope of protection of the present specification. Various procedures or components can be omitted, substituted, or added according to the needs of the various examples. In addition, features described with respect to some examples can also be combined in other examples.
[0010] As shown in Figure 1 , the present application is a method for detecting the quality of inorganic acid products based on machine vision, which comprises the following steps: Figure 1The two-dimensional structural factor frequency domain thermogram of the microbubble cloud of qualified and unqualified inorganic acid samples is shown. The qualified sample (left) presents a significant anisotropic double-lobe high-light structure ring at the characteristic wave number, which intuitively reflects that under the strong electrolyte repulsion and cooperation, the microbubble group forms a tight contact shell in space, and produces a highly consistent second-order orientation arrangement under the shearing action of the stirring flow field; in contrast, the unqualified sample (right) only presents a diffuse, isotropic weak light ring or halo, indicating that the bubble distribution is in a random disordered state, lacking characteristic residence pairing structure. The significant topological difference of this frequency energy distribution confirms the completeness and high discrimination of the second-order anisotropy coefficient of the structural ring as a micro-dynamics fingerprint in macro-imaging detection.
[0011] As shown in Figure 2 , a machine vision-based inorganic acid finished product quality detection method comprises: acquiring a bubble image sequence of the liquid to be tested under stirring and entrainment conditions, and extracting a center coordinate set and an average radius of the bubbles; determining a structural ring wave number in the frequency domain according to the average radius, the structural ring wave number corresponding to a spatial characteristic scale of the bubble near-contact pairing; based on the center coordinate set, calculating a second-order angular harmonic normalized amplitude of the structural factor at the structural ring wave number to obtain a second-order anisotropy coefficient of the structural ring, which is used to represent the orientation order degree of the bubble group in the stirring flow field; comparing the second-order anisotropy coefficient of the structural ring with a preset quality threshold to obtain a quality detection result of the inorganic acid finished product.
[0012] In an embodiment of the present application, acquiring a bubble image sequence of the liquid to be tested under stirring and entrainment conditions comprises: calculating a stirring Froude number, the stirring Froude number being equal to the square of the stirring rotation speed multiplied by the impeller diameter and then divided by the acceleration of gravity, and limiting the stirring Froude number between a lower limit of the stirring Froude number and an upper limit of the stirring Froude number; setting a camera exposure time, so that the camera exposure time is less than or equal to an exposure time coefficient multiplied by a bubble coalescence waiting time; setting a camera frame rate, so that the camera frame rate is greater than or equal to a sampling redundancy coefficient multiplied by the reciprocal of the bubble coalescence waiting time; determining the acquisition time of the kth frame according to the camera frame rate, the acquisition time of the kth frame being equal to the difference obtained by subtracting one from the frame serial number k divided by the camera frame rate, and accordingly acquiring a bubble image sequence composed of a pixel matrix.
[0013] The stirring Froude number is a dimensionless parameter for judging whether the stable free surface entrainment is generated in the stirring working condition. The stirring Froude number is used for quantifying the balance relationship between the stirring intensity and the gravity action of the liquid. The value of the stirring Froude number directly determines the density and stability of the generated bubbles. Specifically, the stirring Froude number is equal to the square of the stirring speed multiplied by the impeller diameter, and then divided by the gravity acceleration.
[0014] The stirring speed is the number of rotations of the stirring blade per unit time. The stirring speed is the core parameter for adjusting the stirring intensity. The unit of the stirring speed is revolutions per second. The stirring speed needs to be set according to the rated power of the stirring equipment and the specifications of the container.
[0015] The impeller diameter is the maximum diameter of the stirring blade. The unit of the impeller diameter is meters. The impeller diameter determines the range of the stirring blade acting on the liquid. The impeller diameter is the basic structural parameter for calculating the stirring Froude number.
[0016] The gravity acceleration is the acceleration of an object under the action of gravity. The gravity acceleration is a fixed physical parameter. The unit of the gravity acceleration is meters per square second. The value of the gravity acceleration is the standard gravity acceleration.
[0017] The lower limit of the stirring Froude number is the minimum stirring intensity critical value for generating stable air entrainment. If the stirring Froude number is lower than the lower limit, a deep enough liquid surface vortex cannot be formed, and the amount of bubble generation is insufficient. Specifically, the lower limit of the stirring Froude number is set according to the equipment calibration value. The lower limit of the stirring Froude number of small experimental equipment is usually taken as zero point zero five. The lower limit of the stirring Froude number of industrial production equipment is usually taken as zero point one.
[0018] The upper limit of the stirring Froude number is the maximum stirring intensity critical value for avoiding excessive liquid surface turbulence and bubble distribution tending to be isotropic. If the stirring Froude number is higher than the upper limit, the recognition degree of the bubble orientation characteristics will be reduced. Specifically, the upper limit of the stirring Froude number is set according to the equipment calibration value. The upper limit of the stirring Froude number of small experimental equipment is usually taken as zero point three. The upper limit of the stirring Froude number of industrial production equipment is usually taken as zero point five.
[0019] The camera exposure time is the length of time that the camera shutter is open. The unit of the camera exposure time is seconds. The camera exposure time is used to control the amount of light received during image acquisition. The camera exposure time needs to be short enough to freeze the relative motion of the bubbles.
[0020] The exposure time coefficient is a dimensionless coefficient for adjusting the ratio of the exposure time and the bubble merging waiting time. The value of the exposure time coefficient is not more than one. The exposure time coefficient is used to reserve a safety margin to avoid motion blur. Specifically, the exposure time coefficient is set according to the bubble motion speed. When the bubble motion is slow, the exposure time coefficient is taken as zero point eight. When the bubble motion is fast, the exposure time coefficient is taken as zero point three to zero point five.
[0021] The bubble coalescence waiting time is the average residence time of two closely contacted bubbles from entering the contact shell to coalescing or separating, the unit of the bubble coalescence waiting time is second, the length of the bubble coalescence waiting time is determined by the electrolyte characteristics of the inorganic acid, and the bubble coalescence waiting time is significantly affected by the ion type and concentration.
[0022] The camera frame rate is the number of frames of images collected by the camera per unit time, the unit of the camera frame rate is hertz, and the camera frame rate determines the time density of the image sequence, and the camera frame rate needs to meet the demand of capturing the dynamic characteristics of the bubbles.
[0023] The sampling redundancy coefficient is a dimensionless coefficient set to ensure the integrity of the image sequence, the sampling redundancy coefficient is not less than one, and the sampling redundancy coefficient is used to cope with the randomness of the bubble movement; specifically, the sampling redundancy coefficient is usually one point two to one point five, and the sampling redundancy coefficient is two in a scene with high detection accuracy requirement.
[0024] The acquisition time of the kth frame is the specific acquisition time of the kth frame in the image sequence, the unit of the acquisition time of the kth frame is second, and the acquisition time of the kth frame is used to ensure the time equal interval of image acquisition; specifically, the acquisition time of the kth frame is equal to the difference between the frame serial number k minus one, and then divided by the camera frame rate.
[0025] The frame serial number k is a positive integer from one to the total number of frames.
[0026] The bubble image sequence is a set of continuous gray scale images collected at time equal intervals, the data type of each frame of image in the bubble image sequence is a pixel matrix, the bubble image sequence contains the spatial distribution and morphological characteristics of the bubbles, and the bubble image sequence is the basic data for subsequent parameter extraction.
[0027] In an embodiment of the present application, the center coordinate set of the bubble is extracted, comprising: A two-dimensional convolution operation is performed on the kth frame of bubble image in the image sequence by using a two-dimensional Gaussian kernel to obtain a denoised kth frame of image, and the two-dimensional Gaussian kernel is defined by the standard deviation of the Gaussian kernel. The gray level of the denoised kth frame of image is traversed as a candidate threshold, for each candidate threshold, the pixels with pixel intensity greater than or equal to the candidate threshold are divided into a foreground pixel set, and the pixels with pixel intensity less than the candidate threshold are divided into a background pixel set. The ratio of the number of pixels in the foreground pixel set to the total number of pixels in the image is calculated as the foreground probability, and the ratio of the number of pixels in the background pixel set to the total number of pixels in the image is calculated as the background probability. The average value of all pixel intensities in the foreground pixel set is calculated as the foreground average gray scale, and the average value of all pixel intensities in the background pixel set is calculated as the background average gray scale. The candidate threshold value that maximizes the product of the foreground probability, the background probability, and the square of the difference between the average gray scale of the foreground and the average gray scale of the background is selected as the target binarization threshold value; A binary mask is generated according to the target binarization threshold value, and pixels with a pixel intensity greater than or equal to the target binarization threshold value in the kth frame image after denoising are assigned a value of one, and pixels with a pixel intensity less than the target binarization threshold value are assigned a value of zero; A circular structure element with a preset structure element radius is used to sequentially perform erosion operation and dilation operation on the binary mask to obtain a binary mask after opening operation. In the binary mask after opening operation, mark out eight-neighborhood connected domains that do not intersect with each other, and count the total number of pixels contained in each eight-neighborhood connected domain. For each eight-neighborhood connected domain, the horizontal coordinate value of all the pixels contained in the eight-neighborhood connected domain is accumulated and then divided by the total number of pixels to obtain a horizontal centroid coordinate, and the vertical coordinate value of all the pixels contained in the eight-neighborhood connected domain is accumulated and then divided by the total number of pixels to obtain a vertical centroid coordinate. The coordinate pair composed of the horizontal centroid coordinate and the vertical centroid coordinate is taken as the center coordinate of the connected domain, and the center coordinates of all the connected domains in the kth frame are summarized to obtain a bubble center coordinate set of the kth frame.
[0028] The two-dimensional Gaussian kernel is a smoothing filter for image denoising, and the pixel values of the two-dimensional Gaussian kernel are in Gaussian distribution, with high weight of the central pixel and low weight of the edge pixel. The two-dimensional Gaussian kernel can effectively suppress image noise and retain bubble outline information.
[0029] The standard deviation of the Gaussian kernel is a core parameter that determines the smoothing degree of the two-dimensional Gaussian kernel. The unit of the standard deviation of the Gaussian kernel is pixel. The smaller the standard deviation of the Gaussian kernel, the weaker the smoothing effect. The larger the standard deviation of the Gaussian kernel, the stronger the smoothing effect but the bubble edge is easy to blur. Specifically, the standard deviation of the Gaussian kernel is set to one-tenth of the equivalent radius of the bubble. If the equivalent radius of the bubble is between five and ten pixels, the standard deviation of the Gaussian kernel is set to zero point five to one pixel.
[0030] The kth frame bubble image is a single frame image with sequence number k in the image sequence, and the kth frame bubble image contains the original spatial distribution information of the bubbles in the liquid to be measured at the moment.
[0031] The two-dimensional convolution operation is an operation of weighted summation of the two-dimensional Gaussian kernel and the corresponding pixels of the kth frame bubble image. The core role of the two-dimensional convolution operation is to realize image smoothing and denoising through the weight distribution of the Gaussian kernel. The two-dimensional convolution operation does not change the size and pixel coordinates of the image.
[0032] The kth frame image after denoising is an image obtained by processing the kth frame bubble image through the two-dimensional convolution operation. The kth frame image after denoising eliminates the random noise in the original image, and the bubble edge of the kth frame image after denoising is clearer.
[0033] Gray scale is a level division of the brightness of image pixels, and the value range of gray scale is usually from zero to two hundred and fifty-five. Each value of gray scale corresponds to a pixel brightness. Gray scale is the basic range for selecting candidate threshold.
[0034] Candidate threshold is a temporary threshold selected from the gray scale of the image to distinguish the foreground and background. Each value of candidate threshold corresponds to a division result of a set of foreground and background pixels.
[0035] Pixel intensity is the brightness value of a single pixel in the image. The size of pixel intensity corresponds to the value of gray scale. Pixel intensity is the core basis for judging whether a pixel belongs to the foreground or background set.
[0036] The foreground pixel set is a set of all pixels whose pixel intensity is greater than or equal to the candidate threshold. The foreground pixel set mainly corresponds to the bubble area in the image. The range of the foreground pixel set changes with the candidate threshold.
[0037] The background pixel set is a set of all pixels whose pixel intensity is less than the candidate threshold. The background pixel set mainly corresponds to the inorganic acid liquid area in the image. The background pixel set has no overlap with the foreground pixel set and covers the entire image.
[0038] The foreground probability is the ratio of the number of pixels in the foreground pixel set to the total number of pixels in the image. The foreground probability reflects the proportion of the bubble area in the entire image.
[0039] The background probability is the ratio of the number of pixels in the background pixel set to the total number of pixels in the image. The sum of the foreground probability and the background probability is one. The background probability reflects the proportion of the liquid area in the entire image.
[0040] The foreground average gray scale is the arithmetic mean of the pixel intensity of all pixels in the foreground pixel set. The foreground average gray scale reflects the overall brightness of the bubble area. The foreground average gray scale is an important indicator for measuring the threshold segmentation effect.
[0041] The background average gray scale is the arithmetic mean of the pixel intensity of all pixels in the background pixel set. The background average gray scale reflects the overall brightness of the liquid area. The difference between the background average gray scale and the foreground average gray scale determines the contrast of the image.
[0042] The target binary threshold is the optimal threshold selected from all candidate thresholds. The target binary threshold maximizes the distinction between the foreground and the background.
[0043] The binary mask is an image containing only two pixel values, zero and one. The pixels with a value of one in the binary mask correspond to the bubble area, and the pixels with a value of zero correspond to the background area. The binary mask realizes the preliminary separation of the bubble and the background.
[0044] The circular structural element is a basic graphic element for morphological operation, the shape of the circular structural element is a circle, and the circular structural element can avoid corner distortion of a bubble contour in morphological processing.
[0045] The preset structural element radius is a core size parameter of the circular structural element, the preset structural element radius is in units of pixels, and the size of the preset structural element radius determines the strength of morphological operation; specifically, the preset structural element radius is set as one fifth of the average bubble radius, and if the average bubble radius is between five and ten pixels, the preset structural element radius is one to two pixels.
[0046] The erosion operation is a basic operation in morphology, the erosion operation can eliminate small protrusions and isolated noise points on a bubble edge in a binary mask, and the erosion operation can refine a bubble contour.
[0047] The dilation operation is a morphological operation corresponding to the erosion operation, the dilation operation can restore a main contour of a bubble after erosion, and the dilation operation can fill small holes in the bubble.
[0048] The binary mask after the opening operation is an image obtained by performing the erosion operation and then the dilation operation on the binary mask, the binary mask after the opening operation eliminates noise and holes in a bubble region, and the bubble contour of the binary mask after the opening operation is more regular.
[0049] The eight-neighbor connected domain refers to a set of pixels in an image, which are connected to each other in the eight pixels in the up, down, left, right and diagonal directions with a certain pixel as the center, each eight-neighbor connected domain corresponds to a complete bubble, and the eight-neighbor connected domains do not overlap with each other.
[0050] The horizontal centroid coordinate is a horizontal center of mass position of the eight-neighbor connected domain, the horizontal centroid coordinate is in units of pixels, and the horizontal centroid coordinate is a horizontal component of a bubble center coordinate.
[0051] The vertical centroid coordinate is a vertical center of mass position of the eight-neighbor connected domain, the vertical centroid coordinate is in units of pixels, and the vertical centroid coordinate is a vertical component of the bubble center coordinate.
[0052] The center coordinate is a coordinate pair composed of the horizontal centroid coordinate and the vertical centroid coordinate, the center coordinate uniquely corresponds to an eight-neighbor connected domain, and the center coordinate represents the spatial position of a single bubble.
[0053] The bubble center coordinate set is a summary set of center coordinates of all bubbles in the kth frame, the bubble center coordinate set contains spatial position information of all bubbles at the moment, and the bubble center coordinate set is core data for subsequent calculation of the structure ring wave number and the anisotropy coefficient.
[0054] In one embodiment of the present application, the average radius of the bubbles is extracted, comprising: For each octagonal neighborhood connected domain in the kth frame, the equivalent radius of the octagonal neighborhood connected domain is obtained by dividing the total number of pixels of the octagonal neighborhood connected domain by pi and then taking the square root of the result; The values of the equivalent radii of all octagonal neighborhood connected domains in the kth frame are accumulated, and the accumulated result is divided by the total number of octagonal neighborhood connected domains in the kth frame to obtain the average radius of the kth frame.
[0055] The equivalent radius is the radius of the octagonal neighborhood connected domain after being equivalent to a circle, and the unit of the equivalent radius is pixel. The equivalent radius is a core size parameter of a single bubble, and the equivalent radius can intuitively reflect the size of a single bubble. Specifically, the equivalent radius is equal to the total number of pixels of the octagonal neighborhood connected domain divided by pi, and then the square root of the result is taken.
[0056] The average radius is the arithmetic mean of the equivalent radii of all bubbles in the kth frame. The unit of the average radius is pixel. The average radius is a core parameter representing the overall size of the bubbles in the frame, and the average radius is a key basis for determining the structural ring wave number subsequently. Specifically, the average radius is equal to the accumulated result of the equivalent radius values of all octagonal neighborhood connected domains in the kth frame, divided by the total number of octagonal neighborhood connected domains in the kth frame.
[0057] In one embodiment of the present application, the structural ring wave number in the frequency domain is determined according to the average radius, comprising: The structural ring wave number of the kth frame is obtained by dividing pi by the average radius of the kth frame.
[0058] The structural ring wave number is a core parameter representing the characteristic size of the bubble near-contact pairing space in the frequency domain. The unit of the structural ring wave number is radian per pixel. The structural ring wave number corresponds to the characteristic frequency of the bubble near-contact pairing. Specifically, the structural ring wave number is equal to pi divided by the average radius of the kth frame.
[0059] In one embodiment of the present application, based on the set of center coordinates, the second-order angular harmonic normalized amplitude of the structure factor at the structural ring wave number is calculated to obtain the structural ring second-order anisotropy coefficient, comprising: The angle range between zero and two times pi is equally divided to obtain a plurality of angle samples; For each angle sample, a discrete structure factor value corresponding to the angle sample is calculated, and the calculation process comprises: traversing the bubble center coordinate set of the kth frame, for each center coordinate, multiplying the transverse centroid coordinate by the cosine value of the angle sample, adding the longitudinal centroid coordinate multiplied by the sine value of the angle sample, to obtain the projection length; multiplying the projection length by the structure ring wave number of the kth frame and a negative imaginary unit as the exponential part of the exponential function, calculating the exponential function value of the exponential part based on the natural constant; adding the exponential function values corresponding to all center coordinates in the kth frame, calculating the square of the modulus of the addition result, and dividing the square of the modulus by the number of connected domains of the kth frame to obtain the discrete structure factor value corresponding to the angle sample; The numerator of the second-order angular harmonic normalized amplitude is calculated, and the calculation process comprises: for each angle sample, multiplying the discrete structure factor value corresponding to the angle sample by a complex exponential factor, and the exponential part of the complex exponential factor is equal to a negative imaginary unit multiplied by two and multiplied by the angle sample; adding the products calculated by all angle samples, and calculating the modulus of the addition result to obtain the numerator of the second-order angular harmonic normalized amplitude; The denominator of the second-order angular harmonic normalized amplitude is calculated, and the calculation process comprises: adding the discrete structure factor values corresponding to all angle samples to obtain the denominator of the second-order angular harmonic normalized amplitude; The numerator of the second-order angular harmonic normalized amplitude is divided by the denominator of the second-order angular harmonic normalized amplitude to obtain the second-order anisotropy coefficient of the structure ring of the kth frame.
[0060] The number of angle samples is a quantitative standard for dividing the angle range, and the number of angle samples determines the density of angle samples. The more the number of angle samples, the higher the calculation accuracy but the larger the operation amount, and the less the number of angle samples, the higher the operation efficiency but the more likely to lose details. Specifically, the number of angle samples is usually thirty-six or seventy-two, one hundred and forty-four for scenes with high detection accuracy requirements, and thirty-six for conventional detection scenes.
[0061] The angle sample is a specific angle value distributed at equal intervals in the angle range of zero to two times pi, and the unit of the angle sample is radian. Each angle sample corresponds to a detection direction on the structure ring, and the angle samples fully cover the circumferential direction of the structure ring. Specifically, the angle sample is equal to the angle interval number multiplied by two multiplied by pi, and then divided by the number of angle samples.
[0062] The discrete structure factor value is a dimensionless parameter representing the frequency domain characteristics of the bubble center coordinate set under a specific angle sample, and the discrete structure factor value reflects the density of bubble distribution in the angle direction.
[0063] The projection length is the projection distance of the bubble center coordinate in the direction of the corresponding angle sample, and the unit of the projection length is pixel. The projection length converts the two-dimensional bubble center coordinate into a one-dimensional value.
[0064] The negative imaginary unit is a basic constant in the operation of complex variable function, and is used for constructing the complex exponential part of the exponential function; specifically, the negative imaginary unit is uniformly taken as the square root of -1, and the value of the negative imaginary unit is taken in the calculation.
[0065] The exponential function value is the calculation result of taking the natural constant as the base, and taking the product of the projection length, the structural ring wave number and the negative imaginary unit as the exponent; the exponential function value is in complex number form, and carries the frequency domain information of the bubble position.
[0066] The modulus of the addition result is the modulus of the complex number obtained after the accumulation of all the exponential function values, and the unit of the modulus of the addition result is dimensionless; the modulus of the addition result reflects the overall intensity of the bubble distribution characteristics in the angle direction in the frequency domain.
[0067] The numerator of the second-order angular harmonic normalized amplitude is a core value reflecting the intensity of the second-order angular anisotropy characteristics of the structural ring, and the numerator of the second-order angular harmonic normalized amplitude is a non-negative real number; the larger the numerator of the second-order angular harmonic normalized amplitude, the more significant the second-order orientation characteristics.
[0068] The complex exponential factor is a complex factor used to extract the second-order angular harmonic characteristics, and the core role of the complex exponential factor is to filter out the signal component corresponding to the second-order harmonic in the angle sample; the complex exponential factor does not change the amplitude order of the discrete structure factor value; specifically, the complex exponential factor is equal to the exponential function value taking the natural constant as the base, taking the negative imaginary unit multiplied by two as the exponent, and taking the angle sample as the result.
[0069] The denominator of the second-order angular harmonic normalized amplitude is the accumulation of the discrete structure factor values of all the angle samples, and the denominator of the second-order angular harmonic normalized amplitude is a positive number; the denominator of the second-order angular harmonic normalized amplitude is used to normalize the numerator to the interval of zero to one, facilitating threshold comparison.
[0070] The second-order anisotropy coefficient of the structural ring is a core dimensionless parameter representing the orientation order degree of the bubble group in the stirring flow field, and the value range of the second-order anisotropy coefficient of the structural ring is between zero and one; the closer the value is to one, the more regular the bubble orientation is, and the closer the value is to zero, the more disordered the bubble distribution is; specifically, the second-order anisotropy coefficient of the structural ring is equal to the numerator of the second-order angular harmonic normalized amplitude divided by the denominator of the second-order angular harmonic normalized amplitude.
[0071] In an embodiment of the present application, the chroma curvature index is calculated by using the logarithmic chroma values corresponding to three sampling heights, comprising: The pixel vertical coordinates of the three sampling heights are determined in the kth bubble image, so that the difference between the pixel vertical coordinates of the adjacent two sampling heights is equal, and the difference is defined as the pixel spacing between the adjacent sampling heights; Three rectangular strip regions are constructed respectively by extending upward and downward in the vertical direction with a preset half-strip thickness from the vertical coordinate of each sampling height as the center; For each rectangular strip region, the red channel intensity, green channel intensity and blue channel intensity of all pixels in the rectangular strip region are counted and divided by the number of pixels in the rectangular strip region to obtain the red channel average, green channel average and blue channel average of the rectangular strip region; The logarithmic chroma value of each rectangular strip region is calculated, and the calculation process includes: dividing the green channel average of the rectangular strip region by the sum of the red channel average of the rectangular strip region, the blue channel average of the rectangular strip region and a preset non-zero positive number, to obtain a chroma value; calculating the natural logarithm of the chroma value to obtain the logarithmic chroma value; wherein the preset non-zero positive number is 10 -6 ; The chroma curvature index is calculated, which is equal to the logarithmic chroma value corresponding to the first sampling height sorted in ascending order of pixel vertical coordinates minus twice the logarithmic chroma value corresponding to the second sampling height, plus the logarithmic chroma value corresponding to the third sampling height, divided by the square of the pixel spacing of adjacent sampling heights.
[0072] The pixel vertical coordinates of the three sampling heights are three fixed longitudinal coordinate positions selected in the vertical direction of the kth bubble image, and the pixel vertical coordinates of the three sampling heights are used to locate the key observation area of gas diffusion, and the pixel vertical coordinates of the three sampling heights need to cover the range where gas is easy to gather above the liquid surface; specifically, the pixel vertical coordinates of the three sampling heights are set according to the vertical resolution of the image, and the longitudinal coordinates corresponding to one-third, one-half and two-thirds of the vertical pixel value of the image are taken respectively.
[0073] The pixel spacing of adjacent sampling heights is the difference between the pixel vertical coordinates of adjacent two sampling heights, and the unit of the pixel spacing of adjacent sampling heights is pixel, and the equal pixel spacing of adjacent sampling heights can ensure the symmetry of the calculation of the gradient of chroma change.
[0074] The preset half-strip thickness is the extension length of the half side of the rectangular strip region in the vertical direction, and the unit of the preset half-strip thickness is pixel, and the preset half-strip thickness determines the vertical width of the rectangular strip region, and too narrow preset half-strip thickness will lead to insufficient pixel statistics, and too wide preset half-strip thickness will mask the chroma gradient change; specifically, the preset half-strip thickness is set according to one-half of the average bubble radius, and if the average bubble radius is between five and ten pixels, the preset half-strip thickness is two to five pixels.
[0075] The rectangular strip region is a rectangular pixel set constructed around the sampling height, the rectangular strip region covers the effective area of the whole image transversely, the rectangular strip region is used to concentrate the chroma information of a specific height, and the rectangular strip region can reduce the influence of single pixel noise on chroma calculation.
[0076] The red channel intensity is a luminance value of an image pixel on a red color channel, and the red channel intensity reflects the proportion of the red component of the pixel.
[0077] The green channel intensity is a luminance value of an image pixel on a green color channel, and the green channel intensity reflects the proportion of the green component of the pixel.
[0078] The blue channel intensity is a luminance value of an image pixel on a blue color channel, and the blue channel intensity reflects the proportion of the blue component of the pixel.
[0079] The pixel number of the rectangular strip region is the total number of pixels contained in a single rectangular strip region, the pixel number of the rectangular strip region is a normalization parameter for calculating the average value of each color channel, and the pixel number of the rectangular strip region ensures that the average value is not affected by the size of the region.
[0080] The red channel average value is the arithmetic average value of the red channel intensity of all pixels in the rectangular strip region, and the red channel average value reflects the overall red hue characteristics of the region.
[0081] The green channel average value is the arithmetic average value of the green channel intensity of all pixels in the rectangular strip region, and the green channel average value reflects the overall green hue characteristics of the region.
[0082] The blue channel average value is the arithmetic average value of the blue channel intensity of all pixels in the rectangular strip region, and the blue channel average value reflects the overall blue hue characteristics of the region.
[0083] The chroma value is a dimensionless parameter representing the color characteristics of the rectangular strip region, the chroma value highlights the color difference through the ratio of the green channel to the red and blue channels, and the chroma value can effectively distinguish the color deviation caused by inorganic acid decomposition gas from optical artifacts.
[0084] The preset non-zero positive number is a compensation parameter for avoiding a zero denominator, the preset non-zero positive number is a dimensionless extremely small value, and the preset non-zero positive number does not affect the calculation accuracy of the chroma value; specifically, the preset non-zero positive number is uniformly set to one ten-thousandth.
[0085] The logarithmic chroma value is the natural logarithm result of the chroma value, the logarithmic chroma value can convert the nonlinear change of the chroma into a relatively linear value, and the logarithmic chroma value can amplify the weak chroma difference.
[0086] The chroma curvature index is a parameter for representing the degree of non-linear change of the logarithmic chroma values of three sampling heights, and the unit of the chroma curvature index is negative square of pixels. The greater the chroma curvature index is, the more significant the non-linearity of the gas concentration distribution is. The smaller the chroma curvature index is, the closer the color change is to linear optical artifacts. Specifically, the chroma curvature index is equal to the logarithmic chroma value of the first sampling height minus twice the logarithmic chroma value of the second sampling height, plus the logarithmic chroma value of the third sampling height, and the result is divided by the square of the pixel spacing between adjacent sampling heights.
[0087] In an embodiment of the present application, the calculated chroma curvature index is compared with a preset threshold value to obtain the quality detection result of the to-be-tested inorganic acid sample, including: setting a chroma curvature threshold value; calculating the absolute value of the chroma curvature index; comparing the absolute value of the chroma curvature index with the chroma curvature threshold value; if the absolute value of the chroma curvature index is less than or equal to the chroma curvature threshold value, it is determined that the quality detection result of the to-be-tested inorganic acid sample is qualified; if the absolute value of the chroma curvature index is greater than the chroma curvature threshold value, it is determined that the quality detection result of the to-be-tested inorganic acid sample is unqualified.
[0088] The chroma curvature threshold value is a critical value for distinguishing whether the quality of the inorganic acid sample is qualified or not. The unit of the chroma curvature threshold value is negative square of pixels. The chroma curvature threshold value is a core standard for dividing the non-linear color deviation of the gas and the linear change of the optical artifacts. The chroma curvature threshold value needs to be set in combination with the baseline data of the qualified sample. Specifically, the chroma curvature threshold value takes the maximum value of the absolute value of the chroma curvature index of the qualified sample. If the measured value range of the qualified sample is between zero point zero zero one and zero point zero zero five negative square of pixels, the chroma curvature threshold value is uniformly set to zero point zero zero five negative square of pixels.
[0089] The absolute value of the chroma curvature index is the non-negative value of the chroma curvature index. The absolute value of the chroma curvature index eliminates the influence of the color change direction and only retains the quantitative characteristics of the change degree.
[0090] The quality detection result is the final conclusion of the quality of the inorganic acid product. The quality detection result only has two values of qualified and unqualified. The quality detection result directly reflects whether the inorganic acid has the problem of purity reduction caused by decomposition.
[0091] The to-be-tested inorganic acid sample refers to the strong acid product that needs to be tested for quality. The to-be-tested inorganic acid sample needs to be consistent with the sample type and concentration range used when setting the chroma curvature threshold value.
[0092] The above describes the embodiments of the present embodiment, but the present embodiment is not limited to the above-described specific embodiments, and the above-described specific embodiments are only illustrative but not restrictive, and those skilled in the art can make many forms under the inspiration of the present embodiment, which all belong to the protection of the present embodiment.
Claims
1. A method for detecting the quality of inorganic acid finished products based on machine vision, characterized in that, The method comprises the following steps: obtaining a bubble image sequence of the liquid to be tested under the stirring entrainment condition, extracting a center coordinate set and an average radius of the bubble; determining a structural ring wave number in a frequency domain according to the average radius, the structural ring wave number corresponding to a spatial characteristic scale of a near-contact pair of the bubble; calculating a second-order angular harmonic normalized amplitude of a structure factor at the structural ring wave number based on the center coordinate set, to obtain a second-order anisotropy coefficient of the structural ring, which is used to represent an orientation order degree of the bubble group in the stirring flow field; comparing the second-order anisotropy coefficient of the structural ring with a preset quality threshold value to obtain a quality detection result of the inorganic acid product. 2.The machine vision-based method for detecting quality of a finished inorganic acid product according to claim 1, characterized in that, The method for obtaining the bubble image sequence of the liquid to be tested under the stirring entrainment condition comprises the following steps: calculating a stirring Froude number, wherein the stirring Froude number is equal to the square of the stirring rotating speed multiplied by the impeller diameter and then divided by the acceleration of gravity, and the stirring Froude number is limited between a lower limit of the stirring Froude number and an upper limit of the stirring Froude number; setting a camera exposure time, so that the camera exposure time is less than or equal to an exposure time coefficient multiplied by a bubble combination waiting time; setting a camera frame rate, so that the camera frame rate is greater than or equal to a sampling redundancy coefficient multiplied by the inverse of the bubble combination waiting time; determining a collection time of the kth frame according to the camera frame rate, wherein the collection time of the kth frame is equal to a difference value obtained by subtracting one from the frame serial number k and then divided by the camera frame rate, and the bubble image sequence composed of the pixel matrix is collected according to the collection time. 3.The machine vision-based method for detecting quality of a finished inorganic acid product according to claim 2, characterized in that, The method for extracting the center coordinate set of the bubble comprises the following steps: performing two-dimensional convolution operation on the kth frame bubble image in the image sequence by using a two-dimensional Gaussian kernel to obtain a denoised kth frame image, wherein the two-dimensional Gaussian kernel is defined by a standard deviation of a Gaussian kernel; traversing a gray level of the denoised kth frame image as a candidate threshold value, and for each candidate threshold value, dividing pixels with a pixel intensity greater than or equal to the candidate threshold value into a foreground pixel set and dividing pixels with a pixel intensity less than the candidate threshold value into a background pixel set; calculating a foreground probability as a ratio of a number of pixels in the foreground pixel set to a total number of pixels in the image, and calculating a background probability as a ratio of a number of pixels in the background pixel set to the total number of pixels in the image; calculating a foreground average gray value as an average of all pixel intensities in the foreground pixel set, and calculating a background average gray value as an average of all pixel intensities in the background pixel set; selecting a candidate threshold value that makes a product of the foreground probability, the background probability and a square of a difference between the foreground average gray value and the background average gray value reach a maximum value as a target binary threshold value; generating a binary mask according to the target binary threshold value, and assigning a pixel with a pixel intensity greater than or equal to the target binary threshold value in the denoised kth frame image to one and a pixel with a pixel intensity less than the target binary threshold value to zero; performing erosion operation and dilation operation on the binary mask in sequence by using a circular structure element with a preset structure element radius to obtain an open operation binary mask; labeling mutually disjoint eight-neighbor connected domains in the open operation binary mask, and counting a total number of pixels contained in each eight-neighbor connected domain. For each eight-neighbor connected domain, the horizontal centroid coordinate is obtained by accumulating the horizontal coordinate values of all pixels contained in the eight-neighbor connected domain and dividing the total number of pixels by the total number of pixels, and the vertical centroid coordinate is obtained by accumulating the vertical coordinate values of all pixels contained in the eight-neighbor connected domain and dividing the total number of pixels by the total number of pixels; The coordinate pair composed of the horizontal centroid coordinate and the vertical centroid coordinate is taken as the center coordinate of the connected domain, and the center coordinates of all connected domains in the kth frame are collected to obtain the bubble center coordinate set of the kth frame. 4.The machine vision-based method for detecting quality of a finished inorganic acid product according to claim 3, characterized in that, The average radius of the bubble is extracted, including: For each eight-neighbor connected domain in the kth frame, the equivalent radius of the eight-neighbor connected domain is obtained by dividing the total number of pixels by pi and then taking the square root of the result; The equivalent radii of all eight-neighbor connected domains in the kth frame are accumulated, and the average radius of the kth frame is obtained by dividing the accumulated result by the total number of eight-neighbor connected domains in the kth frame. 5.The machine vision-based method for detecting quality of a finished inorganic acid product according to claim 4, characterized in that, The structure ring wave number in the frequency domain is determined according to the average radius, including: The structure ring wave number of the kth frame is obtained by dividing pi by the average radius of the kth frame. 6.The machine vision-based method for detecting quality of a finished inorganic acid product according to claim 5, wherein, Based on the center coordinate set, the second-order angular harmonic normalized amplitude of the structure factor at the structure ring wave number is calculated to obtain the structure ring second-order anisotropy coefficient, including: The angle range between zero and two times pi is equally divided to obtain a plurality of angle samples; For each angle sample, the discrete structure factor value corresponding to the angle sample is calculated, and the calculation process includes: traversing the bubble center coordinate set of the kth frame, for each center coordinate, multiplying the horizontal centroid coordinate by the cosine value of the angle sample, adding the vertical centroid coordinate multiplied by the sine value of the angle sample, to obtain the projection length; multiplying the projection length by the structure ring wave number of the kth frame and the negative imaginary unit as the exponential part of the exponential function, calculating the exponential function value of the exponential part with the natural constant as the base; adding the exponential function values corresponding to all center coordinates in the kth frame, calculating the square of the modulus of the addition result, and dividing the square of the modulus by the number of connected domains in the kth frame to obtain the discrete structure factor value corresponding to the angle sample; The numerator of the second-order angular harmonic normalized amplitude is calculated, and the calculation process includes: for each angle sample, multiplying the discrete structure factor value corresponding to the angle sample by the complex exponential factor, and the exponential part of the complex exponential factor is equal to the negative imaginary unit multiplied by two and then multiplied by the angle sample; adding the products calculated by all angle samples, and calculating the modulus of the addition result to obtain the numerator of the second-order angular harmonic normalized amplitude; The denominator of the second-order angular harmonic normalized amplitude is calculated, and the calculation process includes: adding the discrete structure factor values corresponding to all angle samples to obtain the denominator of the second-order angular harmonic normalized amplitude; The structure ring second-order anisotropy coefficient of the kth frame is obtained by dividing the numerator of the second-order angular harmonic normalized amplitude by the denominator of the second-order angular harmonic normalized amplitude. 7.The machine vision-based method for detecting quality of a finished inorganic acid product according to claim 6, wherein, The chroma curvature exponent is calculated using the logarithmic chroma values corresponding to the three sampling heights, including: In the kth frame bubble image, the pixel vertical coordinates of the three sampling heights are determined such that the difference between the pixel vertical coordinates of adjacent two sampling heights is equal, and the difference is defined as the pixel spacing between adjacent sampling heights; respectively, with the pixel vertical coordinates of each sampling height as the center, extend upward and downward in the vertical direction by a preset half-band thickness, to construct three rectangular band regions; For each rectangular band region, the red channel intensity, green channel intensity and blue channel intensity of all pixels in the rectangular band region are counted and divided by the number of pixels in the rectangular band region, to obtain the red channel average, green channel average and blue channel average of the rectangular band region; The log chroma value of each rectangular strip region is calculated, and the calculation process comprises: dividing the average value of the green channel of the rectangular strip region by the sum of the average value of the red channel of the rectangular strip region, the average value of the blue channel of the rectangular strip region and a preset non-zero positive number, to obtain a chroma value; calculating the natural logarithm of the chroma value to obtain the log chroma value; wherein the preset non-zero positive number is 10 -6 ; The chroma curvature index is calculated, which is equal to the logarithmic chroma value corresponding to the first sampling height in ascending order of pixel vertical coordinates, minus twice the logarithmic chroma value corresponding to the second sampling height, plus the logarithmic chroma value corresponding to the third sampling height, divided by the square of the pixel spacing of adjacent sampling heights. 8.The machine vision-based method for detecting quality of a finished inorganic acid product according to claim 7, wherein, The calculated chroma curvature index is compared with a preset threshold value to obtain the quality detection result of the inorganic acid sample to be tested, including: Setting a chroma curvature threshold value; Calculating the absolute value of the chroma curvature index; Comparing the absolute value of the chroma curvature index with the chroma curvature threshold value; If the absolute value of the chroma curvature index is less than or equal to the chroma curvature threshold value, it is determined that the quality detection result of the inorganic acid sample to be tested is qualified; If the absolute value of the chroma curvature index is greater than the chroma curvature threshold value, it is determined that the quality detection result of the inorganic acid sample to be tested is unqualified.