Piston top valve pit detection method and device based on image recognition

By employing multi-angle polarization imaging and image processing technology, the problem of valve pit detection accuracy under the influence of carbon deposits on the piston top was solved, and high-precision valve pit parameter calculation was achieved.

CN122048870APending Publication Date: 2026-05-15SHANDONG ZHENTING JINGGONG PISTON
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610136445.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-30
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

Existing methods for detecting valve pits on piston tops cannot effectively eliminate structural boundary recognition errors caused by carbon deposits or sediments, resulting in insufficient accuracy in extracting valve pit contours and failing to meet the requirements for high-precision detection.

Method used

Using an image recognition-based method, a polarization reflection feature map is generated through multi-angle polarization imaging, lens distortion correction, and grayscale uniformity processing. Combined with polarization uniformity constraints and edge curvature continuity constraints, the sediment region is segmented and candidate boundaries of valve pits are extracted. Spatial overlap suppression and contour continuity completion are performed to obtain the true contour of the valve pits.

Benefits of technology

This improves the stability and reliability of valve recess contour extraction, ensuring accurate calculation of valve recess position coordinates and dimensional parameters, and meeting high-precision detection requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122048870A_ABST
    Figure CN122048870A_ABST
Patent Text Reader

Abstract

The invention discloses a piston top valve pit detection method and device based on image recognition, and particularly relates to the technical field of valve pit detection. The method comprises the following steps: acquiring a multi-angle polarization image sequence at the top of a piston, and carrying out lens distortion correction and gray scale unification processing to form a standard polarization image set; calculating a polarization degree image and a polarization angle image pixel by pixel based on the standard polarization image set, and fusing to generate a polarization reflection feature map; segmenting a sediment area at the top of the piston by adopting a polarization consistency constraint method based on the polarization reflection characteristic pattern, and outputting a sediment mask pattern; extracting candidate boundaries of the valve pit at the top of the piston by adopting an edge curvature continuity constraint method based on the polarization reflection feature map and outputting a candidate contour set; and carrying out space overlap suppression and contour continuity completion processing on the sediment mask pattern and the candidate contour set to obtain a real contour of the valve pit without sediment interference, calculating position coordinate parameters and size parameters of the valve pit, and generating a detection result of the valve pit at the top of the piston.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of valve pit detection technology, and more specifically, to a method and apparatus for detecting valve pits on the piston top based on image recognition. Background Technology

[0002] Current methods for detecting valve recesses on piston tops typically employ traditional visual inspection techniques. These methods acquire two-dimensional images using ordinary optical imaging and extract the valve recess boundaries using conventional grayscale, texture, or edge information. However, during actual operation, the piston top often accumulates varying degrees of carbon deposits or sediment due to combustion processes.

[0003] Existing methods for detecting valve pits on piston tops cannot effectively eliminate structural boundary identification errors caused by deposits on the piston surface, resulting in insufficient accuracy in extracting valve pit contours and causing deviations in the measurement of valve pit size and position parameters, which makes it difficult to meet the actual needs of high-precision engine component quality inspection. Summary of the Invention

[0004] In order to overcome the above-mentioned defects of the prior art, embodiments of the present invention provide a piston top valve pit detection method based on image recognition to solve the problems mentioned in the background art.

[0005] To achieve the above objectives, the present invention provides the following technical solution: The image recognition-based method for detecting valve pits on the piston crown includes the following steps: S1: Based on a fixed imaging distance and a fixed incident angle of the light source, a multi-angle polarized image sequence is acquired from the top of the piston. Lens distortion correction and grayscale uniformity processing are performed on the multi-angle polarized image sequence to form a standard polarized image set. S2: Based on a standard polarization image set, calculate the polarization degree image and polarization angle image pixel by pixel and fuse them to generate a polarization reflection feature map; S3: Based on the polarization reflection feature map, the deposition area at the top of the piston is segmented using the polarization consistency constraint method, and a deposition mask map is output. S4: Based on the polarization reflection feature map, the edge curvature continuity constraint method is used to extract the candidate boundary of the valve pit on the piston top and output the candidate contour set; S5: Spatial overlap suppression and contour continuity completion are performed on the sediment mask image and candidate contour set to obtain the true contour of the vent pit after removing sediment interference. S6: Calculate the position coordinate parameters and size parameters of the valve pit based on the actual contour of the valve pit, and generate the detection result of the valve pit on the top of the piston.

[0006] In a preferred embodiment, S1 specifically refers to: Based on a fixed imaging distance and a fixed incident angle of the light source, multi-angle polarization imaging is performed on the top of the piston to obtain a multi-angle polarization image sequence covering the surface of the top of the piston. Lens distortion correction based on imaging parameters is sequentially applied to the multi-angle polarization image sequence; The multi-angle polarized image sequence that has undergone lens distortion correction is subjected to grayscale uniformization processing to form a standard polarized image set.

[0007] In a preferred embodiment, S2 specifically refers to: Based on the standard polarization image set, the standard polarization image set is registered to a unified pixel coordinate system according to the polarization angle correspondence to form a polarization intensity image group with consistent angles. The maximum and minimum intensity at the pixel level are calculated based on the polarization intensity image group, and the difference and normalization ratio are calculated to form a polarization degree image; Based on the polarization intensity image group, calculate the orthogonal intensity difference and orthogonal intensity sum and perform arctangent operation to form a polarization angle image; The polarization degree image and the polarization angle image are weighted and fused to generate a polarization reflection feature map.

[0008] In a preferred embodiment, S3 specifically refers to: The changes in polarization degree and polarization angle of a pixel neighborhood are calculated based on the polarization reflection feature map, and a polarization consistency metric map is formed. The polarization consistency metric map was smoothed, denoised, thresholded, and connected component merged to obtain a set of candidate regions for sediments at the top of the piston. Based on the standard polarization image set, the polarization intensity image set of the corresponding pixels of the candidate region set of sediments is extracted and the pixel intensity difference value under different polarization angles is calculated. Based on the pixel intensity difference value and polarization consistency metric map, joint screening conditions were set to determine the deposit area at the top of the piston; The porous areas within the sediment region are filled, and a sediment mask map is output.

