Defoaming sand washing monitoring method and system based on image analysis

By constructing a structural tensor matrix and optimizing the anisotropic spatial kernel parameters, the problems of oil droplet deformation and motion ambiguity in high-speed flow fields of traditional bilateral filtering algorithms are solved, enabling accurate identification and monitoring of oil entrainment anomalies and improving the accuracy and robustness of defoaming and sand flushing.

CN121582256AActive Publication Date: 2026-02-27SHAANXI YUYANG PETROLEUM TECH ENG CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202610106820.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-27
Publication Date
2026-02-27
Estimated Expiration
2046-01-27

AI Technical Summary

Technical Problem

Traditional bilateral filtering algorithms cannot adapt to the deformation, stretching, and motion blur of oil droplets in high-speed flow fields when processing images of liquid discharge from sand flushing ports, resulting in missed detections of oil entrainment and affecting the accuracy of defoaming sand flushing monitoring.

Method used

By constructing the structural tensor matrix of pixels and combining it with the fluid velocity data in the pipeline, the flow direction coherence of pixels and the confidence factor of oil phase anisotropy are determined. The anisotropic spatial kernel parameters are optimized, image enhancement processing is performed, and the area ratio of the oil phase region is calculated to determine whether there is an oil entrainment anomaly at the discharge outlet.

Benefits of technology

It enables accurate identification of oil entrainment anomalies in high-speed flow fields, improves the accuracy and robustness of detection, and prevents crude oil loss and environmental pollution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121582256A_ABST
    Figure CN121582256A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of image data processing, and particularly relates to a defoaming sand washing monitoring method and system based on image analysis, and the method comprises the steps: constructing a structure tensor matrix of pixel points, and determining the flow direction coherence degree of the pixel points; determining an oil phase anisotropy confidence factor of the pixel point; determining anisotropic space kernel parameters after pixel point optimization; obtaining an enhanced sand washing port liquid discharge image; and determining the area proportion of the oil phase region in the enhanced sand washing port liquid discharge image, and judging whether the oil entrainment abnormity exists in the discharge port or not. According to the method, gray features and adaptive anisotropic space kernel parameters of the pixel points and the pixel points in the neighborhood of the pixel points are analyzed, the limitation that a fixed-shape filtering kernel is adopted in a traditional bilateral filtering algorithm in a high-speed mixed flow field is overcome, oil phase features are enhanced, and the accuracy and robustness of oil entrainment anomaly monitoring in the defoaming and sand washing process are improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image data processing. More particularly, the present application relates to a defoaming sand washing monitoring method and system based on image analysis. BACKGROUND

[0002] In the operation process of the oilfield joint station and the transfer station, the three-phase separator as the core equipment, the internal sand cleaning is the key link to maintain efficient separation. Due to the large fluctuation of sand content in the liquid entering the separator and the lack of effective online sand discharge monitoring means, the field operation often relies on artificial sand washing at regular intervals, resulting in incomplete or excessive flushing. Especially in the sand washing and liquid discharge process, due to the extremely fast flow rate and turbid fluid, the traditional liquid level meter is difficult to accurately determine the fluid composition at the discharge outlet. If the flushing pressure is not properly controlled, the oil can be easily entrained into the sand discharge pipeline, causing oil loss, i.e. oil entrainment phenomenon. Therefore, identifying oil phase anomalies in a high turbidity background is of great significance for intelligent sand washing control. The sand washing and liquid discharge contain a large number of suspended sand particles flowing at high speed. These discrete particles form dense high-frequency noise points and rough textures in the image, which will interfere with the identification of the oil phase edge. The existing image analysis method usually uses bilateral filtering algorithm to enhance the sand discharge image to extract oil phase features.

[0003] However, when using the bilateral filtering algorithm to process the sand discharge image, the spatial distance weight is usually calculated based on the isotropic circular kernel, i.e. using a fixed shape filter kernel. In the high-speed flow field of sand washing and liquid discharge, the oil droplets mixed in will be severely deformed due to the action of shear force, showing a strip shape along the flow direction and accompanied by strong motion blur. At this time, if a fixed circular kernel filter is used, the smoothing range in the vertical flow direction may be too large, which may damage the narrow edge of the stretched oil droplet, while the smoothing range in the parallel flow direction may be insufficient, which cannot repair the broken oil droplet texture due to motion blur, resulting in the bilateral filtering algorithm being unable to effectively enhance the oil phase features, and further causing the oil entrainment detection to miss the judgment, affecting the accuracy of the defoaming sand washing monitoring. SUMMARY

[0004] To solve the technical problem that the traditional bilateral filtering algorithm cannot adapt to the deformation and stretching of oil droplets and motion blur in the high-speed flow field of sand washing and liquid discharge when processing the sand discharge image, and further causes the oil entrainment detection to miss the judgment, the present application provides solutions in the following aspects.

