Titanium alloy product defect detection method based on image and video technology

The method enhances crack detection in titanium tubes by performing edge detection, calculating crack performance, and distinguishing crack types, addressing the limitations of existing systems in accuracy and efficiency.

CN118710643BActive Publication Date: 2024-12-17BAOJI TOPUDA TITANIUM IND CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411188333.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-28
Publication Date
2024-12-17
Estimated Expiration
2044-08-28

AI Technical Summary

Technical Problem

Existing industrial endoscope systems struggle to accurately identify fine cracks inside titanium tubes, consume excessive time, and fail to distinguish between different types of cracks due to reflection interference.

Method used

A titanium alloy product defect detection method using image and video technology that performs edge detection, calculates crack performance degrees, identifies initial crack areas, matches crack features across images, and distinguishes between hot and cold cracks based on shape analysis.

Benefits of technology

Accurately detects and categorizes crack areas within titanium tubes, reducing time consumption and improving crack identification precision by minimizing interference from lighting and angle variations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118710643B_ABST
    Figure CN118710643B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of image processing technology, and in particular to a titanium alloy product defect detection method based on image video technology, including: obtaining the degree of crack performance of each edge pixel and obtaining the initial crack area according to the grayscale difference of pixel points in each image; obtaining the suspected crack degree of each initial crack area and obtaining the suspected crack area according to the edge shape characteristics of each initial crack area; obtaining the crack feature matching degree through the difference of suspected crack degrees between suspected crack areas in adjacent images and the distance from the centroid, matching adjacent images to obtain the corresponding suspected crack area; obtaining the similar crack feature value of each edge pixel according to the corresponding relationship of each edge pixel point in the corresponding suspected crack area, thereby obtaining the crack pixel point and the crack area; distinguishing between hot crack and cold crack areas. The present invention detects the inside of a titanium tube to obtain an accurate crack area and distinguishes the crack categories.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to a titanium alloy product defect detection method based on image and video technology. Background Art

[0002] Titanium alloys are widely used in aerospace, energy, chemistry and other fields due to their excellent properties such as high specific strength, good stability and non-magnetic properties. However, various forms of cracks often appear in the forging of titanium alloys, especially in the production process from ingots to billets, resulting in severe stress concentration at the cracks, which may even lead to product scrapping in severe cases.

[0003] During the manufacturing and processing of common titanium alloy products, titanium tubes may be cracked due to the influence of stress, pressure, or improper welding, heat treatment, etc. The existing industrial endoscope based on image and video technology is used to detect cracks inside titanium tubes, but there are problems such as the inability to accurately identify fine cracks inside the titanium tubes, a long time consumption, interference with reflection phenomena, and the inability to accurately distinguish the types of cracks. Summary of the invention

[0004] The present invention provides a titanium alloy product defect detection method based on image and video technology to solve the existing problems.

[0005] The titanium alloy product defect detection method based on image and video technology of the present invention adopts the following technical solutions:

[0006] An embodiment of the present invention provides a titanium alloy product defect detection method based on image and video technology, the method comprising the following steps:

[0007] Perform edge detection on each acquired image to obtain several edges of each image;

[0008] According to the grayscale difference between the edge pixel and the surrounding pixel in each image, the crack performance degree of each edge pixel in each image is obtained; according to the crack performance degree, the initial crack area of ​​each image is obtained by screening;

[0009] According to the edge shape features of each initial crack region in each image, the suspected crack degree of each initial crack region in each image is obtained; according to the suspected crack degree, the suspected crack region of each image is obtained;

[0010] The crack feature matching degree of each suspected crack region in the adjacent images is obtained by the difference in suspected crack degree and position between the suspected crack regions in the adjacent images, and the suspected crack regions in the adjacent images are matched to obtain the corresponding suspected crack region of each suspected crack region;

[0011] According to the regional similarity relationship between each suspected crack region and each edge pixel point in the corresponding suspected crack region, the similar crack feature value of each edge pixel point in each suspected crack region of each image is obtained; the crack pixels in all images are obtained according to the similar crack feature values, and the crack region is obtained according to the matching relationship of all crack pixels in different images;

[0012] The hot crack area and the cold crack area are distinguished according to the shape of the crack area to realize the defect detection of titanium alloy products.

[0013] Furthermore, the step of obtaining the crack performance degree of each edge pixel in each image includes the following specific steps:

[0014] The preset neighborhood range is constructed with the ith edge pixel point as the center; the calculation method of the crack performance degree of the ith edge pixel point in the kth image is:

[0015]

[0016] In the formula, Indicates the degree of crack performance of the i-th edge pixel in the k-th image, represents the mean gray value of all edge pixels in the kth image, represents the mean gray value in the neighborhood of the i-th edge pixel in the k-th image, Indicates the maximum grayscale value in the neighborhood of the i-th edge pixel in the k-th image.

