A method for self-adapting positioning of a fluctuation area of a indicator diagram based on a trend envelope center line
Patent Information
- Application Number
- CN202611045011.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-14
- Publication Date
- 2026-10-30
AI Technical Summary
[0005]本发明为了解决现有示功图分析诊断时需要对全图处理分析,导致数据处理量大的问题,提出了一种基于趋势包络中心线的示功图波动区域自适应定位方法,仅对波动区域提取出来分析,解决了数据处理量大的问题
[0016]与现有技术相比,本发明的优点和积极效果是:本发明的基于趋势包络中心线的示功图波动区域自适应定位方法,通过构建示功图上下边界曲线的趋势包络中心线,以边界曲线相对于趋势包络中心线的偏离关系作为波动区域判定依据,实现波动区域的自动定位,并根据波动区域制作波动区域掩码,从而为后续工况识别和故障诊断提供高质量特征区域,解决了目前全图处理图像导致处理量大的问题,以及人工定位波动区域导致自动化低和精度差的问题。
Smart Images

Figure CN123015656A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, specifically to an adaptive localization method for fluctuation regions in indicator diagrams based on the trend envelope centerline, which is particularly suitable for the operational condition analysis of indicator diagrams for reciprocating compressors. Background Technology
[0002] An indicator diagram is a curve that reflects the change in gas pressure within the cylinder of a compressor during one working cycle. Testing the indicator diagram is an important method for studying compressor performance and operating conditions. Based on the shape of the indicator diagram, one can analyze and determine the leakage of valves, piston rings, packing, etc.; the pressure loss during intake and exhaust processes; and the heat exchange during compression and expansion. These analyses can then be used to diagnose compressor faults.
[0003] Therefore, accurate extraction of the fluctuation region on the indicator diagram is a core step in analyzing the operating status of reciprocating compressors. Traditional methods for extracting the fluctuation region on the indicator diagram mainly suffer from the following problems: the shape of the indicator diagram varies greatly among different compressors, and the position of the fluctuation region changes during actual operation due to piston wear, valve leakage, and changes in cylinder clearance. Therefore, fixed ROI (Region of Interest) extraction methods fail. Manual extraction is inefficient, highly subjective, and difficult to adapt to the needs of large-scale indicator diagram analysis.
[0004] Current methods analyze the entire dynamometer card directly, resulting in a large amount of invalid information, a high background ratio, and interference with key fluctuation features. Boundary curve smoothing is poor, and the methods are susceptible to noise interference, leading to incorrect extreme point detection. Mask range determination relies solely on empirical values, lacking sufficient accuracy in both horizontal and vertical dimensions, and failing to precisely define fluctuation areas. Therefore, there is an urgent need for an automated, high-precision method for extracting fluctuation areas and generating masks from dynamometer cards to improve the efficiency and accuracy of dynamometer card condition analysis. Summary of the Invention
[0005] To address the problem of large data processing volume caused by the need to process the entire diagram in existing dynamometer diagram analysis and diagnosis, this invention proposes an adaptive localization method for the fluctuation area of dynamometer diagrams based on the trend envelope centerline. This method extracts and analyzes only the fluctuation area, thus solving the problem of large data processing volume.
[0006] To solve the above-mentioned technical problems, the present invention adopts the following technical solution: An adaptive localization method for fluctuation regions in indicator maps based on the trend envelope centerline includes: Step 1: Obtain the indicator image and preprocess it to obtain a binary image; Step 2: Extract the upper boundary points and lower boundary points of the binary image respectively to obtain the upper boundary point sequence composed of the upper boundary points and the lower boundary point sequence composed of the lower boundary points; Step 3: Smooth the upper boundary point sequence and the lower boundary point sequence along the row coordinate axis to obtain continuous upper boundary curves and continuous lower boundary curves. The row coordinate axis is set vertically and the column coordinate axis is set horizontally. Step four, the extreme point detection step, involves detecting local maxima and local minima for the upper and lower boundary curves respectively, recording the column coordinates of all local maxima of the upper boundary curve to form a sequence of local maxima, and recording the column coordinates of all local minima of the upper boundary curve to form a sequence of local minima. Similarly, the sequences of local maxima and local minima of the lower boundary curve are obtained. Step 5: Perform interpolation fitting on the local maximum point sequence and local minimum point sequence of each boundary curve to construct the upper and lower envelopes of the corresponding boundary curves, and calculate the trend envelope center line of the boundary curve based on the upper and lower envelopes of the same boundary curve. Step 6: Find the intersection point of the boundary curve and its corresponding trend envelope center line. Determine the boundary of the fluctuation region in the column coordinate axis direction based on the intersection point, and determine the boundary of the fluctuation region in the row coordinate axis direction based on the local maximum point sequence and local minimum point sequence of the boundary curve. Step 7, generating the fluctuation region mask. Create a zero matrix with the same size as the binary image, and fill the fluctuation region with the value 1 to generate the upper boundary fluctuation region mask and the lower boundary fluctuation region mask respectively; Step 8: Locate the upper and lower boundary fluctuation regions of the remaining indicator diagrams based on the upper and lower boundary fluctuation region masks.
[0007] In some embodiments, the method for extracting the upper and lower boundary points in step two is as follows: traverse column by column along the column coordinate axis of the binary image, and for each element with a pixel value of 1, take the topmost element as the upper boundary point and the bottommost element as the lower boundary point. All the upper boundary points form an upper boundary point sequence, and all the lower boundary points form a lower boundary point sequence.
[0008] In some embodiments, the Savitzky-Golay filtering method is used for smoothing in step three.
[0009] In some embodiments, step four further includes an endpoint completion step for each extreme point sequence, including: For the sequence of local maxima and local minima of the upper boundary curve, insert an element at the beginning of the sequence. This element stores a column coordinate value of 0 and is used to draw the envelope of the upper boundary curve starting from the first column of the two-dimensional image along the column coordinate axis. For the sequence of local maxima and local minima of the lower boundary curve, insert an element at the end of the sequence. This element stores the column coordinate value as the maximum column number of the binary image. This element is used to draw the envelope of the lower boundary curve starting from the last column of the 2D image in the opposite direction of the column coordinate axis.
[0010] In some embodiments, the method for detecting local maxima and local minima in step four is to use a peak detection function to detect the peak and valley values of the corresponding boundary curves respectively.
[0011] In some embodiments, step five uses a cubic Hermite interpolation function to fit each extreme point sequence, and sets the derivative at all extreme points involved in the interpolation to 0.
[0012] In some embodiments, the method for calculating the trend envelope center line in step five is as follows: the average of the upper and lower envelope lines of the same boundary curve is calculated to obtain the trend envelope center line of the boundary curve.
[0013] In some embodiments, the fluctuation region in step six includes an upper fluctuation region corresponding to the upper boundary curve and a lower fluctuation region corresponding to the lower boundary curve. The trend envelope center line includes an upper trend envelope center line corresponding to the upper boundary curve and a lower trend envelope center line corresponding to the lower boundary curve. The method for determining the boundary of the upper fluctuation region in the column coordinate axis direction is as follows: The leftmost point of the upper trend envelope center line is taken as the left boundary of the upper fluctuation area, and the intersection of the upper boundary curve and the rightmost point of the upper trend envelope center line is taken as the right boundary of the upper fluctuation area. The method for determining the boundary of the lower fluctuation region along the column coordinate axis is as follows: The rightmost end of the lower trend envelope center line is taken as the right boundary of the lower fluctuation area, and the intersection of the lower boundary curve and the leftmost end of the lower trend envelope center line is taken as the left boundary of the lower fluctuation area. The method for determining the boundary of the upper fluctuation region along the row coordinate axis is as follows: In the sequence of local maxima and local minima of the upper boundary curve, the highest point is taken as the upper boundary of the upper fluctuation region, and the lowest point is taken as the lower boundary of the upper fluctuation region. The method for determining the boundary of the lower fluctuation region along the row coordinate axis is as follows: In the sequence of local maxima and local minima of the lower boundary curve, the highest point is taken as the upper boundary of the lower fluctuation region, and the lowest point is taken as the lower boundary of the lower fluctuation region.
[0014] In some embodiments, in the method for determining the boundary of the upper fluctuation region in the column coordinate axis direction, when the intersection of the upper boundary curve and the rightmost end of the upper trend envelope center line exceeds half of the binary image, the second intersection of the upper boundary curve and the upper trend envelope center line from the right end is selected as the right boundary of the upper fluctuation region.
[0015] In some embodiments, step one further includes a step of normalizing the direction of the indicator diagram image, uniformly setting the positive direction of the column coordinate axis to be the increase of the gas volume value in the cylinder from zero to the right, and the positive direction of the row coordinate axis to be the increase of the gas pressure in the cylinder from zero to the top.
[0016] Compared with the prior art, the advantages and positive effects of the present invention are as follows: The adaptive localization method for fluctuation regions of dynamometer diagrams based on the trend envelope center line of the present invention constructs the trend envelope center line of the upper and lower boundary curves of the dynamometer diagram, and uses the deviation relationship between the boundary curves and the trend envelope center line as the basis for determining the fluctuation region, thereby realizing the automatic localization of the fluctuation region. Furthermore, a fluctuation region mask is created based on the fluctuation region, thus providing high-quality feature regions for subsequent working condition identification and fault diagnosis. This solves the problem of large processing volume caused by current full-image processing, as well as the problems of low automation and poor accuracy caused by manual localization of fluctuation regions.
[0017] Other features and advantages of the present invention will become clearer after reading the detailed description of the embodiments of the present invention in conjunction with the accompanying drawings. Attached Figure Description
[0018] Figure 1 This is a flowchart of an embodiment of the adaptive positioning method for fluctuation areas of indicator diagrams based on the trend envelope centerline proposed in this invention; Figure 2 This is a schematic diagram of the boundary curve and the envelope line in one embodiment of the adaptive positioning method for the fluctuation region of the indicator diagram based on the trend envelope center line proposed in this invention; Figure 3 This is a schematic diagram of the upper and lower fluctuation region masks in one embodiment of the adaptive positioning method for fluctuation regions of the indicator diagram based on the trend envelope centerline proposed in this invention. Detailed Implementation
[0019] The specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings.
[0020] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0021] It should be noted that in the description of this invention, the terms "upper", "lower", "left", "right", "vertical", "horizontal", etc., which indicate the direction or positional relationship, are based on the direction or positional relationship shown in the drawings. This is only for the convenience of description and is not intended to indicate or imply that the device or element must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, it should not be construed as a limitation of this invention.
[0022] Example 1, see Figure 1 As shown, this embodiment proposes an adaptive localization method for the fluctuation region of a dynamometer chart based on the trend envelope centerline, including: Step 1: Obtain the indicator image and perform preprocessing to obtain a binary image.
[0023] In some embodiments, but not limited to setting a threshold of 128, the regions with pixel values less than 128 are set to 1 to represent pixels on the indicator curve, and the remaining regions are set to 0 to represent background pixels, thus obtaining a binary image of type uint8.
[0024] Step 2: Extract the upper and lower boundary points of the binary image respectively to obtain the upper boundary point sequence composed of the upper boundary points and the lower boundary point sequence composed of the lower boundary points.
[0025] Step 3: Smooth the upper boundary point sequence and the lower boundary point sequence along the row coordinate axis to obtain continuous upper boundary curves and continuous lower boundary curves. The row coordinate axis is set vertically and the column coordinate axis is set horizontally.
[0026] To reduce the interference of noise on the boundary curve, the upper and lower boundary point sequences are smoothed in the direction of the row coordinate axis.
[0027] Step four, the extreme point detection step, involves detecting local maxima and local minima for both the upper and lower boundary curves. The column coordinates of all local maxima on the upper boundary curve are recorded to form a sequence of local maxima. Similarly, the column coordinates of all local minima on the upper boundary curve are recorded to form a sequence of local minima. The same process is repeated for obtaining the local maxima and local minima sequences for the lower boundary curve.
[0028] In some embodiments, local maxima and local minima are detected on the smoothed upper and lower boundary curves, respectively. Local maxima and local minima are only present in fluctuating regions, and their detection allows for precise determination of the fluctuating region's extent.
[0029] By combining boundary curve smoothing with extreme point detection, the interference of noise on boundary morphology analysis is reduced.
[0030] Step 5: Perform interpolation fitting on the local maximum and local minimum point sequences of each boundary curve to construct the upper and lower envelopes of the corresponding boundary curves, such as... Figure 2 As shown, the trend envelope centerline of the boundary curve is calculated based on the upper and lower envelope lines of the same boundary curve. By constructing the envelope line, the trend envelope centerline of the boundary curve is determined, which can more stably distinguish between the overall trend and local fluctuations.
[0031] Step 6: Find the intersection point of the boundary curve and its corresponding trend envelope center line. Determine the boundary of the fluctuation region in the column coordinate axis direction based on the intersection point, and determine the boundary of the fluctuation region in the row coordinate axis direction based on the local maximum point sequence and local minimum point sequence of the boundary curve.
[0032] The intersection of the boundary curve and its corresponding trend envelope center line is the dividing point of deviation between the two curves. It's possible that the boundary curve was originally above the trend envelope center line, but after this intersection point, it becomes below the trend envelope center line; conversely, it might be below the trend envelope center line, but after this intersection point, it becomes above the trend envelope center line. Since the boundary curve of the fluctuation region fluctuates up and down, it may have multiple intersection points with the trend envelope center line. The number of intersection points reflects the fluctuation frequency of the fluctuation region. Therefore, in this embodiment, determining the fluctuation region based on the intersection points of the trend envelope center line and the boundary curve can help to further accurately locate the range of the fluctuation region. Furthermore, determining the boundary of the fluctuation region by the deviation relationship of the boundary curve relative to the trend envelope center line reduces the reliance on fixed empirical selection methods.
[0033] Step 7, generating the fluctuation region mask. Create a zero matrix with the same size as the binary image, and fill the fluctuation regions with the value 1. Generate the upper boundary fluctuation region mask and the lower boundary fluctuation region mask respectively, as follows. Figure 3 As shown.
[0034] Step 8: Locate the upper and lower boundary fluctuation regions of the remaining indicator maps based on the upper and lower boundary fluctuation region masks.
[0035] The generated fluctuation region mask can be directly used as a priori region of interest for subsequent operating condition identification or fault diagnosis, and has good engineering application value.
[0036] The adaptive localization method for fluctuation regions in dynamometer diagrams based on trend envelope centerlines in this embodiment constructs trend envelope centerlines of the upper and lower boundary curves of the dynamometer diagram. It uses the deviation of the boundary curves from the trend envelope centerlines as the basis for determining fluctuation regions, thereby achieving automatic localization of fluctuation regions. Furthermore, it creates fluctuation region masks based on the fluctuation regions, thus providing high-quality feature regions for subsequent working condition identification and fault diagnosis. This solves the problem of large processing volume caused by full-image processing and the problems of low automation and poor accuracy caused by manual localization of fluctuation regions.
[0037] In some embodiments, the extraction method for the upper and lower boundary points in step two is as follows: traverse column by column along the column coordinate axis of the binary image. For each column of elements with a pixel value of 1, take the topmost element as the upper boundary point and the bottommost element as the lower boundary point. All upper boundary points form an upper boundary point sequence, and all lower boundary points form a lower boundary point sequence. It can be understood that the upper and lower boundary point sequences store the coordinate values of the corresponding boundary points.
[0038] To reduce noise interference on the boundary curves, the upper and lower boundary point sequences are smoothed along the row coordinate axis. In some embodiments, the Savitzky-Golay filtering method is used for smoothing in step three. By performing polynomial fitting on the local data, the filter window length and polynomial order can be adaptively determined according to the number of boundary points, the degree of curve fluctuation, or the image resolution, so as to balance noise suppression capability and curve detail preservation capability.
[0039] In some embodiments, when the number of boundary points is greater than 15, Savitzky-Golay filtering with a window length of 15 and a polynomial order of 2 is used for smoothing. When the number of boundary points is no more than 15, the original boundary point sequence is preserved.
[0040] In some embodiments, step four involves detecting local maxima and local minima on the smoothed upper and lower boundary curves to obtain key extrema that characterize the changes in the boundary curves. To reduce false extrema caused by local noise, peak detection conditions can be set based on the fluctuation characteristics of the boundary curves, and invalid extrema that do not meet the preset conditions can be filtered out.
[0041] Since boundary curves typically lack complete extreme value information at both ends, directly fitting the envelope can easily lead to insufficient fitting in the boundary region or end distortion. Therefore, boundary compensation is performed on the extreme point sequence, supplementing fitting control points at the boundary locations. In a preferred embodiment, a peak detection function can be used to identify local maxima and minima, and detection parameters such as inter-peak distance and peak significance can be adaptively set based on the boundary curve length, fluctuation amplitude, or image size. Boundary compensation points can be set at the start or end positions of the boundary curve, or other locations suitable for ensuring complete coverage of the analysis interval by the envelope.
[0042] In some embodiments, step four, which involves endpoint completion for each extreme point sequence, includes: For the sequence of local maxima and local minima of the upper boundary curve, an element with a column coordinate value of 0 is inserted at the beginning of the sequence. This element is used to start drawing the envelope of the upper boundary curve from the first column of the 2D image along the column coordinate axis. This ensures that the subsequent upper boundary envelope fitting covers the current image analysis interval.
[0043] For the sequence of local maxima and local minima of the lower boundary curve, an element is inserted at the end of the sequence. This element stores the column coordinate value as the maximum column number of the binary image. This element is used to draw the envelope of the lower boundary curve starting from the last column of the 2D image along the reverse direction of the column coordinate axis. This ensures that the subsequent lower boundary envelope fitting covers the current image analysis interval.
[0044] In some embodiments, the method for detecting local maxima and local minima in step four is as follows: Peak detection functions are used to detect the peaks and valleys of the corresponding boundary curves, respectively. In some embodiments, peak detection functions are used to detect peaks and valleys separately, such as the `find_peak` function from the SciPy library in Python, where the `distance` parameter is set to 2, and the `prominence` parameter is set to 0.001 times the standard deviation of the upper and lower boundary smoothing sequences, respectively, to suppress invalid extreme points.
[0045] In some embodiments, step five uses a cubic Hermite interpolation function to fit the sequence of extreme points, and sets the derivatives at all extreme points involved in the interpolation to 0, so that the interpolation curve passes through the extreme points with a horizontal tangent.
[0046] In some embodiments, the method for calculating the trend envelope center line in step five is as follows: the average of the upper and lower envelope lines of the same boundary curve is calculated to obtain the trend envelope center line of the boundary curve.
[0047] The trend envelope centerline satisfies the following relationship: .
[0048] in, The upper envelope, This is the lower envelope.
[0049] In some embodiments, the lateral boundary of the fluctuation region is determined by analyzing the deviation relationship between the smooth boundary curve and the center line of the trend envelope, based on the position of the sign change of the difference between the boundary curve and the center line of the trend envelope.
[0050] In step six, the fluctuation region includes the upper fluctuation region corresponding to the upper boundary curve and the lower fluctuation region corresponding to the lower boundary curve. The trend envelope center line includes the upper trend envelope center line corresponding to the upper boundary curve and the lower trend envelope center line corresponding to the lower boundary curve. The method for determining the boundary of the upper fluctuation region in the column coordinate axis direction is as follows: The leftmost point of the upper trend envelope center line is taken as the left boundary of the upper fluctuation area, and the intersection of the upper boundary curve and the rightmost point of the upper trend envelope center line is taken as the right boundary of the upper fluctuation area.
[0051] The method for determining the boundary of the lower fluctuation region along the column coordinate axis is as follows: The rightmost point of the lower trend envelope center line is taken as the right boundary of the lower fluctuation area, and the intersection of the lower boundary curve and the leftmost point of the lower trend envelope center line is taken as the left boundary of the lower fluctuation area.
[0052] The method for determining the boundary of the upper fluctuation region along the row coordinate axis is as follows: In the sequence of local maxima and local minima of the upper boundary curve, the highest point is taken as the upper boundary of the upper fluctuation region, and the lowest point is taken as the lower boundary of the upper fluctuation region.
[0053] The method for determining the boundary of the lower fluctuation region along the row coordinate axis is as follows: In the sequence of local maxima and local minima of the lower boundary curve, the highest point is taken as the upper boundary of the lower fluctuation region, and the lowest point is taken as the lower boundary of the lower fluctuation region.
[0054] During the compression process of a reciprocating compressor, the volume reduction of the gas inside the cylinder is typically greater than half of the cylinder's working volume. This pattern is reflected in the indicator diagram as follows: the volume range corresponding to the exhaust process is shorter, meaning the pressure fluctuation section at the upper boundary of the indicator diagram (exhaust process curve) has a smaller span along the volume axis; the lower boundary of the indicator diagram corresponds to the intake stroke. Since the pressure inside and outside the cylinder is basically balanced during the intake phase, the gas volume is almost unaffected by pressure fluctuations, and its change is entirely determined by piston displacement, thus resulting in a larger span along the volume axis. The compressibility of gas means that the compression process occupies most of the cylinder volume corresponding to the piston stroke, leaving only a very small volume range corresponding to the exhaust process; while during the intake process, the cylinder pressure remains basically constant, and the cylinder volume changes synchronously with the piston movement, covering most of the piston's working stroke. Ultimately, in the indicator diagram with volume as the horizontal axis, the characteristic difference is that the volume span of the exhaust section is short, while the volume span of the intake section is long. Therefore, in some embodiments, in the method for determining the boundary of the upper fluctuation region along the column coordinate axis, when the intersection point of the upper boundary curve and the rightmost end of the upper trend envelope center line exceeds half of the binary image, the second intersection point from the right of the upper boundary curve and the upper trend envelope center line is selected as the right boundary of the upper fluctuation region. Even if there is an intersection point, a value greater than half the width is not considered a fluctuation region. If the column coordinate value of the intersection point of the boundary curve and the leftmost end of the trend envelope center line is less than 50, the leftmost intersection point is taken as the minimum horizontal boundary of the lower mask; otherwise, the horizontal coordinate corresponding to the second intersection point from the left is taken as the leftmost boundary of the lower mask.
[0055] In some embodiments, step one further includes a step of normalizing the direction of the indicator diagram image, uniformly setting the positive direction of the column coordinate axis to be the increase of the gas volume value in the cylinder from zero to the right, and the positive direction of the row coordinate axis to be the increase of the gas pressure in the cylinder from zero to the top.
[0056] Of course, the above description is not intended to limit the present invention, and the present invention is not limited to the examples given above. Any changes, modifications, additions or substitutions made by those skilled in the art within the scope of the present invention should also fall within the protection scope of the present invention.
Claims
1. A method for self-adapting positioning of the fluctuation area of a dynamometer diagram based on a trend envelope center line, characterized in that, include: Step 1: Obtain the indicator image and preprocess it to obtain a binary image; Step 2: Extract the upper boundary points and lower boundary points of the binary image respectively to obtain the upper boundary point sequence composed of the upper boundary points and the lower boundary point sequence composed of the lower boundary points; Step 3: Smooth the upper boundary point sequence and the lower boundary point sequence along the row coordinate axis to obtain continuous upper boundary curves and continuous lower boundary curves. The row coordinate axis is set vertically and the column coordinate axis is set horizontally. Step four, the extreme point detection step, involves detecting local maxima and local minima for the upper and lower boundary curves respectively, recording the column coordinates of all local maxima of the upper boundary curve to form a sequence of local maxima, and recording the column coordinates of all local minima of the upper boundary curve to form a sequence of local minima. Similarly, the sequences of local maxima and local minima of the lower boundary curve are obtained. Step 5: Perform interpolation fitting on the local maximum point sequence and local minimum point sequence of each boundary curve to construct the upper and lower envelopes of the corresponding boundary curves, and calculate the trend envelope center line of the boundary curve based on the upper and lower envelopes of the same boundary curve. Step 6: Find the intersection point of the boundary curve and its corresponding trend envelope center line. Determine the boundary of the fluctuation region in the column coordinate axis direction based on the intersection point, and determine the boundary of the fluctuation region in the row coordinate axis direction based on the local maximum point sequence and local minimum point sequence of the boundary curve. Step 7: Generation of fluctuation region mask. Create a zero matrix with the same size as the binary image, and fill the fluctuation region with the value 1 to generate the upper boundary fluctuation region mask and the lower boundary fluctuation region mask respectively. Step 8: Locate the upper and lower boundary fluctuation regions of the remaining indicator diagrams based on the upper and lower boundary fluctuation region masks.
2. The method of claim 1, wherein, The method for extracting the upper and lower boundary points in step two is as follows: traverse column by column along the column coordinate axis of the binary image. For each column of elements with a pixel value of 1, take the topmost element as the upper boundary point and the bottommost element as the lower boundary point. All the upper boundary points form the upper boundary point sequence, and all the lower boundary points form the lower boundary point sequence.
3. The method according to claim 1, characterized in that, Step three uses the Savitzky-Golay filtering method for smoothing.
4. The method according to claim 1, characterized in that, Step four also includes endpoint completion for each extreme point sequence, including: For the sequence of local maxima and local minima of the upper boundary curve, insert an element at the beginning of the sequence. This element stores a column coordinate value of 0 and is used to draw the envelope of the upper boundary curve starting from the first column of the two-dimensional image along the column coordinate axis. For the sequence of local maxima and local minima of the lower boundary curve, insert an element at the end of the sequence. This element stores the column coordinate value as the maximum column number of the binary image. This element is used to draw the envelope of the lower boundary curve starting from the last column of the 2D image in the opposite direction of the column coordinate axis.
5. The method according to claim 1, characterized in that, The method for detecting local maxima and local minima in step four is to use a peak detection function to detect the peak and valley values of the corresponding boundary curves respectively.
6. The method according to claim 1, characterized in that, In step five, the cubic Hermite interpolation function is used to fit the sequence of extreme points, and the derivatives at all extreme points involved in the interpolation are set to 0.
7. The method according to claim 1, characterized in that, The method for calculating the trend envelope center line in step five is as follows: calculate the average of the upper and lower envelope lines of the same boundary curve to obtain the trend envelope center line of the boundary curve.
8. The method according to claim 1, characterized in that, The fluctuation region mentioned in step six includes an upper fluctuation region corresponding to the upper boundary curve and a lower fluctuation region corresponding to the lower boundary curve. The trend envelope center line includes an upper trend envelope center line corresponding to the upper boundary curve and a lower trend envelope center line corresponding to the lower boundary curve. The method for determining the boundary of the upper fluctuation region in the column coordinate axis direction is as follows: The leftmost point of the upper trend envelope center line is taken as the left boundary of the upper fluctuation area, and the intersection of the upper boundary curve and the rightmost point of the upper trend envelope center line is taken as the right boundary of the upper fluctuation area. The method for determining the boundary of the lower fluctuation region along the column coordinate axis is as follows: The rightmost end of the lower trend envelope center line is taken as the right boundary of the lower fluctuation area, and the intersection of the lower boundary curve and the leftmost end of the lower trend envelope center line is taken as the left boundary of the lower fluctuation area. The method for determining the boundary of the upper fluctuation region along the row coordinate axis is as follows: In the sequence of local maxima and local minima of the upper boundary curve, the highest point is taken as the upper boundary of the upper fluctuation region, and the lowest point is taken as the lower boundary of the upper fluctuation region. The method for determining the boundary of the lower fluctuation region along the row coordinate axis is as follows: In the sequence of local maxima and local minima of the lower boundary curve, the highest point is taken as the upper boundary of the lower fluctuation region, and the lowest point is taken as the lower boundary of the lower fluctuation region.
9. The method according to claim 8, characterized in that, In the method for determining the boundary of the upper fluctuation region along the column coordinate axis, when the intersection of the upper boundary curve and the rightmost end of the upper trend envelope center line exceeds half of the binary image, the second intersection of the upper boundary curve and the upper trend envelope center line from the right end is selected as the right boundary of the upper fluctuation region.
10. The method according to any one of claims 1-9, characterized in that, Step one also includes a step of normalizing the direction of the indicator diagram image, uniformly setting the positive direction of the column coordinate axis to the increase of the gas volume value in the cylinder from zero to the right, and the positive direction of the row coordinate axis to the increase of the gas pressure in the cylinder from zero to the top.
