A method and system for visual inspection of titanium alloy rod production quality
By dividing the target image of the titanium alloy rod and identifying cracks, the problem of difficult to take into account the detection efficiency and accuracy of the titanium alloy rod in the prior art is solved, and the rapid and accurate detection of the titanium alloy rod and the effective maintenance of the production equipment are achieved.
Patent Information
- Application Number
- CN202410926525.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-11
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-07-11
AI Technical Summary
The prior art is difficult to accurately detect cracks in titanium alloy rods, especially in their special shape and complex turning processing scenarios, which makes it difficult to take into account both detection efficiency and accuracy.
By acquiring the target image of the titanium alloy rod, using the target features to divide the area, identifying multiple groups of symmetrical diagonal gray areas, and using grayscale data to identify cracks, outputting detection results for equipment maintenance.
It realizes rapid and accurate detection of cracks of titanium alloy rods, reduces the impact of production equipment factors on cracks, takes into account detection efficiency and accuracy, and ensures the production quality of titanium alloy rods.
Smart Images

Figure CN118470015B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of image processing for visual inspection, and in particular to a method and system for visual inspection of production quality of titanium alloy bars. Background Art
[0002] Titanium alloys are widely used in various fields due to their high strength, good corrosion resistance, high heat resistance, and bio-friendliness. Due to the particularity of the use of titanium products, the surface quality requirements are very high, and defects such as dents, scratches, cracks, and pinholes are not allowed. These quality problems will seriously affect the performance and application of titanium alloy rods.
[0003] Titanium alloy rods are an important component of titanium alloy materials. In the process of titanium alloy production quality inspection, it is crucial to grasp the production quality of titanium alloy rods. When cracks appear on the surface of titanium alloy rods, the cracks usually appear as straight or slightly curved linear defects. In the existing technology, cracks can be identified through edge information through computer vision technology, but due to the special shape of titanium alloy rods and the particularity of turning processing scenes, the crack types are complex and difficult to detect accurately. Summary of the invention
[0004] The present invention provides a titanium alloy rod production quality visual inspection method and system, which can take into account both efficiency and accuracy when implementing crack detection on the titanium alloy rod.
[0005] The embodiment of the present invention provides the following solution:
[0006] In a first aspect, an embodiment of the present invention provides a method for visually inspecting the production quality of a titanium alloy rod, the method comprising:
[0007] Acquire a target image of the titanium alloy rod, wherein the target image is an image of the end surface of the titanium alloy rod after turning;
[0008] The target image is divided into regions according to the target features on the target image to obtain multiple groups of grayscale regions with symmetrical diagonal distribution, wherein the target features are features in which each grayscale region is symmetrically diagonally distributed with different grayscales around the end turning center of the titanium alloy rod;
[0009] Implement end face crack recognition of the titanium alloy rod according to each group of symmetrically diagonally distributed grayscale areas to obtain crack detection results of the titanium alloy rod;
[0010] Carry out corresponding maintenance on the production equipment of titanium alloy rods according to the crack detection results.
[0011] In an optional embodiment, the target image is divided into regions according to target features on the target image to obtain multiple groups of grayscale regions with symmetrical diagonal distribution, including:
[0012] According to the grayscale values corresponding to the different grayscale areas represented by the target features, the region segmentation line of each grayscale area on the target image is obtained;
[0013] According to the segmentation results of the upper end surface area of the target image by all area segmentation lines, each group of grayscale areas with symmetrical diagonal distribution is obtained.
[0014] In an optional embodiment, obtaining a region segmentation line for each grayscale region on the target image according to grayscale values corresponding to different grayscale regions represented by target features includes:
[0015] Performing image segmentation on the target image by the end face turning center according to the target feature to segment the target image into a first image and a second image;
[0016] Obtaining region segmentation lines for each grayscale region on the first image according to different grayscale values presented by adjacent grayscale regions on the first image;
[0017] The region segmentation line of each grayscale region on the first image is extended to the second image to obtain the region segmentation line of each grayscale region on the target image.
[0018] In an optional embodiment, obtaining a region segmentation line for each grayscale region on the first image according to different grayscale values presented by adjacent grayscale regions on the first image includes:
[0019] Extracting grayscale values of all pixels on the first image to obtain grayscale data of each radial line on the first image;
[0020] According to the grayscale data of each radial line, mean calculation, difference calculation and same grayscale value statistics are performed respectively to obtain the average grayscale value, maximum grayscale difference and maximum frequency grayscale of each radial line;
[0021] According to the average gray value and the maximum frequency gray of the adjacent radial lines, the gray similarity of all adjacent radial lines is obtained;
[0022] The grayscale similarity of all adjacent radial lines is obtained according to the maximum grayscale difference, the grayscale similarity and the preset grayscale deviation threshold;
[0023] When the grayscale similarity of adjacent radial lines is greater than a preset similarity threshold, it is determined that the adjacent radial lines are in the same grayscale region;
[0024] When the grayscale similarity of adjacent radial lines is less than or equal to a similarity threshold, it is determined that the adjacent radial lines are in different grayscale regions to obtain region segmentation lines for each grayscale region on the first image.
[0025] In an optional embodiment, the grayscale similarity of all adjacent radial lines is obtained according to the maximum grayscale difference, the grayscale similarity and a preset grayscale deviation threshold, including:
[0026] According to the formula:
[0027]
[0028] Get the grayscale similarity between radial line k and radial line k+1 ,in, is the grayscale deviation threshold between radial line k and radial line k+1, is the similarity between the grayscale of radial line k and radial line k+1, is the maximum grayscale difference of radial line k, and norm() is the normalization function.
[0029] In an optional embodiment, the end face crack identification of the titanium alloy rod is performed according to each group of symmetrically diagonally distributed grayscale areas to obtain the crack detection result of the titanium alloy rod, including:
[0030] According to the grayscale data of each grayscale area, the average grayscale difference, grayscale variance difference and regional roughness of each grayscale area are obtained;
[0031] According to the average grayscale difference and grayscale variance difference, the regional similarity of each grayscale area is obtained;
[0032] When the region similarity of the current group of grayscale regions is less than a preset similarity threshold, determining whether the region roughness of the current group of grayscale regions is greater than a preset roughness threshold;
[0033] When any area of the current group of grayscale areas is greater than the roughness threshold, it is determined that the corresponding grayscale area has cracks;
[0034] The grayscale area where cracks exist is output as the crack detection result of the titanium alloy rod.
[0035] In an optional embodiment, obtaining the regional roughness of each grayscale region according to the grayscale data of each grayscale region includes:
[0036] Performing corner point detection on the grayscale data of each grayscale area to obtain the number of corner points of each grayscale area in each group of grayscale areas;
[0037] Input the number of corner points and grayscale data of each grayscale area into a preset roughness processing model;
[0038] According to the output result of the roughness processing model, the regional roughness of each grayscale area is obtained.
[0039] In an optional embodiment, outputting the grayscale area where cracks exist as the crack detection result of the titanium alloy rod includes:
[0040] Perform image segmentation on the grayscale area with cracks according to a preset crack segmentation threshold to obtain the distribution distance between each crack pixel point;
[0041] When the distribution distance between each crack pixel point is within a preset range, determining that the crack detection result is a branch crack;
[0042] When the distribution distance between the crack pixel points is not within a preset range, it is determined that the crack detection result is a discontinuous crack.
[0043] In an optional embodiment, before dividing the target image into regions according to target features on the target image, the method further includes:
[0044] Performing noise reduction processing on the target image to obtain a target image after noise reduction processing;
[0045] Inputting the target image after the denoising process into a preset semantic segmentation model to segment the end face part and the background part of the target image after the denoising process;
[0046] The target image segmented into the end face portion is determined as a target image for performing region segmentation based on target features.
[0047] In a second aspect, an embodiment of the present invention further provides a titanium alloy rod production quality visual inspection system, the system comprising:
[0048] An image capturing terminal, used to output a target image of the titanium alloy rod, wherein the target image is an image of the end surface of the titanium alloy rod after turning;
[0049] A data processing terminal is connected to the image shooting terminal; the data processing terminal is used to divide the target image into regions according to the target features on the target image to obtain multiple groups of symmetrically diagonally distributed grayscale regions, wherein the target features are features of symmetrically diagonally distributed grayscales in each grayscale region with the end face turning center of the titanium alloy rod;
[0050] The data processing terminal is also used to implement end face crack recognition of the titanium alloy rod according to each group of symmetrically diagonally distributed grayscale areas to obtain crack detection results of the titanium alloy rod;
[0051] The data processing terminal is also used to perform corresponding maintenance on the production equipment of titanium alloy rods according to the crack detection results.
[0052] Compared with the prior art, the titanium alloy rod production quality visual inspection method and system provided by the present invention have the following advantages:
[0053] The technical solution of the present invention obtains a target image of a titanium alloy rod, where the target image is an image of the end face of the titanium alloy rod after turning. Since the turning surface has bright reflected light and a certain amount of light scattering, there are target features on the target image in which each grayscale area is symmetrically diagonally distributed with different grayscales around the end face turning center of the titanium alloy rod. The target image can be divided into regions according to the target features on the target image to obtain multiple groups of symmetrically diagonally distributed grayscale areas. Further, end face crack identification of the titanium alloy rod is performed according to each group of symmetrically diagonally distributed grayscale areas, so that crack detection results of the titanium alloy rod can be obtained quickly and accurately. According to the crack detection results, the production equipment of the titanium alloy rod is maintained accordingly, which reduces the influence of production equipment factors on cracks and can take into account both efficiency and accuracy when implementing crack detection on the titanium alloy rod. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0055] Figure 1 A flow chart of a method for visually inspecting the production quality of titanium alloy rods provided by one embodiment of the present invention;
[0056] Figure 2 A target image of a titanium alloy rod provided by one embodiment of the present invention;
[0057] Figure 3 A schematic structural diagram of a titanium alloy rod production quality visual inspection system provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0058] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the specific implementation methods, structures, features and effects of the technical solutions proposed by the present invention are described in detail below in conjunction with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0059] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0060] The specific scheme of the visual inspection method and system for production quality of titanium alloy rods provided by the present invention is described in detail below in conjunction with the accompanying drawings.
[0061] See also Figure 1 , which shows a flow chart of a titanium alloy rod production quality visual inspection method provided by an embodiment of the present invention. The inspection method can be applied to the inspection terminal of the titanium alloy rod or the control terminal of the production equipment for implementation. It only needs to be able to run the inspection method, and no specific limitation is made here. The inspection method includes:
[0062] S11, acquiring a target image of the titanium alloy rod, wherein the target image is an image of the end surface of the titanium alloy rod after turning.
[0063] Specifically, the titanium alloy rod is a metal profile produced by the production equipment. The production equipment can be an extrusion molding assembly line equipment or a forging molding forging equipment. The production equipment needs to configure various parameters to implement the continuous production of titanium alloy rods through titanium alloy raw materials. The cross-section of the titanium alloy rod can be rectangular, circular or elliptical. After the titanium alloy rod is produced, in order to check its production quality, the end face of the titanium alloy rod is turned by a lathe to remove the oxide layer on the end face for the convenience of quality inspection. The target image can be obtained by taking a picture of the end face of the titanium alloy rod after turning through an image shooting terminal. The image shooting terminal can be a mobile phone, a quality inspection camera, etc.
[0064] Since the titanium alloy rods are mostly photographed in the production workshop, affected by various factors such as dust and light in the production workshop, there are noise points on the target image, which affects the accuracy of subsequent detection results. Based on this, in a specific implementation, it is also necessary to pre-process the target image, specifically including:
[0065] Perform noise reduction on the target image to obtain the target image after noise reduction. You can choose the appropriate noise reduction method based on actual needs, such as Gaussian filtering, mean filtering, median filtering, etc. Implementing image noise reduction can improve image quality, remove or reduce noise, enhance image clarity and detail performance, reduce the impact of abnormal factors during shooting, and facilitate subsequent image processing and analysis.
[0066] After the image denoising is completed, the denoised target image is input into the preset semantic segmentation model to segment the end face part and the background part of the denoised target image. The CNN (Convolutional Neural Networks) model with an encoding-decoding structure can be used to semantically segment the target image. The segmentation labels are divided into two categories, namely the end face label of the titanium alloy rod and the background label. This method is pixel-level classification, that is, all pixels in the image need to be labeled with corresponding labels. The pixels belonging to the end face of the titanium alloy rod are labeled with a value of 1; the pixels belonging to the background are labeled with a value of 0. The CNN model uses a cross entropy loss function for segmentation processing, and the target image segmented into the end face part is determined as a target image for regional division based on target features.
[0067] It should be noted that since the directly photographed target image contains the end face part and the background part, the implementation of the above-mentioned noise reduction and segmentation processing can improve the processing efficiency and accuracy of subsequent images. Figure 2 , Figure 2 It is a schematic diagram of the target image. In the figure, the cross section of the titanium alloy rod is a circle. The circular area in the coordinate system XOY is the end face of the titanium alloy rod. The image outside the end face is the background. Subsequent processing is performed based on the target image of the end face.
[0068] S12. Divide the target image into regions according to the target features on the target image to obtain multiple groups of symmetrically diagonally distributed grayscale regions, wherein the target features are features in which each grayscale region is symmetrically diagonally distributed with different grayscales around the end turning center of the titanium alloy rod.
[0069] Specifically, since the end face of the titanium alloy rod is turned, there will be bright reflected light on its surface when the end face is illuminated by light, and there will also be a certain amount of light scattering. For the titanium alloy rod, under normal light, the target image collected on its surface will show a certain regularity, specifically, it will be divided into multiple areas on the target image, and the brightness of the two diagonal areas has a great degree of similarity, such as Figure 2 As shown. Based on this regularity and the grayscale presentation regularity of the pixels in the target image, the target image of the titanium alloy rod can be analyzed to determine the area where cracks may exist. The smoothness of the image surface can be used to accurately detect the suspicious area, so as to complete the production quality inspection of the titanium alloy rod based on the crack situation in the defective area after accurate detection.
[0070] The target image is divided into regions for the end face image of the titanium alloy rod, and the grouping is completed according to the diagonal rule. When implementing the regional division, the target image can be segmented based on the grayscale values of different regions to divide the end face of the titanium alloy rod into multiple regions. Taking a titanium alloy rod with a circular cross section as an example, its end face can be divided into multiple sector-shaped regions. The vertex of the central angle of all sector-shaped regions is the end face turning center of the titanium alloy rod. The two sector-shaped regions with symmetrical diagonal distribution are the same group of grayscale regions, and the grayscale values presented by the two are the same. After the target image is segmented, multiple groups of symmetrically diagonally distributed grayscale regions can be obtained.
[0071] Exemplarily, step S12 includes sub-steps S12-1 to S12-2, specifically including:
[0072] S12-1, according to the grayscale values corresponding to different grayscale areas represented by the target features, obtain the region segmentation line of each grayscale area on the target image. Based on the target features represented by the target image, the grayscale value of each pixel can be extracted, and the area formed by the pixels covered by similar grayscale values can be divided into the same grayscale area, and the boundary line of adjacent grayscale areas is the region segmentation line of the grayscale area.
[0073] In practical applications, the number of pixels in the target image is huge. If grayscale calculation is performed one by one, it takes a lot of processing time, resulting in a large amount of redundant calculations in the image processing process. Based on this, in a specific implementation, sub-step S12-1 includes S12-1-1 to S12-1-3, specifically including:
[0074] S12-1-1. Perform image segmentation on the target image using the end face turning center according to the target features, so as to segment the target image into a first image and a second image. Please continue to refer to Figure 2 , still taking the detection of a titanium alloy rod with a circular cross section as an example, the collected target image can be roughly considered to be a circle, and the coordinate system XOY can be constructed based on the center of the circle as the origin of the coordinate axis, with the horizontal direction as the X axis and the vertical direction as the Y axis. The target image is segmented by the coordinate system XOY, and the target image is segmented into a first image and a second image by the X axis or the Y axis, and the first image and the second image are mirror images of each other.
[0075] S12-1-2. According to the different grayscale values presented by the adjacent grayscale areas on the first image, the region segmentation lines of the grayscale areas on the first image are obtained. The region is divided based on the grayscale values of the adjacent grayscale areas on the first image, and the segmentation line between the adjacent grayscale areas, i.e., the region segmentation line, is obtained. The target pixel point can be taken at a position far from the coordinate origin in any quadrant of the coordinate system XOY to obtain the grayscale set of all the pixel points on the line between the target pixel point and the coordinate origin:
[0076]
[0077] Grayscale area division is performed based on the grayscale data represented by the grayscale set to obtain area segmentation lines for each grayscale area on the first image.
[0078] Exemplarily, step S12-1-2 includes:
[0079] In the first step, the grayscale values of all pixels on the first image are extracted to obtain the grayscale data of each radial line on the first image. The grayscale set is the grayscale data of the radial line, and M is the number of pixels on a radial line. By extracting the grayscale values of all pixels on the first image, the grayscale data of each radial line can be obtained, and the grayscale data of each radial line is represented as a corresponding grayscale set.
[0080] In the second step, the mean, difference and same gray value statistics are performed according to the gray data of each radial line to obtain the average gray value, maximum gray difference and maximum frequency gray value of each radial line. The gray values of pixels in the same area are roughly the same, and the gray data of each radial line can be analyzed. A collection of grayscale radial lines , get the gray value distribution range of each radial line , and the corresponding number of pixels , and the gray value of the corresponding pixel The average gray value can be obtained by calculating the mean of the gray data of each radial line; the maximum gray value With the minimum gray value The difference is the maximum grayscale difference; the maximum frequency grayscale is the grayscale value with the most corresponding pixels in the grayscale data of each radial line. .
[0081] The third step is to obtain the grayscale similarity of all adjacent radial lines based on the average grayscale value and the maximum frequency grayscale of the adjacent radial lines. The target image has a grayscale similarity relationship in the diagonal area. For adjacent radial lines, they may exist in the same area. If the grayscale value distribution range on the connecting line is close and the distribution is similar, they belong to the same grayscale area. Therefore, based on the grayscale similarity of adjacent radial lines, it can be determined whether the adjacent radial lines are in the same grayscale area. It can be based on the formula:
[0082]
[0083] Get the grayscale similarity between radial line k and radial line k+1 , where Represents radial lines The average gray value of represents the average gray value of radial line k+1, Indicates the grayscale value with the most corresponding pixels in the grayscale data of the k-th radial line. The grayscale value with the most corresponding pixels in the grayscale data of the k+1th radial line, Represents the absolute value symbol.
[0084] It can be understood that the above formula uses the maximum gray value difference between the corresponding pixels on radial line k and radial line k+1 , and the average gray value of the two For the same grayscale area on the titanium alloy rod, the corresponding average grayscale value will be roughly the same, and the grayscale value distribution is also similar. The smaller the maximum grayscale value difference of the corresponding pixel points on the radial line, the smaller the average grayscale value, and the larger the corresponding calculation result, and then the grayscale similarity of all adjacent radial lines can be accurately calculated.
[0085] In the fourth step, the grayscale similarity of all adjacent radial lines is obtained according to the maximum grayscale difference, grayscale similarity and the preset grayscale deviation threshold. The similarity calculation model can be configured based on actual needs, and the maximum grayscale difference, grayscale similarity and grayscale deviation threshold are input into the similarity calculation model. Based on the output result of the similarity calculation model, the grayscale similarity of adjacent radial lines is obtained. The grayscale similarity represents the grayscale similarity between adjacent radial lines.
[0086] As an example, the formula:
[0087]
[0088] Get the grayscale similarity between radial line k and radial line k+1 ,in, is the grayscale deviation threshold between radial line k and radial line k+1, is the similarity between the grayscale of radial line k and radial line k+1, is the maximum grayscale difference of radial line k, and norm() is the normalization function. It can be understood that for the target image of the titanium alloy rod, the grayscale presented by the overall color will tend to be white, and the grayscale value under normal circumstances is relatively large, so the maximum grayscale difference is considered for calculation. For the minimum grayscale value, due to the possible existence of crack characteristics, there are fewer pixels with smaller grayscale values, but it has no substantial effect on the division of the grayscale area.
[0089] It should be noted that, although the grayscale values of pixels in the same area are similar, due to the influence of other factors during the shooting process, such as light factors, the grayscale values of the pixels on the connecting lines in the picture may have certain deviations. For this reason, a grayscale deviation threshold is set to allow grayscale value differences within the grayscale deviation threshold in the same grayscale area. The grayscale deviation threshold can be set based on the technician's experience or calibration experiments, and does not affect the accuracy of the grayscale area division. For example, setting the grayscale deviation threshold is 5.
[0090] In the fifth step, when the grayscale similarity of adjacent radial lines is greater than a preset similarity threshold, it means that the grayscale features represented by the adjacent radial lines are extremely similar, and the adjacent radial lines are determined to be in the same grayscale region. When the grayscale similarity of adjacent radial lines is less than or equal to the similarity threshold, it means that there are differences in the grayscale features represented by the adjacent radial lines, and the adjacent radial lines are determined to be in different grayscale regions. After performing a similarity comparison on all adjacent radial lines, the grayscale regions on the first image can be obtained. The similarity threshold can also be set based on actual needs, for example, it can be set to 0.7, or other values, which are not specifically limited here.
[0091] At this point, the division of each grayscale region on the first image is completed, and the region segmentation lines of each grayscale region on the first image are obtained based on the boundary lines of adjacent grayscale regions.
[0092] S12-1-3, extending the region segmentation lines of each grayscale region on the first image to the second image to obtain the region segmentation lines of each grayscale region on the target image. Based on the diagonal rule of each grayscale region on the target image, the region segmentation lines on the first image are extended to the outer contour of the second image to obtain the region segmentation lines of each grayscale region on the target image.
[0093] S12-2. Obtain each group of symmetrically diagonally distributed grayscale regions based on the segmentation results of the upper end surface region of the target image by all region segmentation lines. The target image can be segmented into multiple grayscale regions by region segmentation lines. The grayscale features represented by adjacent grayscale regions are different. The grayscale regions that are symmetrically diagonally distributed are the same group of grayscale regions. The grayscale features presented by the same group of grayscale regions are the same. By implementing the grayscale region division of the first image and extending the region segmentation lines, the computational redundancy of data in the grayscale region division process can be effectively reduced, and the processing efficiency of crack detection in titanium alloy rods can be improved.
[0094] At this point, the region grouping of the target image of the titanium alloy rod is completed.
[0095] S13. Implement end face crack identification of the titanium alloy rod according to each group of symmetrically diagonally distributed grayscale regions to obtain crack detection results of the titanium alloy rod.
[0096] Specifically, since the grayscale performance of the same group of grayscale areas is the same, the presence of cracks can be preliminarily judged based on the degree of similarity between two different areas in the same group of grayscale areas. End face crack recognition is to analyze the grayscale performance of the same group of areas, and combine the smoothness characteristics represented by them to accurately judge the grayscale areas where cracks exist. Training for end face crack recognition can be implemented based on the CNN model. When it has a high accuracy after training, end face crack recognition is implemented based on the CNN model, and the output result of the CNN model is determined as the crack detection result of the titanium alloy rod.
[0097] Exemplarily, step S13 includes sub-steps S13-1 to S13-5, specifically including:
[0098] S13-1. According to the grayscale data of each grayscale area, the average grayscale difference, grayscale variance difference and regional roughness of each grayscale area are obtained. The average grayscale difference can be obtained based on the average grayscale difference of each grayscale area; the grayscale variance difference is obtained based on the grayscale variance difference of each grayscale area. Regional roughness characterizes the smoothness of the grayscale area. The presence of cracks will increase the roughness of the titanium alloy rod surface, because the crack edge is usually irregular and may be accompanied by tiny fragments or broken grains. Therefore, the crack area can be further accurately determined based on the roughness of the image in the grayscale area.
[0099] The method for obtaining the regional roughness includes sub-steps S13-1-1 to S13-1-3, specifically:
[0100] S13-1-1. Perform corner detection on the grayscale data of each grayscale area to obtain the number of corner points in each grayscale area in each group of grayscale areas. When there are cracks on the surface of the titanium alloy rod, there will be small particles such as tiny fragments on both sides of the cracks, which will increase the roughness of the surface of the titanium alloy rod. The more small particles there are in the crack area, the greater the roughness. Since the color of the small particles on the surface of the titanium alloy rod is quite different from that of the edge area, the SIFT (Scale-Invariant Feature Transform) corner detection operator can be used to perform corner detection on each grayscale area to obtain the number of corner points in each grayscale area.
[0101] S13-1-2, inputting the number of corner points and grayscale data of each grayscale area into a preset roughness processing model. Similarly, the roughness processing model can be configured based on actual needs, and can accurately calculate the regional roughness based on the number of corner points and grayscale data.
[0102] Because the pixels on the protruding small particles behave differently from the surrounding pixels under light, you can choose to analyze multiple adjacent pixels as a whole, for example, 9 (3×3) adjacent pixels as a whole. As an example, you can use the formula:
[0103]
[0104] Get the regional roughness of each grayscale area , where Indicates In the grayscale area of the group In the region The gray value of a pixel. Indicates In the grayscale area of the group In the region The average gray value of the pixels in the 8 neighborhoods around a pixel. Indicates Group The average gradient value of the region. Indicated in Group The number of pixels in the region whose gradient value is less than 10. Indicates Group The number of corner points for corner detection in each region. norm() is the normalization function.
[0105] It can be understood that in the above calculation, when the gray value difference between the pixel point and the pixel points in the surrounding 8 neighborhoods is large, the gradient value of the pixel points in the overall area is large, and the number of pixel point gradient values less than the set threshold is small, it indicates that there are more fine particles in this titanium alloy rod area, and the roughness of this area is large. The more corner points detected in the area, the greater the possibility that there are many tiny fragments in this area, that is, the greater the roughness of this area.
[0106] S13-1-3, according to the output result of the roughness processing model, the regional roughness of each grayscale area is obtained. Each grayscale area can be marked, and the marking result of each grayscale area and the corresponding regional roughness are stored accordingly. After the regional roughness of each grayscale area is obtained, step S13-2 is entered.
[0107] S13-2. Obtain the regional similarity of each group of grayscale regions based on the average grayscale difference and the grayscale variance difference. Similarly, the regional similarity between two grayscale regions in each group of grayscale regions can be calculated based on the similarity calculation model. For two regions on the surface of a titanium alloy rod that belong to the same group, they should usually show a relatively similar overall grayscale. However, when a certain region has a crack, it will show a certain degree of color difference with the corresponding region. Based on this, the first The degree of regional similarity between two regions within a group:
[0108]
[0109] In the formula, Indicates the degree of regional similarity between two regions in the same group of grayscale regions. Represents the average grayscale difference between two areas in the same group of grayscale areas. It represents the grayscale variance difference of pixels in two regions, and norm() is the normalization function.
[0110] It should be further explained that when the average grayscale difference of pixels in two areas of the same grayscale area is The smaller the grayscale variance difference The smaller the value, the closer the grayscale characteristics of the two grayscale areas in the same group on the titanium alloy rod surface are, which further indicates that the two areas are either normal areas or cracked areas. Further analysis is needed.
[0111] S13-3. When the region similarity of the current group of grayscale regions is less than the preset similarity threshold, it means that the two grayscale regions of the current group of grayscale regions are very similar, and it is further determined whether the region roughness of the current group of grayscale regions is greater than the preset roughness threshold.
[0112] S13-4. When any area of the current group of grayscale areas is greater than the roughness threshold, it means that the surface roughness of the grayscale area greater than the roughness threshold is relatively large, and it is determined that cracks exist in the corresponding grayscale area.
[0113] S13-5. Output the grayscale area where cracks exist as the crack detection result of the titanium alloy rod.
[0114] The following will explain the crack determination process in detail. Setting the similarity threshold , roughness threshold , when the region similarity ,and and , indicating that the two grayscale regions in the same group are very similar and have low surface roughness, and both grayscale regions are normal regions; ,like , , indicating that the similarity between the two is low and the surface roughness is different. The first area in the group is the crack area, and the second area is the normal area. The other cases are analyzed in the same way and will not be further described here.
[0115] So far, all the crack areas on the titanium alloy rod have been obtained through the above data processing method.
[0116] Through the above processing, all crack regions on the titanium alloy rod can be obtained, but the production process of the titanium alloy rod is complicated, and different crack types require different corresponding adjustment parameters. If only the crack region is determined, accurate process parameter adjustment cannot be implemented. Based on this, in a specific implementation, sub-step S13-5 includes S13-5-1 to S13-5-2, specifically including:
[0117] S13-5-1. Perform image segmentation on the grayscale area with cracks according to the preset crack segmentation threshold to obtain the distribution distance between each crack pixel point. Since there are crack features and some small particle features in the crack area, the distribution of crack pixel points in the image after threshold segmentation can reflect the type of crack. The crack type is determined based on the continuity of the coordinates of the pixel points on the crack. Reconstruct the XY coordinate system on the grayscale area with cracks to obtain the coordinates of the pixel points on the crack. From top to bottom and from left to right, select the first pixel as the starting pixel and calculate the distance between it and the nearest pixel around it. The distance between a pixel and the next pixel , the distribution distance between each crack pixel point can be obtained.
[0118] S13-5-2. When the distribution distance between each crack pixel point is within the preset range, it means that the crack has a branched structure, and the crack detection result is determined to be a branched crack. When the distribution distance between each crack pixel point is not within the preset range, it means that the crack has a relatively dispersed structure, and the crack detection result is determined to be a discontinuous crack. The preset range can be set based on actual needs, for example When measuring the distribution distance between each crack pixel point, a distance threshold K3 can be set, and a measurement error of K3=0.5 is allowed.
[0119] At this point, the crack detection result of the titanium alloy rod is obtained, and the process proceeds to step S14.
[0120] S14. Perform corresponding maintenance on the production equipment of titanium alloy rods according to the crack detection results.
[0121] Specifically, the corresponding maintenance of the production equipment can be implemented based on the actual crack detection results. For example, if cracks exist in five consecutive grayscale areas, it may be that the parameter settings of the production equipment are unreasonable, or there is a fault in the production equipment, resulting in crack problems in the production of titanium alloy rods. An alarm can be sent to on-site staff to remind them to conduct corresponding problem analysis for different crack situations, facilitate the implementation of production equipment maintenance, and ensure the product quality of titanium alloy rods.
[0122] Of course, the corresponding crack detection results can also be output based on the branch cracks or discontinuous cracks detected above, and the staff can implement the corresponding production equipment maintenance strategy based on the specific crack types.
[0123] Based on the same technical concept as the detection method, the embodiment of the present invention also provides a titanium alloy rod production quality visual inspection system, please refer to Figure 3 , Figure 3 The system includes an image capturing terminal 301 and a data processing terminal 302.
[0124] The image capturing terminal 301 is used to output a target image of the titanium alloy rod, wherein the target image is an image of the end surface of the titanium alloy rod after turning.
[0125] The data processing terminal 302 is connected to the image shooting terminal 301; the data processing terminal 302 is used to divide the target image into regions according to the target features on the target image to obtain multiple groups of symmetrically diagonally distributed grayscale regions, wherein the target features are the features of each grayscale region being symmetrically diagonally distributed with different grayscales based on the end face turning center of the titanium alloy rod.
[0126] The data processing terminal 302 is also used to perform end face crack recognition of the titanium alloy rod according to each group of symmetrically diagonally distributed grayscale areas to obtain crack detection results of the titanium alloy rod.
[0127] The data processing terminal 302 is also used to perform corresponding maintenance on the production equipment of the titanium alloy rod according to the crack detection results.
[0128] The data processing terminal 302 can also be used to process the relevant processing steps in the above detection method, which will not be described in detail here.
[0129] The technical solution provided in the embodiments of the present invention has at least the following technical effects or advantages:
[0130] 1. By acquiring the target image of the titanium alloy rod, the target image is the image of the end face of the titanium alloy rod after turning. Since the turning surface has bright reflected light and a certain amount of light scattering, there are target features on the target image in which each grayscale area is symmetrically diagonally distributed with different grayscales around the end face turning center of the titanium alloy rod. The target image can be divided into regions according to the target features on the target image to obtain multiple groups of symmetrically diagonally distributed grayscale areas. Further, the end face cracks of the titanium alloy rod are identified according to each group of symmetrically diagonally distributed grayscale areas, so that the crack detection results of the titanium alloy rod can be obtained quickly and accurately. According to the crack detection results, the production equipment of the titanium alloy rod is maintained accordingly, which reduces the influence of production equipment factors on cracks, and takes into account both efficiency and accuracy when implementing crack detection on titanium alloy rods.
[0131] 2. The embodiment of the present invention implements visual inspection of the production quality of titanium alloy bars based on the target features of the titanium alloy bars after turning, taking into account both inspection efficiency and accuracy, and can be applied to on-site fault handling of production equipment, helping staff to grasp the quality inspection results of the products and ensure the production quality of titanium alloy bars.
[0132] It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0133] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
Claims
1. A method for visual inspection of titanium alloy rod production quality, characterized in that: The method comprises: Acquire a target image of the titanium alloy rod, wherein the target image is an image of the end surface of the titanium alloy rod after turning; Divide the target image into regions according to the target features on the target image to obtain multiple groups of grayscale regions with symmetrical diagonal distribution, wherein the target features are features in which each grayscale region is symmetrically diagonally distributed with different grayscales around the end turning center of the titanium alloy rod; Implementing end face crack identification of the titanium alloy rod according to each group of symmetrically diagonally distributed grayscale areas to obtain a crack detection result of the titanium alloy rod; Performing corresponding maintenance on the production equipment of the titanium alloy rod according to the crack detection result; The method of implementing end face crack identification of the titanium alloy rod according to each group of symmetrically diagonally distributed grayscale areas to obtain crack detection results of the titanium alloy rod includes: According to the grayscale data of each grayscale area, the average grayscale difference, grayscale variance difference and regional roughness of each grayscale area are obtained; According to the average grayscale difference and the grayscale variance difference, the region similarity of each grayscale region is obtained, and the specific formula includes: In the formula, Indicates the degree of regional similarity between two regions in the same group of grayscale regions. Represents the average grayscale difference between two areas in the same group of grayscale areas. It represents the grayscale variance difference of pixels in two regions, and norm() is the normalization function; When the region similarity of the current group of grayscale regions is less than a preset similarity threshold, determining whether the region roughness of the current group of grayscale regions is greater than a preset roughness threshold; When any area of the current group of grayscale areas is greater than the roughness threshold, it is determined that cracks exist in the corresponding grayscale area; Outputting the grayscale area where cracks exist as the crack detection result of the titanium alloy rod; According to the grayscale data of each grayscale area, the regional roughness of each grayscale area is obtained, including: Performing corner point detection on the grayscale data of each grayscale area to obtain the number of corner points of each grayscale area in each group of grayscale areas; Input the number of corner points and grayscale data of each grayscale area into a preset roughness processing model; Obtaining the regional roughness of each grayscale area according to the output result of the roughness processing model; The step of outputting the grayscale area where cracks exist as the crack detection result of the titanium alloy rod comprises: Perform image segmentation on the grayscale area with cracks according to a preset crack segmentation threshold to obtain the distribution distance between each crack pixel point; When the distribution distance between the crack pixel points is within a preset range, determining that the crack detection result is a branch crack; When the distribution distance between the crack pixel points is not within a preset range, determining that the crack detection result is a discontinuous crack; The roughness processing model includes: For the In the grayscale area of the group The regional roughness of the region, Indicates In the grayscale area of the group In the region The gray value of each pixel; Indicates In the grayscale area of the group In the region The average gray value of the pixels in the 8 neighborhoods around the pixel Indicates Group The average gradient value of the region Indicated in Group The number of pixels in the region whose gradient value is less than 10 Indicates Group The number of corner points for corner detection in a region; norm() is the normalization function.
2. The titanium alloy rod production quality visual inspection method according to claim 1 is characterized in that: The step of dividing the target image into regions according to the target features on the target image to obtain a plurality of groups of grayscale regions with symmetrical diagonal distributions includes: Obtaining a region segmentation line for each grayscale region on the target image according to grayscale values corresponding to different grayscale regions represented by the target feature; According to the segmentation results of the upper end surface area of the target image by all area segmentation lines, each group of grayscale areas with symmetrical diagonal distribution is obtained.
3. The method for visual inspection of titanium alloy rod production quality according to claim 2, characterized in that: The step of obtaining a region segmentation line for each grayscale region on the target image according to grayscale values corresponding to different grayscale regions characterized by the target features includes: Performing image segmentation on the target image with the end face turning center according to the target feature, so as to segment the target image into a first image and a second image; Obtaining a region segmentation line for each grayscale region on the first image according to different grayscale values presented by adjacent grayscale regions on the first image; The region segmentation line of each grayscale region on the first image is extended to the second image to obtain the region segmentation line of each grayscale region on the target image.
4. The method for visual inspection of titanium alloy rod production quality according to claim 3, characterized in that: The step of obtaining the region segmentation lines of the grayscale regions on the first image according to the different grayscale values presented by the adjacent grayscale regions on the first image includes: Extracting grayscale values of all pixels on the first image to obtain grayscale data of each radial line on the first image; According to the grayscale data of each radial line, mean calculation, difference calculation and identical grayscale value statistics are performed respectively to obtain the average grayscale value, maximum grayscale difference and maximum frequency grayscale of each radial line; According to the average gray value and the maximum frequency gray value of adjacent radial lines, the gray similarity of all adjacent radial lines is obtained. The specific formula includes: Get the grayscale similarity between radial line k and radial line k+1 , where Represents radial lines The average gray value of represents the average gray value of radial line k+1, Indicates the grayscale value with the most corresponding pixels in the grayscale data of the k-th radial line. The grayscale value with the most corresponding pixels in the grayscale data of the k+1th radial line, Indicates the absolute value symbol; Obtaining the grayscale similarity of all adjacent radial lines according to the maximum grayscale difference, the grayscale similarity and a preset grayscale deviation threshold; When the grayscale similarity of the adjacent radial lines is greater than a preset similarity threshold, determining that the adjacent radial lines are in the same grayscale region; When the grayscale similarity of the adjacent radial lines is less than or equal to the similarity threshold, it is determined that the adjacent radial lines are in different grayscale regions to obtain region segmentation lines for each grayscale region on the first image.
5. The method for visual inspection of titanium alloy rod production quality according to claim 4, characterized in that: The step of obtaining the grayscale similarity of all adjacent radial lines according to the maximum grayscale difference, the grayscale similarity and a preset grayscale deviation threshold comprises: According to the formula: Get the grayscale similarity between radial line k and radial line k+1 ,in, is the grayscale deviation threshold between radial line k and radial line k+1, is the similarity between the grayscale of radial line k and radial line k+1, is the maximum grayscale difference of radial line k, norm() is the normalization function, Represents the absolute value symbol.
6. The method for visual inspection of titanium alloy rod production quality according to claim 1, characterized in that: Before dividing the target image into regions according to the target features on the target image, the method further includes: Performing noise reduction processing on the target image to obtain a target image after noise reduction processing; Inputting the target image after the denoising process into a preset semantic segmentation model to segment the end face part and the background part of the target image after the denoising process; The target image segmented into the end surface portion is determined as the target image for performing region segmentation based on the target feature.
7. A titanium alloy rod production quality visual inspection system, characterized in that: The system comprises: An image capturing terminal, used for outputting a target image of the titanium alloy rod, wherein the target image is an image of the end surface of the titanium alloy rod after turning; A data processing terminal connected to the image capturing terminal; the data processing terminal is used to divide the target image into regions according to the target features on the target image to obtain multiple groups of symmetrically diagonally distributed grayscale regions, wherein the target features are features in which each grayscale region is symmetrically diagonally distributed with different grayscales around the end turning center of the titanium alloy rod; The data processing terminal is also used to implement end face crack recognition of the titanium alloy rod according to each group of symmetrically diagonally distributed grayscale areas to obtain crack detection results of the titanium alloy rod; The data processing terminal is also used to perform corresponding maintenance on the production equipment of the titanium alloy rod according to the crack detection result; The method of implementing end face crack identification of the titanium alloy rod according to each group of symmetrically diagonally distributed grayscale areas to obtain crack detection results of the titanium alloy rod includes: According to the grayscale data of each grayscale area, the average grayscale difference, grayscale variance difference and regional roughness of each grayscale area are obtained; According to the average grayscale difference and the grayscale variance difference, the region similarity of each grayscale region is obtained, and the specific formula includes: In the formula, Indicates the degree of regional similarity between two regions in the same group of grayscale regions. Represents the average grayscale difference between two areas in the same group of grayscale areas. It represents the grayscale variance difference of pixels in two regions, and norm() is the normalization function; When the region similarity of the current group of grayscale regions is less than a preset similarity threshold, determining whether the region roughness of the current group of grayscale regions is greater than a preset roughness threshold; When any area of the current group of grayscale areas is greater than the roughness threshold, it is determined that cracks exist in the corresponding grayscale area; Outputting the grayscale area where cracks exist as the crack detection result of the titanium alloy rod; According to the grayscale data of each grayscale area, the regional roughness of each grayscale area is obtained, including: Performing corner point detection on the grayscale data of each grayscale area to obtain the number of corner points of each grayscale area in each group of grayscale areas; Input the number of corner points and grayscale data of each grayscale area into a preset roughness processing model; Obtaining the regional roughness of each grayscale area according to the output result of the roughness processing model; The step of outputting the grayscale area where cracks exist as the crack detection result of the titanium alloy rod comprises: Perform image segmentation on the grayscale area with cracks according to a preset crack segmentation threshold to obtain the distribution distance between each crack pixel point; When the distribution distance between the crack pixel points is within a preset range, determining that the crack detection result is a branch crack; When the distribution distance between the crack pixel points is not within a preset range, determining that the crack detection result is a discontinuous crack; The roughness processing model includes: For the In the grayscale area of the group The regional roughness of the region, Indicates In the grayscale area of the group In the region The gray value of each pixel; Indicates In the grayscale area of the group In the region The average gray value of the pixels in the 8 neighborhoods around the pixel Indicates Group The average gradient value of the region Indicated in Group The number of pixels in the region whose gradient value is less than 10 Indicates Group The number of corner points for corner detection in a region; norm() is the normalization function.