[0009] In a preferred embodiment, S4 specifically refers to: Calculate pixel gradient magnitude map based on polarization reflection feature map and extract edge response point set of gradient magnitude map; Edge response points that fall into the sediment region are removed based on the sediment mask image, forming a set of vent edge points; Establish an edge chain along the valve pit edge point set and calculate the edge chain curvature sequence. Based on the edge curvature continuity constraint, disconnect the curvature abrupt segment and connect the fracture endpoints with the same direction, and output the candidate profile set.

[0010] In a preferred embodiment, S5 specifically refers to: Spatial overlap suppression processing is performed on the candidate contour set based on the sediment mask image, and contour segments corresponding to the overlapping areas between the candidate contour set and the sediment mask image are deleted to form a purified contour segment set. The distance between adjacent contour endpoints and the difference in tangent direction are calculated based on the cleaned contour fragment set, and endpoint pairs that satisfy the contour continuity condition are selected. For endpoint pairs that meet the contour continuity condition, contour continuity completion processing is performed and curve smoothing constraint is applied to output the true contour of the valve recess.

[0011] In a preferred embodiment, S6 specifically refers to: Extract the set of contour points corresponding to the true contour of the valve recess while maintaining a unified pixel coordinate system; Outlier removal and line segment interpolation encryption are performed on the contour point set to form a continuous contour point set; Calculate the minimum bounding rectangle based on a continuous contour point set and obtain the coordinates of the center point of the minimum bounding rectangle as the position coordinate parameter; The perimeter and enclosed area are calculated based on a continuous contour point set, and the dimensional parameters are generated by combining the length of the long side and the length of the short side of the minimum circumscribed rectangle. The results of the valve pit detection on the top of the piston are then output.

[0012] On the other hand, the present invention provides an image recognition-based piston top valve cleft detection device, comprising: One or more processors; Storage device for storing one or more programs; When one or more programs are executed by one or more processors, the one or more processors implement an image recognition-based method for detecting valve pits on the piston top.

[0013] The technical effects and advantages of the image recognition-based piston top valve pit detection method and device of this invention are as follows: Under fixed imaging distance and fixed incident angle of the light source, a multi-angle polarized image sequence of the piston top is acquired. Lens distortion correction and grayscale consistency processing are performed on the multi-angle polarized image sequence to ensure the imaging consistency of the standard polarized image set. Based on the standard polarized image set, the polarization degree image and polarization angle image are calculated pixel by pixel and fused to generate a polarization reflection feature map, so that the surface reflection difference is stably expressed. Based on the polarization reflection feature map, the sediment region is segmented using the polarization consistency constraint method and the sediment mask map is output to realize the annotation of the sediment region. Under the constraint of the sediment mask map, the edge curvature continuity constraint is used to extract the candidate boundary of the valve pit and output the candidate contour set. Then, spatial overlap suppression and contour continuity completion processing are performed on the candidate contour set to obtain the true contour of the valve pit. The position coordinate parameters and size parameters of the valve pit are calculated based on the true contour of the valve pit and the detection results are generated, improving the stability and reliability of contour extraction and parameter calculation. Attached Figure Description

[0014] Figure 1 This is a schematic diagram of the piston top valve pit detection method based on image recognition according to the present invention; Detailed Implementation

[0015] 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, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention. Example 1:

[0016] Figure 1 The present invention provides a piston top valve pit detection method based on image recognition, which includes the following steps: S1: Based on a fixed imaging distance and a fixed incident angle of the light source, a multi-angle polarized image sequence is acquired from the top of the piston. Lens distortion correction and grayscale uniformity processing are performed on the multi-angle polarized image sequence to form a standard polarized image set. S2: Based on a standard polarization image set, calculate the polarization degree image and polarization angle image pixel by pixel and fuse them to generate a polarization reflection feature map; S3: Based on the polarization reflection feature map, the deposition area at the top of the piston is segmented using the polarization consistency constraint method, and a deposition mask map is output. S4: Based on the polarization reflection feature map, the edge curvature continuity constraint method is used to extract the candidate boundary of the valve pit on the piston top and output the candidate contour set; S5: Spatial overlap suppression and contour continuity completion are performed on the sediment mask image and candidate contour set to obtain the true contour of the vent pit after removing sediment interference. S6: Calculate the position coordinate parameters and size parameters of the valve pit based on the actual contour of the valve pit, and generate the detection result of the valve pit on the top of the piston.

[0017] Specifically, S1: Based on a fixed imaging distance and a fixed incident angle of the light source, a multi-angle polarization image sequence is acquired from the top of the piston. Lens distortion correction and grayscale uniformity processing are then performed on the multi-angle polarization image sequence to form a standard polarization image set, including: Based on a fixed imaging distance and a fixed incident angle of the light source, multi-angle polarization imaging is performed on the top of the piston to obtain a multi-angle polarization image sequence covering the surface of the top of the piston. Specifically, the distance between the imaging device and the top surface of the piston to be inspected is fixed. The imaging device includes, but is not limited to, a CCD image sensor or a CMOS image sensor. The fixed imaging distance between the imaging device and the top surface of the piston is determined based on the structural dimensions of the piston and the focal length of the imaging device. For example, for a piston top structure with a diameter of 80mm, the fixed imaging distance can be set to 350mm to ensure clear imaging of the piston top surface. Then, the incident angle of the incident light source is determined. The incident light source can be a light-emitting diode (LED) light source or a laser diode light source. To ensure the effectiveness and accuracy of the polarization imaging of the piston top, the incident angle of the incident light source can be calibrated and determined based on the reflection characteristics of the piston top surface. For example, the incident angle of the light source with the highest reflected light intensity and the most obvious polarization characteristics is determined through previous experiments and can be set to 45 degrees. The fixed imaging distance and the fixed incident angle of the light source remain constant during one polarization imaging process to ensure the consistency and repeatability of the imaging conditions.