[0005] In a first aspect, the present application provides a defoaming sand washing monitoring method based on image analysis, comprising: acquiring a sand washing outlet discharge image and pipeline fluid flow rate data; constructing a structure tensor matrix of pixel points, determining the flow direction coherence degree of the pixel points according to the eigenvalues of the structure tensor and the pipeline fluid flow rate data; determining the oil phase anisotropy confidence factor of the pixel points according to the flow direction coherence degree of the pixel points and the average change rate of the gray value of the pixel points along the fluid extension direction in its neighborhood window; determining the optimized anisotropy spatial kernel parameters of the pixel points according to the oil phase anisotropy confidence factor; performing enhancement processing on the sand washing outlet discharge image by using the optimized anisotropy spatial kernel parameters, to obtain an enhanced sand washing outlet discharge image; determining the area ratio of the oil phase region in the enhanced sand washing outlet discharge image, and judging whether there is oil entrainment abnormality at the discharge port according to the area ratio.

[0006] The present application highlights the directional stretching texture characteristics of oil droplets under high-speed flow field by calculating the flow direction coherence degree and using the difference of the eigenvalues of the structure tensor and the pipeline fluid flow rate data; the present application analyzes the gray level fluctuation and discontinuity of sand grain ghosting by calculating the oil phase anisotropy confidence factor, and realizes accurate identification of sand grain noise; the present application performs adaptive adjustment on the basic spatial standard deviation by determining the optimized anisotropy spatial kernel parameters according to the oil phase anisotropy confidence factor, and enhances the anti-interference ability of the bilateral filtering algorithm under complex flow field; the present application realizes the evaluation of the defoaming sand washing process by generating the enhanced sand washing outlet discharge image based on the optimized anisotropy spatial kernel parameters, calculating the area ratio of the oil phase region and judging the oil entrainment abnormality, can accurately identify the oil entrainment abnormality caused by improper flushing pressure, and improves the accuracy and robustness of detection.

[0007] Preferably, the method for acquiring the sand washing outlet discharge image and the pipeline fluid flow rate data is: deploying a high-speed industrial camera at the sight glass position of the separator sand discharge pipeline, connecting the pipeline electromagnetic flowmeter data interface, collecting the fluid video stream during the sand washing process, synchronously acquiring the pipeline fluid flow rate value corresponding to each frame of image, converting the fluid video stream into a digital gray image sequence by using an image acquisition card, and taking the obtained result as the sand washing outlet discharge image.

[0008] Preferably, the method for obtaining the eigenvalues ​​of the structure tensor is as follows: using the Sobel operator to perform convolution operation on the drainage image of the sand flushing port, calculating the gradient values ​​of the pixel in the horizontal and vertical directions, constructing the structure tensor matrix of the pixel, selecting a neighborhood window of a preset size with the pixel as the center, performing Gaussian weighted summation on the gradient product terms within the neighborhood window, obtaining the three components of the structure tensor matrix respectively, taking the sum of the two diagonal components of the structure tensor matrix as the first value, taking half of the sum of the first value and the square root of the discriminant of the structure tensor as the maximum eigenvalue of the neighborhood structure tensor of the pixel, and taking half of the difference between the first value and the square root of the discriminant as the minimum eigenvalue of the neighborhood structure tensor of the pixel.

[0009] Preferably, the degree of coherence of the flow direction satisfies the expression: In the formula, For the first The degree of flow coherence of each pixel This is the pipeline fluid velocity data at the moment the image of the sand flushing outlet discharge is acquired. and The first The maximum and minimum eigenvalues ​​of the neighborhood structure tensor of each pixel. To prevent tiny quantities with a denominator of zero.

[0010] This invention achieves the assessment of flow direction coherence by constructing a composite function of the exponential term of the pipe fluid velocity data and the ratio term of the structural tensor eigenvalues. The ratio term of the structural tensor eigenvalues ​​analyzes the uniformity of the local texture direction of pixels, while the pipe fluid velocity data term introduces the weighting of macroscopic physical conditions on microscopic texture features. This results in a larger flow direction coherence value being calculated for real fluid regions with clear flow direction features, while the flow direction coherence value is smaller for turbulent noise with chaotic directions or static backgrounds due to the small difference in eigenvalues. This provides a flow direction feature basis for the subsequent adaptive control of anisotropic filtering intensity.

[0011] Preferably, the confidence factor for oil phase anisotropy satisfies the following expression: In the formula, For the first Oil phase anisotropy confidence factor per pixel For the first The degree of flow coherence of each pixel The number of reference pixels selected along the fluid extension direction within the neighborhood window of each pixel. and The first The x and y coordinates of each pixel and respectively, is a unit vector of the fluid extension direction of the i-th pixel point, is a distance offset step, is a natural exponential function. is a pixel point gray value at a position reached after moving the i-th pixel point along the fluid extension direction within its neighborhood window by the distance offset step, is a pixel point gray value at a position reached after moving the i-th pixel point along the fluid extension direction within its neighborhood window by the distance offset step, is a difference between the pixel point gray value at the position reached after moving the i-th pixel point along the fluid extension direction within its neighborhood window by the distance offset step and the pixel point gray value at the position reached after moving the i-th pixel point along the fluid extension direction within its neighborhood window by the distance offset step, is a natural exponential function.