[0017] Furthermore, the screening to obtain the initial crack region of each image according to the crack manifestation degree includes the following specific steps:

[0018] The crack performance degree of each edge pixel is normalized to The normalized evaluation of the crack performance degree of each edge pixel point is obtained, and the target judgment threshold is preset. The edge pixel points whose normalized evaluation of the crack performance degree is greater than the target judgment threshold are recorded as target pixels, and the connected domain where all target pixels are located is recorded as the initial crack area.

[0019] Furthermore, the obtaining of the suspected crack degree of each initial crack region in each image includes the following specific steps:

[0020] The chain code value of each edge pixel point of the jth initial crack area in the kth image is obtained, and the calculation method of the suspected crack degree of the jth initial crack area in the kth image is:

[0021]

[0022] In the formula, represents the suspected crack degree of the jth initial crack region in the kth image, represents the mean value of the crack performance of all edge pixels in the jth initial crack region in the kth image, Indicates the extreme difference in the crack performance of the edge pixel point of the jth initial crack area in the kth image, represents the mean value of the gradient amplitude of the edge pixel points of the jth initial crack area in the kth image, represents the mean value of the gradient amplitude of the edge pixels of all initial crack regions in the kth image, represents the maximum number of times the chain code value is repeated continuously in all edge pixels of the jth initial crack region in the kth image, represents the number of edge pixels in the jth initial crack area in the kth image, Represents the number of edge pixels of the minimum bounding rectangle of the jth initial crack area in the kth image.

[0023] Furthermore, the step of obtaining the suspected crack region of each image according to the suspected crack degree includes the following specific steps:

[0024] The suspected crack extent of all initial crack regions is normalized to The normalized evaluation of the suspected crack degree of each initial crack region is obtained, and a suspected judgment threshold is preset, and the initial crack region whose normalized evaluation of the crack performance degree of the initial crack region is greater than the suspected judgment threshold is recorded as a suspected crack region.

[0025] Furthermore, the step of obtaining the crack feature matching degree of each suspected crack region in adjacent images includes the following specific steps:

[0026] A plane rectangular coordinate system is established with the lower left corner of each image as the origin, the direction from the origin to the last column of pixels in the image as the direction of the x-axis, and the direction from the origin to the first row of pixels in the image as the direction of the y-axis.

[0027] The k+1th image The Euclidean distance from the centroid of the suspected crack region in the kth image to the centroid of the jth suspected crack region in the kth image is recorded as the center matching degree of the jth suspected crack region in the kth image;

[0028] The jth suspected crack region in the kth image and the jth suspected crack region in the k+1th image The calculation method of the crack feature matching degree of a suspected crack area is:

[0029]

[0030] In the formula, represents the jth suspected crack region in the kth image and the jth suspected crack region in the k+1th image. The matching degree of crack characteristics of suspected crack areas; represents the center matching degree of the jth suspected crack area in the kth image; represents the suspected crack degree of the jth initial crack region in the kth image, Indicates the k+1th image The suspected crack degree of the initial crack area, Represents an exponential function with a natural constant as its base.

[0031] Furthermore, the matching of the suspected crack regions of the adjacent images to obtain the corresponding suspected crack region of each suspected crack region includes the following specific steps:

[0032] Among the crack feature matching degrees between the j-th suspected crack region in the k-th image and all the suspected crack regions in the k+1-th image, the suspected crack region corresponding to the maximum crack feature matching degree is recorded as the corresponding suspected crack region of the j-th suspected crack region in the k-th image.

[0033] Furthermore, the step of obtaining the similar crack feature value of each edge pixel point in each suspected crack region of each image includes the following specific steps:

[0034] Record the distance from each edge pixel point to the centroid of the suspected crack area in the nth suspected crack area of ​​the kth image as the first distance of each edge pixel point, obtain the distance from each edge pixel point to the centroid of the suspected crack area in the corresponding suspected crack area of ​​the nth suspected crack area of ​​the kth image as the second distance of each pixel point in the corresponding suspected crack area of ​​the nth suspected crack area, and record the pixel point with the smallest absolute value of the difference between the second distance and the first distance as the corresponding point of each pixel point in the nth suspected crack area of ​​the kth image;

[0035] The calculation method of the similar crack feature value of the i-th edge pixel point in the n-th suspected crack area of ​​the k-th image is:

[0036]

[0037] In the formula, represents the similar crack feature value of the ith edge pixel in the nth suspected crack region of the kth image, Indicates the crack performance degree of the i-th edge pixel in the n-th suspected crack area of ​​the k-th image, Represents the mean value of the crack performance of all edge pixels in the nth suspected crack area of ​​the kth image, Indicates the crack performance degree of the corresponding point of the i-th pixel in the n-th suspected crack area of ​​the k-th image, represents the mean value of the crack performance degree of all pixels in the corresponding suspected crack area of ​​the nth suspected crack area of ​​the kth image, Represents the nth suspected crack area in the kth image and its corresponding suspected crack area The crack feature matching degree.