[0018] After setting the fixed imaging distance and fixed incident angle of the light source, multi-angle polarization imaging is performed on the top surface of the piston. Specifically, multi-angle polarization images of the same piston top surface area are acquired by rotating a polarizer. The rotation angle of the polarizer is selected within the range of 0 to 180 degrees, and images are acquired sequentially at equal intervals. For example, if the rotation interval is 30 degrees, polarization images are acquired at seven polarization angles: 0, 30, 60, 90, 120, 150, and 180 degrees. This results in a multi-angle polarization image sequence covering the piston top surface. The polarization image acquired at each polarization angle is a single-angle polarization image. Each single-angle polarization image represents the light intensity distribution characteristics of the piston top surface at that polarization angle. The spatial coordinates of all pixels in each single-angle polarization image remain consistent, forming a multi-angle polarization image sequence.

[0019] Lens distortion correction based on imaging parameters is sequentially applied to the multi-angle polarization image sequence; Specifically, lens distortion correction refers to correcting image distortion caused by the optical characteristics of the imaging device, including barrel distortion and pincushion distortion correction. First, the lens's imaging parameters are obtained based on the intrinsic parameter calibration of the imaging device and lens. For example, the radial and tangential distortion coefficients of the lens are determined using a checkerboard calibration method. For each single-angle polarized image, the determined radial and tangential distortion coefficients are used to perform nonlinear correction and interpolation processing on the coordinates of each pixel in each single-angle polarized image. Correction methods include, but are not limited to, radial and tangential distortion mathematical model correction, such as using OpenCV distortion correction functions, to ensure the spatial accuracy and consistency of the pixel coordinates in each single-angle polarized image. The resulting multi-angle polarized image sequence after lens distortion correction forms a multi-angle polarized image sequence with corrected lens distortion.

[0020] The multi-angle polarized image sequence that has undergone lens distortion correction is subjected to grayscale uniformization processing to form a standard polarized image set. Specifically, grayscale uniformity processing refers to uniformly adjusting the grayscale intensity range of each single-angle polarized image in a multi-angle polarized image sequence after lens distortion correction, in order to eliminate grayscale differences between images with different angles of polarization and form a standard polarized image set. First, the average grayscale intensity and standard deviation of each single-angle polarized image in the multi-angle polarized image sequence after lens distortion correction are calculated to obtain the overall grayscale statistical characteristics of each single-angle polarized image. Based on the average grayscale intensity and standard deviation of all single-angle polarized images, the target reference grayscale value and standard deviation value for grayscale uniformity processing are determined. For example, the average grayscale intensity of all single-angle polarized images can be selected as the reference value. The target reference grayscale value is used as the standard. For the pixel grayscale value of each single-angle polarized image, a linear grayscale transformation is used to adjust it. Specifically, the original average grayscale intensity of the single-angle polarized image is subtracted from the grayscale value of each pixel of the single-angle polarized image, then divided by the original standard deviation, multiplied by the target standard deviation, and finally added to the target reference grayscale value. This completes the grayscale uniformity processing of all single-angle polarized images. Through the above processing, the pixel grayscale value range of each single-angle polarized image is unified into the standard polarized image set, realizing the uniformity of grayscale intensity of images with different angle polarization. Each single-angle polarized image in the standard polarized image set has a consistent grayscale intensity scale and a unified spatial coordinate relationship.

[0021] S2: Based on a standard polarization image set, the polarization degree image and polarization angle image are calculated pixel by pixel and fused to generate a polarization reflection feature map, including: Based on the standard polarization image set, the standard polarization image set is registered to a unified pixel coordinate system according to the polarization angle correspondence to form a polarization intensity image group with consistent angles. Specifically, according to the polarization angle correspondence of each single-angle polarized image, each single-angle polarized image in the standard polarized image set is registered to a unified pixel coordinate system. The unified pixel coordinate system refers to a common pixel coordinate system set to ensure that the coordinate positions of each corresponding pixel in all single-angle polarized images are completely coincident under different imaging states. The registration process involves selecting the first single-angle polarization image in the standard polarization image set as the reference image and determining the absolute coordinates of each pixel in the reference image. Then, based on the polarization angle difference between each single-angle polarization image to be registered and the reference image, image geometric transformation methods are used to rotate, translate, and scale the single-angle polarization image to be registered, achieving precise spatial alignment between each pixel in the single-angle polarization image to be registered and its corresponding pixel in the reference image. Image geometric transformation methods include, but are not limited to, rigid transformations or affine transformations based on feature point matching. Feature points are determined by using image corner detection operators (e.g., Harris corner detection or Shi-Tomasi corner detection) to extract feature points from both the reference image and the single-angle polarization image to be registered. A nearest neighbor matching strategy is used to determine the correspondence between feature points, and the geometric transformation matrix is ​​calculated to perform coordinate transformation processing on the single-angle polarization image to be registered. Through registration, a group of polarization intensity images with consistent angles is formed, ensuring that the spatial position of each corresponding pixel in the polarization intensity image group is completely unified.

[0022] The maximum and minimum intensity at the pixel level are calculated based on the polarization intensity image group, and the difference and normalization ratio are calculated to form a polarization degree image; Specifically, for each corresponding pixel in the polarization intensity image group, the polarization intensity in all single-angle polarization images is extracted and compared one by one. The maximum and minimum intensity values ​​of the pixel under all angles are recorded. Using the maximum and minimum intensity values ​​as input data, a difference and normalization ratio operation is performed to form a polarization degree image. The difference and normalization ratio operation is specifically as follows: the difference between the maximum and minimum intensity values ​​of each pixel is calculated, and then the difference is divided by the sum of the maximum and minimum intensity values. The resulting ratio is defined as the polarization degree of the pixel. The closer the polarization degree is to 1, the more obvious the change in the polarization intensity of the pixel; the closer it is to 0, the smaller the change.