[0012] The present application realizes the evaluation of the oil phase anisotropy confidence factor by constructing a composite function of the flow direction coherence degree and the exponential term of the gray difference along the fluid extension direction. The flow direction coherence degree term reflects the uniformity of the texture direction within the neighborhood of the pixel point, and the exponential term of the gray difference along the fluid extension direction reflects the continuous stability of the pixel point gray value in the fluid extension direction, so that the real oil phase region calculates a larger oil phase anisotropy confidence factor, and the sand grain region calculates a smaller oil phase anisotropy confidence factor, thereby providing a reliable basis for subsequent determination of the optimized anisotropy spatial kernel parameters of the pixel point.

[0013] Preferably, the optimized anisotropy spatial kernel parameters satisfy the expression: ; ; in the expression, is a standard deviation of the i-th pixel point filter kernel in the direction parallel to the fluid extension direction within its neighborhood window, is a standard deviation of the i-th pixel point filter kernel in the direction perpendicular to the fluid extension direction within its neighborhood window, is a basic spatial standard deviation, is an oil phase anisotropy confidence factor of the i-th pixel point, is a filter scale gain factor of the pixel point, is a filter scale attenuation factor of the pixel point.

[0014] ​​​​The application realizes adaptive calculation of the optimized anisotropic spatial kernel parameters by using the oil phase anisotropy confidence factor to respectively amplify and attenuate the base space standard deviation, the filter scale gain factor term stretches the standard deviation parallel to the fluid extension direction, enhances the smooth connectivity along the streamline, and the filter scale attenuation factor term is used to control the standard deviation perpendicular to the fluid extension direction, prevents fluid edge blurring, so that the oil phase region with clear texture is calculated to obtain a larger aspect ratio filter kernel with significant directionality, and the turbulent noise region is calculated to obtain a small scale filter kernel tending to isotropy, thereby providing a structure guiding basis conforming to the fluid physical characteristics for subsequent anisotropic filtering.

[0015] Preferably, the enhanced processing of the sand washing outlet liquid discharge image comprises: traversing the pixel points in the sand washing outlet liquid discharge image, constructing the anisotropic Gaussian space weight of the pixel points according to the optimized anisotropic spatial kernel parameters of the pixel points and the angle value of the fluid extension direction in the neighborhood window of the pixel points, determining the gray value range weight of the pixel points according to the gray value range standard deviation of the pixel points, and performing bilateral filtering calculation combined with the gray value range weight of the pixel points and the anisotropic Gaussian space weight of the pixel points to obtain the enhanced sand washing outlet liquid discharge image.

[0016] Preferably, the determination of the area ratio of the oil phase region in the enhanced sand washing outlet liquid discharge image comprises: performing adaptive threshold segmentation on the enhanced sand washing outlet liquid discharge image, in response to the gray value of a pixel point in the enhanced sand washing outlet liquid discharge image being less than the calculated adaptive segmentation threshold, the pixel point in the enhanced sand washing outlet liquid discharge image belongs to the oil phase region, and calculating the ratio of the total area of the oil phase region to the total area of the enhanced sand washing outlet liquid discharge image, and taking the obtained result as the area ratio of the oil phase region in the enhanced sand washing outlet liquid discharge image.

[0017] Preferably, the judgment of whether the oil entrainment abnormality exists in the discharge port comprises: in response to the area ratio of the oil phase region in the enhanced sand washing outlet liquid discharge image being greater than the pre-set alarm threshold, the oil entrainment abnormality exists in the discharge port.

[0018] The application realizes the automatic monitoring of the oil entrainment abnormality of the discharge port by comparing the area ratio of the oil phase region in the enhanced sand washing outlet liquid discharge image with the set alarm threshold, the area ratio of the oil phase region directly quantifies the relative content of the crude oil component in the enhanced sand washing outlet liquid discharge image, so that the system can quickly determine the oil entrainment abnormality when detecting that the oil phase area is significantly expanded and exceeds the pre-set safety limit, thereby providing accurate basis for the on-site operator to timely adjust the liquid discharge strategy, and effectively preventing the loss of crude oil and environmental pollution.

[0019] In a second aspect, the present application provides a defoaming sand washing monitoring system based on image analysis, comprising a processor and a memory, wherein the memory stores computer program instructions which, when executed by the processor, implement the above-mentioned defoaming sand washing monitoring method based on image analysis.

[0020] By adopting the above technical solution, the above-mentioned defoaming sand washing monitoring method based on image analysis 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 manufactured according to the memory and the processor, and use is facilitated.

[0021] The present application has the following beneficial effects: The present application introduces an anisotropic filter kernel adaptive correction mechanism based on multi-dimensional feature coupling, which solves the technical problem that the traditional bilateral filter algorithm cannot adapt to oil droplet stretching deformation and motion blur due to the use of a fixed shape filter kernel in the high-speed miscible phase flow environment of defoaming sand washing, and further misjudges sand grain ghosting noise as an oil phase target.