[0038] Furthermore, the method of obtaining crack pixels in all images according to similar crack feature values ​​and obtaining crack regions according to matching relationships of all crack pixels in different images includes the following specific steps:

[0039] All similar crack eigenvalues ​​are normalized to interval, obtain the normalized evaluation of the similar crack feature value of each edge pixel point in the nth suspected crack area of ​​the kth image, preset the crack judgment threshold, and record the edge pixel point whose normalized evaluation of the similar crack feature value is greater than the crack judgment threshold as the crack pixel point in the nth suspected crack area of ​​the kth image;

[0040] The crack performance degree is preset, and the initial value of the crack performance degree is 0. crack pixels, if The corresponding point of the crack pixel is the crack pixel, and the The crack performance degree of the crack pixel point is increased by one. The corresponding point of the corresponding point of the crack pixel is the crack pixel, and the corresponding point of the first image is the crack pixel. The crack performance degree of the crack pixel point is increased by one, and so on. The crack performance degree when the corresponding point of the crack pixel in other images is no longer a crack pixel is recorded as The final crack representation of each crack pixel.

[0041] The final crack expression degree of all pixels in the first image is threshold segmented using the Otsu threshold algorithm, and the area composed of pixels greater than the threshold is recorded as the crack area.

[0042] Furthermore, the step of distinguishing the hot crack region from the cold crack region according to the shape of the crack region includes the following specific steps:

[0043] The average of the similar crack characteristic values ​​of each pixel point in the first image and all corresponding points in all other images is recorded as the crack coefficient of each pixel point; the calculation method of the thermal crack degree value of the rth crack area is:

[0044]

[0045] In the formula, represents the thermal crack degree value of the rth crack area, represents the narrow side length of the minimum circumscribed rectangle of the rth crack area, represents the length of the long side of the minimum circumscribed rectangle of the rth crack area, represents the mean value of the crack coefficients of all pixels in the rth crack area, Represents the mean value of the crack coefficient of all pixels in all crack areas, is the maximum number of consecutive occurrences of the same chain code value at the edge of the rth crack region;

[0046] The thermal crack severity values ​​of all crack regions were normalized to The normalized evaluation of the thermal crack degree value of each crack area is obtained, and the thermal crack threshold is preset. The crack area whose normalized evaluation of the thermal crack degree value of the crack area is greater than the thermal crack threshold is recorded as the hot crack area; the crack area whose normalized evaluation of the thermal crack degree value of the crack area is less than or equal to the thermal crack threshold is recorded as the cold crack area; when there is no crack area in the collected image, the inspected titanium alloy product is recorded as a qualified product.

[0047] The beneficial effects of the technical solution of the present invention are: according to the grayscale difference of pixels in each image, the crack manifestation degree of each edge pixel point is obtained and the initial crack area is obtained, and the area where the crack may exist is preliminarily determined; according to the edge shape characteristics of each initial crack area, the suspected crack degree of each initial crack area is obtained and the suspected crack area is obtained, and the characteristics of the crack area are further expressed; the crack feature matching degree is obtained by the difference in the suspected crack degree between the suspected crack areas in adjacent images and the distance from the center of mass, and the adjacent images are matched to obtain the corresponding suspected crack area; according to the corresponding relationship of each edge pixel point in the corresponding suspected crack area, the similar crack feature value of each edge pixel point is obtained, and the influence of light and angle on the image is eliminated; thereby accurately obtaining the crack pixels and crack areas in all images, and accurately distinguishing the crack categories. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be 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.

[0049] Figure 1 The present invention is a flowchart of the steps of the titanium alloy product defect detection method based on image and video technology. DETAILED DESCRIPTION

[0050] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the titanium alloy product defect detection method based on image and video technology proposed by the present invention, its specific implementation method, structure, characteristics and effects, in combination 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.

[0051] 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.

[0052] The specific scheme of the titanium alloy product defect detection method based on image and video technology provided by the present invention is described in detail below with reference to the accompanying drawings.

[0053] See also Figure 1 , which shows a flowchart of a titanium alloy product defect detection method based on image and video technology provided by an embodiment of the present invention, the method comprising the following steps:

[0054] Step S001: Perform edge detection on each collected image to obtain a number of edges of each image.

[0055] The purpose of this embodiment is to detect the inside of the titanium tube to obtain the accurate crack area. Therefore, an industrial endoscope is used to obtain a video of the inside of the titanium tube, and several initial frames in the video are captured, where each frame of the video is an initial frame. The image is denoised by median filtering to obtain each image after each initial frame is processed. Canny edge detection is performed on each processed image to obtain several edges of each image.