[0023] Based on the polarization intensity image group, calculate the orthogonal intensity difference and orthogonal intensity sum and perform arctangent operation to form a polarization angle image; Specifically, based on two single-angle polarized images with mutually orthogonal polarization angles in the polarization intensity image group, the grayscale intensity of each corresponding pixel position in the two single-angle polarized images is extracted as the polarization intensity data in the orthogonal direction; the orthogonal intensity difference of each corresponding pixel position is calculated, that is, the grayscale intensity of the same corresponding pixel position in the two single-angle polarized images is subtracted and the absolute value is taken; then the orthogonal intensity sum of each corresponding pixel position is calculated, that is, the grayscale intensity of the same corresponding pixel position in the two single-angle polarized images is added; based on the orthogonal intensity difference and the orthogonal intensity sum, an arctangent operation is performed. The specific calculation method is: the polarization angle of each corresponding pixel position is equal to the orthogonal intensity difference divided by the orthogonal intensity sum, and then substituted into the arctangent function for calculation, to obtain the polarization angle distribution range of each corresponding pixel position between 0 degrees and 90 degrees, forming a polarization angle image, where the polarization angle represents the polarization direction distribution information of polarized light at each corresponding pixel position.

[0024] The polarization degree image and the polarization angle image are weighted and fused to generate a polarization reflection feature map; Specifically, the weight coefficients of the degree of polarization image and the angle of polarization image are determined using the information entropy calculation method. Specifically: the overall information entropy of the degree of polarization image and the angle of polarization image are calculated separately; the higher the information entropy, the richer the feature information. The sum of the information entropy of the degree of polarization image and the angle of polarization image is used as the total information entropy. The information entropy of the degree of polarization image and the angle of polarization image are divided by the total information entropy to determine the weight coefficients of the degree of polarization image and the angle of polarization image. After determining the weight coefficients, a weighted summation operation is performed on the degree of polarization and the angle of polarization at each corresponding pixel position in the degree of polarization image and the angle of polarization image. The specific calculation method is as follows: the polarization reflection feature of each corresponding pixel position is equal to the degree of polarization of the corresponding pixel position in the degree of polarization image multiplied by the degree of polarization image weight coefficient, plus the angle of polarization of the corresponding pixel position in the angle of polarization image multiplied by the angle of polarization image weight coefficient. After calculating all corresponding pixel positions, a polarization reflection feature map is formed.

[0025] S3: Based on the polarization reflection feature map, the deposition region at the top of the piston is segmented using the polarization consistency constraint method, and a deposition mask map is output, including: The changes in polarization degree and polarization angle of a pixel neighborhood are calculated based on the polarization reflection feature map, and a polarization consistency metric map is formed. Specifically, for each corresponding pixel position in the polarization reflection feature map, the neighborhood range is determined by selecting the corresponding pixel position as the center and defining a square pixel window centered on the corresponding pixel position. The window size is determined based on the piston top structure size and image resolution, for example, a 3×3 pixel window centered on the corresponding pixel position. The polarization degree and polarization angle of all pixel positions within the neighborhood range are extracted, and the changes in polarization degree and polarization angle of all pixels within the neighborhood range are calculated. The change in polarization degree is calculated based on the absolute value of the difference between the polarization degree of each pixel within the neighborhood window and the polarization degree of the corresponding central pixel position, and then... The average of all differences is taken. Similarly, the polarization angle change is calculated by taking the absolute value of the difference between the polarization angle of each pixel in the neighborhood window and the polarization angle of the corresponding central pixel position, and then taking the average of all differences. The polarization degree change and the polarization angle change represent the degree of consistency of the polarization feature distribution in the neighborhood of the corresponding pixel position, respectively. The smaller the change, the higher the consistency of the polarization feature distribution in the neighborhood of the corresponding pixel position, and the larger the change, the lower the consistency. The neighborhood polarization degree change and the neighborhood polarization angle change are linearly combined to form the polarization consistency measure of each corresponding pixel position, and then a polarization consistency measure map is formed.

[0026] The polarization consistency metric map was smoothed, denoised, thresholded, and connected component merged to obtain a set of candidate regions for sediments at the top of the piston. Specifically, a Gaussian filtering method is used to smooth and denoise the polarization consistency metric map. This Gaussian filtering method involves performing a neighborhood-weighted average operation on each corresponding pixel location in the polarization consistency metric map, with the Gaussian function as the weight. The standard deviation of the Gaussian function is determined based on the spatial scale of the image and the desired smoothness level; for example, a standard deviation of 1.0 is set. After smoothing and denoising, a smoothed polarization consistency metric map is obtained. Thresholding is then performed on the smoothed polarization consistency metric map. The threshold can be determined using the Otsu thresholding method, which involves statistically calculating the gray-level histogram of the entire smoothed polarization consistency metric map and automatically determining the optimal threshold by maximizing the inter-class variance; for example, a threshold of 0.4 is set. Finally, binarization is performed based on the determined threshold. The process involves processing to obtain a preliminary binary map of candidate sediment regions. The binarization method is as follows: pixels with a polarization consistency metric above a threshold are designated as foreground, and pixels with a polarization consistency metric below the threshold are designated as background. Connectivity merging is performed on the binary map of candidate sediment regions. This involves merging interconnected foreground pixels into independent connected regions based on eight-neighbor connectivity, forming multiple initial candidate sediment regions. Simultaneously, filtering and merging are performed based on a connected region area threshold. The connected region area threshold is determined through actual experiments to find the minimum effective region area; for example, a threshold of 10 pixels is set. Connected regions below this threshold are considered noise. Through these processes, the final set of candidate sediment regions at the top of the piston is obtained.