[0022] The present application establishes the internal mapping relationship between the flow direction coherence degree and the real oil phase linear texture by analyzing the structure tensor eigenvalue of the pixel point combined with the pipeline fluid flow rate data, and further couples the index reflecting local texture consistency with the index reflecting texture smoothness by fusing the average change rate of the gray value along the fluid extension direction, thereby realizing accurate identification of high-density sand grain interference.

[0023] The present application can calculate the optimized anisotropic spatial kernel parameters matching the local fluid flow deformation characteristics for each pixel point, dynamically stretch and compress the standard deviation of the filter kernel in the parallel and perpendicular flow directions, realize accurate matching of the filtering process and the local direction features of the image, automatically compress the filter kernel to suppress pseudo-texture for the sand grain noise area, moderately stretch the filter kernel to repair motion blur for the real oil phase area, and ensure high integrity and clarity of the oil phase features in the enhanced sand washing outlet discharge image. Ultimately, the present application improves the accuracy and anti-interference ability of oil entrainment anomaly detection, enhances the robustness of defoaming sand washing monitoring, can timely and accurately identify the oil phase anomaly at the discharge port, and provides a solid technical guarantee for intelligent sand washing control of the oil field three-phase separator and prevention and control of crude oil loss. BRIEF DESCRIPTION OF DRAWINGS

[0024] Figure 1 is a flow chart schematically showing a defoaming sand washing monitoring method based on image analysis in the present application; Figure 2 is a comparative result graph schematically showing the defoaming sand washing monitoring of the fixed shape filter kernel in the prior art and the adaptive shape filter kernel in the present application. DETAILED DESCRIPTION

[0025] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative effort belong to the scope of protection of the present application.

[0026] The specific embodiments of the present application will be described in detail below with reference to the drawings.

[0027] The embodiments of the present application disclose a defoaming sand washing monitoring method based on image analysis, referring to Figure 1 , comprising steps S001 to S005, specifically: S001: Obtain the sand washing outlet image and the pipeline fluid flow rate data.

[0028] Specifically, a high-speed industrial camera is deployed at the sight glass position of the separator sand discharge pipeline, and a pipeline electromagnetic flowmeter data interface is connected, the fluid video stream in the sand discharge process is collected, and the pipeline fluid flow rate value corresponding to each frame of image is synchronously obtained, the video stream is converted into a digital gray scale image sequence by using an image acquisition card, and the sand washing fluid image to be processed is obtained. In this embodiment, the frame rate of the high-speed industrial camera is 60 fps, and in other embodiments, the implementer can set the frame rate of the high-speed industrial camera according to the actual implementation situation.

[0029] S002: Construct a structure tensor matrix of the pixel points, and determine the flow direction coherence degree of the pixel points according to the eigenvalues of the structure tensor and the pipeline fluid flow rate data.

[0030] It should be noted that in the traditional bilateral filtering algorithm, a fixed shape filter kernel is used, which is difficult to adapt to the dynamic distortion of the oil droplet shape caused by the dramatic change of the flow rate in the sand washing fluid, resulting in the reduction of the sensitivity and accuracy of the fluid extension direction feature extraction. According to the principle of fluid mechanics, the oil droplet in the mixed phase fluid will be deformed and stretched under the action of viscous shear force in the high-speed flow field, thereby presenting a significant anisotropic texture in the image, that is, the gradient change along the fluid extension direction in the pixel point neighborhood window is small, and the gradient change perpendicular to the fluid extension direction is large. Therefore, the present application combines the maximum eigenvalue and the minimum eigenvalue of the pixel point neighborhood structure tensor to determine the flow direction coherence degree of the pixel points, which is used to represent the directional stretching strength feature of the local texture of the image caused by the macro flow rate.

[0031] Specifically, the Sobel operator is used to perform convolution operations on the drainage image of the sand flushing port to determine the gradient values ​​of the pixels in the horizontal and vertical directions. A structure tensor matrix for each pixel is constructed. A neighborhood window of a preset size is selected centered on the pixel. A Gaussian kernel of the same size as the neighborhood window is used to perform a Gaussian weighted sum of the gradient products of the pixels within the neighborhood window, resulting in three components of the structure tensor matrix: the Gaussian weighted sum of the squares of the horizontal gradients of the pixels within the neighborhood window, the Gaussian weighted sum of the squares of the vertical gradients of the pixels within the neighborhood window, and the Gaussian weighted sum of the products of the horizontal and vertical gradients of the pixels within the neighborhood window. The sum of the two diagonal components of the structure tensor matrix is ​​taken as the first value. Half of the sum of the first value and the square root of the discriminant of the structure tensor is taken as the largest eigenvalue of the neighborhood structure tensor of the pixel. Half of the difference between the first value and the square root of the discriminant is taken as the smallest eigenvalue of the neighborhood structure tensor of the pixel.