[0056] Step S002: obtaining the degree of crack manifestation of each edge pixel in each image according to the difference in grayscale values ​​between each edge pixel and the surrounding pixels in each image; obtaining the initial crack area of ​​each image according to the degree of crack manifestation; obtaining the suspected crack degree of each initial crack area in each image according to the shape features of the edge pixels of each initial crack area in each image; obtaining the suspected crack area of ​​each image according to the suspected crack degree.

[0057] It should be noted that since the crack area inside the titanium tube is concave and rough, its ability to reflect light is poorer than that of the normal smooth area. Therefore, the crack area obtained by the endoscope is darker and more uniform in color. However, due to differences in distance and angle from the light source, the color of the normal area is brighter and the brightness is uneven.

[0058] Specifically, a preset neighborhood range is constructed with the ith edge pixel point as the center. This embodiment is described by taking 8 neighborhoods as an example. Other neighborhood ranges may be set in other implementations, and this embodiment does not specifically limit them. The calculation method of the crack performance degree of the ith edge pixel point in the kth image is:

[0059]

[0060] In the formula, Indicates the degree of crack performance of the i-th edge pixel in the k-th image, represents the mean gray value of all edge pixels in the kth image, represents the mean gray value in the neighborhood of the i-th edge pixel in the k-th image, Indicates the maximum grayscale value in the neighborhood of the i-th edge pixel in the k-th image.

[0061] The larger the value is, the darker the gray value in the neighborhood of the current edge pixel is relative to the current image. The more likely it is that it is an edge pixel in the crack area, and the greater the degree of crack expression. The smaller it is, the more uniform the grayscale distribution in the neighborhood of the current edge pixel is, the more likely it is the surrounding area of ​​the crack area, and the greater the degree of crack expression of the i-th edge pixel.

[0062] Furthermore, the crack performance of each edge pixel is normalized to interval, obtain the normalized evaluation of the crack performance degree of each edge pixel point, preset the target judgment threshold, record the edge pixel points whose normalized evaluation of the crack performance degree is greater than the target judgment threshold as the target pixel points, and record the connected domain where all the target pixels are located as the initial crack area; in this embodiment, the preset target judgment threshold value is 0.5, and other embodiments may set other values, which are not specifically limited in this embodiment.

[0063] It should be further explained that since the crack area has a weaker ability to reflect light than the normal area, the gradient amplitude at the edge of the crack area is larger. However, due to the angle between the light source and the surface, as well as the distance from the surface to the light source, the material and smoothness of the normal area are more consistent with the surrounding area, and the ability to reflect light is weaker. Therefore, the difference in brightness with the surrounding area changes gradually, and the gradient amplitude is relatively small. The crack is generally long and narrow. Since there may be small cracks and the shape is generally not a regular arc or straight line, the less smooth and regular the area contour is, the greater the possibility that the area is a crack area.

[0064] Specifically, for the jth initial crack region in the kth image, the chain code value of each edge pixel point of the jth initial crack region in the kth image is obtained, and the calculation method of the suspected crack degree of the jth initial crack region in the kth image is:

[0065]

[0066] In the formula, represents the suspected crack degree of the jth initial crack region in the kth image, represents the mean value of the crack performance of all edge pixels in the jth initial crack region in the kth image, Indicates the extreme difference in the crack performance of the edge pixel point of the jth initial crack area in the kth image, represents the mean value of the gradient amplitude of the edge pixel points of the jth initial crack area in the kth image, represents the mean value of the gradient amplitude of the edge pixels of all initial crack regions in the kth image, represents the maximum number of times the chain code value is repeated continuously in all edge pixels of the jth initial crack region in the kth image, represents the number of edge pixels in the jth initial crack area in the kth image, Represents the number of edge pixels of the minimum bounding rectangle of the jth initial crack area in the kth image.

[0067] is the stability of the crack performance of the edge pixel point of the jth initial crack area in the kth image. The larger the value, the more likely it is that the pixel point is in the same initial crack area, and the greater the suspected crack degree. When is larger, it means that the shape of the jth initial crack region in the kth image is more irregular and more likely to be a crack region; It represents the similarity between the jth initial crack region and its minimum circumscribed rectangle. The higher the similarity, the more consistent it is with the crack characteristics.

[0068] Furthermore, all initial crack regions are traversed and the suspected crack degree of each initial crack region is normalized to The normalized evaluation of the suspected crack degree of each initial crack region is obtained, and a suspected judgment threshold is preset. The initial crack region whose normalized evaluation of the crack performance degree of the initial crack region is greater than the suspected judgment threshold is recorded as a suspected crack region; in this embodiment, the preset suspected judgment threshold is 0.5, and other embodiments may set other values, which are not specifically limited in this embodiment.

