A valve plate valve seat surface defect visual detection method and system
Patent Information
- Application Number
- CN202611241502.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-17
- Publication Date
- 2026-10-23
AI Technical Summary
[0007]提供一种阀板阀座表面缺陷视觉检测方法及系统,旨在解决相关技术中阀板或阀座的密封带边缘发生缺损时,密封带边界难以准确识别,导致缺陷区域及边缘损伤范围检测不准确的问题
(1)本发明,通过对正视灰度图像进行径向采样、灰度跃迁提取、候选边缘识别及缺陷区域映射,使表面缺陷检测建立在工业视觉图像分析、边缘检测和缺陷区域提取基础上,进而实现了阀板阀座密封面缺陷的视觉识别与图像定位的效果,有效解决了现有技术中仅依赖人工观察或局部图像特征难以准确识别密封带边缘缺陷的问题。
Smart Images

Figure CN122966623A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of visual image detection technology, specifically to a visual detection method and system for valve plate and valve seat surface defects. Background Technology
[0002] Valve plates and seats are crucial mating components in valves, enabling media cutoff and sealing. The quality of the sealing surface processing directly affects the valve's sealing performance. In applications such as high-pressure and large-diameter valves, the sealing surfaces of valve plates and seats need to withstand media erosion, opening and closing friction, and contact loads. Some valve plates and seats also utilize tungsten carbide ceramic spraying or supersonic thermal spraying to create wear-resistant surfaces. During processing, spraying, assembly, or use, surface defects such as coating peeling and chipping may occur on the sealing surfaces of valve plates and seats, necessitating defect detection. With the application of industrial vision technology, current sealing surface inspection methods involve acquiring surface images using industrial cameras and identifying surface defects based on grayscale, edge, or region features within the images. For valve plates or seats with annular sealing bands, current vision inspection typically involves first extracting the sealing band boundary from the image, defining the area to be inspected based on the extracted boundary, and then searching for image regions within the area to be inspected that differ from normal surfaces. This processing method relies on the accurate identification of the sealing band boundary in the image.
[0003] For example, the invention patent with announcement number CN112837287B discloses a method and apparatus for extracting defect areas on a board surface. The method for extracting defect areas on a board surface includes: acquiring an image of the board surface to be detected and segmenting it to obtain multiple detection units; acquiring grayscale thresholds corresponding to the multiple detection units; calculating the average grayscale value of the detection units and comparing it with the corresponding grayscale thresholds to determine whether the detection units contain defects.
[0004] For example, the invention patent with publication number CN113643268B discloses a method, device, and storage medium for quality inspection of defects in industrial products based on deep learning, solving the problem that it is difficult to correctly judge defective and non-defective parts in defect detection due to similar textures and colors. The process includes: pre-training a neural network model; collecting images of products that have been identified as defect-free or defective; determining the loss function corresponding to the neural network model and training the model; using the neural network model to obtain the depth features of the images and defect prediction results; making classification decisions based on the depth features and defect prediction results; visualizing the defective parts of the samples and providing the decision results.
[0005] However, when coating peeling or chipping occurs on the inner or outer edge of the sealing strip, the defect directly alters the original boundary morphology of the sealing strip, causing the defect edge to blend with the edge of the sealing strip structure. In this case, the sealing strip boundary extracted directly from the current image may shift along the damaged contour. When using the shifted boundary to define the detection area, some damaged areas within the original sealing strip area may be excluded from the detection area. Furthermore, chamfers and other rounded machined edges may exist near the valve plate and valve seat sealing surfaces. These structures can also form obvious grayscale transitions or edge features in the front view image. The edges of the structure and the defect edges formed by coating peeling or chipping may have similar edge appearances in local images. When relying solely on image edge features for differentiation, it is easy to identify normal machined structures as defect edges, or to identify real defect edges as normal structural edges.
[0006] Therefore, in order to address the above problems, there is an urgent need for a visual inspection method and system for valve plate and valve seat surface defects. Summary of the Invention
[0007] This invention provides a visual inspection method and system for valve plate and valve seat surface defects, aiming to solve the problem in related technologies where the sealing strip edge is difficult to accurately identify, resulting in inaccurate detection of defect areas and edge damage range.
[0008] In a first aspect, this application provides a visual inspection method for surface defects of valve plates and valve seats, comprising: S1, acquiring a front-view grayscale image and obtaining pixel equivalents, and obtaining radial image parameters of the workpiece according to the workpiece drawing; S2, determining the center coordinates of the workpiece using a positioning circle separated from the sealing strip, and constructing a radial grayscale sequence based on the center coordinates of the workpiece and the nominal image radius of the inner side and the nominal image radius of the outer side of the sealing strip in the radial image parameters of the workpiece; S3, excluding grayscale transition positions falling into the chamfer image radius range and any processing edge image radius range, obtaining inner candidate edges and outer candidate edges, and filtering candidate edge pairs according to the radial pixel distance between the inner candidate edges and the outer candidate edges, and taking the median of the corresponding candidate edge radii to obtain the inner recovery radius and the outer recovery radius of the sealing strip; S4, when the inner candidate edge radius is greater than the upper limit of the allowable image radius range of the inner side of the sealing strip or the outer candidate edge radius is less than the lower limit of the allowable image radius range of the outer side of the sealing strip, determining radial damage sampling points, mapping the radial damage sampling points to the front-view grayscale image to form a defect area, and determining the actual area of the defect and the radial position range of the defect.
[0009] Secondly, this application also provides a visual inspection system for surface defects of valve plates and valve seats, comprising: an image parameter acquisition unit for acquiring a front-view grayscale image and obtaining pixel equivalents, and obtaining radial image parameters of the workpiece according to the workpiece drawing; a center positioning and radial sampling unit for determining the center coordinates of the workpiece using a positioning circle separated from the sealing strip, and constructing a radial grayscale sequence based on the center coordinates of the workpiece and the nominal image radius of the inner side and the nominal image radius of the outer side of the sealing strip in the radial image parameters of the workpiece; and a candidate edge extraction and boundary restoration unit for excluding grayscale values falling into the chamfer image radius range and any processing edge image radius range. The transition position is determined to obtain the inner and outer candidate edges. Candidate edge pairs are filtered based on the radial pixel distance between the inner and outer candidate edges, and the median of the corresponding candidate edge radii is taken to obtain the inner and outer recovery radii of the sealing strip. The defect detection unit is used to determine the radial damage sampling points when the inner candidate edge radius is greater than the upper limit of the allowable image radius range of the inner side of the sealing strip or the outer candidate edge radius is less than the lower limit of the allowable image radius range of the outer side of the sealing strip. The radial damage sampling points are mapped to the frontal grayscale image to form the defect area, and the actual area and radial position range of the defect are determined.
[0010] The beneficial effects achieved by this application include at least the following: (1) This invention, by performing radial sampling, grayscale transition extraction, candidate edge recognition and defect region mapping on the frontal grayscale image, enables the surface defect detection to be based on industrial visual image analysis, edge detection and defect region extraction, thereby achieving the effect of visual recognition and image positioning of valve plate and valve seat sealing surface defects, effectively solving the problem that the existing technology relies solely on manual observation or local image features to accurately identify sealing strip edge defects.
[0011] (2) In this invention, the workpiece center coordinates are determined by using a positioning circle that is separate from the sealing strip, so that the workpiece positioning does not depend on the sealing strip boundary which may change shape due to coating peeling or edge breakage. This achieves the effect of obtaining an independent workpiece positioning reference even when the sealing strip edge is damaged, effectively solving the problem in the prior art that sealing strip edge defects cause boundary positioning offset and further affect the determination of subsequent defect detection areas.
[0012] (3) In this invention, the corresponding gray-level transition positions are excluded by combining the radius range of the chamfer image and the radius range of each processed edge image. The candidate edge pairs are screened based on the radial pixel distance between the inner candidate edge and the outer candidate edge. The inner recovery radius and the outer recovery radius of the sealing strip are determined by the median of the candidate edge radius. This achieves the effect of distinguishing the edges of normal processed structures and restoring the boundary position of the sealing strip. It effectively solves the problem of edge confusion and sealing strip boundary recognition deviation caused by the similar gray-level features of chamfer, processed edge and defect edge in the prior art.
[0013] (4) In this invention, radial damage sampling points are determined based on the inner candidate edge radius exceeding the upper limit of the allowable image radius range inside the sealing strip or the outer candidate edge radius exceeding the lower limit of the allowable image radius range outside the sealing strip. The radial damage sampling points are then mapped to the frontal grayscale image to form a defect area. The actual area of the defect and the radial position range of the defect are determined by the defect area. This achieves the effect of deducing the material missing area from the abnormal edge position and quantitatively characterizing the edge damage range. This effectively solves the problems of missed detection and inaccurate determination of the defect range caused by the edge defect part falling outside the original detection area in the prior art. Attached Figure Description
[0014] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0015] Figure 1 This is a flowchart of a visual inspection method for surface defects of valve plates and valve seats provided by an exemplary embodiment of this disclosure; Figure 2 This is a structural diagram of a visual inspection system for surface defects of valve plates and valve seats provided by an exemplary embodiment of this disclosure; Figure 3 This is a schematic diagram of workpiece radial image parameters provided in an exemplary embodiment of this disclosure; Figure 4 This is a schematic diagram illustrating the correspondence between radial sampling and radial grayscale sequences provided in an exemplary embodiment of this disclosure. Detailed Implementation
[0016] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0017] In the description of this application, it should be understood that the terms "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicating orientation or positional relationships based on the orientation or positional relationships shown in the accompanying drawings, are used only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this application. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of the stated features. In the description of this application, "a plurality of" means two or more, unless otherwise explicitly specified.
[0018] "A and / or B" includes the following three combinations: A only, B only, and a combination of A and B.
[0019] The use of "applies to" or "configured to" in this application implies open and inclusive language, which does not exclude the applicability to or configuration to devices performing additional tasks or steps. Additionally, the use of "based on" implies openness and inclusivity, because processes, steps, calculations, or other actions "based on" one or more of the stated conditions or values may in practice be based on additional conditions or values beyond those stated.
[0020] In this application, the term "exemplary" is used to mean "used as an example, illustration, or description." Any embodiment described as "exemplary" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use this application. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that this application can be made without using these specific details. In other instances, well-known structures and processes are not described in detail to avoid obscuring the description of this application with unnecessary detail. Therefore, this application is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in this application.
[0021] This application discloses a visual inspection method and system for valve plate and valve seat surface defects, which aims to solve the problem that when the sealing strip edge of the valve plate or valve seat is damaged, the sealing strip boundary is difficult to accurately identify, resulting in inaccurate detection of the defect area and edge damage range.
[0022] Please see Figures 1-4This invention provides a technical solution: a visual inspection method for surface defects of valve plates and valve seats, comprising: S1, acquiring a front-view grayscale image and obtaining pixel equivalents, and obtaining radial image parameters of the workpiece according to the workpiece drawing; S2, determining the center coordinates of the workpiece using a positioning circle separated from the sealing strip, and constructing a radial grayscale sequence based on the workpiece center coordinates and the nominal image radius of the inner side and the nominal image radius of the outer side of the sealing strip in the radial image parameters of the workpiece; S3, excluding grayscale transition positions falling into the chamfer image radius range and any processing edge image radius range, obtaining inner candidate edges and outer candidate edges, and filtering candidate edge pairs according to the radial pixel distance between the inner and outer candidate edges, and taking the median of the corresponding candidate edge radii to obtain the inner recovery radius and the outer recovery radius of the sealing strip; S4, when the inner candidate edge radius is greater than the upper limit of the allowable image radius range of the inner side of the sealing strip or the outer candidate edge radius is less than the lower limit of the allowable image radius range of the outer side of the sealing strip, determining radial damage sampling points, mapping the radial damage sampling points to the front-view grayscale image to form a defect area, and determining the actual area of the defect and the radial position range of the defect.
[0023] Specifically, acquiring a front-view grayscale image and obtaining pixel equivalents includes: placing the valve plate or valve seat within the imaging field of view of the industrial camera, with the sealing surface facing the industrial camera; adjusting the industrial camera's posture, shooting distance, and lens focal length to ensure the industrial camera's optical axis is perpendicular to the sealing surface, the sealing surface is located on the lens's clear imaging plane, and the complete sealing band, positioning circle, and radial sampling area outside the sealing band are all within the effective imaging area and do not intersect with the image edges; placing a length calibration component on the imaging plane where the sealing surface is located, the length calibration component having multiple non-collinear marker points and mutually perpendicular line segments with the same known actual length; establishing a planar mapping relationship based on the actual planar coordinates and image coordinates of each marker point; performing lens distortion correction and perspective correction on the image acquired by the industrial camera; and using the corrected image as a front-view grayscale image; reading the corresponding pixel lengths of the mutually perpendicular line segments in the corrected image; and determining that the perpendicularity calibration is complete when the results calculated by the two line segments according to their known actual lengths and corresponding pixel lengths are consistent within the recording accuracy of the pixel equivalents. The obtained planar mapping relationship is used to eliminate the circular distortion caused by the residual tilt angle of the industrial camera installation. When edge imaging distortion occurs, or when the industrial camera's posture, lens focal length, or shooting distance changes, the verticality calibration is re-performed. A ring-shaped diffused light source is positioned around the industrial camera lens, with its central axis coinciding with the camera's optical axis. The light-emitting surface faces the sealing surface, and the illuminated area covers the entire sealing strip and positioning circle. Diffuse light reduces localized specular reflections from the valve plate or valve seat sealing surface and the tungsten carbide thermal spray coating. The output of the ring-shaped diffused light source, the industrial camera's exposure time, and gain are adjusted so that the grayscale value of the corresponding pixels on the sealing strip and positioning circle is lower than the single-channel grayscale value. The upper limit of the degree is set, and the grayscale transition is preserved at the edge of the sealing strip and the edge of the positioning circle. After the adjustment is completed, the relative positions of the industrial camera, lens and ring diffuse light source are fixed. During the inspection of valve plates or valve seats in the same batch, the shooting distance, lens focal length, light source output, exposure time and gain are kept constant. A single-channel frontal grayscale image containing the complete sealing strip and positioning circle is acquired. In the frontal grayscale image after lens distortion correction and perspective correction, the known actual length and its corresponding pixel length on the length calibration piece are read. The known actual length is divided by the corresponding pixel length to obtain the pixel equivalent.
[0024] In this implementation scheme, by correcting the imaging relationship between the optical axis of the industrial camera and the sealing surface, and by using a ring diffuse light source to reduce the reflection of the sealing surface, the grayscale image viewed from the front can fully present the edge grayscale changes of the sealing strip and the positioning circle, reducing the impact of installation misalignment, lens distortion and local reflection on the measurement of the image radius; by using the length calibration component to obtain the pixel equivalent, a unified scale can be provided for the conversion between the workpiece drawing size and the image radius.
[0025] Specifically, the radial image parameters of the workpiece obtained from the workpiece drawing include: the nominal image radius of the positioning circle, the allowable image radius range of the positioning circle, the nominal image radius of the inner side of the sealing strip, the allowable image radius range of the inner side of the sealing strip, the nominal image radius of the outer side of the sealing strip, the allowable image radius range of the outer side of the sealing strip, the chamfer image radius range, and the image radius range of each processed edge; in this embodiment, the valve plate or valve seat can be an HH-grade high-pressure large-diameter valve plate, an HH-grade high-pressure large-diameter valve seat, or a snap-fit sealing valve seat, or a valve plate or valve seat with a surface coating formed by tungsten carbide ceramic spraying or supersonic thermal spraying. HH grade is the pressure rating identifier recorded in the workpiece drawing or product standard. The radial image parameters of the workpiece are all obtained from the actual dimensions marked on the corresponding workpiece drawing, and no uniform size value is set for different specifications of workpieces; the nominal dimension of the positioning circle diameter, the lower limit of the positioning circle diameter, the upper limit of the positioning circle diameter, and the nominal dimension of the sealing strip inner diameter are read from the workpiece drawing. The system includes the lower limit of the inner diameter of the sealing strip, the upper limit of the inner diameter of the sealing strip, the nominal outer diameter of the sealing strip, the lower limit of the outer diameter of the sealing strip, the upper limit of the outer diameter of the sealing strip, the start and end diameters of the chamfer, and the lower and upper limits of the diameters of each machined edge. The positioning circle is selected from the circular machined edge outside the sealing strip area in the workpiece drawing. Specifically, the selection condition is that there is no overlap in the radial image positions. That is, the upper limit of the allowable image radius range of the positioning circle is less than the lower limit of the allowable image radius range inside the sealing strip, or the lower limit of the allowable image radius range of the positioning circle is greater than the upper limit of the allowable image radius range outside the sealing strip. This ensures that the radial range corresponding to the positioning circle is separated from the radial range of the sealing strip defined by the allowable image radius range inside and outside the sealing strip. The positioning circle does not participate in forming the inner and outer boundaries of the sealing strip. Therefore, when coating peeling or edge chipping occurs at the inner or outer edge of the sealing strip, the positioning circle still corresponds to the independent circular machined edge of the workpiece itself. For valve plates or seats using tungsten carbide ceramic spraying or supersonic thermal spraying, the positioning circle is still determined according to the circular machined edge in the workpiece drawing, and the irregular contour formed after the spray coating is damaged is not used as the positioning circle; before dimensional conversion, the length calibration piece and the sealing surface are placed on the same imaging plane, and the pixel equivalent is calculated based on the known actual length and the corresponding pixel length on the length calibration piece. The pixel equivalent is equal to the known actual length divided by the corresponding pixel length. The pixel equivalent represents the actual length of one pixel in the frontal grayscale image corresponding to the imaging plane where the sealing surface is located; after the installation position of the industrial camera and lens is determined, the camera calibration is completed, and the camera calibration is used to... The obtained lens distortion parameters are used to correct the distortion of the front-view grayscale image, ensuring that the length calibration component, positioning circle, sealing strip, chamfer, and all processed edges are dimensionally converted within the same corrected front-view grayscale image. Since these structures are located on the same sealing surface imaging plane, they share the pixel equivalent obtained from the length calibration component on that imaging plane. If the industrial camera, lens, imaging distance, or the imaging plane of the sealing surface is changed, the length calibration component is repositioned to obtain the pixel equivalent, and the pixel equivalent obtained before the imaging conditions were changed is not used. The pixel equivalent is calculated based on the known actual length of the length calibration component and the corresponding pixel length, and is... Recalibration is required after changes to the industrial camera, lens, imaging distance, or imaging plane of the sealing surface. The diameter of each drawing is divided by two and then by the pixel equivalent to obtain the corresponding image radius, where the unit of the drawing diameter is consistent with the unit of the known actual length, and the unit of the converted image radius is pixels. The nominal image radius of the positioning circle is obtained by dividing the nominal diameter of the positioning circle by two and then by the pixel equivalent. The lower and upper limits of the positioning circle diameter are obtained by dividing the lower and upper limits by two and then by the pixel equivalent, respectively, to obtain the lower and upper limits of the allowable image radius range of the positioning circle. The inner diameter of the sealing strip is obtained by dividing the nominal inner diameter of the sealing strip by two and then by the pixel equivalent. The nominal image radius is obtained by dividing the lower limit and upper limit of the inner diameter of the sealing strip by two, and then by the pixel equivalent, to obtain the lower and upper limits of the allowable image radius range inside the sealing strip. The nominal image radius of the outer side of the sealing strip is obtained by dividing the nominal outer diameter by two, and then by the pixel equivalent. The lower and upper limits of the outer diameter of the sealing strip are then divided by two, and then by the pixel equivalent, to obtain the lower and upper limits of the allowable image radius range outside the sealing strip. The two endpoints of the chamfer image radius range are obtained by dividing the chamfer start and end diameters by two, and then by the pixel equivalent. The chamfer image radius range is then formed according to the image radius from small to large.For machining edges in the workpiece drawing that can form circular grayscale transitions in the frontal grayscale image, excluding the positioning circle, sealing strip boundary, and chamfer, the lower and upper diameter limits of the corresponding machining edges are read, and then divided by two and then by the pixel equivalent to obtain the corresponding image radius intervals of each machining edge. Each machining edge image radius interval remains independent; multiple adjacent or separate machining edge image radius intervals are not merged into a single continuous interval. This allows for subsequent determination of whether the grayscale transition position falls within any machining edge image radius interval. The nominal image radius of the outer side of the sealing strip is subtracted from the nominal image radius of the inner side of the sealing strip to obtain the radial pixel width of the sealing strip. This radial pixel width represents the radial pixel distance between the nominal positions of the outer and inner sides of the sealing strip in the frontal grayscale image and is used to subsequently determine the radial sampling range. For example; Figure 3 The figure shows a schematic diagram of the radial image parameters of the workpiece in this embodiment. In the figure, the nominal image radius of the positioning circle, the nominal image radius of the inner side of the sealing strip, and the nominal image radius of the outer side of the sealing strip are all based on the center of the workpiece circle. The annular area between the nominal image radius of the inner side of the sealing strip and the nominal image radius of the outer side of the sealing strip is the sealing strip area, and the positioning circle is located outside the sealing strip area. The allowable image radius interval of the positioning circle, the allowable image radius interval of the inner side of the sealing strip, and the allowable image radius interval of the outer side of the sealing strip are distributed around the corresponding nominal image radius. The chamfer image radius interval and the image radius interval of each processing edge represent the radial position of the corresponding workpiece structure in the frontal grayscale image, and are used to subsequently exclude the corresponding grayscale transition positions.
[0026] In this implementation scheme, by combining the actual dimensions of the positioning circle, sealing strip, chamfer, and each processed edge in the workpiece drawing with pixel equivalents to convert them into corresponding workpiece radial image parameters, the nominal image radius of the positioning circle, the allowable image radius range of the positioning circle, the nominal image radius of the inner side of the sealing strip, the allowable image radius range of the inner side of the sealing strip, the nominal image radius of the outer side of the sealing strip, the allowable image radius range of the outer side of the sealing strip, the image radius range of the chamfer, and the image radius range of each processed edge can be established in the frontal grayscale image. The radial pixel width of the sealing strip is also obtained, thereby providing a unified image radial position reference for subsequent workpiece center determination, radial grayscale sequence construction, processing structure edge exclusion, and sealing strip boundary restoration.
[0027] Specifically, determining the workpiece center coordinates using the positioning circle separated from the sealing strip includes: defining the horizontal axis of the front-view grayscale image as positive to the right and the vertical axis as positive downward; calculating the horizontal grayscale difference using the horizontal center difference rule and the vertical grayscale difference using the vertical center difference rule, where the horizontal grayscale difference is the difference between the grayscale values of the adjacent pixels on the right and left, and the vertical grayscale difference is the difference between the grayscale values of the adjacent pixels on the lower and upper sides; for boundary pixels of the front-view grayscale image, replacing the grayscale value of the boundary coordinate with the grayscale value of the image boundary pixel closest to the boundary coordinate; obtaining the pixel gradient value by taking the square root of the sum of the squares of the horizontal and vertical grayscale differences; and setting the current pixel gradient value... The current pixel is compared with the gradient values of its four adjacent pixels on the left, right, top, and bottom. If the gradient value of the current pixel is greater than the gradient values of all four adjacent pixels, the current pixel is designated as a local maximum pixel. If the gradient values are equal, the current pixel is not designated as a local maximum pixel. A center counting matrix with the same coordinate range as the frontal grayscale image is established, and the center counts of each circle are cleared to zero. Using the local maximum pixel as the center and the nominal image radius as the radius, the number of circumferential sampling points is determined according to the principle that the arc length between adjacent circumferential sampling points is no greater than one pixel. Circumferential sampling points are then generated uniformly along the circumference. The x and y coordinates of each circumferential sampling point are rounded to the nearest integer, and points outside the coordinate range of the frontal grayscale image are deleted. Image coordinates are used, and duplicate image coordinates appearing repeatedly in the same integer circular trajectory are removed. This ensures that pixels with the same gradient local maxima only add one center count to the same candidate center coordinate, while pixels with different gradient local maxima corresponding to the same candidate center coordinate add one center count each. After the first round of center counting, if there is only one image coordinate with the largest center count, that image coordinate is used as the center coordinate of the first round. If multiple image coordinates have the same largest center count, the sum of the center counts of each image coordinate and its eight surrounding image coordinates is calculated, and the image coordinate with the largest sum of center counts is selected as the center coordinate of the first round. If the sums of center counts are still tied, they are selected according to the ordinate from smallest to largest. First, the image coordinates of the first image in ascending order of horizontal coordinates are selected as the center coordinates of the first round. The pixel distance from each gradient local maxima pixel to the center coordinates of the first round is calculated, and gradient local maxima pixels whose pixel distances fall within the allowable image radius range of the positioning circle are retained. Before performing the second round of center counting, the center counts in the center counting matrix are reset to zero. Only the retained gradient local maxima pixels are counted using the same positioning circle nominal image radius, circumference discretization method, coordinate rounding rule, coordinate range limitation, and trajectory deduplication rule as the first round of center counting. The same parallel resolution rule as the first round of center counting is used to determine the unique image coordinates, which are then used as the workpiece center coordinates.If there are no local maxima pixels in the frontal grayscale image, or if there are no local maxima pixels whose pixel distance is within the allowable image radius range of the positioning circle, the workpiece center coordinates are not generated. The frontal grayscale image is then re-acquired after checking the integrity of the positioning circle image, the illumination from the annular diffuse light source, and the image sharpness of the industrial camera.
[0028] The specific calculation formula is as follows: ; ; ; In the formula, This represents the grayscale value of the pixel at image coordinate . Indicates the horizontal grayscale difference. Indicates vertical grayscale difference. This represents the pixel gradient value.
[0029] ; ; ; ; In the formula, This represents the nominal radius of the positioning circle in the image. Represents the number of circumferential samples, and represents the angle of the i-th circumferential sample. () represents the image coordinates of a pixel that is a local maximum of the gradient. ) represents the coordinates of the candidate circle center after rounding, and round represents rounding to the nearest integer.
[0030] ; In the formula, () represents the image coordinates of the i-th local maximum pixel. () represents the coordinates of the center of the first circle. This represents the pixel distance from the pixel of the i-th local maximum gradient to the coordinates of the center of the first round circle.
[0031] In this implementation scheme, the first round of circle center coordinates are obtained by counting the circle centers in the first round. Then, the local maximum gradient pixels corresponding to the positioning circle are selected according to the allowable image radius range of the positioning circle, and the second round of circle center counting is performed. This can reduce the interference of sealing strip edge defects, chamfers and various processing edges on the circle center positioning, stably obtain the workpiece circle center coordinates, and provide a unified radial reference for the subsequent construction of radial grayscale sequence.
[0032] Specifically, the radial grayscale sequence is constructed based on the workpiece center coordinates and the nominal image radius of the inner and outer sides of the sealing strip in the radial image parameters of the workpiece. This includes: radial sampling can be performed on HH-grade high-pressure large-diameter valve plates, HH-grade high-pressure large-diameter valve seats, interlocking sealing valve seats, and valve plate / seat sealing surfaces using tungsten carbide ceramic spraying or supersonic thermal spraying; the average value of the nominal image radius of the inner and outer sides of the sealing strip is taken as the mid-diameter image radius of the sealing strip, which represents the radial midpoint position of the sealing strip in the frontal grayscale image; the outermost sampling position of each radial sampling line is the position where the nominal image radius of the outer side of the sealing strip is moved away from the workpiece center by half the radial pixel width of the sealing strip. First, one pixel is divided by the image radius of the outermost sampling position to obtain the initial angular interval in radians. Then, 2π is divided by the initial angular interval and rounded up to obtain the total number of radial sampling lines. 2π is divided by the total number of radial sampling lines to obtain the angular sampling interval, thereby ensuring that all radial sampling lines are within a circumference. Distributed with the same angular sampling interval, the last radial sampling line and the starting radial sampling line of the circumference still maintain an angular sampling interval. After the above rounding, the arc length between adjacent radial sampling lines at the outermost sampling position of each radial sampling line is no greater than one pixel. The sampling position located on the side of the workpiece center closer to the outermost sampling position has a smaller image radius, and the arc length between adjacent radial sampling lines is also less than or equal to the arc length of the outermost sampling position. This ensures that the spacing between adjacent radial sampling lines will not exceed the spacing between the outermost sampling positions due to the increase in image radius within the entire radial sampling range. Define the positive direction of the horizontal axis of the frontal grayscale image as right and the positive direction of the vertical axis as downward. Take the ray along the positive direction of the horizontal axis from the center of the workpiece as the starting radial sampling line of the circumference. The radial sampling angle corresponding to the starting radial sampling line of the circumference is zero. Generate each radial sampling line in a clockwise direction according to the angular sampling interval, and write the angle sampling sequence number according to the generation order. Each time an angle sampling sequence number is added, the corresponding radial sampling angle increases by one angular sampling interval.
[0033] Each radial sampling line starts at a position half the radial pixel width of the sealing strip from the nominal image radius inside the sealing strip towards the workpiece center and ends at a position half the radial pixel width of the sealing strip from the nominal image radius outside the sealing strip away from the workpiece center. This ensures the radial sampling range spans the nominal position inside the sealing strip, the nominal position outside the sealing strip, and adjacent radial regions on both sides. Sampling coordinates are determined sequentially from the side closest to the workpiece center to the side furthest away from the workpiece center, with a radial spacing of one pixel. For any radial sampling angle and any sampling position, the sampling coordinates are determined based on the workpiece center's abscissa, ordinate, the image radius corresponding to the sampling position, and the radial sampling angle. The abscissa is obtained by adding the product of the image radius and the cosine of the radial sampling angle to the workpiece center's abscissa, and the ordinate is obtained by adding the product of the image radius and the sine of the radial sampling angle to the workpiece center's ordinate. Since the vertical axis of the frontal grayscale image is downward as the positive direction, the above coordinate calculation is consistent with the radial sampling angle increasing in a clockwise direction. When acquiring the frontal grayscale image, the starting position, ending position, and one pixel range around the corresponding sampling coordinate of each radial sampling line are all located inside the frontal grayscale image, so that there are four complete integer pixels around the sampling coordinate that needs to be interpolated. When the sampling coordinate falls on an integer pixel coordinate, the corresponding grayscale value is read directly. When the sampling coordinate is between integer pixels, the grayscale values of the four integer pixels at the upper left, upper right, lower left, and lower right of the sampling coordinate are read. Bilinear interpolation is performed based on the horizontal and vertical decimal distances of the sampling coordinate relative to the four integer pixels. First, linear interpolation is performed on the grayscale values of the upper and lower sets of integer pixels along the horizontal axis, and then linear interpolation is performed on the two resulting grayscale values along the vertical axis to obtain the grayscale value corresponding to the sampling coordinate.
[0034] The sampled gray values corresponding to the same radial sampling angle are arranged in ascending order of image radius. Each sampling position corresponds to the image radius and the sampled gray value, forming a radial gray sequence. Then, each radial gray sequence is arranged in ascending order of radial sampling angle, so that the angle sampling number, radial sampling angle, image radius, and sampled gray value remain corresponding. For each sampling position in each radial gray sequence, the corresponding image radius is compared with the chamfer image radius interval and the image radius interval of each processing edge. The sampling position where the image radius falls into the chamfer image radius interval is matched with the chamfer image radius interval, and the sampling position where the image radius falls into any processing edge image radius interval is matched with the corresponding processing edge image radius interval. Each processing edge image radius interval is judged independently and not merged. This forms a radial gray sequence organized by radial sampling angle and image radius, and provides the corresponding radial position basis for subsequently excluding the gray value transition positions corresponding to chamfer and each processing edge from the radial gray sequence.
[0035] like Figure 4The diagram shows the correspondence between radial sampling and radial grayscale sequence in this embodiment. In the diagram, the radial sampling lines in the front-view grayscale image start from the workpiece center coordinates and are distributed according to the radial sampling angle. The sampled grayscale values obtained along each radial sampling line are arranged in ascending order of image radius to form a radial grayscale sequence. The horizontal direction represents the radial sampling angle, and the vertical direction represents the image radius. The allowed image radius intervals inside the sealing strip, outside the sealing strip, chamfer, and each processing edge are associated with the corresponding sampling positions, providing a radial position basis for subsequent exclusion of the grayscale transition positions corresponding to the chamfer and each processing edge, as well as for extracting the inner and outer candidate edges.
[0036] In this implementation scheme, by determining the angular sampling interval based on the outermost sampling position, and generating radial sampling lines according to the workpiece center coordinates, the nominal image radius inside the sealing strip, the nominal image radius outside the sealing strip, and the radial pixel width of the sealing strip, the angular spacing between adjacent radial sampling lines within the entire radial sampling range can be controlled. Furthermore, bilinear interpolation is used to obtain the grayscale values corresponding to each sampling coordinate, thereby forming a radial grayscale sequence organized according to the radial sampling angle and image radius. Simultaneously, the chamfer image radius interval and the image radius intervals of each processing edge are associated with their corresponding sampling positions, providing a radial positional basis for subsequently extracting grayscale transition positions and excluding the grayscale transition positions corresponding to the chamfer and each processing edge.
[0037] Specifically, excluding grayscale transition positions falling within the radius range of the chamfered image and any processing edge image, the inner and outer candidate edges are obtained by: calculating the absolute value of the grayscale difference between radially adjacent sampling positions in each radial grayscale sequence; numbering the sampling positions in the same radial grayscale sequence sequentially according to the increasing image radius; and assigning the absolute value of the difference between the grayscale values of two adjacent sampling positions to the sampling position with the larger image radius, thus forming a radial difference sequence. For the current difference value in the radial difference sequence, excluding the first and last positions, if it is simultaneously greater than the previous difference value, the next difference value, and the transition intensity threshold predetermined based on the grayscale fluctuation in the flat region, the sampling position to which the current difference value belongs is taken as the grayscale transition position, so as to avoid identifying small grayscale fluctuations caused by imaging noise as grayscale transition positions. The flat region is the set of radial sampling positions selected in the sealing zone during the calibration stage that do not fall within the radius range of the chamfered image and the processing edge image; the maximum absolute value of the grayscale difference between radially adjacent sampling positions in the flat region is determined as the transition intensity threshold. The chamfer image radius range and the image radius ranges of each processing edge are treated as independent exclusion ranges. Each range is compared with the image radius of each grayscale transition position. If the image radius falls within either the chamfer image radius range or any processing edge image radius range, the corresponding grayscale transition position is deleted. Image radius positions not covered between ranges are not deleted. The average of the nominal image radius inside the sealing strip and the nominal image radius outside the sealing strip is used as the radial boundary position. If there are remaining grayscale transition positions near the center of the radial boundary position, the remaining grayscale transition position with the largest absolute value of grayscale difference is selected as the inner candidate edge. If there are no remaining grayscale transition positions near the center, no inner candidate edge is generated, and the corresponding inner candidate edge is recorded as a null value. If there are remaining grayscale transition positions away from the center of the radial boundary position, the remaining grayscale transition position with the largest absolute value of grayscale difference is selected as the outer candidate edge. If there are no remaining grayscale transition positions away from the center, no outer candidate edge is generated, and the corresponding outer candidate edge is recorded as a null value. Each inner candidate edge, outer candidate edge, and its corresponding radial sampling angle and angle sampling number are retained. When screening candidate edge pairs, radial sampling angles with null values are skipped. During defect detection, only the side with the corresponding candidate edge is judged.
[0038] In this implementation scheme, by extracting the gray-level transition positions in each radial gray-level sequence and excluding the structural gray-level transitions generated by the chamfer image radius range and each processing edge image radius range, the interference of chamfer, processing edge and gray-level noise on the edge recognition of the sealing strip can be reduced, and inner candidate edges and outer candidate edges can be obtained, providing edge data for subsequent determination of the inner recovery radius and outer recovery radius of the sealing strip.
[0039] Specifically, the process of filtering candidate edge pairs based on the radial pixel distance between the inner and outer candidate edges, and obtaining the inner and outer recovery radii of the sealing strip by taking the median of the corresponding candidate edge radii, includes: In this embodiment, the detection object can be an HH-grade high-pressure large-diameter valve plate, an HH-grade high-pressure large-diameter valve seat, or a bite-type sealing valve seat, or a valve plate or valve seat with a surface coating formed by tungsten carbide ceramic spraying or supersonic thermal spraying. When the coating peels off or the edge breaks at the edge of the sealing strip, the inner and outer candidate edges are paired according to each radial sampling angle.The minimum pixel width of the sealing strip is obtained by subtracting the upper limit of the allowed image radius interval on the inner side of the sealing strip from the lower limit of the allowed image radius interval on the outer side. The maximum pixel width of the sealing strip is obtained by subtracting the lower limit of the allowed image radius interval on the inner side from the upper limit of the allowed image radius interval on the outer side. When both inner and outer candidate edges exist at the same radial sampling angle, the radial pixel distance between the two candidate edges is obtained by subtracting the radius of the inner candidate edge from the radius of the outer candidate edge. For example, if the radial pixel distance corresponding to a certain radial sampling angle is greater than or equal to the minimum pixel width of the sealing strip and less than or equal to the maximum pixel width of the sealing strip, the corresponding candidate edge pair is included in the boundary restoration. When the pixel distance is less than the minimum pixel width of the sealing strip or greater than the maximum pixel width of the sealing strip, the corresponding candidate edge pairs are not included in boundary restoration. Therefore, candidate edge pairs that are inconsistent with the normal radial width of the sealing strip are filtered out using the sealing strip width range defined by the workpiece drawing. For candidate edge pairs included in boundary restoration, the inner and outer candidate edge radii are extracted respectively. The inner and outer candidate edge radii are arranged in ascending order of value. When there is only one candidate edge pair included in boundary restoration, the corresponding inner and outer candidate edge radii are directly used as the median and median of the inner and outer candidate edge radii, respectively. The median of the outer candidate edge radius; when the number is odd and greater than one, the radius at the midpoint of the two sorting sequences is taken as the median of the inner and outer candidate edge radii, respectively; when the number is even, the average of the two midpoint radii of the two sorting sequences is taken as the median of the inner and outer candidate edge radii, respectively. The median of the inner and outer candidate edge radii are then used as the inner and outer recovery radii of the sealing strip, respectively, ensuring that minor offset candidate edges caused by local coating peeling, edge breakage, or image grayscale disturbances do not directly determine the inner and outer recovery radii of the sealing strip; no nano When considering candidate edge pairs for boundary restoration, the nominal image radius inside the sealing band is used as the inner restoration radius, and the nominal image radius outside the sealing band is used as the outer restoration radius. Regardless of whether the candidate edge pair is included in boundary restoration, all inner and outer candidate edges obtained in the aforementioned steps, along with their corresponding radial sampling angles, are retained. This ensures that candidate edges not included in boundary restoration can still be used to determine radial damage sampling points based on the direction in which the candidate edge crosses the allowable image radius range inside or outside the sealing band. Whether the candidate edge pair is included in boundary restoration is only used to determine the inner and outer restoration radii of the sealing band.
[0040] In this implementation, by using the minimum and maximum pixel widths of the sealing strip to filter the inner and outer candidate edges under the same radial sampling angle, and calculating the median of the inner and outer candidate edge radii included in the boundary restoration, the inner and outer restoration radii of the sealing strip can be obtained, thereby reducing the direct impact of local coating peeling, edge breakage, or grayscale disturbance on the boundary position. When there are no candidate edge pairs included in the boundary restoration, the nominal image radius of the inner and outer sides of the sealing strip are used as the corresponding restoration radii, and all candidate edges and their corresponding radial sampling angles are retained to provide boundary references and candidate edge information for subsequent radial damage sampling point determination.
[0041] Specifically, when the radius of the inner candidate edge is greater than the upper limit of the allowable image radius range inside the sealing strip, or the radius of the outer candidate edge is less than the lower limit of the allowable image radius range outside the sealing strip, radial damage sampling points are determined, and these radial damage sampling points are mapped to the defect area in the frontal grayscale image. This includes: for radial sampling angles where inner candidate edges exist, when the radius of the inner candidate edge is greater than the upper limit of the allowable image radius range inside the sealing strip and greater than the recovery radius inside the sealing strip, the radial sampling position within the closed interval formed by the recovery radius inside the sealing strip and the radius of the inner candidate edge is determined as the inner radial damage sampling point. The radial sampling position starts from the recovery radius inside the sealing strip. The radial sampling angle increases inwards from the candidate edge radius by a one-pixel radial spacing, including both endpoints. For radial sampling angles with outer candidate edges, when the outer candidate edge radius is less than the lower limit of the allowed image radius range outside the sealing band and less than the outer recovery radius of the sealing band, the radial sampling position within the closed interval formed by the outer candidate edge radius and the outer recovery radius of the sealing band is determined as the outer radial damage sampling point. The radial sampling position starts from the outer candidate edge radius and increases inwards from the outer recovery radius of the sealing band by a one-pixel radial spacing, including both endpoints. When the last radial spacing is less than one pixel, the termination endpoint of the corresponding closed interval is directly included. For each radial damage sampling point, the positive direction of the horizontal axis of the frontal grayscale image is defined as rightward, and the positive direction of the vertical axis is defined as downward. The radial sampling angle starts from the ray along the positive direction of the horizontal axis from the center of the workpiece and increases clockwise. The horizontal coordinate of the damage sampling point is obtained by adding the product of the radius of the radial damage sampling point image and the cosine of the radial sampling angle to the horizontal coordinate of the workpiece center. The vertical coordinate of the damage sampling point is obtained by adding the product of the radius of the radial damage sampling point image and the sine of the radial sampling angle to the vertical coordinate of the workpiece center. The horizontal and vertical coordinates of the damage sampling points are rounded. When the decimal part is equal to half, it is rounded to the integer part of the value to obtain the integer pixel coordinates of the original image. When the integer pixel coordinates of the original image exceed the effective pixel boundary of the frontal grayscale image, the corresponding radial damage sampling point is skipped. In the inner and outer radial damage sampling points, radial damage sampling points mapped to the same integer pixel coordinates of the original image are merged into one original image damage pixel, and the non-repeating angle sampling sequence number corresponding to each radial damage sampling point is retained. Since the angle sampling interval is determined according to the arc length between adjacent radial sampling lines at the outermost sampling position of each radial sampling line corresponding to one pixel, the radial damage sampling points may form obliquely adjacent original image damage pixels after rounding. Therefore, the 8-neighbor pixel connectivity rule is adopted to determine the original image damage pixels that are horizontally adjacent, vertically adjacent, or obliquely adjacent to the current original image damage pixel as connected pixels, and the original image damage pixels belonging to the same 8-neighbor connected domain are divided into the same defect region, and the inner defect region and the outer defect region are output respectively.
[0042] In this implementation scheme, by comparing the inner candidate edge radius with the upper limit of the allowed image radius range inside the sealing strip and the inner recovery radius of the sealing strip, and the outer candidate edge radius with the lower limit of the allowed image radius range outside the sealing strip and the outer recovery radius of the sealing strip, the inner radial damage sampling points and the outer radial damage sampling points can be determined, and the radial damage sampling points are mapped to the original image damage pixels. By merging the same original image integer pixel coordinates and dividing the defect region according to the 8-neighbor pixel connectivity rule, the same defect is prevented from being split due to diagonal adjacency caused by coordinate rounding, forming the inner defect region and the outer defect region, providing pixel basis for subsequently determining the actual area of the defect and the radial position range of the defect.
[0043] Specifically, determining the actual area and radial location range of the defect includes: counting the number of damaged pixels in the original image contained in each defect area, multiplying the number of damaged pixels in the original image by the square of the pixel equivalent to obtain the actual area of the defect. Each defect area is formed by mapping the aforementioned radial damage sampling points. For HH-grade high-pressure large-diameter valve plates, HH-grade high-pressure large-diameter valve seats, interlocking sealing valve seats, and valve plates and seats using tungsten carbide ceramic spraying or supersonic thermal spraying, defect areas formed by coating peeling or edge chipping at the sealing strip edge can be calculated in the same way. Since the aforementioned radial sampling lines are sampled at a radial spacing of one pixel, and the arc length between adjacent radial sampling lines at the outermost sampling position is no greater than one pixel, the remaining sampling positions near the workpiece center... The arc length between adjacent radial sampling lines is no greater than the arc length at the outermost sampling position. The defect region is formed using an 8-neighbor pixel connectivity rule. Therefore, the defect region is represented by a pixel grid of the front-view grayscale image. Multiple radial damage sampling points mapped to the same integer pixel coordinates of the original image correspond to only one original image damage pixel, and are not counted repeatedly. The area corresponding to each original image damage pixel on the imaging plane of the sealing surface is the square of the pixel equivalent. Therefore, multiplying the number of non-repeating original image damage pixels contained in the defect region by the square of the pixel equivalent yields the actual defect area in units of the actual length squared. The actual defect area uses the area corresponding to one original image damage pixel as the area discrete unit. For the inner defect region, the radial sampling angles forming the inner defect region are read. For each inner candidate edge radius, the difference between the inner candidate edge radius and the inner recovery radius of the sealing strip is calculated. The maximum difference is taken and multiplied by the pixel equivalent to obtain the inner radial intrusion depth. The inner radial intrusion depth represents the maximum actual distance the inner defect area travels radially from the inner recovery radius of the sealing strip away from the inner recovery position of the sealing strip. For the outer defect area, the outer candidate edge radius corresponding to each radial sampling angle forming the outer defect area is read. The difference between the outer recovery radius of the sealing strip and the outer candidate edge radius is calculated. The maximum difference is taken and multiplied by the pixel equivalent to obtain the outer radial intrusion depth. The outer radial intrusion depth represents the radial distance the outer defect area travels radially from the outer recovery radius of the sealing strip away from the inner recovery position of the sealing strip. The maximum actual distance into the sealing strip is measured in the direction of the center of the workpiece. The number of non-repeating angle sampling numbers corresponding to the defect area is counted. The number of non-repeating angle sampling numbers, the angle sampling interval, the image radius of the sealing strip's center diameter, and the pixel equivalent are multiplied to obtain the circumferential extension length of the defect at the center diameter of the sealing strip. The angle sampling interval is represented in radians. Each angle sampling number represents the angle range that extends clockwise from the corresponding radial sampling angle by one angle sampling interval. Therefore, when a defect area corresponds to five non-repeating angle sampling numbers, it corresponds to five angle sampling intervals, rather than the four intervals between the centers of five adjacent radial sampling lines. This ensures that the number of non-repeating angle sampling numbers corresponds one-to-one with the angle range used to calculate the circumferential extension length.Based on the angle sampling sequence number corresponding to the defect area, the corresponding radial sampling angle is read to obtain the defect angle interval. Specifically, the non-repeating angle sampling sequences corresponding to the same defect area are arranged in ascending order. Angle sampling sequences with a difference of one between adjacent angle sampling sequences are grouped into the same continuous range. Each continuous range starts with the radial sampling angle corresponding to the first angle sampling sequence number and ends with the radial sampling angle corresponding to the last angle sampling sequence number plus an angle sampling interval, forming the corresponding defect angle interval. When there are two or more non-adjacent continuous ranges, the corresponding defect angle intervals are recorded separately. The starting angle sampling sequence number of the circumference is defined as the angle sampling sequence number corresponding to the starting radial sampling line of the circumference, and its radial sampling angle is zero radians. The ending angle sampling sequence number of the circumference is defined as the last angle sampling sequence number generated in the generation order of the radial sampling line of the circumference, and its radial sampling angle is two π minus an angle sampling interval. The position of two π coincides with the position of zero radians and the radial sampling line is not generated repeatedly. When the defect area contains both the starting angle sampling sequence number of the circumference and the ending angle sampling sequence number of the circumference, the defect is... The radial sampling angle range corresponding to the end of the circle and the radial sampling angle range corresponding to the beginning of the circle are jointly recorded as the zero-angle interval. The end of the circle extends from the beginning radial sampling angle of the corresponding continuous range to 2π, and the beginning of the circle extends from zero radians to the end radial sampling angle of the corresponding continuous range plus an angular sampling interval. The union of the two radial sampling angle ranges represents the zero-angle interval at the same zero-radian position. The pixel distance from the center of each damaged pixel in the original image within the defect area to the center of the workpiece is read as the corresponding image radius. The minimum and maximum image radii are obtained from these, and multiplied by the pixel equivalent to obtain the radial position interval of the defect. The minimum image radius corresponds to the actual radial position of the defect area closer to the center of the workpiece, and the maximum image radius corresponds to the actual radial position of the defect area farther from the center of the workpiece. Thus, for the same defect area, the actual defect area, the inner or outer radial intrusion depth, the circumferential extension length of the defect at the middle diameter of the sealing strip, the defect angle interval, and the defect radial position interval are obtained.
[0044] In this implementation scheme, by statistically analyzing the number of damaged pixels in the original image within the defect area, and combining this with pixel equivalents, the inner recovery radius of the sealing strip, the outer recovery radius of the sealing strip, the angle sampling interval, and the image radius of the sealing strip's mid-diameter, the actual defect area, the inner radial intrusion depth, the outer radial intrusion depth, the circumferential extension length of the defect at the mid-diameter of the sealing strip, the defect angle range, and the defect radial position range can be further obtained. This transforms the inner and outer defect areas from discrete damaged pixels in the image into defect size information with actual length and area meaning, providing a quantitative basis for subsequently determining the radial intrusion degree, circumferential distribution range, and actual damage range of coating peeling or edge chipping.
[0045] Specifically, this embodiment provides a visual inspection system for surface defects of valve plates and seats, applied to a visual inspection method for surface defects of valve plates and seats. It includes: an image parameter acquisition unit, used to acquire a front-view grayscale image containing a complete sealing strip and a positioning circle, obtain pixel equivalents through a length calibration component, and obtain workpiece radial image parameters based on the workpiece drawing, including the nominal image radius of the positioning circle, the allowable image radius range of the positioning circle, the nominal image radius of the inner side of the sealing strip, the allowable image radius range of the inner side of the sealing strip, the nominal image radius of the outer side of the sealing strip, the allowable image radius range of the outer side of the sealing strip, the chamfer image radius range, and the image radius range of each processed edge; and a center positioning and radial sampling unit, used to determine the workpiece center coordinates using the positioning circle separated from the sealing strip, and generate radial sampling lines along the circumferential direction based on the workpiece center coordinates, the nominal image radius of the inner side of the sealing strip, and the nominal image radius of the outer side of the sealing strip, arranging the grayscale values on each radial sampling line in ascending order of image radius to form radial grayscale values. The system comprises a grayscale sequence and a candidate edge extraction and boundary restoration unit. The candidate edge extraction and boundary restoration unit extracts grayscale transition positions from the radial grayscale sequence, excludes grayscale transition positions falling within the radius range of the chamfered image or any processed edge image, obtains inner and outer candidate edges, and filters candidate edge pairs based on the radial pixel distance between them. It calculates the median radius of the inner and outer candidate edges included in the boundary restoration, respectively, to obtain the inner and outer restoration radii of the sealing strip. A defect detection unit determines radial damage sampling points when the inner candidate edge radius is greater than the upper limit of the allowed image radius range for the inner side of the sealing strip and greater than the inner restoration radius, or when the outer candidate edge radius is less than the lower limit of the allowed image radius range for the outer side of the sealing strip and less than the outer restoration radius. It maps the radial damage sampling points to the frontal grayscale image to form a defect region, and determines the actual defect area and radial position range of the defect based on the original image damage pixels and pixel equivalents in the defect region.
[0046] In this implementation scheme, through the sequential processing of the image parameter acquisition unit, the center positioning and radial sampling unit, the candidate edge extraction and boundary restoration unit, and the defect detection unit, the center coordinates and radial grayscale sequence of the workpiece can be determined from the frontal grayscale image and the radial image parameters of the workpiece. The structural edges corresponding to the chamfer image radius range and the image radius range of each processed edge are excluded. Based on the inner and outer candidate edges, the inner and outer recovery radii of the sealing strip are restored, and the defect area is further formed and the actual area and radial position range of the defect are determined. Thus, the image positioning, boundary restoration, and damage range quantification of the edge defects of the valve plate and valve seat sealing strip are realized.
[0047] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0048] The above provides a detailed description of a visual inspection method and system for valve plate and valve seat surface defects provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for visually inspecting surface defects of valve plates and valve seats, characterized in that, include: S1, acquire the frontal grayscale image and obtain the pixel equivalent, and obtain the radial image parameters of the workpiece according to the workpiece drawing; S2, use the positioning circle separated from the sealing strip to determine the workpiece center coordinates, and construct a radial grayscale sequence based on the workpiece center coordinates and the nominal image radius of the inner side and the nominal image radius of the outer side of the sealing strip in the radial image parameters of the workpiece. S3, exclude grayscale transition positions that fall within the radius range of the chamfered image and any processing edge image, obtain inner candidate edges and outer candidate edges, filter candidate edge pairs based on the radial pixel distance between the inner candidate edges and the outer candidate edges, and take the median of the corresponding candidate edge radii to obtain the inner recovery radius and outer recovery radius of the sealing strip; S4. When the radius of the inner candidate edge is greater than the upper limit of the allowable image radius range inside the sealing strip or the radius of the outer candidate edge is less than the lower limit of the allowable image radius range outside the sealing strip, determine the radial damage sampling point, map the radial damage sampling point to the frontal grayscale image to form the defect area, and determine the actual area of the defect and the radial position range of the defect.
2. The method for visual inspection of surface defects of valve plate and valve seat according to claim 1, characterized in that, The process of acquiring a front-view grayscale image and obtaining pixel equivalents includes: Orient the sealing surface of the valve plate or valve seat toward the industrial camera, making the optical axis of the industrial camera perpendicular to the sealing surface. Use a ring diffuse light source coaxial with the optical axis of the industrial camera to acquire a single-channel frontal grayscale image containing the complete sealing strip and positioning circle. Place a length calibration piece on the imaging plane where the sealing surface is located, read the known actual length on the length calibration piece and its corresponding pixel length in the frontal grayscale image, and divide the known actual length by the corresponding pixel length to obtain the pixel equivalent.
3. The method for visual inspection of surface defects of valve plate and valve seat according to claim 2, characterized in that, The radial image parameters of the workpiece obtained from the workpiece drawing include: The workpiece radial image parameters include the nominal image radius of the positioning circle, the allowable image radius range of the positioning circle, the nominal image radius of the inner side of the sealing strip, the allowable image radius range of the inner side of the sealing strip, the nominal image radius of the outer side of the sealing strip, the allowable image radius range of the outer side of the sealing strip, the chamfer image radius range, and the image radius range of each processed edge; the nominal diameter of the positioning circle, the lower limit of the positioning circle diameter, the upper limit of the positioning circle diameter, the nominal diameter of the inner side of the sealing strip, the lower limit of the inner side of the sealing strip diameter, the upper limit of the inner side of the sealing strip diameter, the nominal diameter of the outer side of the sealing strip, the lower limit of the outer side of the sealing strip diameter, the upper limit of the outer side of the sealing strip diameter, the chamfer start and end diameters, and the lower and upper limits of the diameters of each processed edge are read from the workpiece drawing; the positioning circle is selected as a circular processed edge located outside the sealing strip area, and the positioning circle does not participate in the process. The inner and outer boundaries of the sealing strip are formed; the diameter of each drawing is divided by two and then by the pixel equivalent to obtain the corresponding image radius; the nominal image radius and allowable image radius range of the positioning circle are obtained from the nominal size and upper and lower limits of the positioning circle diameter; the nominal image radius and allowable image radius range of the inner side of the sealing strip are obtained from the nominal size and upper and lower limits of the inner diameter of the sealing strip; the nominal image radius and allowable image radius range of the outer side of the sealing strip are obtained from the nominal size and upper and lower limits of the outer diameter of the sealing strip; the chamfer image radius range is obtained from the chamfer start and end diameters; the image radius range of each processing edge is obtained from the upper and lower limits of the diameter of each processing edge; the radial pixel width of the sealing strip is obtained by subtracting the nominal image radius of the inner side of the sealing strip from the nominal image radius of the outer side of the sealing strip.
4. The method for visual inspection of surface defects of valve plate and valve seat according to claim 3, characterized in that, The method of determining the workpiece center coordinates using a positioning circle that is separate from the sealing strip includes: Calculate the difference in grayscale values between adjacent pixels on both sides of the horizontal direction and the difference in grayscale values between adjacent pixels on both sides of the vertical direction in the front-view grayscale image. Obtain the horizontal grayscale difference and the vertical grayscale difference respectively. Take the square root of the sum of the squares of the two grayscale differences to obtain the pixel gradient value. Compare the current pixel gradient value with the gradient values of the four adjacent pixels on the left, right, top, and bottom. If the current pixel gradient value is greater than the gradient values of the four adjacent pixels, the current pixel is designated as the local maximum pixel. Generate an integer circular trajectory with the local maximum pixel as the center and the nominal image radius of the positioning circle as the radius. Use the image coordinates through which the circular trajectory passes as candidate center coordinates and increment the center count once. Use the image coordinate with the largest center count as the first round center coordinate. Calculate the pixel distance from each local maximum pixel to the first round center coordinate. Retain the local maximum pixels whose pixel distance is within the allowable image radius range of the positioning circle. Perform a second round of center count on the retained local maximum pixels. Use the image coordinate with the largest center count in the second round as the workpiece center coordinate.
5. The method for visual inspection of surface defects of valve plate and valve seat according to claim 4, characterized in that, The construction of the radial grayscale sequence based on the workpiece center coordinates and the nominal image radius of the inner side and the nominal image radius of the outer side of the sealing strip in the radial image parameters of the workpiece includes: The average of the nominal image radius inside and outside the sealing strip is taken as the mid-diameter image radius of the sealing strip. The angular sampling interval is determined by the arc length between adjacent radial sampling lines at the outermost sampling position of each radial sampling line, corresponding to one pixel. The positive direction of the horizontal axis in the frontal grayscale image is defined as rightward, and the positive direction of the vertical axis is defined as downward. The ray from the workpiece center along the positive horizontal axis is taken as the starting radial sampling line of the circumference. Radial sampling lines are generated clockwise according to the angular sampling interval, and the generated lines are written with angular sampling numbers in the order they are generated. Each radial sampling line is moved by half from the nominal image radius inside the sealing strip towards the center of the circle. Starting from the position of the pixel width, the sampling coordinates are determined by moving the nominal image radius of the sealing strip outward by half the radial pixel width of the sealing strip away from the center. When the sampling coordinates are between integer pixels, bilinear interpolation is performed based on the surrounding four integer pixels to obtain the gray value corresponding to the sampling coordinates. The sampling gray values corresponding to the same radial sampling angle are arranged in ascending order of image radius to form a radial gray value sequence. Each radial gray value sequence is arranged according to the radial sampling angle, and the radius intervals of the chamfered image and each processing edge image are associated with each sampling position in the radial gray value sequence.
6. The method for visual inspection of surface defects of valve plate and valve seat according to claim 5, characterized in that, The process of excluding grayscale transition positions that fall within the radius range of the chamfered image and any processed edge image to obtain inner and outer candidate edges includes: Calculate the absolute value of the grayscale difference between radially adjacent sampling positions in each radial grayscale sequence. Retain sampling positions with an absolute grayscale difference greater than their radially adjacent positions as grayscale transition positions, and delete grayscale transition positions whose image radius falls within the chamfered image radius range or any processed edge image radius range. Use the average of the nominal image radius inside the sealing strip and the nominal image radius outside the sealing strip as the radial boundary position. If there is a remaining grayscale transition position on the side of the radial boundary position closer to the center, select the remaining grayscale transition position with the largest absolute grayscale difference as the inner candidate edge. If there is no remaining grayscale transition position on the side closer to the center, no inner candidate edge is generated. If there is a remaining grayscale transition position on the side of the radial boundary position farther from the center, select the remaining grayscale transition position with the largest absolute grayscale difference as the outer candidate edge. If there is no remaining grayscale transition position on the side farther from the center, no outer candidate edge is generated.
7. The method for visual inspection of surface defects of valve plate and valve seat according to claim 6, characterized in that, The step of filtering candidate edge pairs based on the radial pixel distance between the inner and outer candidate edges, and obtaining the inner and outer recovery radii of the sealing strip by taking the median of the corresponding candidate edge radii, includes: The minimum pixel width of the sealing band is obtained by subtracting the upper limit of the allowed image radius interval of the inner side of the sealing band from the lower limit of the allowed image radius interval of the outer side of the sealing band. The maximum pixel width of the sealing band is obtained by subtracting the lower limit of the allowed image radius interval of the inner side of the sealing band from the upper limit of the allowed image radius interval of the outer side of the sealing band. When there are inner and outer candidate edges at the same radial sampling angle, and the radial pixel distance between the two candidate edges is greater than or equal to the minimum pixel width of the sealing band and less than or equal to the maximum pixel width of the sealing band, the corresponding candidate edge pair is included in the boundary restoration. The median of the inner and outer candidate edge radii is calculated as the inner and outer restoration radii of the sealing band, respectively. When there are no candidate edge pairs included in the boundary restoration, the nominal image radius of the inner side of the sealing band is used as the inner restoration radius of the sealing band, and the nominal image radius of the outer side of the sealing band is used as the outer restoration radius of the sealing band. The radial sampling angle corresponding to each candidate edge is retained.
8. The method for visual inspection of surface defects of valve plate and valve seat according to claim 7, characterized in that, When the radius of the inner candidate edge is greater than the upper limit of the allowed image radius range inside the sealing strip or the radius of the outer candidate edge is less than the lower limit of the allowed image radius range outside the sealing strip, determining the radial damage sampling point and mapping the radial damage sampling point to the frontal grayscale image to form the defect region includes: For radial sampling angles with inner candidate edges, when the radius of the inner candidate edge is greater than the upper limit of the allowed image radius range inside the sealing strip and greater than the recovery radius inside the sealing strip, the radial sampling position between the recovery radius inside the sealing strip and the radius of the inner candidate edge is determined as the inner radial damage sampling point; for radial sampling angles with outer candidate edges, when the radius of the outer candidate edge is less than the lower limit of the allowed image radius range outside the sealing strip and less than the recovery radius outside the sealing strip, the radial sampling position between the radius of the outer candidate edge and the recovery radius outside the sealing strip is determined as the outer radial damage sampling point. For each radial damage sampling point, the x-coordinate of the damage sampling point is obtained by adding the product of the radial damage sampling point image radius and the cosine of the radial sampling angle to the x-coordinate of the workpiece center. The y-coordinate of the damage sampling point is obtained by adding the product of the radial damage sampling point image radius and the sine of the radial sampling angle to the y-coordinate of the workpiece center. The x-coordinate and y-coordinate are rounded to obtain the integer pixel coordinates of the original image. Radial damage sampling points mapped to the same integer pixel coordinates of the original image are merged into one original image damage pixel, and the corresponding angle sampling sequence number is retained. Based on the 8-neighbor pixel connectivity rule, the original image damage pixels belonging to the same 8-neighbor connected domain are divided into the same defect region, and the inner defect region and the outer defect region are output.
9. The method for visually inspecting surface defects of valve plates and valve seats according to claim 8, characterized in that, The determination of the actual area of the defect and the radial location range of the defect includes: The number of damaged pixels in the original image contained in each defect area is counted. The actual defect area is obtained by multiplying this number by the square of the pixel equivalent. For the inner defect area, the maximum difference between the corresponding inner candidate edge radius and the inner recovery radius of the sealing strip is multiplied by the pixel equivalent to obtain the inner radial intrusion depth. For the outer defect area, the maximum difference between the outer recovery radius of the sealing strip and the corresponding outer candidate edge radius is multiplied by the pixel equivalent to obtain the outer radial intrusion depth. The number of non-repeating angle sampling numbers corresponding to the defect area is counted. The number of non-repeating angle sampling numbers, angle sampling interval, and sealing strip are then combined. Multiply the mid-diameter image radius and pixel equivalent to obtain the circumferential extension length of the defect at the mid-diameter of the sealing strip; read the corresponding radial sampling angle according to the angle sampling sequence number corresponding to the defect area to obtain the defect angle interval; when the defect area contains the starting angle sampling sequence number and the ending angle sampling sequence number of the circumference, record the radial sampling angle range corresponding to the ending side of the circumference and the radial sampling angle range corresponding to the starting side of the circumference of the defect area together as the zero-angle interval; read the minimum image radius and the maximum image radius from the damaged pixel in the original image within the defect area to the center of the workpiece, and multiply them by the pixel equivalent to obtain the radial position interval of the defect.
10. A visual inspection system for surface defects of valve plates and seats, characterized in that, include: The image parameter acquisition unit is used to acquire a front-view grayscale image and obtain the pixel equivalent, and to obtain the radial image parameters of the workpiece according to the workpiece drawing. The center positioning and radial sampling unit is used to determine the workpiece center coordinates using the positioning circle separated from the sealing strip, and to construct a radial grayscale sequence based on the workpiece center coordinates and the nominal image radius of the inner side and the nominal image radius of the outer side of the sealing strip in the radial image parameters of the workpiece. The candidate edge extraction and boundary restoration unit is used to exclude gray-level transition positions that fall within the radius range of the chamfered image and any processing edge image, to obtain inner candidate edges and outer candidate edges, and to filter candidate edge pairs based on the radial pixel distance between the inner and outer candidate edges, and to obtain the inner restoration radius and outer restoration radius of the sealing strip by taking the median of the corresponding candidate edge radii; The defect detection unit is used to determine radial damage sampling points when the radius of the inner candidate edge is greater than the upper limit of the allowable image radius range inside the sealing strip or the radius of the outer candidate edge is less than the lower limit of the allowable image radius range outside the sealing strip. The radial damage sampling points are then mapped to the frontal grayscale image to form a defect area, and the actual area and radial position range of the defect are determined.
Citation Information
Patent Citations
A method and apparatus for extracting defect areas on a plate surface
CN112837287B
Deep learning-based methods, devices, and storage media for industrial product defect inspection.
CN113643268B