[0032] Furthermore, the degree of coherence of the flow satisfies the expression: ; In the formula, For the first The degree of flow coherence of each pixel This is the pipeline fluid velocity data at the moment the image of the sand flushing outlet discharge is acquired. and The first The maximum and minimum eigenvalues ​​of the neighborhood structure tensor of each pixel. To prevent small quantities with a denominator of zero, the range of values ​​for such small quantities is as follows: In this embodiment, the minute amount to prevent the denominator from being zero is set to 0.001. In other embodiments, implementers can set it according to the actual implementation situation.

[0033] In the formula, The larger the value, the faster the fluid velocity in the pipe at the time of image acquisition for the sand flushing outlet. The greater the likelihood that a pixel is affected by the fluid in the pipe, the more likely the 1st pixel is to be affected by the fluid in the pipe. The greater the flow coherence of each pixel, the better. The larger it is, the more likely it is to be the first The stronger the extensibility of the texture in the neighborhood of a pixel in a specific direction, the more pronounced the effect of the texture extension in that direction. The more pronounced the stretching effect on the nth pixel, the more significant the effect on the nth pixel. The greater the likelihood of the presence of linear texture features in the neighborhood of a given pixel, the higher the probability of the presence of linear texture features in the neighborhood of the given pixel. The greater the flow coherence of each pixel, the better.

[0034] S003: Determine the oil phase anisotropy confidence factor of a pixel based on the coherence of the pixel's flow direction and the average rate of change of the gray value of the pixel along the fluid extension direction in its neighborhood window.

[0035] It should be noted that under high-speed oil-sand mixed-phase flow conditions, high-density sand particles will form visual linear trails under high-speed movement. These trails also exhibit significant directional texture features, which can easily lead to misjudging the sand particle trails as oil phase, reducing the accuracy of defoaming and sand flushing monitoring. Based on the optical imaging characteristics of multiphase flow, the grayscale change of the oil phase, as a continuous medium, along the fluid extension direction exhibits a smooth and gradual characteristic, while the sand flow, as a discrete particle collection, still shows high-frequency grayscale fluctuations and discontinuities in its trails along the fluid extension direction. Therefore, this invention combines the flow direction coherence of a pixel with the cumulative characteristics of grayscale value differences along the fluid extension direction within its neighborhood window to determine the oil phase anisotropy confidence factor of the pixel, which is used to characterize that the anisotropic texture at that location belongs to the continuous oil phase.

[0036] Specifically, the direction of the eigenvector corresponding to the minimum eigenvalue of the pixel neighborhood structure tensor is taken as the fluid extension direction within the pixel neighborhood window, and the angle value of the fluid extension direction within the pixel neighborhood window is recorded.

[0037] Furthermore, the confidence factor for oil phase anisotropy satisfies the expression: ; In the formula, For the first Oil phase anisotropy confidence factor per pixel For the first The degree of flow coherence of each pixel The number of reference pixels selected along the fluid extension direction within the pixel's neighborhood window is used to determine the statistical sample size for calculating the confidence factor of the pixel's anisotropy with respect to the oil phase within the neighborhood window. This ensures that grayscale variation features are sufficiently captured along the fluid extension direction to accurately characterize the local anisotropy intensity. In this embodiment, the number of reference pixels is set to 16. In other embodiments, implementers can set this number according to the actual implementation situation. For example, when the fluid texture is more complex, the number of reference pixels can be appropriately increased to improve statistical reliability and reduce noise interference. When the fluid texture is simpler or computational efficiency requirements are higher, the number of reference pixels can be appropriately reduced to avoid excessive computational overhead. and The first To avoid decimals in the summation limits of the expression for the x and y coordinates of each pixel, the number of reference pixels should be set to an even number. and The first a unit vector of the fluid extension direction of the pixel point, a distance offset step of the pixel point relative to the center pixel point, and respectively are the horizontal and vertical coordinates of the pixel point reached after moving the pixel point as the center along the fluid extension direction within its neighborhood window by the distance offset step, respectively are the horizontal and vertical coordinates of the pixel point reached after moving the pixel point as the center along the fluid extension direction within its neighborhood window by the distance offset step, respectively are the horizontal and vertical coordinates of the pixel point reached after moving the pixel point as the center along the fluid extension direction within its neighborhood window by the distance offset step, respectively are the horizontal and vertical coordinates of the pixel point reached after moving the pixel point as the center along the fluid extension direction within its neighborhood window by the distance offset step, respectively are the horizontal and vertical coordinates of the pixel point reached after moving the pixel point as the center along the fluid extension direction within its neighborhood window by the distance offset step, respectively are the horizontal and vertical coordinates of the pixel point reached after moving the pixel point as the center along the fluid extension direction within its neighborhood window by the distance offset step, respectively are the horizontal and vertical coordinates of the pixel point reached after moving the pixel point as the center along the fluid extension direction within its neighborhood window by the distance offset step, respectively are the horizontal and vertical coordinates of the pixel point reached after moving the pixel point as the center along the fluid extension direction within its neighborhood window by the distance offset step, is a natural exponential function.