[0069] Step S003, obtaining the crack feature matching degree of each suspected crack area in each image by the difference in the suspected crack degree between each suspected crack area in adjacent images and the distance from the center of mass, matching the suspected crack areas of adjacent images to obtain corresponding suspected crack areas; obtaining similar crack feature values ​​of each edge pixel point of each suspected crack area in each image according to the correspondence between each edge pixel point of each suspected crack area in adjacent images; obtaining crack pixels according to the similar crack feature values; and obtaining crack areas according to the crack pixels.

[0070] It should be noted that due to the influence of angle and lighting, the imaging effects of the same crack in different images may be different, but the distance between the edge pixels and the center of gravity of the same crack area, the degree to which the pixels in the area conform to the crack area, and the regional position and other features are less affected by angle and lighting. Therefore, the similarities of regions in different images are analyzed based on the above features to achieve regional matching.

[0071] Specifically, a plane rectangular coordinate system is established with the lower left corner of each image as the coordinate origin, the direction from the coordinate origin to the last column of pixels in the image as the direction of the x-axis, and the direction from the coordinate origin to the first row of pixels in the image as the direction of the y-axis.

[0072] The k+1th image The Euclidean distance from the centroid of the j-th suspected crack region in the k-th image to the centroid of the j-th suspected crack region in the k-th image is recorded as the center matching degree of the j-th suspected crack region in the k-th image;

[0073] The jth suspected crack region in the kth image and the jth suspected crack region in the k+1th image The calculation method of the crack feature matching degree of a suspected crack area is:

[0074]

[0075] In the formula, represents the jth suspected crack region in the kth image and the jth suspected crack region in the k+1th image. The matching degree of crack characteristics of suspected crack areas; represents the center matching degree of the jth suspected crack area in the kth image; represents the suspected crack degree of the jth initial crack region in the kth image, Indicates the k+1th image The suspected crack degree of the initial crack area, Represents an exponential function with a natural constant as its base.

[0076] It represents the difference in the center distance between the kth image and the k+1th image corresponding to the suspected crack area. The smaller the difference, the more likely it is that they are in the same area, and the greater the crack feature matching degree. It represents the difference in the suspected crack degree of the corresponding suspected crack area in the k-th image and the k+1-th image. The smaller the difference, the higher the crack feature matching degree.

[0077] Furthermore, the crack feature matching degree between the j-th suspected crack region in the k-th image and each suspected crack region in the k+1-th image is calculated, and the suspected crack region corresponding to the largest crack feature matching degree between the j-th suspected crack region in the k-th image and all suspected crack regions in the k+1-th image is recorded as the corresponding suspected crack region of the j-th suspected crack region in the k-th image.

[0078] It should be further explained that due to the influence of lighting and angle, the detection results of some pixels in one image may be biased, but they can be detected normally in other images. Therefore, it is necessary to analyze the similarity between the pixels in the current area and the corresponding points in the same area in other images;

[0079] Specifically, the distance from each edge pixel point to the centroid of the suspected crack area in the nth suspected crack area of ​​the kth image is recorded as the first distance of each edge pixel point, and in the suspected crack area corresponding to the nth suspected crack area of ​​the kth image, the distance from each edge pixel point to the centroid of the suspected crack area is obtained and recorded as the second distance of each pixel point in the suspected crack area corresponding to the nth suspected crack area, and the pixel point with the smallest absolute value of the difference between the second distance and the first distance is recorded as the corresponding point of each pixel point in the nth suspected crack area of ​​the kth image;

[0080] Then the calculation method of the similar crack feature value of the i-th edge pixel point in the n-th suspected crack area of ​​the k-th image is:

[0081]

[0082] In the formula, The similar crack feature value between the ith edge pixel point in the nth suspected crack region of the kth image and the corresponding point in the corresponding suspected crack region of the k+1th image is simply recorded as the similar crack feature value of the ith edge pixel point in the nth suspected crack region of the kth image, Indicates the crack performance degree of the i-th edge pixel in the n-th suspected crack area of ​​the k-th image, Represents the mean value of the crack performance of all edge pixels in the nth suspected crack area of ​​the kth image, Indicates the crack performance degree of the corresponding point of the i-th pixel in the n-th suspected crack area of ​​the k-th image, represents the mean value of the crack performance degree of all pixels in the corresponding suspected crack area of ​​the nth suspected crack area of ​​the kth image, Represents the nth suspected crack area in the kth image and its corresponding suspected crack area The crack feature matching degree.

[0083] Indicates the degree of crack performance of the ith edge pixel point of the nth suspected crack area relative to all edge pixels. Indicates the degree of crack performance of the ith corresponding point of the nth corresponding suspected crack area relative to all corresponding points of the corresponding suspected crack area. The smaller it is, the more similar the two edge pixels are.