[0027] Based on the standard polarization image set, the polarization intensity image set of the corresponding pixels of the candidate region set of sediments is extracted and the pixel intensity difference value under different polarization angles is calculated. Specifically, for each candidate sediment region in the sediment candidate region set, all pixel positions corresponding to the candidate sediment region are determined; then, based on each single-angle polarized image in the standard polarized image set, the gray intensity corresponding to the pixel position is extracted, forming a polarization intensity image group of the candidate sediment region at each polarization angle; the pixel intensity difference value at different polarization angles is calculated for the polarization intensity image group. The specific calculation method is as follows: for each corresponding pixel position in the candidate sediment region, the gray intensity of the corresponding pixel position at all polarization angles is extracted, the difference between the maximum and minimum gray intensity values ​​is calculated, and defined as the pixel intensity difference value; the pixel intensity difference value characterizes the change of light intensity at the corresponding pixel position in the candidate sediment region at different polarization angles. The larger the difference value, the more obvious the change of light intensity at the pixel position with the polarization angle.

[0028] Based on the pixel intensity difference value and polarization consistency metric map, joint screening conditions were set to determine the deposit area at the top of the piston; Specifically, the method for determining the joint screening conditions is as follows: the polarization consistency measure of each corresponding pixel position in the pixel intensity difference value and polarization consistency measure map is selected as the judgment index. The joint threshold range of pixel intensity difference value and polarization consistency measure is determined based on the analysis of actual samples. For example, the threshold of pixel intensity difference value is set to 0.3 and the threshold of polarization consistency measure map is set to 0.5. A pixel point must simultaneously satisfy the condition that the pixel intensity difference value is higher than its threshold and its polarization consistency measure is also higher than its corresponding threshold in order to be finally determined as a sediment area.

[0029] The porous areas within the sediment region are filled, and a sediment mask image is output. Specifically, morphological closing operations are used to perform pore detection on the binary image of the sediment region. This involves using circular or square structuring elements to dilate the binary image of the sediment region before performing an erosion operation. The size of the structuring elements is determined based on the image resolution and the piston structure size. For example, the structuring element size is set to a circular structuring element with a radius of 3 pixels. After the closing operation, small pores inside the sediment region can be eliminated, generating a pore-free sediment mask image. The sediment mask image formed by the above operations can completely and accurately reflect the boundary and internal area of ​​the sediment region at the top of the piston.

[0030] S4: Based on the polarization reflection feature map, the edge curvature continuity constraint method is used to extract candidate boundaries of the valve pit at the top of the piston, and the candidate contour set is output, including: Calculate pixel gradient magnitude map based on polarization reflection feature map and extract edge response point set of gradient magnitude map; Specifically, the pixel gradient magnitude is calculated using the Sobel gradient operator, an image edge detection operator that includes two orthogonal gradient kernels: a horizontal gradient kernel and a vertical gradient kernel. The horizontal and vertical gradient kernels are used to perform convolution calculations on the grayscale values ​​of each corresponding pixel position and its neighborhood in the polarization reflection feature map, respectively, to obtain the horizontal and vertical gradient components for each corresponding pixel position. The Euclidean norm is then calculated for the horizontal and vertical gradient components of each corresponding pixel position (i.e., the sum of their squares followed by the square root), and the result is the pixel gradient magnitude for that position. This process is repeated for all corresponding pixel positions in the polarization reflection feature map to obtain a complete pixel gradient magnitude map.

[0031] Based on the pixel gradient magnitude map, an edge response point set is extracted from the image using a non-maximum suppression (NMS) method. First, for each corresponding pixel position in the pixel gradient magnitude map, the edge gradient direction is determined based on the calculated horizontal and vertical gradient components. Then, on the vertical line of the gradient direction, the two adjacent pixels before and after the corresponding pixel position are selected, and their gradient magnitudes are extracted and compared. If the gradient magnitude of the corresponding pixel position is greater than the gradient magnitudes of its two adjacent pixels in the gradient direction, the corresponding pixel position is identified as an edge response point, and its gradient magnitude is retained. Otherwise, the gradient magnitude of the corresponding pixel position is suppressed to zero. By performing NMS on all corresponding pixel positions, a complete edge response point set is finally determined, which includes all corresponding pixel positions with retained gradient magnitudes.

[0032] Edge response points that fall into the sediment region are removed based on the sediment mask image, forming a set of vent edge points; Specifically, based on the sediment mask image, all corresponding pixel positions within the sediment region in the mask image are extracted. Each corresponding pixel position in the edge response point set is compared with the corresponding pixel position within the sediment region in the sediment mask image. If a corresponding pixel position in the edge response point set coincides with a corresponding pixel position in the sediment region, the corresponding pixel position is determined to be an edge response point within the sediment region and is removed. If a corresponding pixel position in the edge response point set does not coincide with a corresponding pixel position in the sediment region, the corresponding pixel position is retained as part of the valve pit edge point set. Through the above removal process, the valve pit edge point set is finally formed.

[0033] Establish an edge chain along the valve pit edge point set and calculate the edge chain curvature sequence. Based on the edge curvature continuity constraint, disconnect the curvature abrupt segment and connect the fracture endpoints with the same direction, and output the candidate contour set. Specifically, the edge chain is established as follows: taking any corresponding pixel position in the valve pit edge point set as the starting point, search within the eight-neighbor range of the corresponding pixel position to see if there are other corresponding pixel positions belonging to the valve pit edge point set. If so, connect the searched corresponding pixel position with the starting point to form an initial edge chain; continue to repeat the neighborhood search and connection with the searched corresponding pixel position as the new starting point until there are no new corresponding pixel positions that can be connected on the edge chain, thus forming a complete edge chain; repeat the neighborhood search and connection operation for all corresponding pixel positions in the valve pit edge point set in turn until all corresponding pixel positions in the valve pit edge point set are connected into one or more independent edge chains.

[0034] After establishing the edge chain, calculate the edge chain curvature sequence for each edge chain. The curvature calculation method is as follows: select multiple adjacent corresponding pixel positions one by one along each corresponding pixel position on the edge chain. For example, select two corresponding pixel positions before and after each corresponding pixel position to form a group of 5 points. Then, perform least squares circle fitting calculation on the group of 5 points to obtain the radius of the fitted circle, and use the reciprocal of the radius of the fitted circle as the edge curvature value of the corresponding pixel position at the center. Move the center position sequentially along the entire edge chain to perform circle fitting and curvature calculation, and finally form a complete edge chain curvature sequence.