[0038] wherein, the greater the value of the difference, the greater the possibility that the pixel point is in a linear texture region, the greater the possibility that the pixel point belongs to an oil phase region, and thus the greater the oil phase anisotropy confidence factor of the pixel point. the greater the value of the difference, the greater the possibility that the pixel point is in a linear texture region, the greater the possibility that the pixel point belongs to an oil phase region, and thus the greater the oil phase anisotropy confidence factor of the pixel point. the greater the value of the difference, the greater the possibility that the pixel point is in a linear texture region, the greater the possibility that the pixel point belongs to an oil phase region, and thus the greater the oil phase anisotropy confidence factor of the pixel point. the greater the value of the difference, the greater the possibility that the pixel point is in a linear texture region, the greater the possibility that the pixel point belongs to an oil phase region, and thus the greater the oil phase anisotropy confidence factor of the pixel point. the greater the value of the difference, the greater the possibility that the pixel point is in a linear texture region, the greater the possibility that the pixel point belongs to an oil phase region, and thus the greater the oil phase anisotropy confidence factor of the pixel point. the greater the value of the difference, the greater the possibility that the pixel point is in a linear texture region, the greater the possibility that the pixel point belongs to an oil phase region, and thus the greater the oil phase anisotropy confidence factor of the pixel point. the greater the value of the difference, the greater the possibility that the pixel point is in a linear texture region, the greater the possibility that the pixel point belongs to an oil phase region, and thus the greater the oil phase anisotropy confidence factor of the pixel point. the greater the value of the difference, the greater the possibility that the pixel point is in a linear texture region, the greater the possibility that the pixel point belongs to an oil phase region, and thus the greater the oil phase anisotropy confidence factor of the pixel point. the greater the value of the difference, the greater the possibility that the pixel point is in a linear texture region, the greater the possibility that the pixel point belongs to an oil phase region, and thus the greater the oil phase anisotropy confidence factor of the pixel point.

[0039] S004: determining the optimized anisotropy spatial kernel parameter of the pixel point according to the oil phase anisotropy confidence factor.

[0040] It should be noted that after obtaining the oil phase anisotropy confidence factor of the pixel point, the present application corrects the spatial kernel parameter of the pixel point based on the oil phase anisotropy confidence factor. The traditional bilateral filtering algorithm usually presets a globally fixed spatial standard deviation for all pixel points. The present application corrects the spatial kernel parameter of the pixel point based on the oil phase anisotropy confidence factor to obtain the optimized anisotropy spatial kernel parameter of the pixel point, so that the bilateral filtering algorithm can more accurately extract the oil phase target.

[0041] Specifically, the optimized anisotropy spatial kernel parameter satisfies the expression: ; ; In the formula, For the first The standard deviation of the filter kernel for each pixel in the direction of fluid extension within its neighborhood window. For the first The standard deviation of the filter kernel for each pixel in the direction of fluid extension perpendicular to its neighborhood window. The base spatial standard deviation is used to determine the reference scale of the Gaussian filter kernel within the neighborhood window of a pixel, perpendicular to the direction of fluid extension. In this embodiment, the base spatial standard deviation is set to 3. In other embodiments, implementers can set it according to the actual implementation situation. For example, when the image noise is strong or the detail requirement is high, the base spatial standard deviation can be appropriately increased to enhance the smoothing effect; when the image noise is weak or more subtle textures need to be preserved, the base spatial standard deviation can be appropriately decreased to avoid excessive blurring. For the first Oil phase anisotropy confidence factor per pixel The filter scale gain factor for a pixel is used to adjust the gain of the standard deviation of the pixel filter kernel in the fluid extension direction parallel to its neighborhood window. This ensures that when the oil phase anisotropy confidence factor is large, more flexible optimization of the basic spatial standard deviation can be achieved. The empirical range of the filter scale gain factor is... In this embodiment, the filter scale gain factor is set to 2. In other embodiments, the implementer can set it according to the actual implementation situation. For example, when the oil phase anisotropy confidence factor is large, the filter scale gain factor can be appropriately increased to avoid insufficient smoothing; when the oil phase anisotropy confidence factor is small, the filter scale gain factor can be appropriately decreased to avoid over-smoothing. The filter scale attenuation factor for each pixel is used to adjust the attenuation of the standard deviation of the pixel filter kernel in the direction perpendicular to the main flow direction. This ensures that when the confidence factor for oil phase anisotropy is large, optimization with a shrinkable basic spatial standard deviation can be achieved. The empirical range of the filter scale attenuation factor is [insert range here]. In this embodiment, the filter scale attenuation factor is set to 0.6. In other embodiments, implementers can set it according to the actual implementation situation. For example, when the oil phase anisotropy confidence factor is large, the shrinkage coefficient can be appropriately increased to avoid insufficient edge protection. When the oil phase anisotropy confidence factor is small, the shrinkage coefficient can be appropriately decreased to avoid excessive compression.

[0042] In the formula, The larger it is, the more likely it is to be the first The greater the probability that a pixel belongs to the oil phase region, the larger the effective range of the bilateral filtering algorithm in the fluid extension direction, and the more the filter kernel is stretched. Therefore, the... The larger the standard deviation of the filter kernel for each pixel in the direction of fluid extension parallel to its neighborhood window, the smaller the effective range of the bilateral filtering algorithm in the direction perpendicular to the fluid extension direction, and the more the filter kernel is compressed. Therefore, the... The smaller the standard deviation of the filter kernel for each pixel in the direction of fluid extension perpendicular to its neighborhood window.