[0084] Furthermore, similarly, the similar crack feature value of each edge pixel point in the nth suspected crack area of ​​the kth image is calculated, and the similar crack feature value is normalized to interval, obtain the normalized evaluation of the similar crack feature value of each edge pixel point in the nth suspected crack area of ​​the kth image, preset the crack judgment threshold, and record the edge pixel point whose normalized evaluation of the similar crack feature value is greater than the crack judgment threshold as the crack pixel point in the nth suspected crack area of ​​the kth image. Similarly, obtain all the crack pixel points in each suspected crack area of ​​each image; the preset crack judgment threshold in this embodiment is 0.7, and other embodiments may set other values, which are not specifically limited in this embodiment.

[0085] It should be further explained that although the positions of crack pixels have changed in different images, they all appear as crack pixels. Therefore, this embodiment divides the images according to the performance of each pixel in different images to obtain the crack area.

[0086] Specifically, a crack expression degree is preset, and the initial value of the crack expression degree is 0. crack pixels, if The corresponding point of the crack pixel is the crack pixel, then the first image The crack performance degree of the crack pixel point is increased by one. The corresponding point of the corresponding point of the crack pixel is the crack pixel, then the first image The crack performance degree of the crack pixel point is increased by one, and so on. The crack performance degree when the corresponding point of the crack pixel in other images is no longer a crack pixel is recorded as The final crack expression degree of each crack pixel point. Similarly, the final crack expression degree of all pixels in the first image is obtained. It should be particularly noted that if a pixel point in any image is a crack pixel point, but there is no pixel point in the previous image that makes the current pixel point the corresponding point of any pixel point in the previous image, the crack expression degree of the pixel point at the corresponding coordinate of the crack pixel point in the current image in the first image is increased by one, and the final crack expression degree is obtained by judging the crack pixel point in the current image.

[0087] Furthermore, the average of similar crack feature values ​​of each pixel point in the first image and all corresponding points in all other images is recorded as the crack coefficient of each pixel point.

[0088] Furthermore, the final crack expression degree of all pixels in the first image is threshold segmented using the Otsu threshold algorithm, and the area composed of pixels greater than the threshold is recorded as the crack area. It should be noted that the Otsu threshold algorithm described in this embodiment is an existing public technology and will not be repeated in this embodiment.

[0089] Step S004: obtaining hot crack regions and cold crack regions according to the different shapes and sizes of the crack regions.

[0090] It should be noted that due to the different mechanisms of crack occurrence, titanium tube cracks are divided into two categories: hot cracks and cold cracks. The crack area of ​​hot cracks is wider than that of cold cracks, and the fracture is dendritic and more tortuous in shape. Therefore, when the aspect ratio of the minimum circumscribed rectangle of the crack area is smaller, the crack area is wider or the shape is more tortuous; cold cracks are caused by stress concentration, and the cracks produced are relatively small and continuous and smooth in shape compared to hot cracks.

[0091] Specifically, the calculation method of the thermal crack degree value of the rth crack area is:

[0092]

[0093] In the formula, represents the thermal crack degree value of the rth crack area, represents the narrow side length of the minimum circumscribed rectangle of the rth crack area, represents the length of the long side of the minimum circumscribed rectangle of the rth crack area, represents the mean value of the crack coefficients of all pixels in the rth crack area, Represents the mean value of the crack coefficient of all pixels in all crack areas, is the maximum number of consecutive occurrences of the same chain code value at the edge of the rth crack region.

[0094] when The smaller the value, the less smooth the edge of the crack area is, and the more it conforms to the characteristics of thermal cracks. is the ratio of the width to the length of the minimum circumscribed rectangle of the rth crack region. The larger the ratio, the more the current region conforms to the characteristics of thermal cracks. The larger the value, the more the rth crack region conforms to the characteristics of thermal cracks compared with the rest of the regions.

[0095] Traverse all crack areas and normalize the thermal crack degree value of each crack area to interval, obtain the normalized evaluation of the thermal crack degree value of each crack area, preset the thermal crack threshold, record the crack area whose normalized evaluation of the thermal crack degree value of the crack area is greater than the thermal crack threshold as the thermal crack area; record the crack area whose normalized evaluation of the thermal crack degree value of the crack area is less than or equal to the thermal crack threshold as the cold crack area; when there is no crack area in the collected image, it means that there is no crack defect in the titanium alloy product, and the detected titanium alloy product is recorded as a qualified product. The preset thermal crack threshold in this embodiment is 0.5, and other embodiments may set other values, which are not specifically limited in this embodiment.