[0035] After obtaining the edge chain curvature sequence, based on the edge curvature continuity constraint, curvature abrupt segments are disconnected and the break endpoints with consistent directions are connected to output a candidate contour set. The method for determining edge chain curvature abrupt segments is as follows: calculate the difference between the curvature values ​​of adjacent corresponding pixel positions in the edge chain curvature sequence. If the absolute value of the difference between the curvature values ​​of adjacent corresponding pixel positions exceeds a predetermined curvature difference threshold, then this pixel position is determined as a curvature abrupt point. For example, the curvature difference threshold can be determined through statistical analysis based on the actual valve pit structure characteristics of the piston top, for example, set to 0.5. The edge chain is disconnected at all curvature abrupt point positions along the edge chain to form several edge segments. The disconnected edge segments are judged for consistency in direction and connected. The method for judging consistency in direction is as follows: extract the tangent direction of each of the two endpoints of the edge segment. If the angle between the tangent directions of the two endpoints is less than a preset endpoint direction angle threshold, for example, the endpoint direction angle threshold is set to 30 degrees, then the two endpoints are connected to form a new continuous candidate contour. After the curvature abrupt disconnection and direction consistency endpoint connection processing, a candidate contour set consisting of multiple candidate contours is finally formed.

[0036] S5: Spatial overlap suppression and contour continuity completion are performed on the sediment mask image and candidate contour set to obtain the true contour of the vent pits after removing sediment interference, including: Spatial overlap suppression processing is performed on the candidate contour set based on the sediment mask image, and contour segments corresponding to the overlapping areas between the candidate contour set and the sediment mask image are deleted to form a purified contour segment set. Specifically, each candidate contour segment in the candidate contour set is extracted. For each candidate contour segment, all corresponding pixel positions are compared with the corresponding pixel positions of the sediment region in the sediment mask image to determine whether the candidate contour segment has any corresponding pixel positions that completely or partially overlap with the corresponding pixel positions of the sediment region in the sediment mask image. When the corresponding pixel positions in the candidate contour segment completely or partially overlap with the corresponding pixel positions of the sediment region in the sediment mask image, the candidate contour segment is determined to be an overlapping segment and is removed from the candidate contour set. If none of the corresponding pixel positions in the candidate contour segment overlap with the corresponding pixel positions of the sediment region in the sediment mask image, the candidate contour segment is retained to form a cleaned contour segment set. After spatial overlap suppression processing, the cleaned contour segment set only contains candidate contour segments that do not spatially overlap with the sediment region in the sediment mask image.

[0037] The distance between adjacent contour endpoints and the difference in tangent direction are calculated based on the cleaned contour fragment set, and endpoint pairs that satisfy the contour continuity condition are selected. Specifically, the endpoint coordinates of all contour segments in the cleaned contour segment set are extracted; then, for each endpoint, the Euclidean distance between the endpoint and other contour segment endpoints is calculated, and preliminary screening is performed based on a set distance threshold. The distance threshold between endpoints is determined by the actual structural dimensions of the valve recess at the piston top and the image resolution. For example, through actual measurement and statistical analysis, the maximum acceptable connection distance between the contour break endpoints of the valve recess at the piston top can be set to 5 pixels. For endpoint pairs that pass the preliminary screening based on the distance threshold, the tangent direction difference is calculated. Specifically, the tangent direction at the corresponding pixel position at the end of the contour segment where the endpoint is located is calculated. The line direction calculation uses local multi-point linear fitting to determine the tangent slope. For example, linear fitting is performed on the five nearest consecutive corresponding pixel positions at the end of the contour segment containing the endpoint, and the slope of the fitted line is the tangent direction of the endpoint. The angle between the tangent directions of the two endpoints of an endpoint pair is calculated by taking the absolute value of the difference between the arctangent and arctangent of the tangent slopes at the two endpoints. If the angle exceeds 90 degrees, 180 degrees is subtracted from the angle to obtain the minimum angle. The threshold for the angle is set to ensure the continuity of the connection direction of the contour segment endpoints; for example, the threshold can be set to 30 degrees. All endpoint pairs that meet the contour continuity condition are obtained by jointly filtering by distance and tangent direction difference. To determine the final connection scheme from these candidate endpoint pairs, an iterative greedy algorithm is used: First, all candidate endpoint pairs are sorted in ascending order according to their Euclidean distance. Then, the sorted list is traversed starting from the closest pair. If both endpoints in a pair have not yet been connected, the connection is performed, and the two endpoints are marked as connected. This process is repeated until the list is traversed.

[0038] For endpoint pairs that meet the contour continuity condition, contour continuity completion processing is performed and curve smoothing constraint is applied to output the true contour of the valve recess. Specifically, for each pair of endpoints that meets the continuity condition, linear interpolation is performed on the endpoint coordinates to generate a complete contour segment. The interpolation method is as follows: the distance between the coordinates of the two endpoints of the endpoint pair is divided at equal intervals. For example, based on the Euclidean distance between the pixel coordinates of the two endpoints, several new corresponding pixel positions are inserted at equal intervals to form a continuous complete contour segment between the two endpoints. The number of corresponding pixel positions inserted is determined based on the actual contour curve features of the valve pit at the top of the piston and the image resolution. For example, it can be set to insert 5 corresponding pixel positions between every two endpoints. Through the interpolation completion processing between endpoints, the connection between contour segments is initially purified to form an initial continuous contour.