[0043] S005: Enhance the flushing port drainage image using the optimized anisotropic spatial kernel parameters to obtain the enhanced flushing port drainage image. Determine the area ratio of the oil phase region in the enhanced flushing port drainage image and judge whether there is an oil entrainment anomaly at the discharge outlet based on the area ratio.

[0044] Specifically, determining whether there is oil entrainment abnormality at the discharge port includes: The pixels in the flushing port drainage image are traversed. Based on the optimized anisotropic space kernel parameters of the pixels and the angle values ​​of the fluid extension direction in their neighborhood windows, anisotropic Gaussian space weights of the pixels are constructed. The grayscale weights of the pixels are calculated according to the preset grayscale standard deviation of the bilateral filtering algorithm. The grayscale weights of the pixels and the anisotropic Gaussian space weights of the pixels are combined for bilateral filtering calculation to obtain the enhanced flushing port drainage image. In this embodiment, the grayscale standard deviation is set to 20. In other embodiments, the implementer can set the grayscale standard deviation according to the actual implementation situation.

[0045] An adaptive threshold segmentation algorithm is used to perform adaptive threshold segmentation on the enhanced flushing port drainage image. If the gray value of a pixel in the enhanced flushing port drainage image is less than the segmentation threshold calculated by the adaptive threshold segmentation algorithm, the pixel in the enhanced flushing port drainage image belongs to the oil phase region. The ratio of the total area of ​​the oil phase region to the total area of ​​the enhanced flushing port drainage image is calculated to determine the area proportion of the oil phase region in the enhanced flushing port drainage image.

[0046] In response to the fact that the area of ​​the oil phase region in the enhanced flushing port drainage image is greater than the preset alarm threshold, indicating an abnormality of oil entrainment at the discharge port, in this embodiment, the alarm threshold is set to 0.08. In other embodiments, the implementer can set the alarm threshold according to the actual implementation situation.

[0047] like Figure 2 As shown, Figure 2The comparison results of monitoring by using the fixed shape filter kernel in the prior art and the adaptive shape filter kernel of the present application are shown, in the normal working condition interval of 0 to 40 frames and 60 to 100 frames of sampling frames, the monitoring curve of the prior art presents severe oscillation, and breaks the alarm threshold multiple times, which is because the prior art uses a fixed shape filter kernel, lacks the sensing ability of fluid direction characteristics, and cannot distinguish the high-density sand trail noise from the real oil phase texture, so that the sand is calculated as the oil phase area by mistake, greatly reducing the reliability of the monitoring result; the monitoring curve of the present application can closely fit the reference value obtained by laboratory test in the whole period, in the oil entrainment abnormal interval of 40 to 60 frames, due to the introduction of the oil phase anisotropy confidence factor to dynamically correct the filter kernel, the sand interference is successfully suppressed, the real mutation of the oil phase area ratio is captured, which stably jumps above the alarm threshold, improving the accuracy and robustness of the oil entrainment abnormal monitoring.

[0048] The embodiment of the present application also discloses a defoaming sand washing monitoring system based on image analysis, comprising a processor and a memory, the memory stores computer program instructions, when the computer program instructions are executed by the processor, a defoaming sand washing monitoring method based on image analysis according to the present application is realized.

[0049] The above system also includes a communication bus and a communication interface and other components familiar to those skilled in the art, the setting and function of which are known in the art, therefore, will not be repeated here.

Claims

1. A method for monitoring defoaming and sand flushing based on image analysis, characterized in that, include: Acquire images of the drainage from the sand flushing port and fluid velocity data in the pipeline; Construct the structure tensor matrix of the pixel, and determine the flow direction coherence of the pixel based on the eigenvalues ​​of the structure tensor and the flow velocity data of the pipeline fluid. The confidence factor of oil phase anisotropy of a pixel is determined based on the degree of flow coherence of the pixel and the average rate of change of gray value of the pixel along the fluid extension direction in its neighborhood window. Based on the oil phase anisotropy confidence factor, determine the anisotropic spatial kernel parameters of the pixel after optimization; The optimized anisotropic spatial kernel parameters are used to enhance the sand flushing port drainage image to obtain an enhanced sand flushing port drainage image. Determine the area ratio of the oil phase region in the enhanced flushing port drainage image, and judge whether there is an oil entrainment anomaly at the discharge port based on the area ratio.

2. The defoaming and sand flushing monitoring method based on image analysis according to claim 1, characterized in that, The method for acquiring the flushing port drainage image and pipeline fluid velocity data is as follows: a high-speed industrial camera is deployed at the sight glass position of the separator sand discharge pipeline and connected to the pipeline electromagnetic flowmeter data interface to collect the fluid video stream during the sand discharge process, and the pipeline fluid velocity value corresponding to each frame image is acquired synchronously. The fluid video stream is converted into a digital grayscale image sequence using an image acquisition card, and the obtained result is used as the flushing port drainage image.

