Intelligent valve positioner state detection method and system
By adaptively obtaining the structuring element radius size of pixels, the problem of incomplete filtering of contaminated areas or loss of texture features caused by fixed structuring elements in morphological operations is solved, thereby improving the accuracy of valve positioner status detection.
Patent Information
- Application Number
- CN202511716738.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-21
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2045-11-21
AI Technical Summary
In existing technologies, when processing valve positioner images, morphological operations may fail to effectively filter out large contaminated areas or lead to the loss of key texture features, thus affecting the detection results.
An adaptive method is used to obtain the radius size of the structuring element for each pixel. By using the local intensity variation coefficient and the smoothing index, the structuring element is adaptively selected for filtering to ensure that contaminated areas can be effectively filtered out while retaining key texture features.
It achieves effective filtration in contaminated areas and maintains continuity in background areas, avoiding the loss of key information and improving the accuracy of valve positioner status detection.
Smart Images

Figure CN121169929B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, and in particular to a smart valve positioner state detection method and system. BACKGROUND
[0002] The smart valve positioner is a key execution unit in the modern industrial fluid control system, and the display screen and state indicator lamp on the valve positioner can display the device state and alarm information and other key parameters in real time. The information in the display screen on the valve positioner can be read by collecting the valve positioner image, so as to realize real-time monitoring of the device state.
[0003] When the valve positioner is detected, the valve positioner image needs to be preprocessed to smooth the noise, and the valve positioner image can be preprocessed by morphological operations such as dilation and erosion.
[0004] However, the valve positioner usually works in a harsh industrial site with dust, oil stains and the like, so that the collected image will be contaminated by complex and dynamic changes. When processing the image by the traditional morphological operation, a fixed size of structure element needs to be set. When the on-site environment deteriorates and the contaminated area in the image develops into irregular oil stains or water stains, the fixed structure element will lack the adaptability to the pollution changes. If the size of the structure element is set too small, it cannot effectively filter out the large contaminated area. Conversely, if the size of the structure element is set too large to remove the large contaminated area, the key texture or state feature of the valve positioner may be erased, causing loss of key information and affecting the detection result of the valve positioner state. SUMMARY
[0005] In order to solve the problem that the fixed too small structure element cannot effectively filter out the large contaminated area in the morphological operation and the fixed too large structure element erases the key texture or state feature of the valve positioner, the present application provides a smart valve positioner state detection method and system.
[0006] In the first aspect, the present application provides a smart valve positioner state detection method, which adopts the following technical scheme:
[0007] A smart valve positioner state detection method, comprising the steps of:
[0008] collecting a valve positioner image; obtaining a local intensity variation coefficient of each pixel point according to the difference between the gray value of each pixel point and the average gray value of the pixel points in the neighborhood window thereof; obtaining a smoothing factor of each pixel point in the local region of each pixel point based on the local intensity variation coefficient; and obtaining a smoothing index of each pixel point based on the smoothing factor;
[0009] Adaptively obtain the structural element radius size of each pixel point based on the smoothness index of each pixel point; filter the valve positioner image using the structural element radius size of each pixel point to obtain a filtered valve positioner image.
[0010] Detect the state of the valve positioner based on the filtered valve positioner image.
[0011] The innovation of the present application is to improve the globally fixed structural element size, adaptively obtain the optimal structural element size radius for each pixel point in the image, use a larger structural element for smoothing in the smooth pollution or background area, ensure that the pollution area can be effectively filtered out, and also effectively ensure the continuity and consistency of the background area, avoid excessive detail loss, and realize the fine protection of the key texture features while filtering out the edge of the pollution area in the key information texture edge area.
[0012] Preferably, the local intensity variation coefficient of each pixel point is obtained, comprising:
[0013] Obtain the neighborhood window of each pixel point;
[0014] , represent the local intensity variation coefficient of the i-th pixel point in the valve positioner image; represent the number of pixel points in the neighborhood window of the i-th pixel point in the valve positioner image; represent the gray value of the j-th pixel point in the neighborhood window of the i-th pixel point in the valve positioner image; represent the average gray value of all pixel points in the neighborhood window of the i-th pixel point in the valve positioner image; represent the gray information entropy of all pixel points in the neighborhood window of the i-th pixel point in the valve positioner image;||represent the absolute value symbol.
[0015] Based on the gray information entropy and average gray deviation in the neighborhood window of the pixel point, the local intensity variation coefficient is obtained, which is more accurate.
[0016] Preferably, the neighborhood window of each pixel point is obtained, comprising:
[0017] Pre-set neighborhood window size Construct a window of around each pixel point in the valve positioner image as the neighborhood window of each pixel point in the valve positioner image.
[0018] Preferably, the smoothness factor of each pixel point in the local area of each pixel point is obtained, comprising:
[0019] obtaining a local region of each pixel point;
[0020] , representing a smoothing factor of the kth pixel point in the local region of the ith pixel point; representing a local intensity variation coefficient of the kth pixel point in the local region of the ith pixel point; representing a mean value of local intensity variation coefficients of all pixel points in a neighborhood region of the kth pixel point in the local region of the ith pixel point; representing a mean value of local intensity variation coefficients of all pixel points in the local region of the ith pixel point.
[0021] By comparing the local intensity variation of the pixel points under different scale neighborhoods, the accuracy of distinguishing smooth regions and texture edge pixel points is improved.
[0022] Preferably, the obtaining of the local region of each pixel point comprises:
[0023] a window is constructed with each pixel point in the valve positioner image as the center, as the local region of each pixel point in the valve positioner image.
[0024] Preferably, the obtaining of the smoothing index of each pixel point comprises:
[0025] ;
[0026] In the formula, representing the smoothing index of the ith pixel point; representing a smoothing factor of the kth pixel point in the local region of the ith pixel point; representing the number of pixel points in the local region of the ith pixel point.
[0027] Preferably, the adaptive obtaining of the structural element radius size of each pixel point based on the smoothing index of each pixel point comprises:
[0028] According to the smoothing index of each pixel point in the valve positioner image, a connected component analysis is performed on the valve positioner image to obtain various regions in the valve positioner image, and the number of pixel points in the various regions is taken as the area of each region in the valve positioner image.
[0029] , representing the structural element radius size of the ith pixel point; representing the smoothing index of the ith pixel point; representing a mean value of areas of all regions in the valve positioner image; representing a down rounding symbol; max() represents a maximum value function.
[0030] The larger structural element is used for the smooth area, which ensures that the pollution area can be effectively filtered out, and also effectively ensures the continuity and consistency of the background area, avoids excessive detail loss; the smaller structural element is used for the texture edge pixel point, which realizes filtering out the edge of the pollution area, and realizes fine protection of the key texture features.
[0031] Preferably, the structural element radius size of each pixel point is used to filter the valve positioner image to obtain a filtered valve positioner image, including:
[0032] The valve positioner image is subjected to an opening operation according to the structural element radius of each pixel point in the valve positioner image to obtain the filtered valve positioner image.
[0033] Preferably, the valve positioner state is detected based on the filtered valve positioner image, including:
[0034] An image of the valve positioner in each state is obtained, a template matching algorithm is used to perform template matching on the filtered valve positioner image and the image of the valve positioner in each state, an image in the state with the highest similarity is obtained, recorded as a target image, and the state corresponding to the target image is the state of the current valve positioner.
[0035] The accuracy of the valve positioner state detection is submitted.
[0036] In a second aspect, the present application provides an intelligent valve positioner state detection system, which adopts the following technical scheme:
[0037] An intelligent valve positioner state detection system, comprising a processor and a memory, the memory stores computer program instructions, when the computer program instructions are executed by the processor, the above-mentioned intelligent valve positioner state detection method is realized.
[0038] By adopting the above technical scheme, the above-mentioned intelligent valve positioner state detection method is generated into a computer program and stored in the memory to be loaded and executed by the processor, so that a terminal device is made according to the memory and the processor, and the use is convenient.
[0039] The application has the following technical effects: the innovation of the application is to improve the globally fixed structure element size, to adaptively obtain the optimal structure element size radius for each pixel point in the image, to use a larger structure element for smoothing in a smooth pollution or background area, to ensure that the pollution area can be effectively filtered out, and to effectively ensure the continuity and consistency of the background area, thereby avoiding excessive detail loss; in the texture edge area of the key information, the edge of the pollution area is filtered out while the key texture features are finely protected; further, the local gray level change of the pixel point itself and the local gray level change of the pixel point in different size neighborhoods are considered, so that the true smooth area and the complex texture edge area can be more accurately distinguished, thereby providing a very reliable basis for subsequent size adaptation. BRIEF DESCRIPTION OF DRAWINGS
[0040] Figure 1 is a method flow chart in a state detection method of an intelligent valve positioner according to an embodiment of the application. DETAILED DESCRIPTION
[0041] The technical solutions in the embodiments of the application will be clearly and completely described below with reference to the drawings in the embodiments of the application. Obviously, the described embodiments are some, but not all, of the embodiments of the application.
[0042] An embodiment of the application discloses a state detection method of an intelligent valve positioner, referring to Figure 1 , comprising steps S1-S4:
[0043] S1: collecting a valve positioner image.
[0044] In the embodiment of the application, a camera is used to photograph the surface of the valve positioner to obtain a valve positioner surface RGB image. In order to facilitate subsequent processing, the valve positioner surface RGB image is subjected to grayscale processing to obtain a valve positioner image.
[0045] S2: obtaining a local intensity change coefficient of each pixel point in the valve positioner image according to the difference between the gray value of each pixel point and the gray mean value of the pixel points in the neighborhood window; obtaining a smoothing factor of each pixel point in the local area of each pixel point based on the local intensity change coefficient; and obtaining a smoothing index of each pixel point in the valve positioner image based on the smoothing factor.
[0046] It should be noted that the corresponding edge in the valve positioner image has a relatively large gray change; the gray change in the background area and the pollution area is small, because the local intensity change coefficient of each pixel point is obtained according to the difference between the gray value of each pixel point and the gray mean value of the pixel points in the neighborhood window.
[0047] In this embodiment of the invention, a preset neighborhood window size is used. Constructing a system centered on each pixel in the valve positioner image The window serves as a neighborhood window for each pixel of the valve positioner image;
[0048] Obtain the local intensity variation coefficient of each pixel in the valve positioner image:
[0049] ;
[0050] In the formula, The local intensity variation coefficient represents the i-th pixel in the valve positioner image; This represents the number of pixels in the neighborhood window of the i-th pixel in the valve positioner image. This represents the grayscale value of the j-th pixel in the neighborhood window of the i-th pixel in the valve positioner image; This represents the average grayscale value of all pixels in the neighborhood window of the i-th pixel in the valve positioner image. The grayscale entropy represents the grayscale information of all pixels in the neighborhood window of the i-th pixel in the valve positioner image; || represents the absolute value sign.
[0051] as well as The larger the value, the more likely the i-th pixel is to be an edge pixel in the valve positioner image, and the larger its local intensity variation coefficient; conversely, the smaller the value, the more likely it is to be an edge pixel in the valve positioner image, and the larger its local intensity variation coefficient. as well as The smaller the value, the more likely the i-th pixel is to be inside the background and contaminated areas of the valve positioner image, and the smaller its local intensity variation coefficient.
[0052] It should be noted that the grayscale changes in smooth areas (background areas and inside contaminated areas) in the valve positioner image are small, while the grayscale changes in pixels at the texture edges of the valve positioner image are large. If the same size structuring element is used for each pixel in the valve positioner, if the structuring element size is set too small, it will not be able to effectively filter out large contaminated areas. Conversely, if the structuring element size is set too large to remove large contaminated areas, the key texture features of the valve positioner may be erased, resulting in the loss of key information and affecting the detection results of the valve positioner status. Therefore, in order to remove surface contamination while retaining the key information of the valve positioner, this invention obtains the smoothness coefficient of each pixel based on the local intensity change coefficient of each pixel, which facilitates the adaptive selection of the structuring element size.
[0053] In this embodiment of the invention, a system is constructed centered on each pixel in the valve positioner image. The window serves as a local area for each pixel of the valve positioner image;
[0054] Obtain the smoothing factor for each pixel in a local region of each pixel:
[0055] ;
[0056] In the formula, The smoothing factor represents the k-th pixel in the local region of the i-th pixel; The local intensity variation coefficient of the k-th pixel in the local region of the i-th pixel; The average local intensity variation coefficient of all pixels in the neighborhood region of the k-th pixel in the local region of the i-th pixel; The mean value of the local intensity variation coefficients of all pixels in the local region of the i-th pixel.
[0057] , as well as The larger the value, the more likely the k-th pixel in the local region of the i-th pixel is to belong to a pixel at the texture edge. The value is small, making The value must be greater than This makes the smoothing factor of the kth pixel in the local region of the i-th pixel 0, thus avoiding dividing the texture region pixels into smooth region pixels.
[0058] , as well as The smaller the value, the more likely the k-th pixel is to be located in a smooth region within the local area of the i-th pixel. The value is large, making The value must be less than This makes the smoothing factor of the kth pixel in the local region of the i-th pixel 1, thus dividing the k-th pixel into smooth region pixels.
[0059] The smaller the value and The larger the value, the smaller the average local intensity variation coefficient of the i-th pixel at a small scale, and the larger the average local intensity variation coefficient at a large scale. This indicates that pixels exist at texture edges as the range increases. Therefore, the k-th pixel in the local region of the i-th pixel is more likely to be located in a smooth region. The value is large, making The value must be less than This makes the smoothing factor of the kth pixel in the local region of the i-th pixel 1, thus dividing the k-th pixel into smooth region pixels.
[0060] The larger the value and The smaller the value, the larger the average local intensity change coefficient of the i-th pixel at a small scale, and the smaller the average local intensity change coefficient at a large scale. This indicates the existence of smooth regions of pixels as the range increases. Therefore, the k-th pixel in the local region of the i-th pixel is more likely to belong to a pixel at the texture edge. The value is small, making The value must be greater than This makes the smoothing factor of the k-th pixel in the local region of the i-th pixel 0.
[0061] Obtain the smoothness index of each pixel in the valve positioner image:
[0062] ;
[0063] In the formula, The smoothness index represents the i-th pixel. The smoothing factor represents the k-th pixel in the local region of the i-th pixel; This represents the number of pixels in the local region of the i-th pixel. The larger the value, the more the i-th pixel is within a relatively large smooth area, and therefore the smoothness index of the i-th pixel is larger. The smaller the value, the more likely the i-th pixel is to be located at the edge of the texture, and therefore the smoothness index of the i-th pixel is smaller.
[0064] S3: Based on the smoothness index of each pixel in the valve positioner image, obtain the structural element radius size of each pixel in the valve positioner image.
[0065] It should be noted that the higher the smoothness index of any pixel in the valve positioner image, the larger the pixel is in a relatively large background or contaminated area. In this case, a larger structuring element is needed to ensure that the contaminated area can be effectively filtered out, and to effectively ensure the continuity and consistency of the background area, avoiding excessive loss of detail. Conversely, the smaller the value, the smaller the pixel is, indicating that the pixel belongs to the edge texture pixel. A smaller structuring element should be used to achieve the filtering out of the edge of the contaminated area while achieving fine protection of key texture features.
[0066] In the embodiment of the present application, according to the smooth index of each pixel point in the valve positioner image, connected component analysis is performed on the valve positioner image to obtain each region in the valve positioner image, and the number of pixel points in each region is taken as the area of each region in the valve positioner image.
[0067] The structural element radius size of each pixel point in the valve positioner image is obtained:
[0068] ;
[0069] In the formula, represents the structural element radius size of the i-th pixel point; represents the smooth index of the i-th pixel point; represents the area mean value of all regions in the valve positioner image; represents the floor symbol; max() represents the maximum value function; , which ensures that the structural element radius is at least 1, avoiding the case that the structural element radius is 0; The greater the value of the i-th pixel point in a relatively large range of background regions or contaminated regions, the greater the structural element required to ensure that the contaminated region can be effectively filtered out, and the continuity and consistency of the background region can also be effectively ensured to avoid excessive detail loss; The smaller the value of the i-th pixel point, the smaller the structural element required to achieve the filtering of the edge of the contaminated region while achieving fine protection of the key texture features;
[0070] It should be noted that the present application adjusts the structural element radius size based on .
[0071] S4: According to the structural element radius of each pixel point, the valve positioner image is filtered and processed, and the valve positioner state is detected through the processed image.
[0072] It should be noted that according to the structural element radius of each pixel point, the valve positioner image is filtered and processed, and the valve positioner state is detected through the processed image.
[0073] In the embodiment of the present application, according to the structural element radius of each pixel point in the valve positioner image, the valve positioner image is subjected to open operation to obtain a filtered valve positioner image;
[0074] The image of the valve positioner in each state is acquired, a template matching algorithm is used to perform template matching on the filtered valve positioner image and the image of the valve positioner in each state, the image in the state corresponding to the highest similarity is acquired, and the image is recorded as a target image; and the state corresponding to the target image is the state of the current valve positioner.
[0075] It should be noted that the image of the valve positioner in each state includes the image in the normal air supply state, the image in the air path leakage state, the image in the maintenance waiting state, and the like.
[0076] The above are preferred embodiments of the present application, and are not intended to limit the protection scope of the present application, and therefore: any equivalent changes made according to the structure, shape, principle of the present application should be covered within the protection scope of the present application.
Claims
1. A smart valve positioner condition detection method, characterized by, The method comprises the following steps: acquiring a valve positioner image; obtaining a local intensity variation coefficient of each pixel point according to the difference between the gray value of each pixel point and the average gray value of the pixel points in the neighborhood window of each pixel point; obtaining a smoothing factor of each pixel point in the local region of each pixel point based on the local intensity variation coefficient; and obtaining a smoothing index of each pixel point based on the smoothing factor; obtaining a structural element radius size of each pixel point adaptively based on the smoothing index of each pixel point; performing morphological filtering on the valve positioner image using the structural element radius size of each pixel point to obtain a filtered valve positioner image; and detecting the state of the valve positioner based on the filtered valve positioner image.
2. The method of claim 1, wherein, The method of obtaining the local intensity variation coefficient of each pixel point comprises the following steps: obtaining a neighborhood window of each pixel point; , local intensity variation coefficient of the i-th pixel in the valve positioner image; the number of pixel points in the neighborhood window of the i-th pixel in the valve positioner image; the gray value of the j-th pixel in the neighborhood window of the i-th pixel in the valve positioner image; the gray mean value of all pixel points in the neighborhood window of the i-th pixel in the valve positioner image; the gray information entropy of all pixel points in the neighborhood window of the i-th pixel in the valve positioner image; 3. A method of detecting the state of a smart valve positioner according to claim 2, characterized in that, The method of obtaining the neighborhood window of each pixel point comprises the following steps: Pre-set neighborhood window size A window of size 3x3 centered at each pixel in the valve positioner image is constructed as the neighborhood window for each pixel in the valve positioner image. A window of size 3x3 centered at each pixel in the valve positioner image is constructed as the neighborhood window for each pixel in the valve positioner image.
4. The method of claim 1, wherein, The method of obtaining the smoothing factor of each pixel point in the local region of each pixel point comprises the following steps: obtaining a local region of each pixel point; , a smoothing factor of the kth pixel point in the local region representing the ith pixel point; a local intensity variation coefficient of the kth pixel point in the local region representing the ith pixel point; a mean value of local intensity variation coefficients of all pixel points in a neighborhood region of the kth pixel point in the local region representing the ith pixel point; a mean value of local intensity variation coefficients of all pixel points in the local region representing the ith pixel point.
5. A method of detecting the state of a smart valve positioner according to claim 4, characterized in that, The method of obtaining the local region of each pixel point comprises the following steps: A window is constructed with each pixel point in the valve positioner image as the center as the local area of each pixel point in the valve positioner image.
6. The method of claim 1, wherein, The method of obtaining the smoothing index of each pixel point comprises the following steps: ; In the formula, represents the smoothing index of the i-th pixel point; represents the smoothing factor of the k-th pixel point in the local region of the i-th pixel point; represents the number of pixel points in the local region of the i-th pixel point.
7. The method of claim 1, wherein, The method of obtaining the structural element radius size of each pixel point adaptively based on the smoothing index of each pixel point comprises the following steps: performing connected component analysis on the valve positioner image according to the smoothing index of each pixel point in the valve positioner image to obtain various regions in the valve positioner image, and taking the number of pixel points in each region as the area of each region in the valve positioner image; , represents the radius size of the structuring element of the i-th pixel point; represents the smoothing index of the i-th pixel point; represents the area mean of all regions in the valve positioner image; represents the floor symbol; max() represents the maximum function.
8. The method of claim 1, wherein, The method of performing filtering on the valve positioner image using the structural element radius size of each pixel point to obtain a filtered valve positioner image comprises the following steps: performing an opening operation on the valve positioner image according to the structural element radius of each pixel point in the valve positioner image to obtain a filtered valve positioner image.
9. The method of claim 1, wherein, The method of detecting the state of the valve positioner based on the filtered valve positioner image comprises the following steps: obtaining an image of the valve positioner in each state, performing template matching on the filtered valve positioner image and the image of the valve positioner in each state using a template matching algorithm, obtaining an image in the state corresponding to the highest similarity, denoted as a target image, and the state corresponding to the target image is the state of the current valve positioner.
10. A smart valve positioner condition detection system, characterized by, The device comprises a processor and a memory, and the memory stores computer program instructions which, when executed by the processor, implement the intelligent valve positioner state detection method according to any one of claims 1-9.
Citation Information
Patent Citations
Ultrasonic image denoising method based on spatial filtering
CN116205823A
Valve fault intelligent detection system
CN117173187A