[0039] After completing the initial continuous contour completion process, curve smoothing constraint processing is performed on the initial continuous contour to obtain the true contour of the valve pit. The curve smoothing constraint processing method is as follows: a curve smoothing filtering method is used to smooth the corresponding pixel position coordinates on the initial continuous contour. The curve smoothing filtering method includes, but is not limited to, the cubic spline curve fitting method. Specifically, all corresponding pixel position coordinates of the initial continuous contour are extracted. Using the endpoint coordinates of the contour curve as boundary constraints, the cubic spline interpolation method is applied to fit the curve to all corresponding pixel positions of the contour curve to obtain the fitted cubic spline smooth curve. The cubic spline smooth curve is sampled at equal intervals. The sampling interval is determined according to the actual contour curve length and the required smoothing accuracy. For example, sampling can be set to be performed once every 1 pixel length to ensure the continuity and smoothness of the contour curve. After cubic spline curve fitting and equal interval sampling processing, a smooth and continuous true contour of the valve pit is finally obtained. All corresponding pixel position coordinate data in the true contour constitute the precise boundary of the valve pit.

[0040] S6: Calculate the position coordinates and dimensions of the valve recess based on its actual contour, and generate the valve recess detection results at the top of the piston, including: Extract the set of contour points corresponding to the true contour of the valve recess while maintaining a unified pixel coordinate system; Specifically, the set of contour points corresponding to the true contour of the valve pit refers to the coordinates of all corresponding pixels contained in the true contour of the valve pit after curve smoothing constraint processing. The method for maintaining a unified pixel coordinate system is as follows: the coordinates of each corresponding pixel in the contour point set are completely consistent with the unified pixel coordinate system used in each single-angle polarized image in the standard polarized image set. The unified pixel coordinate system means that the spatial coordinates of each corresponding pixel in the standard polarized image set are uniform and fixed, thus ensuring a one-to-one correspondence and consistency in the spatial positions between the set of contour points corresponding to the true contour of the valve pit and each single-angle polarized image.

[0041] Outlier removal and line segment interpolation encryption are performed on the contour point set to form a continuous contour point set; Specifically, outlier removal is performed on the contour point set using a local density statistical method. This method determines the distance distribution between each corresponding pixel position and its adjacent corresponding pixels. A fixed-radius circular neighborhood is defined around each corresponding pixel position to determine the local density. The neighborhood radius is determined based on the edge smoothness characteristics of the valve pit on the piston top and the image resolution, for example, set to 3 pixels. For each corresponding pixel position, the number of other corresponding pixels within the circular neighborhood is calculated as the local density value. Outliers are then removed based on a local density threshold. The local density threshold is determined by statistically analyzing the overall local density values ​​of the contour point set and selecting the 5th percentile of the statistical values ​​as the local density threshold. For example, the local density threshold is set to the number of corresponding pixels within the neighborhood that are less than or equal to 2. If the local density value of a corresponding pixel position is lower than the threshold, it is identified as an outlier and removed. The remaining pixels after removal constitute the purified contour point set. Line segment interpolation is used to densify the cleaned contour point set to improve contour continuity. Adjacent corresponding pixel positions in the cleaned contour point set are connected, and the Euclidean distance between adjacent corresponding pixel positions is calculated. When the Euclidean distance between adjacent corresponding pixel positions is greater than the distance densification threshold, multiple new corresponding pixel positions are inserted at equal intervals between adjacent corresponding pixel positions. The distance densification threshold is determined based on the actual structural characteristics of the valve pit on the piston top and the image resolution. For example, by actually measuring the optimal continuity requirement of the valve pit edge contour on the piston top, the distance densification threshold is set to 2 pixels. Linear interpolation is used, that is, multiple corresponding pixel positions are evenly inserted along a straight line between two adjacent corresponding pixel positions. The number of interpolations is such that the distance between any two adjacent corresponding pixel positions after interpolation is no greater than the distance densification threshold. After outlier removal and line segment interpolation densification, the contour point set is transformed into a continuous contour point set, ensuring the spatial continuity and accuracy of the contour curve.

[0042] Calculate the minimum bounding rectangle based on a continuous contour point set and obtain the coordinates of the center point of the minimum bounding rectangle as the position coordinate parameter; Specifically, the rotating caliper algorithm is used to calculate the minimum bounding rectangle of the continuous contour point set, and the convex hull contour of the continuous contour point set is calculated. The convex hull calculation adopts the Graham scan algorithm. Specifically, the bottom corresponding pixel position of the continuous contour point set is selected as the reference point, and the polar angles of the remaining corresponding pixel positions are calculated sequentially with the reference point as the origin. They are sorted in ascending order of polar angles and scanned sequentially to gradually determine the corresponding pixel positions on the convex hull. Each boundary line segment in the convex hull contour is used as a side of the rectangle. All boundary line segments of the convex hull contour are rotated and scanned one by one, and the area of ​​the minimum bounding rectangle in each direction is calculated. The rectangle with the smallest area is selected as the minimum bounding rectangle of the continuous contour point set. Finally, based on the coordinate positions of the four vertices of the minimum bounding rectangle, the coordinate position of the center point of the rectangle is calculated as the position coordinate parameter of the valve pit, which is used to accurately describe the spatial position characteristics of the valve pit on the piston top.

[0043] The perimeter and enclosed area are calculated based on a continuous contour point set, and the size parameters are generated by combining the length of the long side and the length of the short side of the minimum circumscribed rectangle. The detection results of the valve pit on the top of the piston are then output. Specifically, the Euclidean distance between adjacent corresponding pixel positions in the continuous contour point set is calculated, and all distances are summed to obtain the perimeter parameter of the true contour of the valve pit. The enclosing area is calculated based on the continuous contour point set. Green's formula is used to calculate the polygon area, treating the contour curve formed by the continuous contour point set as a closed polygon. The area of ​​the trapezoid formed by each side of the polygon and the coordinate axes is calculated sequentially and then summed. The result is the area enclosed by the continuous contour point set. Simultaneously, based on the calculated minimum bounding rectangle, the lengths of the long and short sides of the rectangle are extracted. The perimeter and enclosing area of ​​the continuous contour point set, along with the lengths of the long and short sides of the minimum bounding rectangle, are used together as size parameters. These size parameters comprehensively characterize the geometric dimensions of the valve pit on the piston top. Finally, the output piston top valve pit detection result includes position coordinate parameters and size parameters. The position coordinate parameters represent the spatial position of the center point of the valve pit on the piston top, while the size parameters comprehensively reflect the geometric size characteristics of the valve pit. Example 2:

