A method and system for detecting surface defects of titanium alloy forgings
Through visual saliency detection and illumination feature correction, the problem of reflection influence in the surface defect detection of titanium alloy forgings is solved, high-accuracy defect detection is achieved, and the reliability of the quality inspection results of titanium alloy forgings is ensured.
Patent Information
- Application Number
- CN202410809046.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-21
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2044-06-21
AI Technical Summary
Existing surface defect detection methods for titanium alloy forgings lead to inaccurate detection results due to reflective effects, which affects the accuracy of quality inspection of titanium alloy forgings.
Visual saliency detection is used to obtain the saliency of each pixel, construct illumination features and calculate correction weights, and quickly and accurately obtain defect detection results through the difference map between the corrected image and the original image to ensure the accuracy of the detection results.
Through visual saliency detection and illumination feature correction, the impact of reflection is effectively reduced, the accuracy and speed of surface defect detection of titanium alloy forgings are improved, and the reliability of the detection results is ensured.
Smart Images

Figure CN118379286B
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a method and system for detecting surface defects of titanium alloy forgings. Background Art
[0002] Titanium alloy has the advantages of high temperature resistance, corrosion resistance, and good comprehensive mechanical properties. It has been widely used in many fields such as automobiles, ships, and aerospace. As one of the main products of titanium alloy materials, the surface quality of titanium alloy forgings directly affects the safety during use. Therefore, surface defect detection of titanium alloy forgings is the top priority in the production process of titanium alloy forgings.
[0003] At present, the patent application document with application publication number CN116309570A discloses a titanium alloy bar quality detection method and system, wherein the method includes: collecting a grayscale image of the rod surface of the titanium alloy bar to be detected, and taking the grayscale value with the highest frequency in the grayscale image as the background value; sliding a sliding window of a preset size on the grayscale image pixel by pixel, and generating a window area each time; obtaining the noise level of the corresponding window area center point according to the difference between the grayscale value of the window area center point and the background value, the information entropy of the window area, and the ratio of the number of edge points to the number of quasi-edge points; obtaining the basic standard deviation of each pixel when Gaussian filtering is performed according to the noise level; screening defective pixels according to the noise level, correcting the basic standard deviation of the defective pixels, and obtaining the adaptive standard deviation of the defective pixels; using the adaptive standard deviation of the pixels to complete the corresponding Gaussian filtering, obtain a denoised image, and perform quality detection of the titanium alloy bar to be detected according to the denoised image.
[0004] The above method determines the adaptive standard deviation of the defective pixel points according to the image information in the window area of the defective pixel points in the grayscale image, and completes Gaussian filtering based on the adaptive standard deviation to obtain a denoised image; however, since the surface of the titanium alloy forging has a reflective effect, the degree of reflection of different pixels in the grayscale image is different, which affects the accuracy of the denoised image and thus leads to inaccurate surface defect detection results. Summary of the invention
[0005] In order to solve the technical problem of inaccurate surface defect detection results, the present application provides a surface defect detection method and system for titanium alloy forgings, which can obtain accurate surface defect detection results.
[0006] In a first aspect, the present application provides a method for detecting surface defects of titanium alloy forgings, the method comprising: performing visual significance detection on a forging image to obtain the significance of each pixel point, taking pixel points whose significance is greater than a significance threshold as points to be corrected, and taking pixel points whose significance is not greater than the significance threshold as standard points; obtaining a brightness map of the forging image, the brightness map comprising the brightness value of each pixel point on the forging image; constructing illumination features of each pixel point on the brightness map, comprising: obtaining adjacent pixel points within an eight-neighborhood range of a pixel point, arranging the brightness values of each adjacent pixel point in a preset order, and obtaining illumination features of the pixel point; calculating correction weights of a point to be corrected and each standard point, and performing weighted summation of the pixel values of each standard point in the forging image according to the normalized correction weights to obtain the correction value of the point to be corrected, the point to be corrected With standard point The modified weight for: , Points to be corrected With standard point The characteristic distance of illumination, is the illumination distance threshold, is a preset coefficient; after obtaining the correction values of all the points to be corrected in the forging image, a corrected image is obtained, and a difference map between the forging image and the corrected image is calculated to obtain a defect detection result.
[0007] In one embodiment, before performing visual saliency detection on the forging image to obtain the significance of each pixel point, the detection method also includes: collecting a real-time image of the titanium alloy forging, and using the maximum inter-class variance method to obtain the grayscale threshold of the real-time image; performing threshold segmentation on the real-time image according to the grayscale threshold to obtain a threshold segmentation map; multiplying the threshold segmentation map with the real-time image to obtain a forging image, and the forging image is a grayscale image.
[0008] The real-time image includes the background area and the titanium alloy forging area. In order to avoid the influence of the background area in the real-time image on defect detection, the image information of the titanium alloy forging area is obtained by threshold segmentation to obtain the forging image, ensuring that the forging image only contains the surface information of the titanium alloy forging.
[0009] In one embodiment, performing visual saliency detection on a forging image to obtain the saliency of each pixel includes: obtaining neighborhood ranges of multiple preset sizes of a pixel, and calculating the image entropy within each neighborhood range to obtain an image entropy sequence of the pixel; calculating the saliency of the pixel, and obtaining the image entropy sequence of the pixel. Significance Satisfies the relationship: ;in is the pixel point in the forging image Any pixel other than , and Pixels and pixels The image entropy sequence, and Pixels and pixels The coordinate position of is the space coefficient.
[0010] Since the surface of the titanium alloy forging is a smooth surface, if there are defects on the surface of the titanium alloy forging, the grayscale value will change at the defect position, and the defect position is a visually significant point relative to the surface of the titanium alloy forging. Therefore, the point to be corrected is accurately located by obtaining the significance of each pixel point, and the point to be corrected corresponds to the suspected defect position point.
[0011] In one embodiment, the neighborhood ranges of the plurality of preset sizes include rectangular area ranges centered on the pixel point and having sizes of 3×3, 5×5, and 7×7.
[0012] In one embodiment, the point to be corrected With standard point Light characteristic distance for:
[0013] ;in, Points to be corrected Among the lighting characteristics numerical values, Standard point Among the lighting characteristics numerical values, is the light threshold; is the preset function, when hour, ,when hour, .
[0014] In one embodiment, the method for calculating the correction weight further includes: constructing the texture features of each pixel point on the forging image; calculating the point to be corrected With standard point The modified weight :
[0015] , Points to be corrected With standard point The characteristic distance of illumination, Points to be corrected With standard point The texture feature distance, is the illumination distance threshold, is the texture distance threshold, is the preset coefficient.
[0016] The illumination feature distance is used to characterize the point to be corrected With standard point The consistency of the illumination direction and illumination intensity between the two points. The texture feature distance is used to reflect the point to be corrected. With standard point The consistency of texture features between With standard point When the consistency of illumination features and texture features is in a good state, the point to be corrected With standard point The correction weight of Correction point The greater the impact of the correction value, the more accurate the correction value must be ensured.
[0017] In one embodiment, constructing the texture features of each pixel point on the forging image includes: obtaining adjacent pixels within an eight-neighborhood range of a pixel point, arranging the grayscale values of each adjacent pixel point in the forging image in a preset order, and obtaining the texture features of the pixel point.
[0018] In a second aspect of the present application, a surface defect detection system for a titanium alloy forging is provided, comprising a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, a surface defect detection method for a titanium alloy forging according to the first aspect of the present application is implemented.
[0019] The technical solution of this application has the following beneficial technical effects:
[0020] Since the grayscale value of the defect position point will change, the defect position point is a visually significant point. Therefore, the visual significance detection algorithm is first used to obtain the significance of each pixel point, and the pixel point with a significance greater than the significance threshold is taken as the point to be corrected, and the pixel point with a significance not greater than the significance threshold is taken as the standard point. The point to be corrected is the suspected defect position point, and the standard point is the normal position point; considering the reflective characteristics of the titanium alloy forging surface, the illumination intensity of different pixels in the forging image in different directions is different, therefore, the illumination characteristics of each pixel point are constructed on the brightness map; further, the pixel value of the standard point is used to correct the pixel value of the point to be corrected, and the correction weights of the correction point and each standard point are calculated according to the illumination feature distance between the correction point and each standard point. The larger the illumination feature distance, the smaller the correction weight, and the smaller the influence of the pixel value of the standard point on the correction value of the point to be corrected, ensuring that the correction value is the theoretical grayscale value when there is no defect, and obtaining a theoretical image without surface defects, that is, a corrected image; directly calculating the difference map between the forging image and the corrected image, and quickly and accurately obtaining the defect detection result. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] By reading the detailed description below with reference to the accompanying drawings, the above and other purposes, features and advantages of the exemplary embodiments of the present application will become easy to understand. In the accompanying drawings, several embodiments of the present application are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:
[0022] Figure 1 is a flow chart of a method for detecting surface defects of a titanium alloy forging according to an embodiment of the present application;
[0023] Figure 2 is a schematic diagram of a forging image according to an embodiment of the present application;
[0024] Figure 3 is a schematic diagram of a saliency map according to an embodiment of the present application;
[0025] Figure 4 is a schematic diagram of the distribution of points to be corrected in a forging image according to an embodiment of the present application;
[0026] Figure 5 A schematic diagram of adjacent pixels within an eight-neighborhood range of a pixel according to an embodiment of the present application;
[0027] Figure 6 is a schematic diagram of a corrected image according to an embodiment of the present application;
[0028] Figure 7 is a schematic diagram of defect detection results according to an embodiment of the present application;
[0029] Figure 8It is a structural block diagram of a surface defect detection system for a titanium alloy forging according to an embodiment of the present application. DETAILED DESCRIPTION
[0030] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.
[0031] It should be understood that when the terms "first", "second", etc. are used in the claims, specification and drawings of the present application, they are only used to distinguish different objects, rather than to describe a specific order. The terms "include" and "comprise" used in the specification and claims of the present application indicate the presence of the described features, wholes, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or their collections.
[0032] According to a first aspect of the present application, the present application provides a method for detecting surface defects of a titanium alloy forging. Figure 1 FIG. 1 is a flow chart of a method for detecting surface defects of a titanium alloy forging according to an embodiment of the present application. Figure 1 As shown, the surface defect detection method 100 of the titanium alloy forging includes steps S101 to S104, which are described in detail below.
[0033] S101, performing visual saliency detection on the forging image to obtain the saliency of each pixel point, taking the pixel points whose saliency is greater than the saliency threshold as the points to be corrected, and taking the pixel points whose saliency is not greater than the saliency threshold as the standard points.
[0034] In one embodiment, before performing visual saliency detection on the forging image to obtain the saliency of each pixel, the detection method further includes: collecting a real-time image of the titanium alloy forging, and using the maximum inter-class variance method to obtain the grayscale threshold of the real-time image; performing threshold segmentation on the real-time image according to the grayscale threshold to obtain a threshold segmentation map; multiplying the threshold segmentation map with the real-time image to obtain a forging image, wherein the forging image is a grayscale image. Figure 2 , which is a schematic diagram of a forging image according to an embodiment of the present application.
[0035] Among them, the real-time image is an image directly captured by the camera, which contains the background area outside the titanium alloy forging. The grayscale threshold can divide the real-time image into a foreground area and a background area, wherein the foreground area corresponds to the titanium alloy forging area in the real-time image; therefore, in the threshold segmentation map, the value of the pixel point in the titanium alloy forging area is 1, and the value of the pixel point in the background area is 0. The threshold segmentation map is multiplied by the real-time image to obtain the forging image, which only contains the surface information of the titanium alloy forging, avoiding the influence of the background area in the real-time image on defect detection.
[0036] In one embodiment, since the surface of the titanium alloy forging is a smooth surface, if there are defects on the surface of the titanium alloy forging, the grayscale value will change at the defect position, and the defect position is a visually significant point relative to the surface of the titanium alloy forging. Therefore, the forging image can be subjected to visual saliency detection to obtain the significance of each pixel point. The greater the significance of the pixel point, the greater the probability that it is a defect location point.
[0037] Specifically, performing visual saliency detection on the forging image to obtain the saliency of each pixel point includes: performing visual saliency detection on the forging image using a visual saliency algorithm to obtain the saliency of each pixel point; wherein the visual saliency algorithm is an Itti algorithm, a spectral residual algorithm, a HC algorithm, a FT algorithm or a GR algorithm.
[0038] Among them, the Itti algorithm is a saliency detection model based on the Gaussian pyramid fusion of image color, brightness and direction features; the spectral residual algorithm is a saliency detection model based on the frequency domain; the HC algorithm is a color contrast algorithm based on the color global histogram. The greater the difference in color features between a pixel and other pixels, the higher the significance; the FT algorithm is a saliency detection algorithm based on the Euclidean distance between the pixel vector and the average pixel vector in the Lab color space; the GR algorithm is a saliency detection algorithm based on superpixel segmentation and contrast between regions; among them, the Itti algorithm, spectral residual algorithm, HC algorithm, FT algorithm and GR algorithm are all existing visual saliency algorithms, which will not be repeated here.
[0039] In another embodiment, performing visual saliency detection on a forging image to obtain the saliency of each pixel includes: obtaining a neighborhood range of multiple preset sizes of a pixel point, and calculating the image entropy within each neighborhood range to obtain an image entropy sequence of the pixel point; calculating the saliency of the pixel point, and obtaining the image entropy sequence of the pixel point. Significance Satisfies the relationship: ;in is the pixel point in the forging image Any pixel other than , and Pixels and pixels The image entropy sequence, and Pixels and pixels The coordinate position of is the space coefficient.
[0040] Among them, the value of the spatial coefficient is 1; the multiple preset sizes include 3×3, 5×5 and 7×7, and the neighborhood range of a pixel point with multiple preset sizes corresponds to a rectangular area range with the pixel point as the center and the sizes are 3×3, 5×5 and 7×7 respectively; the image entropy is a one-dimensional image entropy or a two-dimensional image entropy.
[0041] Under normal circumstances, the image entropy within the neighborhood of the defect location point will be greater than that of the normal location point. However, due to the different sizes of surface defects of titanium alloy forgings, if the image entropy is only calculated within a neighborhood of a single preset size (taking 3×3 as an example), when a pixel point is located inside the surface defect (the pixel point is actually the defect location point), the image entropy within its 3×3 neighborhood will be smaller, making it impossible to distinguish between the defect location point and the normal location point, resulting in missed detection of the defect location point. Therefore, the present application can obtain the image entropy within neighborhoods of multiple preset sizes to obtain the numerical size and change characteristics of the image entropy within different neighborhoods, thereby avoiding missed detection of defect location points due to a single preset size.
[0042] In one embodiment, after obtaining the significance of each pixel, the significance of all pixels is normalized; for a pixel, if the significance after normalization is greater than the significance threshold, it means that the gray value information in the neighborhood of the pixel is significantly different from that of other pixels, and the pixel is a suspected defective position point, and the pixel is marked as a point to be corrected; conversely, if the significance after normalization is not greater than the significance threshold, it means that the gray value information in the neighborhood of the pixel is slightly different from that of other pixels, and the pixel is a normal position point, and the pixel is marked as a standard point. The significance threshold is 0.6.
[0043] See also Figure 3 , is a schematic diagram of a saliency map according to an embodiment of the present application, wherein the saliency map includes the saliency of each pixel in the forging image; further, the value of the point to be corrected in the forging image is marked as 1, and the value of the standard point is marked as 0, and the following can be obtained: Figure 4 Schematic diagram of the distribution of points to be corrected in the forging image shown.
[0044] In this way, according to the significance of each pixel point in the forging image, each pixel point in the forging image is divided into a point to be corrected and a standard point, wherein the point to be corrected corresponds to a suspected defect position point in the forging image.
[0045] S102, obtaining a brightness map of the forging image, and constructing a lighting feature of each pixel point on the brightness map.
[0046] In one embodiment, since the surface of the titanium alloy forging has a reflective effect, the degree of reflection of different pixels in the forging image is different, which leads to different illumination characteristics of different pixels in the forging image. The illumination characteristics are used to reflect the illumination intensity of the pixel in different directions.
[0047] Specifically, the forging image is converted to the Lab color space, which includes a brightness channel L and two color channels a and b, and the image of the brightness channel L is used as the brightness map of the forging image. The brightness map includes the brightness value of each pixel on the forging image; constructing the illumination feature of each pixel on the brightness map includes: obtaining adjacent pixels within the eight neighborhoods of a pixel, arranging the brightness values of each adjacent pixel in a preset order, and obtaining the illumination feature of the pixel.
[0048] For example, see Figure 5 , a schematic diagram of adjacent pixels within the eight-neighborhood range of a pixel according to an embodiment of the present application; the eight-neighborhood range is a 3×3 rectangular range centered on the pixel, that is, one pixel corresponds to 8 adjacent pixels; starting from the adjacent pixel directly above the pixel, the brightness values of the 8 adjacent pixels are arranged in a clockwise direction to obtain the illumination feature of the pixel, and the illumination feature is a vector of 1 row and 8 columns, Figure 5 The illumination features in are [2, 2, 3, 3, 4, 4, 3, 3].
[0049] In this way, the illumination feature of each pixel in the forging image can be obtained, and the illumination feature can reflect the illumination intensity of the pixel in different directions.
[0050] S103, calculating the correction weights of a point to be corrected and each standard point, and performing weighted summation on the pixel values of each standard point in the forging image according to the normalized correction weights to obtain the correction value of the point to be corrected.
[0051] In one embodiment, the point to be corrected is a suspected defect position point, and the standard point is a normal position point where no defect exists; in a normal production and processing process, the number of points to be corrected in the forging image is small, and the number of standard points is large. Therefore, the pixel value of the point to be corrected can be corrected according to the pixel value of the standard point in the forging image, so that the pixel value of the point to be corrected after correction is the pixel value when no defect exists.
[0052] Specifically, for a point to be corrected in the forging image, the correction weights of the point to be corrected and each standard point are calculated, and the correction weights are: , Points to be corrected With standard point The characteristic distance of illumination, is the illumination distance threshold, is the preset coefficient, Points to be corrected With standard point The correction weight of The value of is 2; the preset coefficient The value of is 1.
[0053] Among them, the points to be corrected With standard point The illumination characteristic distance can adopt the Euclidean distance, and the illumination characteristic distance is used to characterize the point to be corrected. With standard point The consistency of the illumination direction and illumination intensity between the two points. The larger the illumination feature distance, the worse the consistency of the illumination direction and illumination intensity. With standard point The smaller the correction weight.
[0054] In other embodiments, the point to be corrected With standard point Light characteristic distance You can also: ;in, Points to be corrected Among the lighting characteristics numerical values, Standard point Among the lighting characteristics numerical values, is the light threshold; is the preset function, when hour, ,when hour, Among them, the light threshold The value of is 2.
[0055] In another embodiment, the method for calculating the correction weight further includes: constructing a texture feature of each pixel point on the forging image, and the correction weight is:
[0056] , Points to be corrected With standard point The characteristic distance of illumination, Points to be corrected With standard point The texture feature distance, is the illumination distance threshold, is the texture distance threshold, is the preset coefficient, Points to be corrected With standard point The correction weight of . Among them, the preset coefficient value is 1; the texture feature distance can be the Euclidean distance.
[0057] Among them, constructing the texture feature of each pixel point on the forging image includes: obtaining adjacent pixels within the eight-neighborhood range of a pixel point, arranging the grayscale values of each adjacent pixel point in the forging image according to a preset order, and obtaining the texture feature of the pixel point.
[0058] Understandably, Used to reflect the points to be corrected With standard point The consistency of the illumination features between them. The smaller the illumination feature distance, the better the consistency of the illumination features. Used to reflect the points to be corrected With standard point The consistency of texture features between the correction points is the smaller the distance between texture features, the better the consistency of texture features. With standard point When the consistency of illumination features and texture features is in a good state, the point to be corrected With standard point The correction weight is larger.
[0059] In one embodiment, the point to be corrected is obtained After the correction weights of each standard point are normalized, the correction weights are normalized to wait for the correction point With standard point The modified weight As an example, first calculate the point to be corrected The sum of the modified weights of each standard point and the modified weight The ratio of the sum of the modified weights is used as the normalized modified weight The pixel values of each standard point are weighted summed according to the normalized correction weight to obtain the point to be corrected. The correction value, that is, the point to be corrected The correction value satisfies the relationship:
[0060] ;in For correction point With standard point The normalized correction weights between is the standard point in the forging image The pixel value of is the number of standard points in the forging image, Points to be corrected Correction value.
[0061] In this way, a correction value of the point to be corrected can be obtained, and the correction value is a theoretical grayscale value when there is no defect under the illumination characteristics and texture characteristics corresponding to the point to be corrected.
[0062] S104, after obtaining the correction values of all the points to be corrected in the forging image, a corrected image is obtained, and a difference map between the forging image and the corrected image is calculated to obtain a defect detection result.
[0063] In one embodiment, the correction values of all the points to be corrected in the forging image are obtained in the same way, and the pixel values at the points to be corrected are replaced with the corresponding correction values to obtain a corrected image; in the corrected image, the pixel values of the standard points remain unchanged, and the pixel values of the points to be corrected are the corresponding correction values. Since the correction value is the theoretical grayscale value when there is no defect under the illumination characteristics and texture characteristics corresponding to the points to be corrected, the corrected image can be regarded as a theoretical image without surface defects, see Figure 6 , is a schematic diagram of a corrected image according to an embodiment of the present application; the forging image and the corrected image are subtracted, and the difference map obtained can be used as a defect detection result.
[0064] Specifically, calculating the difference map between the forging image and the corrected image to obtain the defect detection result includes: calculating the absolute value of the difference between each pixel in the forging image and the corrected image to obtain the difference map; and performing threshold segmentation on the difference map using the maximum between-class variance method to obtain the defect detection result.
[0065] Understandably, see Figure 7 , is a schematic diagram of the defect detection result according to the embodiment of the present application; the defect detection result is a binary image, including a value of 0 and a value of 1; the value of 0 corresponds to a normal position point in the forging image, and the value of 1 corresponds to a defect position point in the forging image, which can reflect the defect position and the size of the defect area to obtain an accurate defect detection result.
[0066] The technical principle and implementation details of the surface defect detection method of titanium alloy forgings of the present application are introduced above through specific embodiments. Since the grayscale value of the defect position point will change, the defect position point is a visually significant point. Therefore, the visual significance detection algorithm is first used to obtain the significance of each pixel point, and the pixel point with a significance greater than the significance threshold is taken as the point to be corrected, and the pixel point with a significance not greater than the significance threshold is taken as the standard point. The point to be corrected is the suspected defect position point, and the standard point is the normal position point; considering the reflective characteristics of the titanium alloy forging surface, the illumination intensity of different pixels in the forging image in different directions is different, therefore, the illumination characteristics of each pixel point are constructed on the brightness map; further, the pixel value of the standard point is used to correct the pixel value of the point to be corrected, and the correction weights of the correction point and each standard point are calculated according to the illumination feature distance between the correction point and each standard point. The larger the illumination feature distance, the smaller the correction weight, and the smaller the influence of the pixel value of the standard point on the correction value of the point to be corrected, ensuring that the correction value is the theoretical grayscale value when there is no defect, and obtaining a theoretical image without surface defects, that is, a corrected image; directly calculating the difference map between the forging image and the corrected image, and quickly and accurately obtaining the defect detection result.
[0067] According to the second aspect of the present application, the present application also provides a surface defect detection system for titanium alloy forgings. Figure 8 : is a structural block diagram of a surface defect detection system for titanium alloy forgings according to an embodiment of the present application. Figure 8 As shown, the system 50 includes a processor and a memory, the memory stores computer program instructions, and when the computer program instructions are executed by the processor, a surface defect detection method for a titanium alloy forging according to the first aspect of the present application is implemented. The system also includes other components well known to those skilled in the art, such as a communication bus and a communication interface, whose settings and functions are known in the art, so they are not described here.
[0068] In the present application, 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, system or device. For example, a computer-readable storage medium may be any suitable 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 this application may be implemented using computer-readable / executable instructions that may be stored or otherwise maintained by such a computer-readable medium.
[0069] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0070] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the patent application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent application shall be subject to the attached claims.
Claims
1. A method for detecting surface defects of titanium alloy forgings, characterized in that: The detection method comprises: Performing visual saliency detection on the forging image to obtain the saliency of each pixel point, taking the pixel points whose saliency is greater than the saliency threshold as the points to be corrected, and taking the pixel points whose saliency is not greater than the saliency threshold as the standard points; Acquire a brightness map of the forging image, wherein the brightness map includes the brightness value of each pixel on the forging image; construct a lighting feature of each pixel on the brightness map, including: acquiring adjacent pixels within an eight-neighborhood range of a pixel, arranging the brightness values of each adjacent pixel in a preset order, and obtaining the lighting feature of the pixel; Calculate the correction weights of a point to be corrected and each standard point, and perform weighted summation on the pixel values of each standard point in the forging image according to the normalized correction weights to obtain the correction value of the point to be corrected. With standard point The modified weight for: , Points to be corrected With standard point The characteristic distance of illumination, is the illumination distance threshold, is the preset coefficient; the point to be corrected With standard point Light characteristic distance for: ; Points to be corrected Among the lighting characteristics numerical values, Standard point Among the lighting characteristics numerical values, is the light threshold; is the preset function, when hour, ,when hour, ; After obtaining the correction values of all the points to be corrected in the forging image, a corrected image is obtained, and a difference map between the forging image and the corrected image is calculated to obtain a defect detection result; Correction value for: ; For correction point With standard point The normalized correction weights are is the standard point in the forging image The pixel value of is the number of standard points in the forging image.
2. The method for detecting surface defects of a titanium alloy forging according to claim 1, characterized in that: Before performing visual saliency detection on the forging image to obtain the saliency of each pixel, the detection method further includes: Collect the real-time image of titanium alloy forgings, and use the maximum inter-class variance method to obtain the gray threshold of the real-time image; Performing threshold segmentation on the real-time image according to the grayscale threshold to obtain a threshold segmentation map; The threshold segmentation map is multiplied by the real-time image to obtain a forging image, which is a grayscale image.
3. The surface defect detection method of a titanium alloy forging according to claim 1 is characterized in that: Visual saliency detection of forging images to obtain the saliency of each pixel includes: Obtaining neighborhood ranges of multiple preset sizes for a pixel point, and calculating the image entropy within each neighborhood range to obtain an image entropy sequence of the pixel point; Calculate the significance of the pixel point, the pixel point Significance Satisfies the relationship: ;in is the pixel point in the forging image Any pixel other than , and Pixels and pixels The image entropy sequence, and Pixels and pixels The coordinate position of is the space coefficient.
4. The method for detecting surface defects of a titanium alloy forging according to claim 3, characterized in that: The neighborhood ranges of the plurality of preset sizes include rectangular area ranges with the pixel point as the center and sizes of 3×3, 5×5 and 7×7.
5. The method for detecting surface defects of a titanium alloy forging according to claim 1, characterized in that: The calculation method of the modified weight also includes: Constructing texture features of each pixel point on the forging image; Calculate the points to be corrected With standard point The modified weight : , Points to be corrected With standard point The characteristic distance of illumination, Points to be corrected With standard point The texture feature distance, is the illumination distance threshold, is the texture distance threshold, is the preset coefficient.
6. The method for detecting surface defects of a titanium alloy forging according to claim 5, characterized in that: Constructing the texture features of each pixel point on the forging image includes: Adjacent pixel points within the eight-neighborhood range of a pixel point are obtained, and the grayscale values of each adjacent pixel point in the forging image are arranged in a preset order to obtain the texture features of the pixel point.
7. A surface defect detection system for titanium alloy forgings, characterized in that: The method comprises a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, a surface defect detection method for a titanium alloy forging according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Titanium alloy bar quality detection method and system
CN116309570A
Printed fabric defect detection method
CN111861996A
Depth map detection method and device, storage medium and electronic equipment
CN114742756A