[0096] It should be noted that the The model only shows negative correlation and the output of the constraint model is in In the range, As the input of this model, it can be replaced by other models with the same purpose in specific implementation. The model is used as an example for description without any specific limitation.

[0097] So far, the present invention is completed.

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

Claims

1. A titanium alloy product defect detection method based on image and video technology, characterized in that: The method comprises the following steps: Perform edge detection on each acquired image to obtain several edges of each image; According to the grayscale difference between the edge pixel and the surrounding pixel in each image, the crack performance degree of each edge pixel in each image is obtained; according to the crack performance degree, the initial crack area of ​​each image is obtained by screening; According to the edge shape features of each initial crack region in each image, the suspected crack degree of each initial crack region in each image is obtained; according to the suspected crack degree, the suspected crack region of each image is obtained; The crack feature matching degree of each suspected crack region in the adjacent images is obtained by the difference in suspected crack degree and position between the suspected crack regions in the adjacent images, and the suspected crack regions in the adjacent images are matched to obtain the corresponding suspected crack region of each suspected crack region; According to the regional similarity relationship between each suspected crack region and each edge pixel point in the corresponding suspected crack region, the similar crack feature value of each edge pixel point in each suspected crack region of each image is obtained; the crack pixels in all images are obtained according to the similar crack feature values, and the crack region is obtained according to the matching relationship of all crack pixels in different images; Differentiate between hot crack area and cold crack area according to the shape of crack area, and realize defect detection of titanium alloy products; The specific steps of obtaining the crack performance degree of each edge pixel point in each image include the following: The preset neighborhood range is constructed with the ith edge pixel point as the center; the calculation method of the crack performance degree of the ith edge pixel point in the kth image is: In the formula, Indicates the degree of crack performance of the i-th edge pixel in the k-th image, represents the mean gray value of all edge pixels in the kth image, represents the mean gray value in the neighborhood of the i-th edge pixel in the k-th image, Indicates the maximum gray value within the neighborhood of the i-th edge pixel in the k-th image; The specific steps of obtaining the suspected crack degree of each initial crack area in each image are as follows: The chain code value of each edge pixel point of the jth initial crack area in the kth image is obtained, and the calculation method of the suspected crack degree of the jth initial crack area in the kth image is: In the formula, represents the suspected crack degree of the jth initial crack region in the kth image, represents the mean value of the crack performance of all edge pixels in the jth initial crack region in the kth image, Indicates the extreme difference in the crack performance of the edge pixel point of the jth initial crack area in the kth image, represents the mean value of the gradient amplitude of the edge pixel points of the jth initial crack area in the kth image, represents the mean value of the gradient amplitude of the edge pixels of all initial crack regions in the kth image, represents the maximum number of times the chain code value is repeated continuously in all edge pixels of the jth initial crack region in the kth image, represents the number of edge pixels in the jth initial crack area in the kth image, Represents the number of edge pixels of the minimum bounding rectangle of the jth initial crack area in the kth image; The specific steps of obtaining the crack feature matching degree of each suspected crack area in the adjacent images include the following: A plane rectangular coordinate system is established with the lower left corner of each image as the origin, the direction from the origin to the last column of pixels in the image as the direction of the x-axis, and the direction from the origin to the first row of pixels in the image as the direction of the y-axis. The Euclidean distance from the centroid of the j'th suspected crack region in the k+1th image to the centroid of the jth suspected crack region in the kth image is recorded as the center matching degree of the jth suspected crack region in the kth image; The calculation method of the crack feature matching degree between the jth suspected crack area in the kth image and the j'th suspected crack area in the k+1th image is: In the formula, represents the crack feature matching degree between the j-th suspected crack region in the k-th image and the j'-th suspected crack region in the k+1-th image; represents the center matching degree of the jth suspected crack area in the kth image; represents the suspected crack degree of the j'th initial crack region in the k+1th image, Represents an exponential function with a natural constant as its base.

2. The titanium alloy product defect detection method based on image and video technology according to claim 1 is characterized in that: The specific steps of obtaining the initial crack region of each image according to the degree of crack manifestation are as follows: The crack performance degree of each edge pixel is normalized to The normalized evaluation of the crack performance degree of each edge pixel point is obtained, and the target judgment threshold is preset. The edge pixel points whose normalized evaluation of the crack performance degree is greater than the target judgment threshold are recorded as target pixels, and the connected domain where all target pixels are located is recorded as the initial crack area.

3. The titanium alloy product defect detection method based on image and video technology according to claim 1 is characterized in that: The specific steps of obtaining the suspected crack area of ​​each image according to the suspected crack degree are as follows: The suspected crack extent of all initial crack regions is normalized to The normalized evaluation of the suspected crack degree of each initial crack region is obtained, and a suspected judgment threshold is preset, and the initial crack region whose normalized evaluation of the crack performance degree of the initial crack region is greater than the suspected judgment threshold is recorded as a suspected crack region.