3. The defoaming and sand flushing monitoring method based on image analysis according to claim 1, characterized in that, The method for obtaining the eigenvalues ​​of the structure tensor is as follows: The Sobel operator is used to perform convolution operations on the drainage image of the sand flushing port, calculating the gradient values ​​of the pixels in the horizontal and vertical directions, constructing the structure tensor matrix of the pixels, selecting a neighborhood window of a preset size centered on the pixel, performing Gaussian weighted summation on the gradient product terms within the neighborhood window, obtaining the three components of the structure tensor matrix, taking the sum of the two diagonal components of the structure tensor matrix as the first value, taking half of the sum of the first value and the square root of the discriminant of the structure tensor as the maximum eigenvalue of the neighborhood structure tensor of the pixel, and taking half of the difference between the first value and the square root of the discriminant as the minimum eigenvalue of the neighborhood structure tensor of the pixel.

4. A defoaming and sand flushing monitoring method based on image analysis according to claim 1 or 3, characterized in that, The degree of coherence in the flow direction satisfies the expression: ; In the formula, For the first The degree of flow coherence of each pixel This is the pipeline fluid velocity data at the moment the image of the sand flushing outlet discharge is acquired. and The first The maximum and minimum eigenvalues ​​of the neighborhood structure tensor of each pixel. To prevent tiny quantities with a denominator of zero.

5. The defoaming and sand flushing monitoring method based on image analysis according to claim 1, characterized in that, The oil phase anisotropy confidence factor satisfies the following expression: ; In the formula, For the first Oil phase anisotropy confidence factor per pixel For the first The degree of flow coherence of each pixel The number of reference pixels selected along the fluid extension direction within the neighborhood window of each pixel. and The first The x and y coordinates of each pixel and The first The unit vector of the fluid extension direction of each pixel. This is the distance offset step size. For the first Moving along the fluid extension direction within its neighborhood window, centered on a pixel. The grayscale value of the pixel at the position reached after a step, and the movement... The difference in grayscale values ​​of the pixels at the position reached after a step. It is a natural exponential function.

6. The defoaming and sand flushing monitoring method based on image analysis according to claim 1, characterized in that, The optimized anisotropic space kernel parameters satisfy the expression: ; ; In the formula, For the first The standard deviation of the filter kernel for each pixel in the direction of fluid extension within its neighborhood window. For the first The standard deviation of the filter kernel for each pixel in the direction of fluid extension perpendicular to its neighborhood window. Based on the spatial standard deviation, For the first Oil phase anisotropy confidence factor per pixel The filter scale gain factor for each pixel. is the filter scale attenuation factor for each pixel.

7. The defoaming and sand flushing monitoring method based on image analysis according to claim 1, characterized in that, The enhancement processing of the flushing port drainage image includes: traversing the pixels in the flushing port drainage image, constructing anisotropic Gaussian space weights for the pixels based on the optimized anisotropic space kernel parameters of the pixels and the angle values ​​of the fluid extension direction in their neighborhood windows, determining the grayscale weights of the pixels based on the standard deviation of the grayscale values, and performing bilateral filtering calculations by combining the grayscale weights and the anisotropic Gaussian space weights of the pixels to obtain the enhanced flushing port drainage image.

8. The defoaming and sand flushing monitoring method based on image analysis according to claim 1, characterized in that, Determining the area ratio of the oil phase region in the enhanced sand flushing port drainage image includes: applying adaptive threshold segmentation to the enhanced sand flushing port drainage image; in response to a pixel in the enhanced sand flushing port drainage image having a gray value less than the calculated adaptive segmentation threshold, the pixel in the enhanced sand flushing port drainage image belongs to the oil phase region; calculating the ratio of the total area of ​​the oil phase region to the total area of ​​the enhanced sand flushing port drainage image; and using the result as the area ratio of the oil phase region in the enhanced sand flushing port drainage image.

9. The defoaming and sand flushing monitoring method based on image analysis according to claim 1, characterized in that, The determination of whether there is an oil entrainment anomaly at the discharge outlet includes: responding to the fact that the area ratio of the oil phase region in the enhanced flushing port drainage image is greater than a preset alarm threshold, indicating that there is an oil entrainment anomaly at the discharge outlet.

10. A defoaming and sand-washing monitoring system based on image analysis, characterized in that, include: A processor and a memory, the memory storing computer program instructions that, when executed by the processor, implement a defoaming and sand-washing monitoring method based on image analysis according to any one of claims 1-9.

Citation Information

Patent Citations

  • SAR image change detection method based on adaptive weight image fusion

    CN104200471A

  • Intelligent safety monitoring method and system for workover treatment

    CN114893133A

  • Bottled water impurity detection method based on machine vision

    CN116823835A

  • High-voltage electrical equipment surface defect identification method based on image processing

    CN120953292A

  • Method and apparatus for processing an image property map

    EP3358844A1