A titanium metal wire drawing process intelligent control method and system
By calculating the edge degree of the titanium wire and the target gamma value, the grayscale image of the titanium wire is intelligently controlled, which solves the problem of poor brightness enhancement caused by the fixed gamma value and improves the accuracy of titanium wire drawing process parameter adjustment and crack detection. accuracy.
Patent Information
- Application Number
- CN202410907259.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-08
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2044-07-08
AI Technical Summary
In the prior art, when a fixed gamma value is used to enhance the brightness of titanium wire grayscale images, the effect is not good, resulting in a low accuracy in adjusting titanium wire drawing process parameters.
By obtaining the grayscale image of the titanium wire, determine the edge pixels, calculate the edge degree of the titanium wire and the target gamma value, use the gamma transformation algorithm to enhance the image, distinguish the titanium wire and the edge of the crack, and adjust the image grayscale value to improve the contrast.
The brightness enhancement effect of the titanium wire grayscale image is improved, making the cracks more obvious, improving the accuracy of adjusting the titanium wire drawing process parameters, and reducing the possibility of crack defects.
Smart Images

Figure CN118446946B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image data processing. The present invention relates to an intelligent control method and system for titanium metal wire drawing process. Background Art
[0002] The wire drawing process of titanium metal is one of the important means of cold processing of titanium metal materials. The wire drawing process is a very complex material deformation process with many influencing factors. The influencing factors include not only the changes in the material structure (including structural deformation, the formation of microtexture, etc.), but also the temperature of the wire rod and the changes in the surface state during the wire drawing process. In the wire drawing process, the deformation of the material is mainly affected by four factors: the die angle, the friction coefficient between the material and the die, the area shrinkage rate, and the hardening coefficient. The configuration of these factors will affect the quality of the wire drawing. Usually, poor process parameter configuration will cause cracks or even wire breakage in the titanium metal during the drawing process.
[0003] The patent application document with publication number CN111476792A discloses a method for extracting the contour of a plate and strip steel image, which performs contrast enhancement on the plate and strip steel image based on gamma transformation, wherein the gamma value is a set fixed value. It is understandable that the gamma transformation can also be used to enhance the contrast of the grayscale image of the titanium wire. Generally, before detecting the crack of the titanium wire, the brightness of the grayscale image of the collected titanium wire can be adjusted to increase the contrast of different parts in the grayscale image to make the crack more obvious. For example, the brightness of the grayscale image can be adjusted using a gamma transformation algorithm, wherein the gamma transformation algorithm is a common image brightness enhancement algorithm. However, since the brightness range of different titanium wire grayscale images may be different, generally, the effect of brightness enhancement of different titanium wire grayscale images using a fixed gamma value is different, resulting in a poor effect of brightness enhancement of the grayscale image, resulting in a low accuracy rate of adjusting the parameters of the titanium metal wire drawing process according to the enhanced image.
[0004] Based on this, it is particularly important to improve the contrast enhancement effect of the grayscale image of the titanium wire so as to make defects such as cracks in the grayscale image more obvious, thereby improving the accuracy of adjusting the parameters of the titanium metal wire drawing process. Summary of the invention
[0005] In order to solve the problem that the above-mentioned fixed gamma value leads to poor brightness enhancement effect of grayscale images, thereby leading to poor accuracy in adjusting parameters of titanium wire drawing process according to the enhanced image, the present invention proposes a method and system for intelligent control of titanium wire drawing process. To this end, the present invention provides solutions in the following aspects.
[0006] In a first aspect of an embodiment of the present invention, a method for intelligently controlling a titanium metal wire drawing process is provided, comprising:
[0007] Obtain a grayscale image of the titanium wire and determine the edge pixel points in the grayscale image; take any edge pixel point as a target point, and obtain the number of similar pixel points of the target point according to a preset similarity measurement standard, which is recorded as the total number of targets corresponding to the target point; traverse the remaining edge pixel points to obtain the total number of targets corresponding to each remaining edge pixel point;
[0008] Calculate the titanium wire edge degree b of the target point: , where: M is the total number of targets corresponding to the target point, and the edge pixels other than the target point on the first straight line in the gradient direction of the target point are taken as the gradient pixel points of the target point. The first straight line passes through the target point. is the number of all gradient pixels corresponding to the target point, is the total number of targets corresponding to the jth gradient pixel point among all the gradient pixel points, and c is a preset value; traversing the remaining edge pixel points to obtain the titanium wire edge degree of each remaining edge pixel point;
[0009] Calculate the target gamma value of the target point : ,in, is the preset initial gamma value, e is the natural constant, A is the preset hyperparameter, and B is the value obtained by normalizing the positive correlation of the titanium wire edge degree of the target point; based on the target gamma value and gamma transform algorithm to calculate the updated grayscale value of the target point; traverse the remaining edge pixel points to obtain the updated grayscale value of each remaining edge pixel point; thereby obtaining an enhanced image of the grayscale image;
[0010] Based on the enhanced image, defects of the titanium wire are detected to obtain detection results, and the parameters of the titanium metal wire drawing process are adjusted based on the detection results.
[0011] The direction of the crack in the grayscale image of the titanium wire is changing. For example, the crack is a broken line or a curve, and the direction of the edge of the titanium wire is basically unchanged. Therefore, according to the preset similarity measurement standard, it is easy to know that the total number of targets corresponding to the edge pixel points corresponding to the crack is small, and the total number of targets corresponding to the edge pixel points corresponding to the titanium wire is large. Therefore, if the total number of targets corresponding to the target point is larger, the target point is more likely to be the edge pixel point corresponding to the titanium wire, and vice versa, the target point is more likely to be the edge pixel point corresponding to the crack.
[0012] Since there are fewer cracks in the grayscale image of titanium wire, that is, fewer edge pixels corresponding to the cracks, and more edges of titanium wire, that is, more edge pixels corresponding to the titanium wire, the probability that the gradient pixel is the edge pixel corresponding to the titanium wire is greater, and the difference in the total number of targets between the edge pixels corresponding to the titanium wire is smaller, so the greater the mean of the difference between the total number of targets corresponding to the target point and the total number of targets corresponding to the gradient pixel, the more likely the target point is the edge pixel corresponding to the crack, and vice versa, the more likely the target point is the edge pixel corresponding to the titanium wire. Based on this, the edge pixel corresponding to the titanium wire can be distinguished from the edge pixel corresponding to the crack by the target titanium wire edge degree of the edge pixel. When the target titanium wire edge degree B is greater than the preset hyperparameter A, the target point can be considered to be the edge pixel corresponding to the titanium wire, thereby reducing the grayscale of the target point; when B is less than A, the target point can be considered to be the edge pixel corresponding to the crack, thereby increasing the grayscale of the target point. Based on this, the crack can be made more prominent in the grayscale image, thereby improving the accuracy of crack recognition, and thus improving the accuracy of adjusting the parameters of the titanium metal drawing process.
[0013] In one embodiment, the process of acquiring edge pixels in the grayscale image includes:
[0014] The process of obtaining edge pixel points includes: taking any pixel point in a grayscale image as a reference point, establishing a mutation window of a preset size with the reference point as the center, taking the pixel points other than the reference point on the second straight line in the gradient direction of the reference point as first pixel points, wherein the second straight line passes through the reference point and the first pixel point is in the mutation window; calculating the grayscale difference between the reference point and each first pixel point, and taking the average value of all grayscale differences as the mutation degree of the reference point; traversing the remaining pixel points in the grayscale image to obtain the mutation degree of each remaining pixel point; performing positive correlation normalization on the mutation degree of each pixel point in the grayscale image to obtain the target mutation degree of each pixel point in the grayscale image; taking the pixel point whose target mutation degree is greater than a preset threshold as the edge pixel point.
[0015] The larger the average value of the grayscale difference between the reference point and the first pixel point is, the more likely the reference point is an edge pixel point; otherwise, the more likely the reference point is not an edge pixel point. Based on this, it can be determined whether the pixel point is an edge pixel point.
[0016] In one embodiment, the mutation window is circular or square in shape.
[0017] In one embodiment, similar pixel points of a target point are obtained according to a preset similarity measurement standard, including: establishing a screening window of a preset size with the target point as the center, taking the pixel points other than the target point on the third straight line in the vertical direction of the gradient direction of the target point as the vertical points corresponding to the target point, wherein the third straight line passes through the target point, and the vertical point is in the screening window, and calculating the difference between the target point and the qth vertical point in the screening window. : ,in, is the target mutation degree of the target point, is the target mutation degree of the qth vertical point, is the absolute value, is the angle between the target point and the gradient direction of the qth vertical point; traverse the remaining vertical points to obtain the difference between the target point and each remaining vertical point;
[0018] The difference between the target point and the qth vertical point is negatively normalized to obtain the similarity between the target point and the qth vertical point; the remaining vertical points are traversed to obtain the similarity between the target point and each remaining vertical point; the vertical points corresponding to the similarity greater than the preset similarity threshold are taken as similar pixel points of the target point.
[0019] The smaller it is, the more likely the target point and the qth vertical point are the same type of pixel points. For example, if the target point is the edge pixel point corresponding to the titanium wire, and the qth vertical point is also the edge pixel point corresponding to the titanium wire, then the target point and the qth vertical point are the same type of pixel points.
[0020] The smaller it is, the more likely the target point and the qth vertical point are the same type of pixels. Based on this, similar pixels to the target point can be screened out by the difference between the target point and the vertical point.
[0021] In one embodiment, the screening window is circular in shape.
[0022] In one embodiment, negative correlation normalization is performed on the first similarity between the target point and the qth vertical point to obtain the similarity between the target point and the qth vertical point, including:
[0023] The expression of the similarity between the target point and the qth vertical point is:
[0024] , where is the natural exponential function, is the similarity between the target point and the qth vertical point.
[0025] In one embodiment, B is a value obtained by normalizing the positive correlation of the titanium wire edge degree of the target point, including:
[0026] B is called the target titanium wire edge degree of the target point; the expression of the target titanium wire edge degree of the target point is:
[0027] , where is the minimum value of the titanium wire edge degree of all edge pixels in the grayscale image, is the maximum value of the titanium wire edge degree of all edge pixels in the grayscale image.
[0028] In a second aspect of an embodiment of the present invention, a titanium metal wire drawing process intelligent control system is provided, comprising: a processor and a memory, the memory storing computer program instructions, and when the computer program instructions are executed by the processor, a titanium metal wire drawing process intelligent control method according to any one of the first aspects of the embodiment of the present invention is implemented.
[0029] The beneficial effects of the present invention include:
[0030] If the titanium wire edge degree of a certain edge pixel point is greater, the probability that the edge pixel point is the edge pixel point corresponding to the titanium wire is greater, and the target gamma value of the edge pixel point is greater, so that the grayscale value of the edge pixel point is reduced in a greater proportion, and thus the edge pixel point is less obvious. If the titanium wire edge degree of a certain edge pixel point is smaller, the probability that the edge pixel point is the edge pixel point corresponding to the crack is greater, and the target gamma value of the edge pixel point is smaller, and thus the edge pixel point is more obvious. Finally, the edge of the crack is more prominent in the grayscale image, so that the brightness enhancement effect of the grayscale image of the titanium wire is better, so that the accuracy of adjusting the parameters of the titanium metal wire drawing process according to the enhanced image is higher. If defects such as cracks are detected, the possibility of cracks can be reduced after adjusting the wire drawing process. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] By reading the following detailed description with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:
[0032] Figure 1 is a flow chart schematically showing a method for intelligently controlling a titanium metal wire drawing process according to an embodiment of the present invention;
[0033] Figure 2 is a schematic diagram schematically showing the positional relationship between the titanium wire and the camera arranged side by side according to this embodiment;
[0034] Figure 3is a schematic diagram schematically showing titanium wires arranged side by side and cracks in the titanium wires according to the present embodiment;
[0035] Figure 4 is a schematic diagram schematically showing a mutation window having a square shape and a side length of 3 according to the present embodiment;
[0036] Figure 5 The figure schematically shows a structural frame diagram of an intelligent control system for titanium metal wire drawing process according to the present embodiment. DETAILED DESCRIPTION
[0037] In some of the processes described in the specification and claims of the present invention and the above-mentioned figures, multiple operations appearing in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this article or executed in parallel. The serial numbers of the operations, such as 101, 102, etc., are only used to distinguish different operations, and the serial numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this article are used to distinguish different messages, devices, modules, etc., and do not represent the order of precedence, nor do they limit "first" and "second" to different types; in other words, the serial numbers themselves, such as "first", "second", etc., compiled for the components in this article are only used to distinguish the objects described, and do not have any order or technical meaning.
[0038] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0039] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0040] Figure 1 FIG. 1 is a flow chart schematically showing a method for intelligently controlling a titanium wire drawing process according to an embodiment of the present invention. Figure 1 As shown, firstly, according to a first aspect of the present invention, a method for intelligently controlling a titanium metal wire drawing process is provided.
[0041] The specific instructions are as follows: Figure 1 As shown, steps S1 to S5 are included:
[0042] In step S1, a grayscale image of the titanium wire is obtained, and edge pixel points in the grayscale image are obtained. The specific description is as follows:
[0043] Specifically, a grayscale image of one titanium wire or at least two titanium wires arranged side by side may be obtained.
[0044] Figure 2 FIG. 1 is a schematic diagram schematically showing the positional relationship between the titanium wire and the camera in parallel according to this embodiment. Figure 2 As shown, 201 is a camera and 202 is a titanium wire placed side by side. For example, 20 titanium wires of 2 m in length are randomly cut from the produced titanium wires, and the 20 titanium wires are placed side by side horizontally on the exhibition stand, where the titanium wires are adjacent. A camera is installed directly above the titanium wires, and the camera is used to capture images of the titanium wires. After capturing the image of one side of the 20 titanium wires, the 20 titanium wires can be rolled to capture images of the other side. An image transmission device is built into the camera, and the image transmission device is used to transmit the captured image to the intelligent control system for titanium wire drawing process. The intelligent control system for titanium wire drawing process is used to analyze and process images.
[0045] The collected image can be segmented to remove the background in the image, and then the image can be grayed to obtain a gray image of the titanium wire. A semantic segmentation algorithm can be used for image segmentation.
[0046] In layman's terms, the titanium wire drawing process is to pass the titanium wire through a metal circular hole with a smaller diameter. During the drawing process, the titanium wire in the metal circular hole will be subjected to axial tension and axial vertical pressure. Since the forces on each part of the titanium wire in the metal circular hole may be uneven, and the central axis of the titanium wire is subjected to greater tension, cracks and other defects may occur in the titanium wire.
[0047] The following is an explanation using the crack defect of titanium wire as an example. Figure 3 FIG. 2 is a schematic diagram schematically showing the side-by-side titanium wires and cracks in the titanium wires according to the present embodiment. Figure 3 As shown, 301 is the edge of a titanium wire, 302 is an edge pixel point corresponding to a titanium wire, 303 is a crack on the surface of a titanium wire, 304 is an edge pixel point corresponding to the crack, 305 is a non-edge pixel point, 306 is a crack on the surface of a titanium wire, and 307 is a partial crack in a crack that is a straight line.
[0048] In this context, the edge pixel points corresponding to the titanium wire are referred to as titanium wire edge pixels, or the pixel points corresponding to the titanium wire edge are referred to as titanium wire edge pixels, and the edge pixel points corresponding to the crack are referred to as crack edge pixels, or the pixel points corresponding to the crack are referred to as crack edge pixels. For example, 302 is a titanium wire edge pixel point, and 304 is a crack edge pixel point.
[0049] In the grayscale image of the titanium wire: there is a high probability that the grayscale difference between the crack edge pixel and the surrounding pixels is large; there is a high probability that the grayscale difference between the edge pixel of the titanium wire and the surrounding pixels is large; if a pixel is neither a crack edge pixel nor a titanium wire edge pixel, there is a high probability that the grayscale difference between the pixel and the surrounding pixels is small.
[0050] Therefore, the edge pixels in the grayscale image can be obtained according to the grayscale difference between the pixels. If the titanium wire to be detected has defects such as cracks, the edge pixels in the grayscale image include titanium wire edge pixels and crack edge pixels.
[0051] After obtaining the edge pixel points, the edge pixel points can be analyzed and processed to determine whether the edge pixel points are titanium wire edge pixels or crack edge pixels. Subsequently, the brightness of the titanium wire edge pixels can be appropriately reduced, and the brightness of the crack edge pixels can be appropriately increased, so that the edges of defects such as cracks are more obvious in the grayscale image, thereby improving the accuracy of detecting defects such as cracks, thereby improving the accuracy of adjusting the titanium metal wire drawing process.
[0052] The process of obtaining edge pixels is described below.
[0053] Any pixel point in the grayscale image is called a reference point, and a mutation window of a preset size is established with the reference point as the center. The implementer can set the size of the mutation window according to the specific implementation scenario. For example, the mutation window can be a square, and the side length of the mutation window can be 3; the shape of the mutation window can be a circle, and the diameter of the circle can be 5. It can be understood that when the mutation window is a square with a side length of 3, for any pixel point, the number of first pixels corresponding to the pixel point is 2. When the mutation window is a square with a side length of 3, the amount of calculation corresponding to the circle is smaller than that of a circle with a diameter of 7.
[0054] Here, any one means any one.
[0055] Figure 4 Schematic diagram schematically showing a mutation window having a square shape and a side length of 3 according to this embodiment. Figure 4 As shown, Figure 4 There are 9 small squares in total, and the small squares correspond to the pixels one by one. 401 is pixel A1, 402 is pixel A2, and 403 is pixel A2. If 402 is a reference point, and the gradient direction corresponding to the reference point is the row direction, then the number of first pixels corresponding to the reference point is 2, and the first pixels are pixel A1 and pixel A3.
[0056] In one embodiment, the unit of the side length of the mutation window is explained as follows: the shape of any pixel is a square by default, and the side length of the square corresponding to any pixel is one unit. For example, if the side length of the mutation window is 3, the length of the side length is the cumulative sum of the side lengths of 3 pixels. Based on this, the unit of the side length of the mutation window is "pieces" or "times". In layman's terms, the side length of the mutation window is a multiple of the side length of a pixel.
[0057] In another embodiment, any two adjacent pixels are determined in the row direction of the image, and the distance between the centers of the two pixels is taken as the first unit. The side length of the mutation window is a multiple of the first unit. Based on this, the unit of the side length can be "times". In other words, the first unit is considered to be 1. When the length of the side length of the mutation window is 3 times the first unit, the side length of the mutation window is considered to be 3. At this time, the side length is a relative value.
[0058] In other embodiments, the unit of the side length of the mutation window or the diameter of the circle is millimeter.
[0059] In the mutation window, the pixel points other than the reference point on the straight line in the gradient direction of the reference point are called first pixel points, wherein the straight line is called a second straight line, the second straight line passes through the reference point, and the first pixel point is in the mutation window. For example, when the mutation window is a square, and the side length of the square is 3, the reference point corresponds to 2 first pixel points.
[0060] The gradient direction of the pixel point can be obtained based on the Sobel operator, which is a prior art.
[0061] The gradient direction of the pixel is the direction in which the grayscale changes fastest, and the grayscale difference between the edge pixel and its surrounding pixels is large. Therefore, the degree of mutation of the reference point can be determined based on the grayscale difference between the reference point and the first pixel. Subsequently, whether the reference point is an edge pixel can be determined based on the degree of mutation.
[0062] By traversing all remaining pixels in the grayscale image, the mutation degree of each remaining pixel can be obtained.
[0063] It should be noted that the shape and size of the mutation window of each pixel in the grayscale image are the same.
[0064] Perform positive correlation normalization on the mutation degree of all pixels in the grayscale image to obtain the target mutation degree of each pixel; take the pixels whose target mutation degree is greater than the preset threshold as edge pixels. The implementer can set the preset threshold according to the specific implementation scenario. For example, the preset threshold can be an empirical value of 0.8. There is no restriction on the positive correlation normalization function.
[0065] Preferably, in one embodiment: the process of obtaining the mutation degree of any pixel in the grayscale image includes:
[0066] The expression of the mutation degree of any pixel in the grayscale image is:
[0067] ,in, is the mutation degree of the i-th pixel in the grayscale image, is the gray value of the i-th pixel, a is the number of all first pixels corresponding to the i-th pixel, is the pth first pixel point among all first pixel points corresponding to the ith pixel point.
[0068] in, The larger it is, the greater the probability that the i-th pixel is an edge pixel.
[0069] Preferably, in one embodiment: the process of obtaining the target mutation degree of any pixel point in the grayscale image includes: the expression of the target mutation degree is:
[0070] ,in, is the target mutation degree of the i-th pixel in the grayscale image, is the mutation degree of the i-th pixel, is the maximum value of the mutation degree of all pixels in the grayscale image. is the minimum value of the mutation degree of all pixels in the grayscale image, where one pixel corresponds to one mutation degree.
[0071] In another embodiment, edge pixels in the grayscale image may be determined based on conventional image recognition techniques, such as edge detection algorithms.
[0072] In step S2, similar pixels of each edge pixel are calculated, and the number of similar pixels of each edge pixel is used as the total number of targets of the corresponding edge pixel, wherein the edge pixel corresponds to the total number of targets. Specifically, any edge pixel is used as the target point, and the number of similar pixels of the target point is obtained according to the preset similarity measurement standard, which is recorded as the total number of targets corresponding to the target point; the remaining edge pixel points are traversed to obtain the total number of targets corresponding to each remaining edge pixel point. The specific description is as follows:
[0073] like Figure 3As shown, it can be understood that the edge of the titanium wire is in a straight line, that is, all edge pixels corresponding to a titanium wire edge are basically distributed on a straight line. For a titanium wire edge, the gradient directions of the titanium wire edge pixels are basically consistent, and the differences between the target mutation degrees of the titanium wire edge pixels are small. Obviously, the total number of targets corresponding to the titanium wire edge pixels is large.
[0074] like Figure 3 As shown, the direction of the crack is changing, that is, the shape of the crack is not a straight line. 307 is a part of a crack that is a straight line, but the length of this part of the crack is shorter. Obviously, the total number of targets corresponding to the crack edge pixels is small.
[0075] Even if the shape of the crack is a curve, similar pixel points to the edge pixel points corresponding to the crack can be determined by the method of this solution. Obviously, the total number of targets corresponding to the edge pixel points corresponding to the crack is small.
[0076] Therefore, based on the distinguishing features of the crack and the titanium wire edge, the total number of targets corresponding to each edge pixel in the grayscale image can be obtained.
[0077] The following is an example of a target point. Based on the distinguishing features of the crack and the edge of the titanium wire, similar pixel points on a straight line perpendicular to the gradient direction of the target point can be obtained. This straight line is called the third straight line, and the third straight line passes through the target point. The number of all similar pixel points of the target point can then be counted, and this number is called the total number of targets corresponding to the target point.
[0078] All remaining edge pixels in the grayscale image are traversed to obtain similar pixels of each remaining edge pixel and the total number of targets corresponding to each remaining edge pixel.
[0079] Preferably, in one embodiment: the process of acquiring similar pixel points of the target point includes:
[0080] A screening window of preset size is established with the target point as the center, and the shape of the screening window can be circular. Among them, the implementer can set the size and shape of the screening window according to the specific implementation scenario. For example, the shape of the screening window can be circular, and its diameter can be an empirical value of 20. It should be noted that a larger screening window can be set to reduce the possibility that the target titanium wire edge degree of the crack edge pixel point is large. The reason is that for 307 (a part of a crack with a straight line shape in a crack), if the crack of this part is long, the target titanium wire edge degree of the crack edge pixel point corresponding to the crack of this part is large.
[0081] In the filtering window corresponding to the target point, the pixel points other than the target point on the straight line in the vertical direction of the gradient direction of the target point are taken as the vertical points corresponding to the target point. The straight line is called the third straight line. The third straight line passes through the target point, and the vertical point is in the filtering window.
[0082] If the target point is a titanium wire edge pixel, the probability that the target point's gradient direction is perpendicular to the titanium wire edge is higher, the probability that the target point and the vertical point corresponding to the target point have a smaller target mutation degree difference is higher, and the probability that the target point and the vertical point corresponding to the target point have a smaller angle in the gradient direction is higher. The reason is that the vertical point corresponding to the titanium wire edge pixel is more likely to be a titanium wire edge pixel.
[0083] If the target point is a crack edge pixel, the probability that the target point and the vertical point corresponding to the target point have a large difference in the target mutation degree is high, and the probability that the target point and the vertical point corresponding to the target point have a large angle in the gradient direction is high. The reason is that most of the vertical points corresponding to the crack edge pixel are likely not crack edge pixels or titanium wire edge pixels.
[0084] Therefore, the similarity between the target point and each vertical point corresponding to the target point can be determined based on the difference in the target mutation degree between the target point and each vertical point corresponding to the target point, and the angle between the target point and each vertical point corresponding to the target point. The similarity greater than the preset similarity threshold is called the target similarity, and the vertical point corresponding to the target similarity is taken as the similar pixel point of the target point. The implementer can set the preset similarity threshold according to the specific implementation scenario. For example, the preset similarity threshold can be an empirical value of 0.9.
[0085] Preferably, in one embodiment, the expression of similarity is:
[0086] ,in, is the similarity between the target point and the qth vertical point among all vertical points corresponding to the target point, is the absolute value, is an exponential function with a natural constant as the base, T is the target mutation degree of the target point, is the target mutation degree of the qth vertical point among all vertical points corresponding to the target point. There are two angles between the straight line in the gradient direction of the target point and the straight line in the gradient direction of the qth vertical point. is the minimum of the two angles, where the angle value is positive by default.
[0087] The smaller it is, the greater the probability that the qth vertical point is a pixel of the same type as the target point, and the more likely the qth vertical point is a similar pixel to the target point.
[0088] The smaller it is, the greater the probability that the qth vertical point is a pixel of the same type as the target point, and the more likely the qth vertical point is a similar pixel to the target point.
[0089] It can be understood that the titanium wire edge pixel points and the crack edge pixel points are different types of pixel points.
[0090] Traverse all the remaining vertical points corresponding to the target point to obtain the similarity between each remaining vertical point and the target point.
[0091] It should be noted that The function for performing negative correlation normalization may be a conventional negative correlation normalization function in the prior art.
[0092] In another embodiment, calculating similar pixels of a target point includes:
[0093] The pixel points on the third straight line in the vertical direction of the gradient direction of the target point are called the vertical points corresponding to the target point, wherein the third straight line passes through the target point, and the grayscale difference value between each vertical point and the target point is calculated, and the vertical points whose grayscale difference value is less than the preset grayscale threshold are regarded as similar pixel points of the target point. The reason is that two pixel points with smaller grayscale difference values are more likely to be the same type of pixel points. The implementer can set the preset grayscale threshold according to the specific implementation scenario, for example, the preset grayscale threshold can be 15. In other embodiments, the range of the vertical point can be further limited, for example, the vertical point is in the above-mentioned screening window.
[0094] In step S3, based on the total number of targets corresponding to each edge pixel point, the titanium wire edge degree of each edge pixel point is calculated. Specifically, the titanium wire edge degree b of the target point is calculated: , where: M is the total number of targets corresponding to the target point, and the edge pixels other than the target point on the first straight line in the gradient direction of the target point are taken as the gradient pixel points of the target point. The first straight line passes through the target point. is the number of all gradient pixels corresponding to the target point, is the total number of targets corresponding to the jth gradient pixel point among all the gradient pixel points, and c is a preset value; traverse the remaining edge pixel points to obtain the titanium wire edge degree of each remaining edge pixel point. The specific description is as follows:
[0095] In this scenario, for any gradient pixel point corresponding to the target point, it is highly likely to be a titanium wire edge pixel point.
[0096] For example, if the target point is a titanium wire edge pixel point, then usually the gradient direction of the target point is perpendicular to the direction of the titanium wire edge. The gradient pixel points corresponding to the target point include other titanium wire edge pixel points and may also include crack edge pixel points, but the possibility of including crack edge pixel points is small.
[0097] For example, if the target point is a titanium wire edge pixel point, and a gradient pixel point corresponding to the target point is also a titanium wire edge pixel point, then the probability that the difference between the total number of targets corresponding to the target point and the total number of targets corresponding to the gradient pixel point is smaller is higher.
[0098] For example, if the target point is a crack edge pixel, and a gradient pixel corresponding to the target point is a titanium wire edge pixel, then the probability that the total number of targets corresponding to the target point is larger than the total number of targets corresponding to the gradient pixel is larger. The reason is that the direction of the crack is changing, while the direction of the titanium wire edge is basically fixed, which leads to a higher probability that the total number of targets corresponding to the titanium wire edge pixel is larger than the total number of targets corresponding to the crack edge pixel.
[0099] Therefore, the titanium wire edge degree of the target point can be determined according to the total number of targets corresponding to the target point, the difference between the total number of targets corresponding to the target point and the total number of targets corresponding to each gradient pixel point corresponding to the target point.
[0100] All remaining edge pixels in the grayscale image are traversed to obtain the titanium wire edge degree of each remaining edge pixel.
[0101] Preferably, in one embodiment, the process of obtaining the titanium wire edge degree of the target point includes: the expression of the titanium wire edge degree is:
[0102] , where b is the edge degree of the titanium wire at the target point, is the number of all gradient pixel points corresponding to the target point, M is the total number of targets corresponding to the target point, is the total number of targets corresponding to the jth gradient pixel point among all gradient pixel points corresponding to the target point, and c is the preset value. The implementer can set the preset value according to the specific scenario, where the preset value can be an empirical value of 1. The function of the preset value is to prevent the denominator from being 0.
[0103] in, The smaller the value, the more likely the target point is to be a titanium wire edge pixel; conversely, the more likely the target point is to be a crack edge pixel. The reason is that the gradient pixel corresponding to the titanium wire edge pixel is more likely to be a titanium wire edge pixel, and the gradient pixel corresponding to the crack edge pixel is also more likely to be a titanium wire edge pixel, which leads to the possibility that the titanium wire edge degree corresponding to the titanium wire edge pixel is greater than the titanium wire edge degree corresponding to the crack edge pixel.
[0104] The larger the M is, the more likely the target point is to be a pixel at the edge of the titanium wire; conversely, the smaller the M is, the more likely the target point is to be a pixel at the edge of the crack.
[0105] In step S4, based on the edge degree of the titanium wire, the target gamma value of each edge pixel is calculated, so as to obtain an enhanced image of the grayscale image based on the gamma transformation algorithm. Specifically, the target gamma value of the target point is calculated. : ,in, is the preset initial gamma value, e is the natural constant, A is the preset hyperparameter, and B is the value obtained by normalizing the positive correlation of the titanium wire edge degree of the target point; based on the target gamma value And gamma transform algorithm, calculate the updated gray value of the target point; traverse the remaining edge pixels to obtain the updated gray value of each remaining edge pixel; thus, an enhanced image of the gray image is obtained. The specific instructions are as follows:
[0106] If the titanium wire edge degree of a certain edge pixel point is greater, the edge pixel point is more likely to be a titanium wire edge pixel point, and the target gamma value corresponding to the edge pixel point should be larger to reduce the brightness of the edge pixel point.
[0107] If the titanium wire edge degree of a certain edge pixel is smaller, the edge pixel is more likely to be a crack edge pixel, and the target gamma value corresponding to the edge pixel should be smaller to increase the brightness of the edge pixel and make the edge pixel more obvious. When the brightness of the crack edge pixel is increased, the crack will be more obvious in the grayscale image, which is conducive to subsequent crack detection.
[0108] Therefore, the target gamma value of each edge pixel can be determined according to the titanium wire edge degree, preset hyperparameters and preset initial gamma value of each edge pixel. The implementer can set the value of the preset hyperparameter and the preset initial gamma value according to the specific implementation scenario. The preset hyperparameter can take the empirical value of 0.6, and the preset initial gamma value can take 1.
[0109] Therefore, based on the gamma transform algorithm, according to the grayscale value of each edge pixel and its target gamma value, the updated grayscale value of each edge pixel can be obtained, thereby obtaining an enhanced image of the grayscale image. Among them, the gamma transform algorithm is a prior art, and the grayscale scaling coefficient in the gamma transform algorithm is 1.
[0110] Preferably, in one embodiment, the process of obtaining the target gamma value of any edge pixel in the grayscale image includes:
[0111] The titanium wire edge degrees of all edge pixel points in the grayscale image are normalized by positive correlation to obtain the target titanium wire edge degree of each edge pixel point.
[0112] The expression of the target gamma value of the target point is:
[0113] ,in, is the target gamma value of the target point, To preset the initial gamma value, is a natural constant, B is the target titanium wire edge degree of the target point, Preset hyperparameters.
[0114] The larger B is, the more likely the target point is a titanium wire edge pixel, and the larger the corresponding target gamma value is.
[0115] The smaller B is, the more likely the target point is a crack edge pixel, and the smaller the corresponding target gamma value is.
[0116] when When it is less than 0, the target point can be considered as a crack edge pixel.
[0117] The prominence of the crack in the image may be small. By increasing the brightness of the pixel points at the edge of the crack and reducing the brightness of the pixel points at the edge of the titanium wire, the crack is made more prominent, thereby improving the accuracy of crack detection.
[0118] Traverse all remaining edge pixels to obtain the target gamma value of each edge pixel.
[0119] Preferably, in one embodiment, the expression of the target point target titanium wire edge degree is:
[0120] , where B is the target titanium wire edge degree of the target point, b is the target titanium wire edge degree of the target point, is the maximum value of the titanium wire edge degree of all edge pixels in the grayscale image, The minimum value of the titanium wire edge degree of all edge pixels in the grayscale image.
[0121] All remaining edge pixel points in the grayscale image are traversed to obtain the target titanium wire edge degree of each remaining edge pixel point.
[0122] The target titanium wire edge degree represents the possibility that the edge pixel point is the titanium wire edge pixel point.
[0123] In another embodiment, the positive correlation normalization function may be Norm normalization, the implementer can set the value of the corresponding preset hyperparameter according to the specific scenario. In other embodiments, the positive correlation normalization function can be a Sigmoid function, and the implementer can set the value of the corresponding preset hyperparameter according to the specific scenario.
[0124] In step S5, defect detection is performed on the titanium wire based on the enhanced image to obtain a detection result, and the parameters of the titanium metal wire drawing process are adjusted based on the detection result.
[0125] After the grayscale value of the edge pixel is updated, an enhanced image of the grayscale image is obtained. The cracks in the enhanced image are more obvious, so the titanium wire can be detected for crack defects based on the enhanced image, that is, the cracks can be identified, thereby improving the accuracy of the detection. The titanium wire can be detected for crack defects using a trained convolutional neural network model. The trained convolutional neural network can be obtained from more grayscale images of titanium wires containing cracks. The convolutional neural network can be a back propagation neural network. The training process is a prior art and will not be described in detail.
[0126] It should be noted that if cracks are detected in the grayscale image of the titanium wire, the intelligent control system for titanium wire drawing process will determine that there is a problem with the wire drawing process, and the parameters of the wire drawing process need to be adjusted. For example, the feedback control system (such as a PID controller) in the intelligent control system for titanium wire drawing process can be used to adjust the parameters of the wire drawing process in real time according to information such as the location and size of the cracks to reduce the possibility of cracks. It should be noted that the setting of the specific parameters of the feedback control system and the setting method will not be repeated, and the implementer can set the parameters according to the specific implementation situation.
[0127] The cracks in the image are detected to obtain the detection results. As the detection results change, the parameters of the titanium metal drawing process will change accordingly to reduce the possibility of cracks.
[0128] Figure 5 FIG. 2 is a schematic diagram showing a structure frame of an intelligent control system for titanium wire drawing process according to this embodiment. Figure 5 As shown, 501 is a communication bus.
[0129] The present invention also provides an intelligent control system for titanium metal wire drawing process. Figure 5As shown, the system includes a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, an intelligent control method for titanium metal wire drawing process according to the first aspect of the present invention is implemented.
[0130] The system also includes other components familiar to those skilled in the art, such as a communication bus and a communication interface, whose configuration and functions are known in the art and thus will not be described in detail here.
[0131] In the present invention, the aforementioned memory may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, apparatus or device. For example, a computer-readable storage medium may be any appropriate magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory RRAM (Resistive Random Access Memory), a dynamic random access memory DRAM (Dynamic Random Access Memory), a static random access memory SRAM (Static Random-Access Memory), an enhanced dynamic random access memory EDRAM (Enhanced Dynamic Random Access Memory), a high-bandwidth memory HBM (High-Bandwidth Memory), a hybrid memory cube HMC (Hybrid Memory Cube), etc., or any other medium that can be used to store the required information and can be accessed by an application, a module, or both. Any such computer storage medium may be part of a device or accessible or connectable to a device. Any application or module described in the present invention may be implemented using computer-readable / executable instructions that may be stored or otherwise maintained by such a computer-readable medium.
[0132] In the description of this specification, "plurality" or "several" means at least two, such as two, three or more, etc., unless otherwise clearly and specifically defined.
[0133] Although this specification has shown and described a number of embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will conceive of many modifications, changes and alternatives without departing from the ideas and spirit of the present invention. It should be understood that in the practice of the present invention, various alternatives to the embodiments of the present invention described herein may be employed.
Claims
1. A method for intelligent control of titanium metal wire drawing process, characterized in that: include: Obtaining a grayscale image of the titanium wire and determining edge pixel points in the grayscale image; Take any edge pixel point as the target point, and obtain the number of similar pixels to the target point according to the preset similarity measurement standard, which is recorded as the total number of targets corresponding to the target point; traverse the remaining edge pixel points to obtain the total number of targets corresponding to each remaining edge pixel point; Calculate the titanium wire edge degree b of the target point: , where: M is the total number of targets corresponding to the target point, and the edge pixels other than the target point on the first straight line in the gradient direction of the target point are taken as the gradient pixel points of the target point. The first straight line passes through the target point. is the number of all gradient pixels corresponding to the target point, is the total number of targets corresponding to the jth gradient pixel point among all the gradient pixel points, and c is a preset value; traversing the remaining edge pixel points to obtain the titanium wire edge degree of each remaining edge pixel point; Calculate the target gamma value of the target point : ,in, is the preset initial gamma value, e is the natural constant, A is the preset hyperparameter, and B is the value obtained by normalizing the positive correlation of the titanium wire edge degree of the target point; based on the target gamma value and gamma transform algorithm to calculate the updated grayscale value of the target point; traverse the remaining edge pixel points to obtain the updated grayscale value of each remaining edge pixel point; thereby obtaining an enhanced image of the grayscale image; Based on the enhanced image, defects of the titanium wire are detected to obtain detection results, and the parameters of the titanium metal wire drawing process are adjusted based on the detection results.
2. The intelligent control method for titanium wire drawing process according to claim 1 is characterized in that: The process of obtaining edge pixel points includes: taking any pixel point in a grayscale image as a reference point, establishing a mutation window of a preset size with the reference point as the center, taking the pixel points other than the reference point on the second straight line in the gradient direction of the reference point as first pixel points, wherein the second straight line passes through the reference point and the first pixel point is in the mutation window; calculating the grayscale difference between the reference point and each first pixel point, and taking the average value of all grayscale differences as the mutation degree of the reference point; traversing the remaining pixel points in the grayscale image to obtain the mutation degree of each remaining pixel point; performing positive correlation normalization on the mutation degree of each pixel point in the grayscale image to obtain the target mutation degree of each pixel point in the grayscale image; taking the pixel point whose target mutation degree is greater than a preset threshold as the edge pixel point.
3. The intelligent control method for titanium wire drawing process according to claim 2 is characterized in that: According to a preset similarity measurement standard, similar pixel points of the target point are obtained, including: establishing a screening window of a preset size with the target point as the center, taking the pixel points other than the target point on the third straight line in the vertical direction of the gradient direction of the target point as the vertical points corresponding to the target point, wherein the third straight line passes through the target point, and the vertical point is in the screening window, and calculating the difference between the target point and the qth vertical point in the screening window : ,in, is the target mutation degree of the target point, is the target mutation degree of the qth vertical point, is the absolute value, is the angle between the target point and the gradient direction of the qth vertical point; traverse the remaining vertical points to obtain the difference between the target point and each remaining vertical point; The difference between the target point and the qth vertical point is negatively normalized to obtain the similarity between the target point and the qth vertical point; the remaining vertical points are traversed to obtain the similarity between the target point and each remaining vertical point; the vertical points corresponding to the similarity greater than the preset similarity threshold are taken as similar pixel points of the target point.
4. The intelligent control method for titanium wire drawing process according to claim 1 is characterized in that: B is the value obtained after positive correlation normalization of the titanium wire edge degree of the target point, including: B is called the target titanium wire edge degree of the target point; the expression of the target titanium wire edge degree of the target point is: , where is the minimum value of the titanium wire edge degree of all edge pixels in the grayscale image, is the maximum value of the titanium wire edge degree of all edge pixels in the grayscale image.
5. The intelligent control method for titanium wire drawing process according to claim 2 is characterized in that: The shape of the mutation window is circular or square.
6. The intelligent control method for titanium wire drawing process according to claim 3 is characterized in that: The screening window is circular in shape.
7. The intelligent control method for titanium wire drawing process according to claim 3 is characterized in that: The first similarity between the target point and the qth vertical point is negatively correlated and normalized to obtain the similarity between the target point and the qth vertical point, including: The expression of the similarity between the target point and the qth vertical point is: , where is the natural exponential function, is the similarity between the target point and the qth vertical point.
8. An intelligent control system for titanium wire drawing process, characterized in that: include: A processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, an intelligent control method for titanium metal wire drawing process according to any one of claims 1 to 7 is implemented.
