A method and system for identifying metrological detection data based on machine vision
By monitoring the dynamic fluctuation characteristics of liquid level under high-frequency impact and analyzing the effect of liquid viscosity on light reflection, combining the local interference energy density model and generalized fractional Fourier transform, we evaluate the meniscus effect caused by background overlapping effect and surface tension, and solving the problem of insufficient liquid level recognition accuracy in the prior art, achieving higher liquid level metering accuracy and credibility.
Patent Information
- Application Number
- CN202411558059.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-04
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2044-11-04
AI Technical Summary
The prior art does not monitor the unfavorable factors such as complex physical interference during the liquid filling process, resulting in insufficient liquid level recognition accuracy, affecting the accuracy of liquid level metering detection.
By monitoring the dynamic fluctuation characteristics of liquid level under high-frequency impact, analyzing the perturbation of the light reflection path and intensity of liquid viscosity, using local interference energy density model and generalized fractional Fourier transform, we evaluate the meniscus effect caused by background overlapping effect and surface tension, and conduct a comprehensive analysis of the credibility of liquid level metering.
It improves the accuracy and stability of liquid level identification, reduces metering errors caused by changes in the external environment or differences in liquid characteristics, and enhances the credibility of liquid level metering.
Smart Images

Figure CN119037772B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of metrology and detection technology, and more specifically, to a metrology and detection data recognition method and system based on machine vision. Background Art
[0002] In the measurement and detection of liquid filling operations, traditional liquid level detection methods mostly rely on mechanical or contact sensors. Although these methods can provide a certain degree of accuracy, they have significant limitations when facing high-speed filling, non-contact measurement requirements and complex liquid environments. Machine vision technology uses a camera to capture image data in the liquid filling process in real time, and combined with image processing algorithms, it can achieve accurate identification and real-time monitoring of liquid levels.
[0003] However, the existing technology does not accurately monitor adverse factors such as complex physical interference during the liquid filling process, which may cause insufficient liquid level recognition accuracy and affect the accuracy of liquid level measurement and detection.
[0004] In order to solve the above problems, a technical solution is now provided. Summary of the invention
[0005] In order to overcome the above-mentioned defects of the prior art, an embodiment of the present invention provides a method and system for identifying metrological detection data based on machine vision to solve the problems raised in the above-mentioned background technology.
[0006] To achieve the above object, the present invention provides the following technical solutions:
[0007] A method for identifying metrological detection data based on machine vision comprises the following steps:
[0008] By monitoring the dynamic fluctuation characteristics of the liquid level under high-frequency impact, it is determined whether the irregular fluctuation of the liquid surface during the filling process significantly interferes with the liquid level identification;
[0009] When the irregular fluctuation of the liquid surface during the filling process does not significantly interfere with the liquid level recognition, the disturbance of the liquid viscosity on the light reflection path and intensity is analyzed to determine whether there is any abnormality in the influence of the abnormal change of the reflected light on the machine vision recognition accuracy;
[0010] When the abnormal change of reflected light has an abnormal impact on the recognition accuracy of machine vision: analyze the local energy fluctuation of the difference between the background light and the liquid light intensity through the local interference energy density model to evaluate the influence of the background overlapping effect on the recognition accuracy of the liquid edge; perform spectrum analysis on the spatiotemporal fluctuation of the liquid surface tension gradient through the generalized fractional Fourier transform to evaluate the adverse effect of the meniscus effect caused by the surface tension on the recognition accuracy of the liquid level;
[0011] The reliability of liquid level measurement is determined by comprehensively analyzing the influence of background overlay effect on liquid edge recognition accuracy and the adverse effect of meniscus effect caused by surface tension on liquid level recognition accuracy.
[0012] In a preferred embodiment, by monitoring the dynamic fluctuation characteristics of the liquid level under high-frequency impact, it is determined whether the irregular fluctuation of the liquid level during the filling process significantly interferes with the liquid level identification, specifically:
[0013] Real-time image acquisition of the liquid level during the filling process to obtain liquid level image data under high-frequency impact;
[0014] Preprocess the collected liquid level image data to extract liquid level edge features;
[0015] Using the time series analysis method, the displacement change of the liquid level edge in the continuous frames is calculated to obtain the liquid level fluctuation frequency and liquid level fluctuation amplitude;
[0016] Compare the liquid level fluctuation frequency and liquid level fluctuation amplitude with their corresponding preset thresholds to determine whether the irregular liquid surface fluctuations significantly interfere with liquid level identification:
[0017] Set the preset threshold of liquid level fluctuation frequency to , the preset threshold of liquid level fluctuation amplitude is ;
[0018] When the level fluctuation frequency is less than or equal to , and the liquid level fluctuation amplitude is less than or equal to When the irregular fluctuation of the liquid surface does not obviously interfere with the liquid level identification, it is determined that the irregular fluctuation of the liquid surface obviously interferes with the liquid level identification.
[0019] In a preferred embodiment, by analyzing the disturbance of liquid viscosity on the light reflection path and intensity, it is determined whether there is an abnormality in the influence of abnormal changes in reflected light on the machine vision recognition accuracy, specifically:
[0020] Obtaining the light reflection path and the light reflection intensity under different liquid viscosity conditions, and extracting characteristic parameters of the light reflection path and the light reflection intensity respectively;
[0021] Establish a model between liquid viscosity and light reflection disturbance, and analyze the effect of liquid viscosity on the light reflection path and light reflection intensity;
[0022] Based on the effect of liquid viscosity on the light reflection path and light reflection intensity, it is determined whether there is an abnormal change in the reflected light, thereby determining whether there is an abnormal effect of the abnormal change in the reflected light on the machine vision recognition accuracy.
[0023] In a preferred embodiment, the local energy fluctuation of the difference between the background light and the liquid light intensity is analyzed by a local interference energy density model to evaluate the influence of the background overlay effect on the liquid edge recognition accuracy, specifically:
[0024] Calculate the light intensity difference using the formula: ;in, is the difference in light intensity, is the intensity of light reflected by the liquid, is the background light intensity;
[0025] The local energy density is calculated by calculating the square accumulation of the intensity difference: ;in, is the local energy density, It's location The difference in light intensity at and are the start and end time of the time period respectively;
[0026] Establish a local interference energy density model: ;in, is the identification error, is the influence coefficient, is the local energy density, is a constant term;
[0027] Calculate the local energy density for each spatial region and time period;
[0028] According to the local interference energy density model, combined with the energy density of each spatial region, the recognition error of the corresponding region is calculated;
[0029] The recognition errors of each region are accumulated, and appropriate weights are assigned to different regions to calculate the overall error index, which is expressed as: ;in, is the overall error index, It's location The weight of is the identification error of this area.
[0030] In a preferred embodiment, the temporal and spatial fluctuations of the liquid surface tension gradient are spectrally analyzed by generalized fractional Fourier transform to evaluate the adverse effect of the meniscus effect caused by the surface tension on the liquid level recognition accuracy, specifically:
[0031] The tension fluctuation at each time point was compared with the adaptive threshold using an adaptive threshold-based fluctuation capture algorithm;
[0032] The adaptive threshold calculation formula is as follows: ;in, It's time The adaptive threshold at is the tension gradient over time The mean on ; is the adjustment parameter, is the tension gradient over time The standard deviation on ;
[0033] A dual filter is used to analyze tension fluctuations in the low-frequency band and the high-frequency band respectively;
[0034] Calculate the energy focusing degree, the expression is: ;in, is in spatial position The energy focusing degree at Indicates low-frequency tension fluctuations, Indicates high-frequency tension fluctuations, is the radius in the polar coordinate system, is the polar angle;
[0035] The average value of the energy focusing degree of all regions is marked as the energy focusing index.
[0036] In a preferred embodiment, a dual filter is used to analyze the tension fluctuations in the low frequency band and the high frequency band respectively, specifically:
[0037] The separation formula for low frequency is: ;
[0038] The separation formula for high frequency is: .
[0039] In a preferred embodiment, the reliability of liquid level measurement is determined by comprehensively analyzing the influence of the background overlay effect on the liquid edge recognition accuracy and the adverse effect of the meniscus effect caused by surface tension on the liquid level recognition accuracy, specifically:
[0040] The overall error index and the energy focusing index are normalized, and the normalized overall error index and the energy focusing index are respectively assigned weight coefficients to calculate the liquid level measurement credibility index;
[0041] A first measurement trustworthy threshold and a second measurement trustworthy threshold are set, wherein the first measurement trustworthy threshold is less than the second measurement trustworthy threshold;
[0042] When the liquid level measurement credibility index is less than the first threshold value of measurement credibility, it is determined that the liquid level measurement credibility is high;
[0043] When the liquid level measurement credibility index is greater than or equal to the first measurement credibility threshold and less than or equal to the second measurement credibility threshold, it is determined that the liquid level measurement credibility is within the controllable range;
[0044] When the liquid level measurement credibility index is greater than the second measurement credibility threshold, it is determined that the liquid level measurement credibility is low.
[0045] On the other hand, the present invention provides a measurement detection data recognition system based on machine vision, including a liquid level fluctuation monitoring module, a viscosity disturbance analysis module, an energy fluctuation analysis module, a tension gradient analysis module and a liquid level trustworthy judgment module;
[0046] Liquid level fluctuation monitoring module: By monitoring the dynamic fluctuation characteristics of the liquid level under high-frequency impact, it is determined whether the irregular fluctuation of the liquid surface during the filling process significantly interferes with the liquid level identification;
[0047] Viscous disturbance analysis module: When the irregular fluctuation of the liquid surface during the filling process does not significantly interfere with the liquid level recognition, the module analyzes the disturbance of the liquid viscosity on the light reflection path and intensity to determine whether there is any abnormality in the influence of abnormal changes in reflected light on the machine vision recognition accuracy;
[0048] Energy fluctuation analysis module: When the abnormal change of reflected light has an abnormal impact on the recognition accuracy of machine vision, the local energy fluctuation of the difference between the background light and the liquid light intensity is analyzed through the local interference energy density model to evaluate the impact of the background overlapping effect on the recognition accuracy of the liquid edge;
[0049] Tension gradient analysis module: When the abnormal change of reflected light has an abnormal impact on the machine vision recognition accuracy, the generalized fractional Fourier transform is used to perform spectrum analysis on the spatiotemporal fluctuation of the liquid surface tension gradient to evaluate the adverse effect of the meniscus effect caused by the surface tension on the liquid level recognition accuracy;
[0050] Liquid level credibility judgment module: The credibility of liquid level measurement is judged by comprehensively analyzing the influence of background overlapping effect on the accuracy of liquid edge recognition and the adverse effect of meniscus effect caused by surface tension on liquid level recognition accuracy.
[0051] The technical effects and advantages of the method and system for measuring and detecting data recognition based on machine vision of the present invention are as follows:
[0052] 1. By monitoring the dynamic fluctuation characteristics of the liquid level under high-frequency impact, the interference of irregular liquid surface fluctuations on liquid level recognition can be judged in real time, so that the liquid level fluctuations that may cause errors in the filling process can be accurately identified. When the liquid level fluctuates greatly, by detecting the interference of fluctuations on recognition in advance, the metering error caused by dynamic changes in filling is reduced from the source, effectively ensuring the stability of the recognition system. In the case of small fluctuations, continuing to analyze the disturbance of the light reflection path and intensity can further judge the accuracy of the machine vision system and avoid recognition deviations caused by abnormal reflected light.
[0053] 2. By analyzing the background overlap effect and the meniscus effect caused by surface tension, the accuracy of liquid level recognition is further improved. The local interference energy density model and generalized fractional Fourier transform are used to conduct in-depth analysis of the spatiotemporal spectrum of liquid surface tension fluctuations, which can accurately capture the subtle changes in light reflection and the influence of liquid surface curvature on liquid level recognition during the recognition process. By comprehensively analyzing these influencing factors, the credibility of liquid level measurement can be effectively evaluated, and compensation measures can be taken in a timely manner. This multi-level, multi-angle dynamic evaluation method greatly improves the accuracy of liquid level measurement and reduces measurement errors caused by changes in the external environment or differences in liquid characteristics. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 A schematic diagram of a method for identifying metrological detection data based on machine vision according to the present invention;
[0055] Figure 2 The present invention is a schematic structural diagram of a metrology detection data recognition system based on machine vision. DETAILED DESCRIPTION
[0056] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0057] Example 1
[0058] Figure 1 The present invention provides a method for identifying metrological detection data based on machine vision, which comprises the following steps:
[0059] By monitoring the dynamic fluctuation characteristics of the liquid level under high-frequency impact, it is determined whether the irregular fluctuation of the liquid surface during the filling process significantly interferes with the liquid level identification.
[0060] When irregular fluctuations in the liquid surface during the filling process do not significantly interfere with liquid level recognition, the effect of the liquid viscosity on the light reflection path and intensity is analyzed to determine whether there is any abnormality in the impact of abnormal changes in reflected light on the machine vision recognition accuracy.
[0061] When the abnormal change of reflected light has an abnormal impact on the machine vision recognition accuracy: the local energy fluctuation of the difference between the background light and the liquid light intensity is analyzed through the local interference energy density model to evaluate the influence of the background overlay effect on the liquid edge recognition accuracy; the spatiotemporal fluctuation of the liquid surface tension gradient is spectrally analyzed through the generalized fractional Fourier transform to evaluate the adverse effect of the meniscus effect caused by the surface tension on the liquid level recognition accuracy.
[0062] The reliability of liquid level measurement is determined by comprehensively analyzing the influence of background overlay effect on liquid edge recognition accuracy and the adverse effect of meniscus effect caused by surface tension on liquid level recognition accuracy.
[0063] Liquid level under high-frequency impact refers to the rapid and frequent fluctuations on the liquid surface during the filling process due to factors such as high-speed liquid flow, mechanical vibration or external disturbance. These fluctuations are usually manifested as the liquid surface fluctuating violently up and down in a short period of time, forming high-frequency dynamic changes. Liquid level fluctuations under high-frequency impact have a significant interference with the machine vision liquid level recognition system, which may lead to a decrease in recognition accuracy.
[0064] By monitoring the dynamic fluctuation characteristics of the liquid level under high-frequency impact, it is determined whether the irregular fluctuation of the liquid surface during the filling process significantly interferes with the liquid level identification. Specifically:
[0065] Real-time image acquisition of the liquid level during the filling process is performed to obtain liquid level image data under high-frequency impact:
[0066] During the filling process, a high-speed camera is set up to collect real-time images of the liquid level and capture the image data of the liquid level under high-frequency impact. The frame rate of the high-speed camera should be adjusted according to the fluctuation characteristics of the liquid and the filling speed to ensure that every detail of the liquid level during high-speed fluctuation can be accurately captured.
[0067] The collected liquid level image data consists of multiple frames of continuous images, and each frame corresponds to the liquid level state at a moment.
[0068] Preprocess the collected liquid level image data to extract clear liquid level edge features:
[0069] Image preprocessing mainly includes steps such as denoising, image enhancement and edge detection.
[0070] De-noising the image. Common noise sources may come from the internal noise of the equipment, interference from ambient light, etc. In order to eliminate these noises, a Gaussian filter or a median filter can be used to smooth the image using convolution operations to reduce the interference of noise on edge recognition. The denoised image should be clearer and can accurately reflect the contour of the liquid level.
[0071] Image enhancement algorithms are used to improve image contrast and brightness, making the liquid level edge more obvious in the image. For images with low brightness or unclear contrast, enhancement algorithms such as histogram equalization can effectively improve the visibility of the edge.
[0072] Apply edge detection algorithms (such as Canny algorithm or Sobel operator) to detect the liquid level edge in the image. By calculating the grayscale changes in the image, the edge detection algorithm can locate the exact position of the liquid level, thereby generating clear liquid level edge features.
[0073] Using the time series analysis method, the displacement change of the liquid level edge in the continuous frames is calculated to obtain the liquid level fluctuation frequency and liquid level fluctuation amplitude:
[0074] The vertical height of the liquid level edge is continuously acquired based on the liquid level image data.
[0075] Calculate the change in liquid level height, which is the absolute value of the current liquid level minus the liquid level height in the previous frame.
[0076] By calculating the height changes between consecutive frames, the displacement sequence of liquid level fluctuations is obtained.
[0077] By analyzing the displacement sequence of liquid level fluctuation, the frequency and amplitude of liquid level fluctuation are calculated.
[0078] The liquid level fluctuation frequency can be obtained by analyzing the periodic changes of the liquid level displacement sequence, that is, the liquid level fluctuation frequency is the inverse of the period of the liquid surface fluctuation.
[0079] The liquid level fluctuation amplitude is represented by the difference between the maximum and minimum liquid level heights, that is, the liquid level fluctuation amplitude is the difference between the maximum height of the liquid level in the time series and the minimum height of the liquid level in the time series.
[0080] Compare the liquid level fluctuation frequency and liquid level fluctuation amplitude with their corresponding preset thresholds to determine whether the irregular liquid surface fluctuations significantly interfere with liquid level identification:
[0081] Set the preset threshold of liquid level fluctuation frequency to , the preset threshold of liquid level fluctuation amplitude is , the following conditions are used to determine whether the liquid level fluctuation significantly interferes with liquid level identification:
[0082] When the level fluctuation frequency is greater than When , it means that the liquid level fluctuation frequency exceeds the allowable range, which may interfere with liquid level identification.
[0083] When the liquid level fluctuation is greater than When , it means that the liquid level fluctuation amplitude exceeds the allowable range, which may affect the liquid level identification.
[0084] When the level fluctuation frequency is less than or equal to , and the liquid level fluctuation amplitude is less than or equal to When the irregular fluctuation of the liquid surface does not obviously interfere with the liquid level identification, it is determined that the irregular fluctuation of the liquid surface obviously interferes with the liquid level identification.
[0085] When irregular fluctuations in the liquid level significantly interfere with liquid level identification, the following measures can be taken:
[0086] Introducing dynamic filtering algorithm: By applying a low-pass filter during the recognition process, the interference caused by high-frequency fluctuations can be eliminated, especially when the filling speed is fast, which can effectively smooth the liquid level fluctuation data and enhance the stability of recognition.
[0087] Increase the frame rate and optimize the data acquisition frequency: Increasing the acquisition frame rate of the camera can capture more subtle liquid level fluctuations and reduce the recognition deviation caused by short-term and drastic fluctuations in the liquid level. At the same time, optimizing the acquisition frequency enables the system to track and adjust the liquid level fluctuations in real time.
[0088] Optimize recognition algorithm: Adjust the liquid level recognition algorithm to increase tolerance to liquid level fluctuations. For example, use time series analysis or prediction models to estimate liquid level trends, thereby reducing the impact of irregular fluctuations on real-time recognition.
[0089] Among them, the preset thresholds of the liquid level fluctuation frequency and the preset thresholds of the liquid level fluctuation amplitude are usually set according to the actual filling process and liquid characteristics through experimental data. The preset threshold of the liquid level fluctuation frequency can be determined by monitoring the liquid level fluctuation frequency under normal filling conditions and analyzing historical data to determine a maximum allowable frequency that does not affect recognition. The preset threshold of the liquid level fluctuation amplitude measures the maximum height variation range of normal liquid level fluctuations to ensure that the liquid level does not affect the accurate recognition of the machine vision system within the allowable fluctuation range. These two thresholds need to be flexibly adjusted according to factors such as the physical properties of different liquids (such as viscosity, density) and filling speed to ensure the accuracy of the recognition system.
[0090] By analyzing the disturbance of liquid viscosity on the light reflection path and intensity, it is determined whether there is any abnormality in the impact of abnormal changes in reflected light on the machine vision recognition accuracy, specifically:
[0091] Obtain the light reflection path and light reflection intensity under different liquid viscosity conditions, and extract the characteristic parameters of the light reflection path and light reflection intensity respectively:
[0092] Under different liquid viscosity conditions, high-precision optical sensors and cameras are used to collect the path and intensity of light reflection. The experiment needs to test liquids of different viscosities and record the changes in the light reflection path and intensity under each liquid viscosity condition. The collected data will be used for subsequent analysis.
[0093] The data is preprocessed to extract the characteristic parameters of the light reflection path and the light reflection intensity. The characteristics of the light reflection path are described by the curvature change of the reflection path, and the characteristics of the reflected light intensity are extracted by frequency domain analysis.
[0094] The curvature of the light reflection path is calculated as follows: ;in, is the curvature of the light reflection path, which indicates the degree of change of the light reflection path; is the liquid viscosity; It’s time; and are the velocity components of the reflection path in the horizontal and vertical directions, respectively, indicating the changing speed of the reflection path; and are the acceleration components of the reflection path in the horizontal and vertical directions, respectively, indicating the acceleration change of the reflection path.
[0095] The formula for the curvature of the light reflection path calculates the curvature of the reflection path through the velocity and acceleration components, thereby extracting the characteristics of the light reflection path.
[0096] The spectral characteristics of the reflected light intensity are calculated by Fourier transform, and the formula is as follows: ;in, It is the frequency domain conversion result of the reflected light intensity, indicating the distribution of light intensity at different frequencies; is the intensity of reflected light, which varies with time and the viscosity of the liquid; is the frequency; It is the imaginary unit, used to represent the imaginary part of a complex number; It is pi.
[0097] Through Fourier transform, the light intensity signal can be converted from the time domain to the frequency domain to analyze the frequency characteristics of the light intensity change.
[0098] A model between liquid viscosity and light reflection disturbance is established to analyze the effect of liquid viscosity on the light reflection path and light reflection intensity:
[0099] The relationship between the change in reflection path and viscosity is described by a sine function, and the relationship between the change in reflection intensity and viscosity is described by a cosine function.
[0100] The model formula for the curvature of the light reflection path is as follows: ;in, It is the influence function of liquid viscosity on the curvature change amplitude, indicating the regulation of curvature by different liquid viscosities; It is the cycle of fluctuation; is the phase shift, indicating the initial phase of the fluctuation; is a constant term.
[0101] The perturbation model of the reflected light intensity is as follows: ;in, It is the function of the effect of liquid viscosity on the amplitude of the light intensity spectrum, indicating the regulation of light intensity by different liquid viscosities; is the phase shift; is a constant term.
[0102] Function of the effect of liquid viscosity on the amplitude of light intensity spectrum: It shows how the change of liquid viscosity affects the amplitude change of light reflection intensity in the frequency domain. The greater the viscosity of the liquid, the smaller the disturbance amplitude of the reflected light may be, and the change of spectrum amplitude will also be reduced accordingly. This function is fitted by experimental data to describe the regulation of light intensity change by different viscosities.
[0103] Function of the influence of liquid viscosity on the curvature change amplitude: It represents the influence of liquid viscosity on the curvature change of the light reflection path. The greater the viscosity of the liquid, the smaller the fluctuation of the reflection path is usually, and the curvature change amplitude is lower. This function fits the relationship between viscosity and curvature change amplitude by analyzing the actual influence of liquids with different viscosities on the reflection path.
[0104] Based on the effect of liquid viscosity on the light reflection path and light reflection intensity, determine whether there is an abnormal change in reflected light, and thus determine whether there is an abnormal effect on the machine vision recognition accuracy:
[0105] If the curvature change of the light reflection path exceeds its corresponding preset threshold, it is determined that an abnormality occurs in the reflection path.
[0106] If the frequency spectrum change of the reflected light intensity exceeds its corresponding preset threshold, it is determined that the reflected light intensity is abnormal.
[0107] When an abnormality occurs in the reflection path or an abnormality occurs in the intensity of the reflected light, it is determined that there is an abnormality in the impact of the abnormal change in the reflected light on the accuracy of machine vision recognition.
[0108] Among them, the preset threshold corresponding to the curvature threshold of the light reflection path is calculated by performing a large number of tests on the normal reflection path of liquids at different viscosities, and the maximum allowable range of curvature change is calculated to ensure that the recognition accuracy is not affected within this range. The preset threshold corresponding to the spectrum change of the reflected light intensity is determined by analyzing the spectrum distribution of the normal reflected light intensity to determine the maximum allowable spectrum change range. The thresholds of both need to be adjusted in combination with the error tolerance of the machine vision system and the characteristics of the liquid to ensure the stability and accuracy of the recognition system.
[0109] The influence of abnormal changes in reflected light on the recognition accuracy of machine vision is determined by analyzing the disturbance of liquid viscosity on the reflection path and intensity of light, mainly because liquid viscosity directly affects the smoothness and stability of the liquid surface. When the viscosity is high, the liquid surface is relatively stable, and the reflection path and intensity of light change less; when the viscosity is low, the liquid surface is easily affected by fluctuations, resulting in the deviation of the light reflection path and drastic changes in intensity, which may cause the machine vision system to recognize the liquid level. When this analysis finds that the abnormal changes in reflected light have a significant impact on the recognition accuracy, it is necessary to further evaluate the background overlap effect and the meniscus effect caused by surface tension, because these two effects are usually obvious when the surface state of the liquid is disturbed. Liquid viscosity not only affects light reflection, but also affects surface tension, which in turn aggravates the interference of the meniscus effect and background overlap effect on the recognition accuracy.
[0110] The local energy fluctuation of the difference between the background light and the liquid light intensity is analyzed by the local interference energy density model to evaluate the influence of the background overlapping effect on the liquid edge recognition accuracy. Specifically:
[0111] During the filling process, background light will form a superposition effect on the liquid surface, affecting the machine vision system's accurate recognition of the liquid edge. Therefore, the optical sensor needs to record the light intensity difference data between the background light and the liquid light reflection in real time. This data will be used for subsequent energy fluctuation analysis.
[0112] The intensity difference between background light and liquid reflected light is collected in real time.
[0113] Calculate the light intensity difference using the formula: ;in, is the difference in light intensity, indicating time The difference between the liquid reflected light intensity and the background light intensity; It is the intensity of light reflected by the liquid; is the background light intensity.
[0114] The local energy density is obtained by calculating the square accumulation of the light intensity difference. The local energy density can be expressed by the following formula: ;in, is the local energy density, indicating the time interval from arrive Inside, Location Energy fluctuations at It's location The difference in light intensity at and The start and end time of the time period respectively.
[0115] Through the local energy density, the energy fluctuation of light intensity difference in the local spatial area can be evaluated, reflecting the dynamic characteristics of light intensity changes.
[0116] In order to analyze the influence of local energy fluctuation on the accuracy of liquid edge recognition, a local interference energy density model is established to quantify the relationship between energy fluctuation and recognition error. The local interference energy density model is as follows: ;in, is the recognition error, indicating the position The influence of the liquid edge recognition accuracy; is the influence coefficient, which indicates the influence intensity of local energy density on the recognition error; is the local energy density, which indicates the local energy change due to light intensity fluctuations; is a constant term, which indicates the basic interference degree.
[0117] The influence of local energy fluctuation on liquid edge recognition error can be calculated through the local interference energy density model.
[0118] Based on the local interference energy density model, the influence of background overlapping effect on liquid edge recognition is quantitatively evaluated. The specific quantification method is as follows:
[0119] Calculate the local energy density for each spatial region and time period.
[0120] According to the local interference energy density model, combined with the energy density of each spatial region, the recognition error of the corresponding area is calculated.
[0121] The recognition errors in different regions and time points are compared. Regions with larger errors indicate larger differences in light intensity and more obvious background overlap effects, which affect the accurate recognition of the liquid edge.
[0122] In order to quantify the impact of the background overlay effect on the recognition accuracy of the entire liquid edge, the recognition errors of each area are accumulated, and appropriate weights are assigned to different areas to calculate the overall error index, which is expressed as: ;in, is the overall error index, which is used to evaluate the impact of background overlap effect on the overall liquid edge recognition accuracy; It's location The weight at the position is used to indicate that some areas have a greater impact on the overall recognition accuracy; is the identification error of the region; is the cumulative sum over all spatial regions.
[0123] The larger the overall error index, the more serious the impact of the background overlap effect on the liquid edge recognition accuracy. This means that the recognition error accumulates in multiple spatial regions, and the difference between the background light and the liquid light significantly interferes with the accurate recognition of the machine vision system, resulting in a decrease in recognition accuracy. The negative impact of the background overlap effect on recognition is stronger.
[0124] The spectral analysis of the spatiotemporal fluctuation of the liquid surface tension gradient is performed by generalized fractional Fourier transform to evaluate the adverse effects of the meniscus effect caused by surface tension on the liquid level recognition accuracy. Specifically:
[0125] The fluctuation of liquid surface tension will show complex temporal and spatial changes during the filling process, especially at the edge of the container. The contact between the liquid and the container wall will form an obvious meniscus effect, which further affects the shape of the liquid surface.
[0126] The use of an adaptive threshold-based fluctuation capture algorithm can more sensitively identify nonlinear fluctuations in the liquid surface tension gradient. By comparing the tension fluctuation at each time point with the adaptive threshold, those fluctuations that significantly deviate from the threshold are captured to evaluate key changes in the liquid surface tension gradient.
[0127] The adaptive threshold calculation formula is as follows: ;in, It's time Adaptive threshold when is the tension gradient over time The mean on ; is the adjustment parameter, indicating sensitivity; is the tension gradient over time This formula can dynamically adjust the threshold to adapt to the nonlinear fluctuation of tension.
[0128] After capturing the significant fluctuations in the liquid surface tension gradient, the frequency of the liquid surface tension fluctuations is analyzed in layers through a multidimensional analysis model of time and space frequency. Tension fluctuations of different frequencies may affect the recognition accuracy of the liquid level to varying degrees. A dual filter is used to analyze the tension fluctuations in the low-frequency band and the high-frequency band respectively. Low-frequency fluctuations usually mean that the liquid surface is more stable, while high-frequency fluctuations indicate rapid changes in the liquid surface, which can easily interfere with machine vision detection.
[0129] The separation formula for low frequency is: ;
[0130] The separation formula for high frequency is: .
[0131] in, Indicates low-frequency tension fluctuations, Indicates high-frequency tension fluctuations; It is the critical point of frequency, which is set experimentally to distinguish low-frequency and high-frequency components; is the tension gradient, is the radius in the polar coordinate system, representing the position of the liquid surface from the center of the container to the container wall; It is the polar angle, which indicates the angular change of the liquid surface.
[0132] After separating the low-frequency and high-frequency components, it is necessary to analyze the impact of tension fluctuations in different frequency bands on liquid level recognition. Low-frequency fluctuations will form a relatively stable meniscus effect, while high-frequency fluctuations will increase the irregular changes in the liquid surface. Therefore, an energy focusing index is defined to calculate the energy distribution of tension fluctuations, and based on the fluctuation amplitude of each frequency band, the degree of interference with liquid level recognition is quantified.
[0133] Calculate the energy focusing degree, the expression is: ;in, is in spatial position The energy focusing degree at the point reflects the overall energy of the liquid surface tension fluctuation.
[0134] A greater energy focus usually means that the energy of the tension fluctuation is more concentrated, the meniscus effect is more significant, the potential interference to the accuracy of liquid level recognition is stronger, the liquid surface shows a larger tension fluctuation amplitude in this area, and the liquid surface position detected by the system may be more unstable. Therefore, a greater energy focus usually indicates an increased risk of liquid level recognition error.
[0135] The average value of the energy focusing degree of all regions is marked as the energy focusing index. The larger the energy focusing index, the more significant the adverse effect of the meniscus effect caused by surface tension on the liquid level recognition accuracy, which means that in each region, the liquid surface tension fluctuates more violently, the energy concentration is higher, and the meniscus effect interferes more with the liquid level recognition. This may lead to unstable liquid surface and blurred recognition boundaries, thereby increasing the recognition error. Therefore, as the energy focusing index increases, the interference risk faced by the liquid level recognition system also increases, and the possibility of reduced recognition accuracy is higher.
[0136] The reliability of liquid level measurement is determined by comprehensively analyzing the influence of the background overlapping effect on the liquid edge recognition accuracy and the adverse effect of the meniscus effect caused by surface tension on the liquid level recognition accuracy. Specifically:
[0137] The overall error index and energy focusing index are normalized, and weight coefficients are assigned to the normalized overall error index and energy focusing index respectively, and the liquid level measurement credibility index is calculated.
[0138] The specific implementation method of calculating the liquid level measurement credibility index mentioned above is not specifically limited here. Any method that can calculate the liquid level measurement credibility index by respectively weighting the normalized overall error index and energy focusing index can be used. In order to implement the technical solution of the present invention, the present invention provides a specific method for calculating the liquid level measurement credibility index.
[0139] The expression of liquid level measurement reliability index is: ;in, It is the reliability index of liquid level measurement. is the overall error index, is the energy focusing index, and are the weight coefficients of the overall error index and the energy focusing index, respectively, and and Both are greater than 0.
[0140] The liquid level measurement credibility index is a comprehensive analysis based on the overall error index of the background overlay effect and the energy focusing index of the meniscus effect caused by surface tension. The larger the overall error index and the energy focusing index, the more interference the liquid level recognition system is subject to and the greater the recognition error. Therefore, the larger the liquid level measurement credibility index is, the lower the credibility of the liquid level measurement is.
[0141] The first threshold of measurement reliability and the second threshold of measurement reliability are set, and the first threshold of measurement reliability is smaller than the second threshold of measurement reliability:
[0142] The setting of the first threshold of metrological credibility and the second threshold of metrological credibility can be adjusted according to the actual recognition error range of the system. Generally speaking, the first threshold of metrological credibility is set in the range when the recognition error is small. For example, through experimental data, it is found that the system performance is stable when the error is less than 0.5%, and the first threshold can be set to 0.5. The second threshold of metrological credibility is set in the range where the system recognition error is significantly increased but still acceptable, such as 1.5%, so as to ensure that the system can trigger compensation measures when the error exceeds 1.5%.
[0143] When the liquid level measurement credibility index is less than the first measurement credibility threshold, the liquid level measurement credibility is determined to be high, which means that the liquid level recognition error is small and the liquid level measurement credibility is high, indicating that the system works normally and the recognition accuracy is within the ideal range.
[0144] When the liquid level measurement credibility index is greater than or equal to the first measurement credibility threshold and less than or equal to the second measurement credibility threshold, the liquid level measurement credibility is judged to be within the controllable range. At this time, it means that the liquid level recognition accuracy is affected by some background overlapping effects and liquid surface tension fluctuations, but it is generally controllable and the recognition error is in a medium range. At this time, slight optimization can be performed, including adjusting the camera angle, optimizing the parameters of the recognition algorithm, and adding filtering processing to reduce background light interference and liquid fluctuations.
[0145] When the liquid level measurement credibility index is greater than the second threshold value of the measurement credibility, the liquid level measurement credibility is judged to be low. At this time, it means that the liquid level recognition accuracy error has increased significantly, indicating that the background overlap effect and surface tension have a significant impact on the liquid level measurement, the recognition accuracy has decreased, and the system credibility is low. When it is judged that the liquid level measurement credibility is low, the following measures can be taken:
[0146] Introduce a compensation algorithm for liquid surface tension to reduce the meniscus effect: Dynamically adjust the edge detection parameters in the recognition algorithm to reduce the impact of liquid surface curvature on liquid level recognition accuracy, thereby improving the measurement reliability of the system.
[0147] Adjust the light source and add filters to reduce background light interference: By adjusting the angle and intensity of the light source, the light reflected from the liquid surface can be more uniform, reducing the impact of the overlapping effect. At the same time, adding optical filters can effectively filter out unnecessary background light interference, making the signal received by the camera clearer, thereby improving the stability and accuracy of recognition.
[0148] Reset system parameters and verify the recognition process multiple times: Resetting system parameters includes adjusting key parameters such as camera position and recognition algorithm threshold. At the same time, the accuracy of the recognition results must be verified through multiple tests to ensure that the system can maintain stable measurement accuracy under various conditions, thereby restoring the credibility of liquid level measurement.
[0149] Example 2
[0150] The difference between Example 2 of the present invention and Example 1 is that this example introduces a metrology detection data recognition system based on machine vision.
[0151] Figure 2 A structural schematic diagram of a metrology detection data recognition system based on machine vision of the present invention is given, which includes a liquid level fluctuation monitoring module, a viscous disturbance analysis module, an energy fluctuation analysis module, a tension gradient analysis module and a liquid level credible judgment module.
[0152] Liquid level fluctuation monitoring module: By monitoring the dynamic fluctuation characteristics of the liquid level under high-frequency impact, it is determined whether the irregular fluctuation of the liquid surface during the filling process significantly interferes with the liquid level identification.
[0153] Viscous disturbance analysis module: When irregular fluctuations in the liquid surface during the filling process do not significantly interfere with liquid level recognition, the module analyzes the disturbance of the liquid viscosity on the light reflection path and intensity to determine whether there is any abnormality in the impact of abnormal changes in reflected light on the machine vision recognition accuracy.
[0154] Energy fluctuation analysis module: When the abnormal change of reflected light has an abnormal impact on the recognition accuracy of machine vision, the local energy fluctuation of the difference between the background light and the liquid light intensity is analyzed through the local interference energy density model to evaluate the impact of the background overlapping effect on the recognition accuracy of the liquid edge;
[0155] Tension gradient analysis module: When there is an abnormal effect of abnormal changes in reflected light on the machine vision recognition accuracy, the spatiotemporal fluctuations of the liquid surface tension gradient are spectrally analyzed through generalized fractional Fourier transform to evaluate the adverse effects of the meniscus effect caused by surface tension on the liquid level recognition accuracy.
[0156] Liquid level credibility judgment module: The credibility of liquid level measurement is judged by comprehensively analyzing the influence of background overlapping effect on the accuracy of liquid edge recognition and the adverse effect of meniscus effect caused by surface tension on liquid level recognition accuracy.
[0157] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters and thresholds in the formula are set by technicians in this field according to actual conditions.
[0158] The above embodiments may be implemented in whole or in part by software, hardware, firmware or any other combination thereof. When implemented by software, the above embodiments may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or may be transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media sets. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium. The semiconductor medium may be a solid-state hard disk.
[0159] Those of ordinary skill in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0160] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and modules described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0161] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0162] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, and may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0163] In addition, each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.
[0164] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program codes.
[0165] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0166] Finally: The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for identifying metrological detection data based on machine vision, characterized in that: The steps include: By monitoring the dynamic fluctuation characteristics of the liquid level under high-frequency impact, it is determined whether the irregular fluctuation of the liquid surface during the filling process significantly interferes with the liquid level identification. Specifically: Real-time image acquisition of the liquid level during the filling process to obtain liquid level image data under high-frequency impact; Preprocess the collected liquid level image data to extract liquid level edge features; Using the time series analysis method, the displacement change of the liquid level edge in the continuous frames is calculated to obtain the liquid level fluctuation frequency and liquid level fluctuation amplitude; Compare the liquid level fluctuation frequency and liquid level fluctuation amplitude with their corresponding preset thresholds to determine whether the irregular liquid surface fluctuations significantly interfere with liquid level identification: Set the preset threshold of liquid level fluctuation frequency to , the preset threshold of liquid level fluctuation amplitude is ; When the level fluctuation frequency is less than or equal to , and the liquid level fluctuation amplitude is less than or equal to When , it is determined that the irregular fluctuation of the liquid level does not obviously interfere with the liquid level identification; Otherwise, it is determined that the irregular fluctuation of the liquid level obviously interferes with the liquid level identification; When the irregular fluctuation of the liquid surface during the filling process does not significantly interfere with the liquid level recognition, the influence of the abnormal change of the reflected light on the machine vision recognition accuracy is judged by analyzing the disturbance of the liquid viscosity on the light reflection path and intensity. Specifically: Obtaining the light reflection path and the light reflection intensity under different liquid viscosity conditions, and extracting characteristic parameters of the light reflection path and the light reflection intensity respectively; Establish a model between liquid viscosity and light reflection disturbance, and analyze the effect of liquid viscosity on the light reflection path and light reflection intensity; Based on the influence of liquid viscosity on the light reflection path and light reflection intensity, it is determined whether there is an abnormal change in reflected light, so as to determine whether there is an abnormality in the influence of the abnormal change in reflected light on the machine vision recognition accuracy; When the abnormal change of reflected light has an abnormal impact on the recognition accuracy of machine vision: the local energy fluctuation of the difference between the background light and the liquid light intensity is analyzed through the local interference energy density model to evaluate the impact of the background overlapping effect on the recognition accuracy of the liquid edge, specifically: Calculate the light intensity difference using the formula: ;in, is the difference in light intensity, is the intensity of light reflected by the liquid, is the background light intensity; The local energy density is calculated by calculating the square accumulation of the intensity difference: ;in, is the local energy density, It's location The difference in light intensity at and are the start and end time of the time period respectively; Establish a local interference energy density model: ;in, is the identification error, is the influence coefficient, is the local energy density, is a constant term; Calculate the local energy density for each spatial region and time period; According to the local interference energy density model, combined with the energy density of each spatial region, the recognition error of the corresponding region is calculated; The recognition errors of each region are accumulated, and appropriate weights are assigned to different regions to calculate the overall error index, which is expressed as: ;in, is the overall error index, It's location The weight of is the identification error of the region; The spectral analysis of the spatiotemporal fluctuations of the liquid surface tension gradient is performed by generalized fractional Fourier transform to evaluate the adverse effects of the meniscus effect caused by surface tension on the liquid level recognition accuracy. Specifically: The tension fluctuation at each time point was compared with an adaptive threshold using an adaptive threshold-based fluctuation capture algorithm; The adaptive threshold calculation formula is as follows: ;in, It's time The adaptive threshold at is the tension gradient over time The mean on ; is the adjustment parameter, is the tension gradient over time The standard deviation on ; A dual filter is used to analyze tension fluctuations in the low-frequency band and the high-frequency band respectively; Calculate the energy focusing degree, the expression is: ;in, is in spatial position The energy focusing degree at Indicates low-frequency tension fluctuations, Indicates high-frequency tension fluctuations, is the radius in the polar coordinate system, is the polar angle; The average value of the energy focusing degree of all regions is labeled as the energy focusing index; The reliability of liquid level measurement is determined by comprehensively analyzing the influence of the background overlapping effect on the liquid edge recognition accuracy and the adverse effect of the meniscus effect caused by surface tension on the liquid level recognition accuracy. Specifically: The overall error index and the energy focusing index are normalized, and the normalized overall error index and the energy focusing index are respectively assigned weight coefficients to calculate the liquid level measurement credibility index; A first measurement trustworthy threshold and a second measurement trustworthy threshold are set, wherein the first measurement trustworthy threshold is less than the second measurement trustworthy threshold; When the liquid level measurement credibility index is less than the first threshold value of measurement credibility, it is determined that the liquid level measurement credibility is high; When the liquid level measurement credibility index is greater than or equal to the first measurement credibility threshold and less than or equal to the second measurement credibility threshold, it is determined that the liquid level measurement credibility is within the controllable range; When the liquid level measurement credibility index is greater than the second measurement credibility threshold, it is determined that the liquid level measurement credibility is low.
2. The method for identifying metrological detection data based on machine vision according to claim 1, characterized in that: Use dual filters to analyze tension fluctuations in the low-frequency band and high-frequency band respectively, specifically: The separation formula for low frequency is: ; The separation formula for high frequency is: .
3. A metrology detection data recognition system based on machine vision, used to implement a metrology detection data recognition method based on machine vision according to any one of claims 1-2, characterized in that: It includes liquid level fluctuation monitoring module, viscous disturbance analysis module, energy fluctuation analysis module, tension gradient analysis module and liquid level trustworthy judgment module; Liquid level fluctuation monitoring module: By monitoring the dynamic fluctuation characteristics of the liquid level under high-frequency impact, it is determined whether the irregular fluctuation of the liquid surface during the filling process significantly interferes with the liquid level identification; Viscous disturbance analysis module: When the irregular fluctuation of the liquid surface during the filling process does not significantly interfere with the liquid level recognition, the module analyzes the disturbance of the liquid viscosity on the light reflection path and intensity to determine whether there is any abnormality in the influence of abnormal changes in reflected light on the machine vision recognition accuracy; Energy fluctuation analysis module: When the abnormal change of reflected light has an abnormal impact on the recognition accuracy of machine vision, the local energy fluctuation of the difference between the background light and the liquid light intensity is analyzed through the local interference energy density model to evaluate the impact of the background overlapping effect on the recognition accuracy of the liquid edge; Tension gradient analysis module: When the abnormal change of reflected light has an abnormal impact on the machine vision recognition accuracy, the generalized fractional Fourier transform is used to perform spectrum analysis on the spatiotemporal fluctuation of the liquid surface tension gradient to evaluate the adverse effect of the meniscus effect caused by the surface tension on the liquid level recognition accuracy; Liquid level credibility judgment module: The credibility of liquid level measurement is judged by comprehensively analyzing the influence of background overlapping effect on the accuracy of liquid edge recognition and the adverse effect of meniscus effect caused by surface tension on liquid level recognition accuracy.
Citation Information
Patent Citations
Glass liquid level meter identification method and system based on machine vision
CN113052178A
Liquid level detection method
CN116399424A