4. The titanium alloy product defect detection method based on image and video technology according to claim 1 is characterized in that: The matching of the suspected crack regions of the adjacent images to obtain the corresponding suspected crack region of each suspected crack region includes the following specific steps: Among the crack feature matching degrees between the j-th suspected crack region in the k-th image and all the suspected crack regions in the k+1-th image, the suspected crack region corresponding to the maximum crack feature matching degree is recorded as the corresponding suspected crack region of the j-th suspected crack region in the k-th image.

5. The titanium alloy product defect detection method based on image and video technology according to claim 1 is characterized in that: The specific steps of obtaining the similar crack feature value of each edge pixel point in each suspected crack area of ​​each image include the following: Record the distance from each edge pixel point to the centroid of the suspected crack area in the nth suspected crack area of ​​the kth image as the first distance of each edge pixel point, obtain the distance from each edge pixel point to the centroid of the suspected crack area in the corresponding suspected crack area of ​​the nth suspected crack area of ​​the kth image as the second distance of each pixel point in the corresponding suspected crack area of ​​the nth suspected crack area, and record the pixel point with the smallest absolute value of the difference between the second distance and the first distance as the corresponding point of each pixel point in the nth suspected crack area of ​​the kth image; The calculation method of the similar crack feature value of the i-th edge pixel point in the n-th suspected crack area of ​​the k-th image is: In the formula, represents the similar crack feature value of the ith edge pixel in the nth suspected crack region of the kth image, Indicates the crack performance degree of the i-th edge pixel in the n-th suspected crack area of ​​the k-th image, Represents the mean value of the crack performance of all edge pixels in the nth suspected crack area of ​​the kth image, Indicates the crack performance degree of the corresponding point of the i-th pixel in the n-th suspected crack area of ​​the k-th image, represents the mean value of the crack performance degree of all pixels in the corresponding suspected crack area of ​​the nth suspected crack area of ​​the kth image, Represents the nth suspected crack area in the kth image and its corresponding suspected crack area The crack feature matching degree.

6. The titanium alloy product defect detection method based on image and video technology according to claim 5 is characterized in that: The method of obtaining crack pixel points in all images according to similar crack feature values ​​and obtaining crack regions according to matching relationships of all crack pixel points in different images includes the following specific steps: All similar crack eigenvalues ​​are normalized to interval, obtain the normalized evaluation of the similar crack feature value of each edge pixel point in the nth suspected crack area of ​​the kth image, preset the crack judgment threshold, and record the edge pixel point whose normalized evaluation of the similar crack feature value is greater than the crack judgment threshold as the crack pixel point in the nth suspected crack area of ​​the kth image; The crack performance degree is preset, and the initial value of the crack performance degree is 0. crack pixels, if The corresponding point of the crack pixel is the crack pixel, and the The crack performance degree of the crack pixel point is increased by one. The corresponding point of the corresponding point of the crack pixel is the crack pixel, and the corresponding point of the first image is the crack pixel. The crack performance degree of the crack pixel point is increased by one, which will satisfy the The crack performance degree when the corresponding point of the crack pixel in other images is no longer a crack pixel is recorded as The final crack representation of each crack pixel; The final crack expression degree of all pixels in the first image is threshold segmented using the Otsu threshold algorithm, and the area composed of pixels greater than the threshold is recorded as the crack area.

7. The titanium alloy product defect detection method based on image and video technology according to claim 5 is characterized in that: The step of distinguishing the hot crack region from the cold crack region according to the shape of the crack region includes the following specific steps: The average of the similar crack characteristic values ​​of each pixel point in the first image and all corresponding points in all other images is recorded as the crack coefficient of each pixel point; the calculation method of the thermal crack degree value of the rth crack area is: In the formula, represents the thermal crack degree value of the rth crack area, represents the narrow side length of the minimum circumscribed rectangle of the rth crack area, represents the length of the long side of the minimum circumscribed rectangle of the rth crack area, represents the mean value of the crack coefficients of all pixels in the rth crack area, Represents the mean value of the crack coefficient of all pixels in all crack areas, is the maximum number of consecutive occurrences of the same chain code value at the edge of the rth crack region; The thermal crack severity values ​​of all crack regions were normalized to interval, obtain the normalized evaluation of the thermal crack degree value of each crack area, preset the thermal crack threshold, and record the crack area whose normalized evaluation of the thermal crack degree value of the crack area is greater than the thermal crack threshold as the thermal crack area; The crack region whose normalized evaluation of the thermal crack degree value of the crack region is less than or equal to the thermal crack threshold is recorded as the cold crack region; When there is no crack area in the collected image, the inspected titanium alloy product is recorded as a qualified product.