[0044] The difference between Embodiment 2 and Embodiment 1 is that this embodiment introduces a piston top valve pit detection device based on image recognition.

[0045] The image recognition-based piston crown valve pit detection device includes one or more processors; it also includes a storage device for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the image recognition-based piston crown valve pit detection method.

[0046] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more sets of available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. The semiconductor medium can be a solid-state drive.

[0047] Those skilled in the art will recognize that the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0048] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and modules described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0049] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or modules may be electrical, mechanical, or other forms.

[0050] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0051] In addition, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module.

[0052] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0053] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0054] In conclusion, the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for detecting valve pits on piston tops based on image recognition, characterized in that, Includes the following steps: S1: Based on a fixed imaging distance and a fixed incident angle of the light source, a multi-angle polarized image sequence is acquired from the top of the piston. Lens distortion correction and grayscale uniformity processing are performed on the multi-angle polarized image sequence to form a standard polarized image set. S2: Based on a standard polarization image set, calculate the polarization degree image and polarization angle image pixel by pixel and fuse them to generate a polarization reflection feature map; S3: Based on the polarization reflection feature map, the deposition area at the top of the piston is segmented using the polarization consistency constraint method, and a deposition mask map is output. S4: Based on the polarization reflection feature map, the edge curvature continuity constraint method is used to extract the candidate boundary of the valve pit on the piston top and output the candidate contour set; S5: Spatial overlap suppression and contour continuity completion are performed on the sediment mask image and candidate contour set to obtain the true contour of the vent pit after removing sediment interference. S6: Calculate the position coordinate parameters and size parameters of the valve pit based on the actual contour of the valve pit, and generate the detection result of the valve pit on the top of the piston.

2. The piston top valve pit detection method based on image recognition according to claim 1, characterized in that, S1, specifically: Based on a fixed imaging distance and a fixed incident angle of the light source, multi-angle polarization imaging is performed on the top of the piston to obtain a multi-angle polarization image sequence covering the surface of the top of the piston. Lens distortion correction based on imaging parameters is sequentially applied to the multi-angle polarization image sequence; The multi-angle polarized image sequence that has undergone lens distortion correction is subjected to grayscale uniformization processing to form a standard polarized image set.

3. The piston top valve pit detection method based on image recognition according to claim 2, characterized in that, S2, specifically: Based on the standard polarization image set, the standard polarization image set is registered to a unified pixel coordinate system according to the polarization angle correspondence to form a polarization intensity image group with consistent angles. The maximum and minimum intensity at the pixel level are calculated based on the polarization intensity image group, and the difference and normalization ratio are calculated to form a polarization degree image; Based on the polarization intensity image group, calculate the orthogonal intensity difference and orthogonal intensity sum and perform arctangent operation to form a polarization angle image; The polarization degree image and the polarization angle image are weighted and fused to generate a polarization reflection feature map.

4. The piston top valve pit detection method based on image recognition according to claim 3, characterized in that, S3, specifically: The changes in polarization degree and polarization angle of a pixel neighborhood are calculated based on the polarization reflection feature map, and a polarization consistency metric map is formed. The polarization consistency metric map was smoothed, denoised, thresholded, and connected component merged to obtain a set of candidate regions for sediments at the top of the piston. Based on the standard polarization image set, the polarization intensity image set of the corresponding pixels of the candidate region set of sediments is extracted and the pixel intensity difference value under different polarization angles is calculated. Based on the pixel intensity difference value and polarization consistency metric map, joint screening conditions were set to determine the deposit area at the top of the piston; The porous areas within the sediment region are filled, and a sediment mask map is output.

5. The piston top valve pit detection method based on image recognition according to claim 4, characterized in that, S4, specifically: Calculate pixel gradient magnitude map based on polarization reflection feature map and extract edge response point set of gradient magnitude map; Edge response points that fall into the sediment region are removed based on the sediment mask image, forming a set of vent edge points; Establish an edge chain along the valve pit edge point set and calculate the edge chain curvature sequence. Based on the edge curvature continuity constraint, disconnect the curvature abrupt segment and connect the fracture endpoints with the same direction, and output the candidate profile set.

6. The piston top valve pit detection method based on image recognition according to claim 5, characterized in that, S5, specifically: Spatial overlap suppression processing is performed on the candidate contour set based on the sediment mask image, and contour segments corresponding to the overlapping areas between the candidate contour set and the sediment mask image are deleted to form a purified contour segment set. The distance between adjacent contour endpoints and the difference in tangent direction are calculated based on the cleaned contour fragment set, and endpoint pairs that satisfy the contour continuity condition are selected. For endpoint pairs that meet the contour continuity condition, contour continuity completion processing is performed and curve smoothing constraint is applied to output the true contour of the valve recess.

7. The piston top valve pit detection method based on image recognition according to claim 6, characterized in that, S6, specifically: Extract the set of contour points corresponding to the true contour of the valve recess while maintaining a unified pixel coordinate system; Outlier removal and line segment interpolation encryption are performed on the contour point set to form a continuous contour point set; Calculate the minimum bounding rectangle based on a continuous contour point set and obtain the coordinates of the center point of the minimum bounding rectangle as the position coordinate parameter; The perimeter and enclosed area are calculated based on a continuous contour point set, and the dimensional parameters are generated by combining the length of the long side and the length of the short side of the minimum circumscribed rectangle. The results of the valve pit detection on the top of the piston are then output.

8. A piston top valve pit detection device based on image recognition, characterized in that, include: One or more processors; Storage device for storing one or more programs; When one or more programs are executed by one or more processors, the one or more processors implement the image recognition-based piston top valve pit detection method as described in any one of claims 1-7.