Intelligent visual measurement and control analysis system for resin separation interface
By using a nonlinear mapping model that combines image acquisition, HSV color space transformation, and Snell's law compensation, the problem of depth error in resin separation interface monitoring was solved, and high-precision automated control of the resin regeneration process was achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-11
- Publication Date
- 2026-04-07
AI Technical Summary
Existing technologies for monitoring resin separation interfaces suffer from strong human subjectivity and the inability of conventional visual inspection to eliminate edge depth errors caused by refraction of multiple media, thus failing to meet the requirements of high-precision industrial control.
The image acquisition module is used for preprocessing. HSV color space transformation and hierarchical semantic segmentation technology are used to accurately locate interface features. Combined with the light path refraction compensation mechanism of Snell's law, a nonlinear mapping model is constructed to generate high-precision physical height data. Closed-loop automatic control is achieved through PID control strategy.
It achieves high-precision monitoring of the resin separation interface under complex lighting and window contamination environments, ensuring precise automated control of the resin regeneration process and meeting the high-precision requirements of industrial sites.
Smart Images

Figure CN121810700A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of industrial control technology, and more specifically, to an intelligent visual measurement and control analysis system for resin separation interfaces. Background Technology
[0002] In ion exchange resin regeneration processes in industries such as power plant water treatment, chemical engineering, and pharmaceuticals, the separation effect of anion and cation exchange resins directly determines the regeneration quality and subsequent water production efficiency. Real-time and accurate monitoring of the resin separation interface (i.e., the boundary between the anion and cation exchange resin layers) is a core element for achieving automated regeneration control. Traditional monitoring methods mainly rely on manual visual observation through a viewing window. This method is not only labor-intensive and heavily influenced by subjective factors, but also cannot achieve continuous real-time monitoring, failing to meet the demands of modern industry for refined production process management. Although differential pressure transmitters or conductive / capacitive probes have been introduced for auxiliary detection in some fields, differential pressure methods are highly susceptible to resin density fluctuations and bubble interference, while contact probes face the problem of decreased sensitivity due to resin scaling and contamination. Furthermore, these instruments can only provide single-point or discrete liquid level information, failing to fully represent the dynamic changes at the interface.
[0003] With the development of machine vision technology, camera-based non-contact monitoring solutions have begun to be applied in this field. However, existing conventional visual inspection solutions typically only perform simple grayscale binarization or edge detection on images, and when establishing the mapping relationship between pixels and physical height, they often rely on simplified perspective transformation models (such as homography matrices), assuming that light travels in a straight line in a single homogeneous medium. But in the actual resin separation tank scenario, light must pass through air, a pressure-resistant window glass of considerable thickness, and a mixture of resin and water in sequence, which is a typical multi-layered medium optical environment. Due to the thickness of the window glass and the significant differences in refractive indices of the various media, the light will be deflected according to Snell's law, and the lateral displacement caused by this refraction increases non-linearly with the increase of the incident angle. Existing linear mapping methods cannot eliminate the depth error caused by physical refraction, resulting in a significant decrease in measurement accuracy in the window edge area, which cannot meet the high-precision industrial control requirements. In addition, the complex lighting environment of the industrial site, water mist and stains on the window surface, and batch differences in resin color also make it difficult for traditional simple image processing algorithms based on RGB space to obtain stable recognition results.
[0004] Therefore, an optimized intelligent visual measurement and control analysis system for resin separation interfaces is desired. Summary of the Invention
[0005] To address the aforementioned technical problems, this application is proposed. Embodiments of this application provide an intelligent visual measurement and control analysis system for resin separation interfaces.
[0006] According to one aspect of this application, an intelligent visual measurement and control analysis system for resin separation interfaces is provided, comprising: an image acquisition module, used to respond to a system start command and control an image acquisition device to acquire images from the resin separation tank window based on preset configuration parameters to obtain an original source image; a hue and saturation component extraction module, used to preprocess the original source image and extract hue and saturation components to obtain an HSV feature image; a layered interface semantic segmentation module, used to extract feature regions and perform layered interface semantic segmentation on the HSV feature image to locate and output interface pixel coordinates; a physical space mapping module, used to substitute the interface pixel coordinates into a preset calibration matrix to perform physical space mapping and serialization smoothing calculation to obtain an actual height value; a control strategy generation module, used to logically compare the actual height value with a preset set of process thresholds, and generate a control command frame containing valve action codes based on the comparison result and a PID control strategy; and a control drive module, used to send the control command frame to the field control system through an industrial communication interface to drive the actuator to perform actions and complete the measurement and control cycle.
[0007] Compared with existing technologies, this application provides an intelligent visual measurement and control analysis system for resin separation interfaces. Firstly, it accurately locates interface features under complex lighting and viewing window contamination environments through image acquisition and HSV color space transformation, utilizing hierarchical semantic segmentation technology. Furthermore, the solution abandons the traditional linear perspective mapping model and constructs a light path refraction compensation mechanism based on Snell's law. This mechanism transforms interface pixel coordinates into the line-of-sight angle of incidence and combines the viewing window glass thickness and refractive index to calculate the nonlinear lateral displacement, thereby reconstructing the true physical height to eliminate optical distortion. Based on this high-precision data, the system generates control commands through a PID strategy to drive field valves, achieving precise closed-loop automated control of the resin regeneration process. Attached Figure Description
[0008] The above and other objects, features, and advantages of this application will become more apparent from the more detailed description of the embodiments of this application in conjunction with the accompanying drawings. The drawings are provided to further illustrate the embodiments of this application and form part of the specification. They are used together with the embodiments of this application to explain this application and do not constitute a limitation thereof. In the drawings, the same reference numerals generally represent the same components or steps.
[0009] Figure 1 This is a system block diagram of the intelligent visual measurement and control analysis system for resin separation interface according to an embodiment of this application.
[0010] Figure 2 This is a schematic diagram of the system architecture of the intelligent visual measurement and control analysis system for resin separation interface according to an embodiment of this application.
[0011] Figure 3This is a data flow diagram of the intelligent visual measurement and control analysis system for resin separation interface according to an embodiment of this application.
[0012] Figure 4 This is a block diagram of the physical space mapping module in the intelligent visual measurement and control analysis system for resin separation interface according to an embodiment of this application.
[0013] Figure 5 This is a block diagram of the physical height determination unit in the intelligent visual measurement and control analysis system for resin separation interface according to an embodiment of this application. Detailed Implementation
[0014] Hereinafter, exemplary embodiments according to this application will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this application, and not all embodiments of this application. It should be understood that this application is not limited to the exemplary embodiments described herein.
[0015] As indicated in this application and claims, unless the context clearly indicates otherwise, the words "a," "an," "an," and / or "the" are not specifically singular and may include plural forms. Generally speaking, the terms "comprising" and "including" only indicate the inclusion of explicitly identified steps and elements, which do not constitute an exclusive list, and the method or apparatus may also include other steps or elements.
[0016] While this application makes various references to certain modules of the systems according to embodiments of this application, any number of different modules can be used and run on user terminals and / or servers. The modules described are merely illustrative, and different aspects of the systems and methods may use different modules.
[0017] Flowcharts are used in this application to illustrate the operations performed by the system according to embodiments of this application. It should be understood that the preceding or following operations are not necessarily performed in exact order. Instead, various steps can be processed in reverse order or simultaneously as needed. Furthermore, other operations can be added to these processes, or one or more steps can be removed from them.
[0018] Hereinafter, exemplary embodiments according to this application will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this application, and not all embodiments of this application. It should be understood that this application is not limited to the exemplary embodiments described herein.
[0019] To address the technical challenges of existing resin separation interface monitoring methods, which are limited by human subjectivity and conventional visual inspection methods cannot eliminate edge depth-of-view errors caused by refraction in multi-layered media, this application proposes an intelligent visual measurement and control analysis system for resin separation interfaces. The system first accurately locates the interface pixel coordinates under complex lighting conditions through image acquisition and HSV color space nonlinear mapping, utilizing hierarchical semantic segmentation technology. Then, abandoning traditional linear mapping, it constructs a physical reconstruction model based on Snell's law. By calculating the incident tangent of the line of sight and the refractive index parameters of the viewing window glass, it accurately calculates the refraction height deviation compensation to eliminate nonlinear optical distortion. Finally, based on the reconstructed true height data, it uses a PID strategy to generate control commands to drive the field actuators, achieving closed-loop automatic control throughout the entire process.
[0020] Figure 1 This is a system block diagram of the intelligent visual measurement and control analysis system for resin separation interface according to an embodiment of this application. Figure 2 This is a schematic diagram of the system architecture of the intelligent visual measurement and control analysis system for resin separation interface according to an embodiment of this application. Figure 3 This is a data flow diagram of the intelligent visual measurement and control analysis system for resin separation interfaces according to an embodiment of this application. Figure 1 , Figure 2 and Figure 3 As shown, the resin separation interface intelligent visual measurement and control analysis system 100 according to an embodiment of this application includes: an image acquisition module 110, used to respond to a system start command and control an image acquisition device to acquire images of the resin separation tank window based on preset configuration parameters to obtain an original source image; a hue and saturation component extraction module 120, used to preprocess the original source image and extract hue and saturation components to obtain an HSV feature image; a layered interface semantic segmentation module 130, used to extract feature regions and perform layered interface semantic segmentation on the HSV feature image to locate and output interface pixel coordinates; a physical space mapping module 140, used to substitute the interface pixel coordinates into a preset calibration matrix to perform physical space mapping and serialization smoothing calculation to obtain the actual height value; a control strategy generation module 150, used to logically compare the actual height value with a preset set of process thresholds, and generate a control command frame containing valve action codes based on the comparison result and PID control strategy; and a control drive module 160, used to send the control command frame to the field control system through an industrial communication interface to drive the actuator to act and complete the measurement and control cycle.
[0021] Specifically, such as Figure 2As shown in the figure, this diagram illustrates the overall closed-loop control architecture of the intelligent visual measurement and control analysis system for the resin separation interface. During system operation, the system first acquires raw source images of the resin separation tank in real time through a viewing window using an image acquisition device. Subsequently, the image processing unit (industrial computer) and intelligent recognition algorithms perform HSV color space transformation and layered interface semantic segmentation on the images to locate and output the interface pixel coordinates. This is then combined with physical space mapping to calculate the interface height. These physical feature data are fed into the intelligent visual measurement and control analysis host for state analysis and judgment, and combined with a PID strategy to generate control command frames. Finally, the commands are sent to the field control system via industrial communication interfaces (including Ethernet, RS485, and switch / analog signals), which drives the underlying actuators and resin delivery pumps, thus forming a closed-loop control feedback from visual perception to physical execution, achieving automated intelligent measurement and control of the resin regeneration process.
[0022] In the aforementioned intelligent visual measurement and control analysis system 100 for resin separation interfaces, the image acquisition module 110 is used to respond to system startup commands and control the image acquisition device to acquire images of the resin separation tank window based on preset configuration parameters to obtain the original source image. It should be understood that due to the complex conditions often present in industrial environments where resin separation tanks are located, such as uneven lighting, surface reflection of the window, and significant differences in the optical properties of the resin and water layers, an uncontrolled adaptive acquisition mode is prone to timing jitter or image distortion due to mismatched exposure parameters, severely affecting the accuracy of subsequent interface recognition. Therefore, in the technical solution of this application, the image acquisition device is controlled to acquire images of the resin separation tank window based on preset configuration parameters to obtain the original source image, thereby forcing the hardware system to operate synchronously according to specific exposure times, gain coefficients, and sampling frequencies adapted to the physical environment of the site. It is worth mentioning that the image acquisition device here includes an industrial camera and an LED fill light. This eliminates environmental noise and timing deviations from the signal source, ensuring that the acquired image data has a stable signal-to-noise ratio and accurate timestamps, laying a high-quality data foundation for subsequent semantic segmentation and physical inversion.
[0023] Specifically, in this embodiment, the image acquisition module is used to: respond to a system startup command, extract the exposure time and analog gain coefficient from preset configuration parameters, and calculate the frame interval time in combination with the sampling frequency to obtain a sensor driving vector containing timing and level signals; control the image acquisition device to open the shutter based on the sensor driving vector, perform integral response and photoelectric conversion on the incident photon flux of the resin separation tank window within the exposure time, and linearly amplify the converted voltage signal using the analog gain coefficient to obtain an amplified analog signal matrix; and digitally quantize the analog signal matrix using an analog-to-digital converter to obtain the original source image.
[0024] More specifically, in a specific example of this application, the system first executes a parameter parsing and driver generation process. Upon receiving a system startup command containing a timestamp and authorization code, it immediately retrieves preset configuration parameters from non-volatile memory, accurately extracts the exposure time and analog gain coefficient, and calculates the frame interval time between two adjacent frames based on the set sampling frequency. These physical parameters are then encapsulated into a sensor drive vector containing precise shutter trigger timing and gain level control signals. Subsequently, the system executes a photoelectric conversion and signal modulation process. The timing generator at the bottom layer of the image acquisition device opens the electronic shutter according to the sensor drive vector. Within the locked exposure time, it integrates the incident photon flux passing through the resin separation tank window, converts the light signal into a charge packet using a photodiode array, and then converts it into a voltage signal through a floating diffusion node. The weak voltage signal is then linearly amplified with low noise using the analog gain coefficient, thereby constructing an amplified analog signal matrix that characterizes the optical properties of the window. At this point, the physical process of analog signal amplification can be represented as follows: ;in, Representing coordinates The amplified analog voltage value, Represents the analog gain coefficient. Indicates quantum efficiency, Indicates the exposure time. This represents the incident photon flux density. Indicates floating diffusion capacitance. This represents the system bias voltage. The calculation process reveals the physical mechanism by which the system adapts the window photon flux by adjusting the gain and exposure time. Finally, the system performs digital quantization and image construction, using an analog-to-digital converter to discretize and sample the amplified analog signal matrix, mapping continuous analog voltages to digital grayscale values to generate the original source image conforming to a Bayer array or monochrome format.
[0025] In the aforementioned intelligent visual measurement and control analysis system 100 for resin separation interfaces, the hue and saturation component extraction module 120 is used to preprocess the original source image and extract the hue and saturation components to obtain an HSV feature image. It should be understood that due to the complex industrial environment where the resin separation tank is located, the surface of the pressure-resistant window is often accompanied by water mist condensation, stains, and irregular optical reflections. Furthermore, the acquired image data is easily affected by fluctuations in ambient lighting and electronic thermal noise, resulting in blurred boundary features between the anion and cation resins and the water layer in the original image, making it difficult to distinguish them using a single color threshold. Therefore, in the technical solution of this application, the original source image is further preprocessed and the hue and saturation components are extracted to obtain an HSV feature image. This allows for the use of convolution operations in the spatial domain to filter out high-frequency random noise, and in the color domain, nonlinear transformations to decouple the brightness information, which is easily affected by light intensity, from the hue and saturation information, which characterize the inherent properties of the substance. This effectively eliminates environmental interference caused by water mist and uneven lighting in the window, significantly enhances the feature contrast of the resin layer interface, and provides highly robust feature data input for subsequent semantic segmentation.
[0026] Specifically, in the embodiments of this application, the hue saturation component extraction module is used to: perform spatial domain Gaussian convolution smoothing on the original source image using a Gaussian convolution kernel to obtain a smoothed denoised base image; perform linear contrast stretching enhancement on the denoised base image to obtain an enhanced RGB image; and perform color space nonlinear mapping transformation on the enhanced RGB image to obtain an HSV feature image.
[0027] More specifically, a Gaussian convolution kernel is used to perform spatial domain Gaussian convolution smoothing on the original source image to obtain a smoothed, denoised base image. It should be understood that the industrial environment where the resin separation tank is located is extremely complex. The surface of the pressure-resistant window is often accompanied by water condensation, stains, and irregular optical reflections. Furthermore, the acquired image data is highly susceptible to interference from ambient lighting fluctuations and electronic thermal noise, causing the boundary features between the anion and cation resins and the water layer in the original image to be masked by high-frequency noise. Therefore, in the technical solution of this application, a Gaussian convolution kernel is used to perform spatial domain Gaussian convolution smoothing on the original source image. This utilizes the low-pass filtering characteristics of convolution operations in the spatial domain to filter out high-frequency random noise, while simultaneously smoothing the subtle texture interference on the window surface. This effectively eliminates environmental interference caused by water condensation and electronic noise in the window, significantly improving the image's signal-to-noise ratio and providing a clean data foundation for subsequent contrast enhancement and semantic segmentation.
[0028] In a specific example of this application, the system first performs Gaussian kernel construction and convolution operation. The image processing unit receives the original source image output by the image acquisition module and generates a two-dimensional Gaussian convolution kernel of odd size according to preset denoising intensity parameters. The weight distribution of this convolution kernel conforms to a two-dimensional Gaussian function, with the highest weight at the center and exponentially decreasing weights at the edges. Subsequently, the system uses this convolution kernel to perform a sliding window operation on the two-dimensional pixel matrix of the original source image, aligning the center of the convolution kernel with each target pixel in the image. The system calculates the sum of the products of the gray values of all pixels within the area covered by the convolution kernel and their corresponding weights, and uses this weighted sum as the new gray value of the target pixel. This process is repeated across all pixels in the image to complete spatial domain filtering, thereby generating a smoothed denoised base image. The mathematical calculation process of this spatial domain Gaussian convolution smoothing is as follows: ;in, Indicates the denoised base image in coordinates Pixel value at that location, This represents the input pixel value of the original source image at the corresponding coordinates. This represents the two-dimensional discrete convolution operator. This represents the Gaussian smoothing filter function. This represents the radius of the convolution kernel (kernel size is (2k+1)×(2k+1)). , This represents the relative displacement variable within the convolution kernel. This represents the standard deviation of the Gaussian distribution. This formula describes how the system uses Gaussian weights to perform a weighted average of neighboring pixels, thereby physically smoothing out high-frequency abrupt signal changes caused by water mist or sensor thermal noise.
[0029] More specifically, the denoised base image is enhanced by linear contrast stretching to obtain an enhanced RGB image. It should be understood that because the resin-water mixture in the resin separation tank has significant absorption and scattering effects on light, and the transmittance of the viewing window glass decreases with use, the grayscale distribution of the acquired image is often concentrated in a narrow, low-brightness range. This results in extremely low contrast between the anion and ion resin layers and the water layer in the denoised base image, making it difficult to distinguish by the naked eye or simple thresholding. Therefore, in the technical solution of this application, the denoised base image is further enhanced by linear contrast stretching to obtain an enhanced RGB image. This remaps the compressed grayscale histogram in the original image to the full dynamic range, thereby increasing the brightness difference between different media layers. This effectively overcomes the problem of dark imaging caused by insufficient lighting and poor media transmittance in industrial settings, significantly improving the visual saliency of the resin separation interface and providing high signal-to-noise ratio data support for subsequent HSV spatial feature extraction.
[0030] In a specific example of this application, the histogram statistical analysis logic is first initiated, traversing the two-dimensional pixel matrix of the denoised base image in the red, green, and blue channels respectively. The minimum and maximum grayscale values of the current frame image in each channel are calculated and locked, thereby determining the distribution range of effective information. Subsequently, the system performs pixel-level linear mapping operations based on this statistical range, linearly stretching the original pixel grayscale values concentrated in a narrow range to the standard display dynamic range. A truncation operation is used to prevent numerical overflow. Finally, the processed data from the three channels are resynthesized to generate an enhanced RGB image with high contrast characteristics. The calculation process of this linear contrast stretching enhancement is defined by the following formula: ;in, This indicates the enhanced RGB image in channels. and coordinates Normalized pixel values at that location, This indicates the input denoised base image in channels. The original pixel values in and These represent the input image in channels. The minimum and maximum effective gray values in the data. This represents the total number of gray levels in the image (typically 256, corresponding to an 8-bit bit depth). This formula reveals how the system amplifies the subtle differences in optical reflection between the resin and water layers through mathematical transformations, ensuring sufficient dynamic range for the image before color space conversion.
[0031] More specifically, a nonlinear color space mapping transformation is performed on the enhanced RGB image to obtain an HSV feature image. It should be understood that due to the extremely unstable lighting conditions in the industrial environment where the resin separation tank is located, and the color characteristics of the anion and cation resins and the water layer being highly susceptible to the effects of surface reflection, glass refraction, and batch-to-batch differences in resin, analysis solely within the RGB color space results in a severe coupling between color and brightness information due to the high correlation of the three RGB channels, making it difficult to extract stable material interface features under fluctuating lighting conditions. Therefore, in the technical solution of this application, a nonlinear color space mapping transformation is further performed on the enhanced RGB image to obtain an HSV feature image. This utilizes the cylindrical coordinate characteristics of the HSV model to mathematically decouple the hue component representing the inherent color of the material and the saturation component representing color purity from the lightness component, which is easily affected by ambient light. This effectively avoids the interference of industrial lighting intensity variations and window shadows on image segmentation, significantly improving the robustness and accuracy of the system in identifying the anion and cation resin layer interfaces.
[0032] In a specific example of this application, the system first activates the color space conversion engine, traversing the two-dimensional matrix of the enhanced RGB image pixel by pixel. It reads the red, green, and blue channel values at each coordinate point and normalizes these values from the original integer gray levels to a standard floating-point range. Then, through comparison operations, it determines the maximum and minimum values of each pixel in the three channels, as well as the chromaticity difference between them. Subsequently, the system performs a nonlinear mapping calculation based on a hexagonal pyramid model. It selects the corresponding piecewise function branch based on the channel position of the maximum value, uses the chromaticity difference to perform a weighted calculation on the color deflection angle to resolve the hue component, and simultaneously calculates the saturation component based on the ratio of the maximum value to the chromaticity difference. The maximum value is then directly assigned as the lightness component, thus completing the transformation from Cartesian coordinates to cylindrical coordinates. Finally, the system recombines and quantizes the calculated three components to construct an HSV feature image containing clear material property characteristics. The nonlinear mapping calculation formula for the hue component is as follows: ;in, Represents the coordinates in the HSV feature image The hue component value at that location, , , These represent the normalized red, green, and blue channel pixel values of the enhanced RGB image, respectively. This represents the maximum value among the three channels. This represents the minimum value among the three channels. Indicates color difference (i.e. ), This is a binary modulo operation used to correct the result to a positive period. The formula clarifies how the system transforms physical color attributes into angular features through a piecewise nonlinear function, ensuring the separability of different resin layers in the hue channel.
[0033] In the aforementioned intelligent visual measurement and control analysis system 100 for resin separation interfaces, the layered interface semantic segmentation module 130 is used to extract feature regions and perform layered interface semantic segmentation on HSV feature images to locate and output interface pixel coordinates. It should be understood that although HSV feature images achieve feature decoupling in color space, their image field of view still includes non-measured objects such as the metal tank background of the resin separation tank, the window border, and reflective supports. Furthermore, the boundary between the anion and cation resins and the water layer often appears jagged or transitional at the micro-pixel level. Direct physical mapping would severely reduce measurement accuracy due to background noise. Therefore, in this application's technical solution, feature regions are further extracted and layered interface semantic segmentation is performed on the HSV feature images to locate and output interface pixel coordinates. This eliminates invalid background interference through geometric constraints and uses statistical clustering algorithms to group discrete pixels into media layers (anion resin, cation resin, and water) with clear physical meaning, ultimately fitting a geometric boundary line with sub-pixel accuracy. This ensures that the output coordinate data is pure and represents the real material interface, providing highly reliable geometric input for subsequent physical height inversion.
[0034] Specifically, in the embodiments of this application, the hierarchical interface semantic segmentation module is used to: generate ROI masks and remove invalid backgrounds from HSV feature images to obtain effective data of regions of interest; reshape the effective data of regions of interest into a feature vector set, and perform pixel-level feature clustering based on K-Means to obtain a pixel classification matrix; and perform interface edge detection and coordinate fitting on the pixel classification matrix to obtain interface pixel coordinates.
[0035] More specifically, ROI mask generation and invalid background removal are performed on the HSV feature image to obtain effective data for the region of interest. It should be understood that the imaging field of view of the resin separation tank not only includes the window area reflecting the resin layering state, but also inevitably encompasses the outer wall of the metal tank, the window flange border, and the surrounding industrial environment background. Pixels in these non-monitored areas often exhibit color characteristics similar to the resin layer or extreme reflective highlights in the HSV color space. If the entire field of view image is directly input into subsequent classification algorithms, it is highly likely to cause center shift or misidentification of feature clustering. Therefore, in the technical solution of this application, ROI mask generation and invalid background removal are further performed on the HSV feature image to obtain effective data for the region of interest. This allows for the construction of a spatial filter through geometric morphological constraints, forcing the background noise pixels outside the window border to be zeroed, retaining only the internal medium data of the window with actual physical significance. This significantly reduces the data dimensionality of subsequent processing, completely eliminates the interference of the static environmental background on dynamic interface recognition, and ensures that the interface segmentation algorithm focuses only on the core process object.
[0036] In a specific example of this application, the system first initiates the window contour localization logic, extracts saturation or brightness component data from the HSV feature image, and uses the Canny edge detection operator combined with the Hough transform line detection algorithm to scan the rectangular closed region with the most dramatic brightness gradient change in the image, thereby accurately locating the physical boundary coordinates of the resin separation tank window. Subsequently, the system constructs a binary mask matrix with the same size as the original image based on these boundary coordinates, assigns a weight of 1 to pixels inside the window boundary and a weight of 0 to pixels outside the window boundary, and performs a Hadamard product operation (i.e., multiplies corresponding elements) between this binary mask matrix and the three-dimensional matrix of the HSV feature image, thereby generating effective region of interest (ROI) data containing only information about the anodic and cathodic resins and water layers within the window. The mathematical calculation process for this ROI mask extraction and background removal is as follows: ;in, Indicates the coordinates after masking. Valid data for the region of interest. This represents the pixel vector values of the input HSV feature image. This represents the binary mask matrix generated based on the viewport contour. This represents the Hadamard product operation. This represents the set of valid physical regions within the resin separation tank's viewing window, with 0 representing the zero vector. This formula clarifies how the system uses geometric logic operations to forcibly filter out background noise from outside the viewing window, ensuring that subsequent clustering is performed only on the valid medium.
[0037] More specifically, the effective data of the region of interest is reshaped into a feature vector set, and then subjected to pixel-level feature clustering based on K-Means to obtain a pixel classification matrix. It should be understood that while the media (anion resin, cation resin, and water) within the resin separation tank window are physically continuous, they appear as discrete sets of pixels in the HSV feature image. Furthermore, the distribution of these pixels in the color space is not absolutely separated, but rather exhibits blurred transition zones and local overlaps. If simple hard thresholding is used for segmentation, misclassification due to parameter drift is highly likely. Therefore, in the technical solution of this application, the effective data of the region of interest is further reshaped into a feature vector set, and then subjected to pixel-level feature clustering based on K-Means to obtain a pixel classification matrix. This utilizes statistical learning methods to mine the natural aggregation attributes of the data in the multidimensional feature space, adaptively finding the optimal decision boundary to distinguish different media. This effectively overcomes the color drift problem caused by uneven illumination and batch differences in the media, achieving high-precision semantic segmentation of the anion and cation resins and water layers, ensuring the robustness of the system under complex operating conditions.
[0038] In a specific example of this application, the system first performs data dimensionality reduction and feature reshaping operations. It iterates through the effective data of the region of interest after masking, removing invalid pixels marked as background (i.e., zero values). It then extracts the component values of the remaining effective pixels in the three dimensions of hue, saturation, and brightness, constructing a three-dimensional feature vector for each pixel. All vectors are combined to form a feature vector set of size N×3, where N is the total number of effective pixels. Subsequently, the system initiates a K-Means clustering iteration process. Based on prior knowledge of the resin separation process, the number of clusters K is set to 3 (corresponding to anion resin, cation resin, and water, respectively). Three cluster center vectors are randomly initialized. The Euclidean distance between each sample in the feature vector set and each cluster center is calculated. Samples are assigned to their corresponding clusters according to the minimum distance principle, and the cluster centers are updated using the mean of the samples within each cluster. This process is repeated until the center positions converge. Finally, the system performs result mapping and matrix reconstruction operations, reads the final category label (such as 0, 1, 2) of each pixel, refills it according to the spatial coordinates of the original image, and generates a pixel classification matrix with the same size as the original image, where the value of each element represents the semantic category of the medium at that location.
[0039] More specifically, interface edge detection and coordinate fitting are performed on the pixel classification matrix to obtain the interface pixel coordinates. It should be understood that although the pixel classification matrix clearly defines the medium attributes of each pixel within the window, it is essentially still a two-dimensional array composed of discrete category labels. Furthermore, influenced by local lighting or suspended particles, tiny classification gaps may exist within regions of the same medium, and the boundaries between different media often exhibit non-smooth, jagged edges, making it unsuitable as a direct benchmark for accurate physical height measurement. Therefore, in this application's technical solution, interface edge detection and coordinate fitting are further performed on the pixel classification matrix to obtain the interface pixel coordinates. This allows for morphological operations to repair intra-class defects, and statistical fitting algorithms are used to macroscopically extract smooth, continuous geometric boundaries between different medium layers. This transforms the discrete semantic segmentation results into unique geometric position parameters with sub-pixel precision, significantly improving the system's ability to suppress liquid level fluctuations and edge noise, and providing highly reliable input data for subsequent physical space mapping.
[0040] In a specific example of this application, the system first performs morphological optimization processing. Using preset structuring elements, it performs a closing operation on the pixel classification matrix. Specifically, it first performs a dilation operation to connect broken neighboring pixels, and then performs an erosion operation to restore the original boundary morphology. This fills the tiny pores caused by misclassification within the anionic resin or water layer regions, smooths random burrs at the interfaces of different media, and generates a classification map with enhanced connectivity. Subsequently, the system performs vertical gradient scanning and edge localization. It traverses the optimized pixel classification matrix column by column along a direction perpendicular to the horizontal plane (i.e., the Y-axis direction of the image), calculates the difference in category labels between adjacent pixel rows, and accurately identifies the set of pixel locations where the category label abruptly changes from one medium to another. This set represents the physical interface trajectory of different medium layers. Finally, the system performs geometric fitting and coordinate output. It uses the gradient maximum method combined with an average value filtering strategy to perform statistical analysis on the aforementioned set of abrupt change points, calculates the weighted average position of the interface on the vertical axis of the image coordinate system, and outputs interface pixel coordinates with sub-pixel accuracy.
[0041] In the aforementioned intelligent visual measurement and control analysis system 100 for resin separation interfaces, the physical space mapping module 140 is used to substitute the interface pixel coordinates into a preset calibration matrix for physical space mapping and sequential smoothing calculation to obtain the actual height value. It should be understood that since the interface pixel coordinates only reflect the two-dimensional geometric position on the target surface of the image sensor, they are dimensionless relative values. Furthermore, limited by the refractive effect of the resin separation tank window glass and the perspective distortion of the camera installation angle, these coordinates cannot directly represent the true liquid level height. Simultaneously, affected by liquid inflow impact or bubble disturbance, the instantaneous liquid level often exhibits non-functional high-frequency fluctuations, which, if directly used for control, would lead to frequent valve oscillations. Therefore, in the technical solution of this application, the interface pixel coordinates are further substituted into a preset calibration matrix for physical space mapping and sequential smoothing calculation to obtain the actual height value. This establishes an accurate mathematical mapping model from the image domain to the physical control domain, and a time-series filtering algorithm is used to eliminate random noise interference. This ensures that the output liquid level data possesses both millimeter-level spatial measurement accuracy and temporal stability, providing a reliable decision-making basis for subsequent closed-loop control.
[0042] Figure 4 This is a block diagram of the physical space mapping module in the intelligent visual measurement and control analysis system for resin separation interfaces according to an embodiment of this application. Figure 4 As shown in the embodiments of this application, the physical space mapping module 140 includes: a physical height determination unit 141, used to determine the instantaneous physical height value based on the interface pixel coordinates; and a time-weighted recursive unit 142, used to introduce the historical output state value of the previous moment and use the exponential weighted moving average algorithm to perform time-weighted recursive filtering on the instantaneous physical height value to obtain a smooth and stable actual height value.
[0043] Specifically, the physical height determination unit 141 is used to determine the instantaneous physical height value based on the interface pixel coordinates. It should be understood that since the interface pixel coordinates only reflect the two-dimensional geometric position on the target surface of the image sensor, they are dimensionless relative values and are limited by perspective distortion due to the camera's installation angle. Therefore, these coordinates cannot directly represent the true liquid level height and cannot be directly used to guide the precise operation of industrial valves. Therefore, in the technical solution of this application, the instantaneous physical height value is further determined based on the interface pixel coordinates to establish a linear perspective mapping model from the image domain to the physical control domain, transforming discrete pixel row indices into liquid level values with clear physical dimensions (such as millimeters). This ensures that the output measurement data is consistent with the liquid level standard required by the on-site process, providing a quantitative decision-making basis for subsequent closed-loop control.
[0044] More specifically, in a concrete example of this application, the system first receives the interface pixel coordinates output by the front end and constructs a homogeneous coordinate vector containing the ordinate. Simultaneously, it retrieves a pre-set calibration matrix, which is a linear mapping parameter set obtained by comparing and calibrating the physical size of the viewport with the pixel size based on the homography transformation principle. This matrix describes the perspective projection relationship between the image plane and the physical facade of the resin separation tank. Subsequently, the system performs matrix operations and reference offset correction, using the calibration matrix to inversely map the homogeneous coordinate vector to the physical world coordinate system, eliminating trapezoidal distortion caused by the camera mounting angle, calculating the physical ordinate relative to the bottom of the viewport, and superimposing the reference offset of the bottom of the viewport relative to the bottom of the tank, thereby calculating the instantaneous physical height value. The spatial coordinate inverse projection calculation model based on the homography matrix is as follows: ;in, Indicates the instantaneous physical height value. This represents the vertical coordinate of the interface pixel in the input image (i.e., the interface pixel coordinate). This represents the coefficients of specific elements in the inverse of the calibration matrix (homography matrix). These coefficients incorporate information about the camera's focal length, imaging distance, and mounting angle. This indicates the physical reference offset of the bottom of the viewport relative to the bottom of the resin separation tank.
[0045] In particular, an in-depth analysis of the visual measurement and control scheme for resin separation interfaces revealed significant physical model defects in the spatial coordinate inverse projection method based on the homography matrix used in the above embodiments. This method, based on a simplified perspective transformation model, implicitly assumes the idealized straight-line propagation of light in a single homogeneous medium. However, in the actual scenario of resin separation and regeneration processes, the visual measurement system faces a typical multi-layered medium optical environment: light must pass through air, a relatively thick pressure-resistant window glass, and a mixture of resin and water in sequence. This physical reality leads to two error sources that cannot be eliminated by a linear model: first, the refraction offset effect, where light is deflected according to Snell's law when passing through interfaces of media with different refractive indices (air to glass, glass to liquid), and the degree of deflection changes non-linearly with the angle of incidence. Second, the amplification effect of the depth error caused by the thickness of the window; industrial-grade pressure-resistant windows are usually thick (often exceeding 20mm), and the extended propagation path of light inside the glass significantly increases the lateral displacement, resulting in a non-negligible geometric deviation between the actual light path and the ideal straight-line light path. In the original scheme, this nonlinear distortion caused by physical refraction was incorrectly attributed to the linear fitting residual of the homography matrix. This resulted in acceptable measurements in the central region of the viewing window, but once the liquid level was at the upper or lower edges of the window (large incident angle regions), the measurement error diverged exponentially, making it difficult to meet the high-precision industrial control requirement of ±1mm. Therefore, an optical compensation mechanism based on an optical path physical model must be introduced to fundamentally solve the problem of depth distortion caused by refraction.
[0046] To overcome the aforementioned shortcomings, in a preferred embodiment of this application, an adaptive physical inverse mapping mechanism based on optical path refraction compensation is constructed as an improvement. This mechanism abandons the single geometric projection approach and, by introducing a ray tracing model, deeply integrates the optical parameters and geometric position information of the viewing window glass to achieve accurate physical inversion of the resin separation interface. Adaptive refraction compensation is performed on the geometric projection by introducing the optical parameters of the viewing window glass. This fundamentally eliminates the nonlinear distortion caused by multi-layer media refraction, enabling distortion-free and accurate measurement of the resin separation interface height across the entire field of view.
[0047] More specifically, in another specific example of this application, Figure 5 This is a block diagram of the physical height determination unit in the intelligent visual measurement and control analysis system for resin separation interfaces according to an embodiment of this application. Figure 5As shown, the physical height determination unit 141 includes: a line-of-sight incident tangent value determination subunit 1411, used to determine the line-of-sight incident tangent value based on camera intrinsic parameters and interface pixel coordinates, wherein the camera intrinsic parameters include focal length and optical center ordinate; a refraction height deviation compensation determination subunit 1412, used to determine the refraction height deviation compensation amount based on the line-of-sight incident tangent value and window glass parameters, wherein the window glass parameters include glass thickness and glass refractive index; and a physical reconstruction subunit 1413, used to perform physical reconstruction by fusing geometric projection and refraction correction on the refraction height deviation compensation amount and the line-of-sight incident tangent value based on basic set mapping parameters to obtain the instantaneous physical height value.
[0048] Accordingly, the line-of-sight incident tangent determination subunit 1411 is used to determine the line-of-sight incident tangent based on camera intrinsic parameters and interface pixel coordinates. The camera intrinsic parameters include focal length and optical center ordinate. It should be understood that since the degree of light refraction directly depends on the incident angle, and the original interface pixel coordinates only represent the position on the imaging plane and cannot directly reflect the direction of light propagation, and given the thickness of the viewing window glass in the resin separation tank, the depth-of-sight error diverges non-linearly with increasing incident angle. Therefore, in the technical solution of this application, the line-of-sight incident tangent is further determined based on camera intrinsic parameters and interface pixel coordinates to eliminate the influence of camera intrinsic parameters, transforming the pixel coordinates of the image plane into geometric angles in the optical center coordinate system, thereby constructing a normalized line-of-sight incident angle vector.
[0049] In a specific example of this application, the physical height determination unit first initiates the line-of-sight vector construction logic and reads the pixel ordinates of the detected interface in the image. Simultaneously, it retrieves camera intrinsic parameter data from the system calibration file. This intrinsic parameter data precisely contains the ordinate of the camera's optical axis center in the image coordinate system. and the camera's equivalent focal length in the Y-axis direction Subsequently, based on the geometric principles of the pinhole imaging model, the system calculates the perpendicular distance of a pixel relative to the optical center and compares this distance with the equivalent focal length to determine the tangent of the incident angle when light enters the window surface. The formula for this conversion from the pixel domain to the angle domain is as follows: ;in, This represents the tangent of the angle of incidence of the line of sight. Let be the angle of incidence of light relative to the window surface. It is the vertical pixel coordinate of the detected interface in the image. The vertical coordinate (optical center) of the camera's optical axis center in the image coordinate system. This is the equivalent focal length of the camera along the Y-axis (in pixels). This step involves more than just coordinate system transformation; it also involves calculation. By obtaining the degree of deviation of the light rays from the normal to the viewport, the core independent variable for subsequent variable nonlinear compensation was established. Specifically, a larger incident angle indicates more severe refraction distortion in the subsequent light path, making this parameter the core independent variable for variable nonlinear compensation. In other words, this formula shows that the system uses geometric relationships to transform the positional information of the image plane into angular information representing the direction of the light path, thereby quantifying the degree of deviation of the line of sight from the normal to the viewport and establishing the core independent variable for subsequent refraction correction calculations.
[0050] Accordingly, the refraction height deviation compensation determining subunit 1412 is used to determine the refraction height deviation compensation amount based on the incident tangent of the line of sight and the window glass parameters, including the glass thickness and the glass refractive index. It should be understood that when light passes through the window glass, due to the significant difference in refractive index between air and glass, its actual propagation path will be laterally shifted relative to the ideal straight line, leading to a deviation in the measurement of longitudinal height. Furthermore, in industrial settings, the thicker the window glass or the more tilted the observation angle, the more severe this depth-of-view error caused by physical refraction becomes. Therefore, in the technical solution of this application, the refraction height deviation compensation amount is further determined based on the incident tangent of the line of sight and the window glass parameters. This allows for the introduction of Snell's law to perform high-precision modeling of the physical process of refraction in this multi-layered medium, calculating the height difference between the theoretical landing point and the actual landing point after refraction through the glass if the glass were absent. In this way, the optical illusion caused by the physical entity of the viewing window glass can be quantified and eliminated, especially in the edge observation area with a large angle of incidence. This compensation mechanism is the key to achieving high-precision measurement across the entire field of view and effectively solves the problem of significant accuracy attenuation in the edge area of the original linear projection scheme.
[0051] In a specific example of this application, the system first reads the line-of-sight incident tangent calculated by the preceding steps. Simultaneously, it retrieves the physical property parameters of the resin separation tank window from a preset system calibration file. These parameters precisely cover the physical thickness of the window glass. and the refractive index of the window glass Subsequently, the system performs optical path tracing calculations, using inverse trigonometric functions to restore the incident tangent to the angle of incidence, calculating the angle of refraction after the light enters the glass medium based on the difference in refractive index, and deriving the lateral displacement of the light after exiting the glass by combining the glass thickness. Finally, it calculates the refraction height deviation compensation amount used to correct geometric projection errors. The core calculation process is as follows: ;in, This represents the amount of compensation for the refraction height deviation. The physical thickness of the viewing window glass (unit: mm). This represents the incident tangent of the line of sight (i.e., the tangent of the angle of incidence of the light ray). The refractive index of the viewing window glass (typically 1.45-1.55), while and This involves inverse trigonometric function operations. The formula clarifies how the system, based on the laws of physical optics, transforms the nonlinear propagation path of light in thick glass into a quantifiable vertical height correction value.
[0052] Accordingly, the physical reconstruction subunit 1413 is used to perform physical reconstruction by fusing geometric projection and refraction correction on the refraction height deviation compensation and the line-of-sight incident tangent based on the basic set mapping parameters to obtain the instantaneous physical height value. It should be understood that although the preceding steps calculate the line-of-sight incident tangent characterizing the light path direction and the refraction height deviation compensation amount quantifying the window refraction effect, isolated compensation parameters cannot directly characterize the liquid level height, and the uncorrected geometric projection result has a significant virtual image of depth at the window edge, resulting in a nonlinear deviation between the observed value and the true value. Therefore, in the technical solution of this application, the physical reconstruction by fusing geometric projection and refraction correction on the refraction height deviation compensation and the line-of-sight incident tangent based on the basic set mapping parameters is further performed to obtain the instantaneous physical height value, thereby completing the final regression from the optical model to the physical space. The calculated optical correction amount is dynamically superimposed onto the triangulation model to achieve the unification of theoretical depth of view and physical compensation. In this way, the theoretical depth of view when light travels in a straight line can be restored to the actual physical height of the resin interface. Without changing the hardware structure, the algorithm can eliminate the nonlinear error caused by the refraction of multiple media, and achieve accurate measurement without distortion across the entire observation range.
[0053] In a specific example of this application, the physical reconstruction subunit first retrieves the system's preset base set mapping parameters. This parameter set precisely defines the spatial topology of the vision system, including the vertical mounting height of the camera lens optical center relative to the reference plane at the bottom of the resin separation tank, and the horizontal and vertical distances from the camera lens optical center to the inner wall of the resin separation tank's viewing window. Subsequently, the system performs geometric projection and correction fusion operations. Using the principle of triangulation, it multiplies the incident tangent of the line of sight with the horizontal and vertical distances to construct the theoretical geometric depth of vision assuming that light propagates in a straight line in a single homogeneous medium. Then, it subtracts the refraction height deviation compensation amount calculated in the previous steps, thereby removing the visual illusion error caused by refraction from the theoretical depth of vision. Finally, it calculates the instantaneous physical height value after refraction correction. The calculation formula for this physical reconstruction process is as follows: ;in, This is the instantaneous physical height value after refraction correction. It is the vertical mounting height (in mm) of the camera lens optical center relative to the reference surface at the bottom of the resin tank, and L represents the horizontal and vertical distance (in mm) from the camera lens optical center to the inner wall of the resin separation tank window. This represents the theoretical depth of view assuming light travels in a straight line, minus... This involves removing the errors caused by refraction, thereby reconstructing the true physical height of the resin interface.
[0054] Through this deep integration of geometric and physical models, this solution achieves optical precision measurement accuracy without altering the hardware structure, using pure algorithmic methods, enabling distortion-free monitoring of the resin separation interface across the entire observation range (especially at the window edge).
[0055] In the aforementioned intelligent visual measurement and control analysis system 100 for resin separation interfaces, the control strategy generation module 150 is used to logically compare the actual height value with a preset set of process thresholds, and generate a control command frame containing valve action codes based on the comparison results and the PID control strategy. It should be understood that because the ion exchange resin regeneration process has extremely high requirements for liquid level control accuracy, if only simple on / off threshold control is used, it is very easy to cause overshoot or frequent valve oscillation due to liquid level inertia. Traditional manual operation has significant lag, making it difficult to meet the dynamic stability requirements of the resin separation interface during the wiping and conveying stages. Therefore, in the technical solution of this application, the actual height value is further logically compared with the safety boundary and target value in the preset set of process thresholds to obtain the position alarm status bit and control deviation amount, and a control command frame containing valve action codes is generated based on the comparison results and the PID control strategy. This constructs an intelligent decision-making center based on visual feedback, converting high-precision measurement data into smooth industrial control signals. This enables automated closed-loop control of the resin regeneration process, ensuring that the liquid level remains within a safe process range while maintaining the optimal separation interface height through precise valve fine-tuning.
[0056] Specifically, in this embodiment, the control strategy generation module is used to: logically compare the actual height value with the safety boundary and target value in the preset process threshold set to obtain the alarm status bit and control deviation amount; in response to the normal alarm status bit, perform incremental PID calculation based on the control deviation amount and its historical rate of change to obtain the control valve opening increment; map the control valve opening increment into hardware action code and encapsulate it through a protocol to obtain a control command frame.
[0057] More specifically, in a specific example of this application, the system first performs a state space determination and deviation calculation process. The control strategy generation module receives a smooth and stable actual height value output by the physical space mapping module, and simultaneously retrieves a preset set of process thresholds. This set clearly defines the high alarm limit, the low alarm limit, and the target value corresponding to the current process step (such as backwashing or regeneration). The system uses comparator logic to compare the actual height value with the high and low alarm limits in real time. If the value exceeds the safety boundary, the alarm state is immediately set to a high level to trigger system interlock protection; otherwise, the normal state is maintained. At the same time, the system calculates the algebraic difference between the actual height value and the target value to generate a control deviation quantity that represents the current control error. Subsequently, the system executes PID logic operations and instruction encapsulation. Responding to a normal alarm status, the system introduces pre-tuned proportional, integral, and derivative coefficients. Based on the current control deviation and historical deviation values from the previous two sampling times, it performs incremental PID calculations to determine the required valve opening increment to eliminate the current error. Finally, the system queries the hardware driver table, mapping this digital increment to hardware action codes recognizable by the field actuator (e.g., valve position register write values). Strictly adhering to industrial communication protocols (e.g., Modbus TCP), the system encapsulates the action codes with the device address and checksum to generate a complete control instruction frame. The mathematical model for this incremental PID calculation is as follows: ;in, This represents the calculated increment of the control valve opening. These represent the proportional coefficient, integral coefficient, and differential coefficient, respectively. This represents the control deviation calculated at the current moment. These represent the historical control deviations at the previous and two previous sampling times, respectively. This formula reveals how the system uses the trend of deviation changes to calculate precise control compensation, thereby achieving zero steady-state error adjustment of the resin interface.
[0058] In the aforementioned intelligent visual measurement and control analysis system 100 for resin separation interface, the control drive module 160 is used to send control command frames to the field control system via an industrial communication interface to drive the actuator and complete the measurement and control cycle. It should be understood that since digital decision signals cannot directly drive high-power electrical equipment in industrial settings, and the field environment is often filled with complex electromagnetic interference, without a reliable communication and drive mechanism, high-precision algorithm results cannot be translated into actual process control actions, leading to a disconnect between monitoring and execution. Therefore, in the technical solution of this application, control command frames are further sent to the field control system via an industrial communication interface to drive the actuator and complete the measurement and control cycle, thereby constructing a reliable transmission bridge from the information domain to the physical domain, and utilizing standard industrial protocols to achieve remote command issuance and interference-resistant transmission. This ensures that the resin regeneration process strictly follows the real-time status of visual feedback for automated adjustment, eliminating the lag of manual operation and achieving true closed-loop intelligent control.
[0059] Specifically, the control drive module is used to: perform integrity verification on the control command frame using a cyclic redundancy check algorithm, and transmit it to the field control system through a physical layer interface. More specifically, in a specific example of this application, the system first performs a command verification and reliable transmission process. The control drive module, acting as the communication master station, performs bit-level integrity verification on the generated control command frame using a cyclic redundancy check algorithm. After confirming that the data packet is not interfered with by internal bus noise, it sends it to the field control system (such as a PLC programmable logic controller or a DCS distributed control system) through a physical layer interface (such as an RS-485 serial bus or an industrial Ethernet interface). Subsequently, the system performs a protocol parsing and physical drive process. The field control system receives and parses the command frame, and based on the encapsulated register address and function code, controls the corresponding intermediate relay to engage or output a 4-20mA analog current, thereby driving the pneumatic valves or electric transfer pumps connected to the resin separator pipeline to produce mechanical actions such as opening, closing, or adjusting the opening degree. Finally, the system performs an action feedback and closed-loop confirmation process, collecting the position limit signal or flow feedback signal of the underlying device in real time to confirm that the physical action has been executed accurately, and feeding this status back to the vision measurement and control system to update the current working condition, thereby completing a complete measurement and control cycle.
[0060] In summary, the intelligent visual measurement and control analysis system for resin separation interface according to the embodiments of this application is explained. Firstly, it accurately locates interface features under complex lighting and viewing window contamination environments through image acquisition and HSV color space transformation, utilizing hierarchical semantic segmentation technology. Furthermore, the solution abandons the traditional linear perspective mapping model and constructs a light path refraction compensation mechanism based on Snell's law. This transforms the interface pixel coordinates into the line-of-sight incident angle and combines the viewing window glass thickness and refractive index to calculate the nonlinear lateral displacement, thereby reconstructing the true physical height to eliminate optical distortion. Based on this high-precision data, the system generates control commands through a PID strategy to drive the field valves, achieving precise closed-loop automated control of the resin regeneration process.
[0061] The various embodiments of this disclosure have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or improvement of the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.
Claims
1. A smart visual measurement and control analysis system for resin separation interfaces, characterized in that, include: The image acquisition module is used to respond to the system startup command and control the image acquisition device to acquire images from the resin separation tank window based on preset configuration parameters to obtain the original source image; The hue and saturation component extraction module is used to preprocess the original source image and extract the hue and saturation components to obtain the HSV feature image; The layered interface semantic segmentation module is used to extract feature regions and perform layered interface semantic segmentation on HSV feature images to locate and output interface pixel coordinates; the physical space mapping module is used to substitute the interface pixel coordinates into a preset calibration matrix to perform physical space mapping and serialization smoothing calculation to obtain the actual height value; the control strategy generation module is used to logically compare the actual height value with a preset set of process thresholds, and generate a control command frame containing valve action code based on the comparison result and PID control strategy. The control drive module is used to send control command frames to the field control system through the industrial communication interface to drive the actuator to move and complete the measurement and control cycle.
2. The intelligent visual measurement and control analysis system for resin separation interface according to claim 1, characterized in that, The image acquisition module is used to: respond to the system start command, extract the exposure time and analog gain coefficient from the preset configuration parameters, and calculate the frame interval time in combination with the sampling frequency to obtain a sensor drive vector containing timing and level signals; control the image acquisition device to open the shutter based on the sensor drive vector, perform integral response and photoelectric conversion on the incident photon flux of the resin separation tank window within the exposure time, and linearly amplify the converted voltage signal using the analog gain coefficient to obtain an amplified analog signal matrix; and digitally quantize the analog signal matrix using an analog-to-digital converter to obtain the original source image.
3. The intelligent visual measurement and control analysis system for resin separation interface according to claim 1, characterized in that, The hue and saturation component extraction module is used to: perform spatial domain Gaussian convolution smoothing on the original source image using a Gaussian convolution kernel to obtain a smoothed denoised base image; perform linear contrast stretching enhancement on the denoised base image to obtain an enhanced RGB image; and perform color space nonlinear mapping transformation on the enhanced RGB image to obtain an HSV feature image.
4. The intelligent visual measurement and control analysis system for resin separation interface according to claim 1, characterized in that, The hierarchical interface semantic segmentation module is used to: generate ROI masks and remove invalid backgrounds from HSV feature images to obtain effective data of regions of interest; reshape the effective data of regions of interest into a feature vector set, and perform pixel-level feature clustering based on K-Means to obtain a pixel classification matrix; Interface edge detection and coordinate fitting are performed on the pixel classification matrix to obtain the interface pixel coordinates.
5. The intelligent visual measurement and control analysis system for resin separation interface according to claim 1, characterized in that, The physical space mapping module includes: a physical height determination unit, used to determine the instantaneous physical height value based on the interface pixel coordinates; and a time-weighted recursive unit, used to introduce the historical output state value of the previous moment and use an exponentially weighted moving average algorithm to perform time-weighted recursive filtering on the instantaneous physical height value to obtain a smooth and stable actual height value.
6. The intelligent visual measurement and control analysis system for resin separation interface according to claim 1, characterized in that, The control strategy generation module is used to: logically compare the actual height value with the safety boundary and target value in the preset process threshold set to obtain the alarm status bit and control deviation; in response to the normal alarm status bit, perform incremental PID calculation based on the control deviation and its historical rate of change to obtain the control valve opening increment; map the control valve opening increment into hardware action code and encapsulate it through a protocol to obtain a control command frame.
7. The intelligent visual measurement and control analysis system for resin separation interface according to claim 1, characterized in that, The control drive module is used to: perform integrity verification on the control command frame using a cyclic redundancy check algorithm, and transmit it to the field control system through the physical layer interface.
8. The intelligent visual measurement and control analysis system for resin separation interface according to claim 5, characterized in that, The physical height determination unit includes: a line-of-sight incident tangent determination subunit, used to determine the line-of-sight incident tangent based on camera intrinsic parameters and interface pixel coordinates, wherein the camera intrinsic parameters include focal length and optical center ordinate; a refraction height deviation compensation determination subunit, used to determine the refraction height deviation compensation amount based on the line-of-sight incident tangent and window glass parameters, wherein the window glass parameters include glass thickness and glass refractive index; and a physical reconstruction subunit, used to perform physical reconstruction of the refraction height deviation compensation amount and the line-of-sight incident tangent by fusing geometric projection and refraction correction based on basic set mapping parameters to obtain the instantaneous physical height value.
Citation Information
Patent Citations
Systems and methods for creating aberration-corrected gradient index lenses
CN104955633A
Image recognition method for water treatment resin interface
CN105628707A
Liquid level detection method based on visual non-contact
CN111397692A
Spectrum test system and test method based on refractive index double-compensation test
CN114813586A
Method and system for identifying anion and cation resin interfaces of separation tower
CN116310998A