Auxiliary detection method of titanium alloy forgings based on image intelligent enhancement

By performing channel separation and characteristic analysis on the RGB image of titanium alloy forgings, the gamma value is adaptively determined for image enhancement, which solves the problem of mismatch between the gamma value and the image characteristics, improves the image enhancement effect, and ensures that defects can be effectively detected .

CN118967544BActive Publication Date: 2024-12-27HANZHONG QUNFENG MACHINERY MFG
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The existing gamma transformation algorithm does not match the image characteristics when selecting gamma values, which affects the image enhancement effect and makes the surface defects of titanium alloy forgings difficult to detect.

Method used

Separate the RGB image of the titanium alloy forging into multiple channel images, analyze the pixel complexity, importance and contrast of each channel image, adaptively determine the gamma value for image enhancement, ensuring that the gamma value matches the image characteristics, thereby improving Image enhancement effect.

Benefits of technology

Through adaptive gamma value matching, the image enhancement effect is significantly improved, making defects on the surface of titanium alloy forgings easier to detect and enhancing the visibility of image details.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118967544B_ABST
    Figure CN118967544B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of image processing, and more specifically, to an auxiliary detection method for titanium alloy forgings based on image intelligent enhancement, the method comprising: collecting RGB images of titanium alloy forgings and separating them into a plurality of channel images; obtaining the dispersion degree of each type of pixel area of ​​each channel image according to a number of pixel areas of each channel image, and obtaining the pixel complexity of each channel image based on the dispersion degree; obtaining the importance of each channel image according to the pixel complexity and the distribution of grayscale value changes and gradient values ​​in the channel image; obtaining the contrast of each channel image; and obtaining the gamma value of each channel image based on the pixel complexity, importance and contrast of the channel image to enhance each channel image, wherein the gamma value of each channel image obtained by the present invention matches the image characteristics, thereby improving the enhancement effect.
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 more specifically, to an auxiliary detection method for titanium alloy forgings based on image intelligent enhancement. Background Art

[0002] Since titanium alloys have many advantages such as high strength and corrosion resistance, titanium alloy forgings are widely used in aerospace and other fields. When using titanium alloy forgings, it is necessary to ensure their quality. When detecting surface defects of titanium alloy forgings, in order to improve the visibility of surface details of titanium alloy forgings, it is necessary to process the image through gamma transformation, so that the defect details on the surface of titanium alloy forgings can be more easily detected.

[0003] The patent document with the authorization announcement number CN107527333B currently discloses a fast image enhancement method based on gamma transform, and the steps are as follows: input the image to be enhanced, and count the grayscale histogram of the image; then use the interpolation method to smooth the grayscale histogram of the original image; then count the average value of the image grayscale value, the mode of the image grayscale value, and the median of the image grayscale value based on the smoothed histogram; based on the size relationship of these three index values, pre-judge the value range of γ in the gamma transform, and then use the local traversal method to determine the optimal γ value; finally, enhance the image according to the optimal γ value and output the enhanced image.

[0004] The gamma transform algorithm in the above method achieves image detail enhancement through adaptive gamma value. The enhancement effect on different images depends on the size of the gamma value. However, if the selected gamma value does not match the image characteristics, it will affect the image enhancement effect, making the image enhancement effect less than expected, and thus causing defects to be difficult to detect. Summary of the invention

[0005] In order to solve the problem that if the gamma value selected by the gamma transform algorithm does not match the image characteristics, the image enhancement effect will be affected, the present invention proposes an auxiliary detection method for titanium alloy forgings based on image intelligent enhancement, which includes the following steps:

[0006] Collect RGB images of titanium alloy forgings and separate them into multiple channel images;

[0007] Get the pixel complexity of each channel image , Represents the pixel complexity of the i-th channel image; Represents the number of types of pixel areas in the i-th channel image; Represents the dispersion degree of the z-th pixel area of ​​the i-th channel image; Representing the maximum value of the dispersion degree of all pixel-like regions of the i-th channel image; obtaining the importance of each channel image, wherein the importance of the channel image is positively correlated with the pixel complexity;

[0008] Get the gamma value of each channel image , Represents the gamma value of the i-th channel image; Represents the importance of the i-th channel image; Represents the contrast of the i-th channel image; Represents the mean gray value of the pixels in the i-th channel image; Represents the gray value threshold; exp() represents the exponential function with a natural constant as the base;

[0009] The images of each channel are enhanced according to the gamma values ​​of the images of each channel to obtain enhanced images of each channel; and the defect areas are identified based on the enhanced images of each channel.

[0010] The innovation of the present invention lies in separating the RGB image of titanium alloy forgings into multiple channel images, analyzing the characteristics of each channel image, obtaining the pixel complexity, importance and contrast of each channel image, and enhancing each channel image based on the pixel complexity, importance and contrast of each channel image, so that the adaptive gamma value is more matched with the characteristics of each channel image, thereby improving the image enhancement effect, making the image enhancement effect as expected, and thus making defects easy to detect.

[0011] Preferably, the acquisition of the pixel area includes:

[0012] Taking the jth pixel of the i-th channel image as an example, the pixel points with the same grayscale value in the eight neighborhoods of the j-th pixel of the i-th channel image are recorded as target pixels, and the area formed by the target pixel and the j-th pixel of the i-th channel image is recorded as the j-th pixel area of ​​the i-th channel image, so as to obtain several pixel areas of the i-th channel image.

[0013] Preferably, the type of the pixel area is obtained, including:

[0014] The pixel regions with consistent grayscale values ​​in the i-th channel image are regarded as a type of pixel region, and each type of pixel region of the i-th channel image is obtained.

[0015] Preferably, obtaining the dispersion degree of the z-th type pixel area of ​​the ith channel image includes:

[0016] Get the distance from the central pixel point of any z-th pixel area in the i-th channel image to the central area of ​​each of the remaining z-th pixel areas, and take the minimum distance value as the representative distance of the z-th pixel area in the i-th channel image; take the mean of the representative distances of each z-th pixel area in the i-th channel image as the dispersion degree of the z-th pixel area in the i-th channel image.

[0017] The greater the dispersion degree of each type of pixel area of ​​each channel image, the greater the pixel complexity of each channel image, which makes it easy to obtain the pixel complexity of each channel image according to the dispersion degree of each type of pixel area of ​​each channel image.

[0018] Preferably, obtaining the importance of each channel image includes:

[0019] ;

[0020] In the formula, Represents the importance of the i-th channel image; Represents the pixel complexity of the i-th channel image; Represents the mean gradient value of all pixels in the i-th channel image; Represents the maximum value of the gradient values ​​of all pixels in the i-th channel image; Represents the standard deviation of the gradient values ​​of all pixels in the i-th channel image; Represents the maximum value of the standard deviation of the gradient values ​​of pixels in all channel images; exp() represents an exponential function with a natural constant as the base.

[0021] The change of grayscale value and the distribution of gradient value in the channel image can reflect the edge or detail information in the channel image. Therefore, the importance of the channel image can be obtained according to the change of grayscale value and the distribution of gradient value in the channel image, so as to facilitate the subsequent adaptive gamma value according to the importance of the channel image.

[0022] Preferably, the acquisition of the contrast of the channel image includes:

[0023] The difference between the maximum grayscale value and the minimum grayscale value of the i-th channel image is obtained, and the ratio of the difference to 255 is used as the contrast of the i-th channel image.

[0024] The contrast of the channel image reflects the visual impact and information hierarchy of the channel image. If the contrast of the channel image is smaller, it means that the channel image needs to be enhanced more, so as to facilitate the subsequent adaptive gamma value according to the contrast of the channel image.

[0025] Preferably, the step of enhancing the image based on each channel and identifying the defective area includes:

[0026] The enhanced images of each channel are fused to obtain the enhanced image of the titanium alloy forging, and the defects in the enhanced image of the titanium alloy forging are detected using edge detection.

[0027] The adaptive gamma value of each channel image is more matched with the characteristics of each channel image, which improves the effect of image enhancement and makes the effect of image enhancement as expected, thereby making defects easier to detect.

[0028] The present invention has the following beneficial effects: the purpose of the present invention is to separate the RGB image of a titanium alloy forging into multiple channel images, analyze the characteristics of each channel image, obtain the pixel complexity, importance and contrast of each channel image, and enhance each channel image based on the pixel complexity, importance and contrast of each channel image, so that the adaptive gamma value is more matched with the characteristics of each channel image, thereby improving the effect of image enhancement, making the effect of image enhancement as expected, and thus making it easy to detect defects. Furthermore, the importance and pixel complexity of the channel image reflect the amount of edge or detail information in the channel image, which can better measure the performance characteristics of different channel images for titanium alloy forging materials, so that the final adaptive gamma value is more accurate. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] By reading the following detailed description with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:

[0030] Figure 1 It is a flowchart of the steps of the titanium alloy forging auxiliary detection method based on image intelligent enhancement in an embodiment of the present invention. DETAILED DESCRIPTION

[0031] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0032] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0033] See also Figure 1 , which shows a flowchart of a titanium alloy forging auxiliary detection method based on image intelligent enhancement provided by an embodiment of the present invention, the method comprising the following steps:

[0034] S001. Collect RGB images of titanium alloy forgings and separate them into multiple channel images.

[0035] In an embodiment of the present invention, a high-definition camera is used to photograph the surface of a titanium alloy forging to obtain an RGB image of the titanium alloy forging, and the titanium alloy forging image is separated into multiple channel images. It should be noted that the multiple channel images are respectively an R channel image, a G channel image, and a B channel image.

[0036] S002. According to a number of pixel regions of each channel image, obtain the dispersion degree of each type of pixel region of each channel image, and based on the dispersion degree, obtain the pixel complexity of each channel image.

[0037] It should be noted that the known gamma transform algorithm enhances image details through gamma values, and the enhancement effect on different images depends on the size of the gamma value. If the selected gamma value does not match the image characteristics, it will affect the image enhancement effect, making the image enhancement effect less than expected. Since titanium alloys have different abilities to reflect or absorb light under different spectra, the material properties may be better reflected in certain color channels. Therefore, the present invention separates the titanium alloy forging image into multiple channel images, analyzes the features of each channel image, obtains the gamma value of each channel image for enhancement, and first analyzes the pixel complexity of each channel image. If the regional distribution of the same grayscale value is sparser, the pixel complexity of the channel image is greater.

[0038] In an embodiment of the present invention, taking the jth pixel of the i-th channel image as an example, the pixel in the eight neighborhoods of the j-th pixel of the i-th channel image whose grayscale value is consistent with that of the pixel is recorded as the target pixel, and the area formed by the target pixel and the j-th pixel of the i-th channel image is recorded as the j-th pixel area of ​​the i-th channel image, and the j-th pixel of the i-th channel image is the central pixel of the j-th pixel area of ​​the i-th channel image. Similarly, several pixel areas of the i-th channel image are obtained.

[0039] The pixel area with consistent grayscale value in the i-th channel image is taken as a type of pixel area, and each type of pixel area of ​​the i-th channel image is obtained; the distance from the central pixel point of any z-th pixel area in the i-th channel image to the central area of ​​each of the remaining z-th pixel areas is obtained, and the minimum distance value is taken as the representative distance of the z-th pixel area in the i-th channel image; the mean value of the representative distance of each z-th pixel area in the i-th channel image is taken as the dispersion degree of the z-th pixel area of ​​the i-th channel image.

[0040] Get the pixel complexity of the i-th channel image:

[0041] ;

[0042] In the formula, Represents the pixel complexity of the i-th channel image; Represents the number of types of pixel areas in the i-th channel image; Represents the dispersion degree of the z-th pixel area of ​​the i-th channel image; Represents the maximum value of the dispersion degree of all pixel regions of the i-th channel image; The larger the value of , the more dispersed the distribution of the z-th pixel area of ​​the i-th channel image is, that is, the sparser the distribution between pixel areas with the same gray value, the more complex their relationship is, so the greater the pixel complexity of the i-th channel image is; The smaller the value, the more concentrated the distribution of the z-th pixel area of ​​the ith channel image is, that is, the more concentrated the distribution between pixel areas with the same grayscale value is, the lower the complexity is, so the ith channel image has a lower pixel complexity; the greater the pixel complexity of the channel image, the higher the information complexity of the channel image, the more details there are, and the gamma value used by the channel image needs to be closer to 1.

[0043] S003. Obtain the importance of each channel image according to the pixel complexity of each channel image and the distribution of grayscale value changes and gradient values ​​in the channel image, and obtain the contrast of each channel image according to the grayscale value of the channel image; obtain the gamma value of each channel image based on the pixel complexity, importance and contrast of the channel image.

[0044] It should be noted that, since the information contributions in different channel images are different, it is necessary to retain the edge or detail information in the image as much as possible when subsequently enhancing the channel image containing more information. Since the grayscale value changes and the distribution of gradient values ​​in the channel image can reflect the edge or detail information in the channel image, the present invention obtains the importance of the channel image according to the grayscale value changes and the distribution of gradient values ​​in the channel image. The greater the importance of the channel image, the more useful detail information there is in the channel image, which facilitates the subsequent acquisition of the gamma value of the channel image according to the importance of the channel image.

[0045] In this embodiment of the present invention, the importance of the i-th channel image is obtained:

[0046] ;

[0047] In the formula, Represents the importance of the i-th channel image; Represents the pixel complexity of the i-th channel image; Represents the mean gradient value of all pixels in the i-th channel image; Represents the maximum value of the gradient values ​​of all pixels in the i-th channel image; Represents the standard deviation of the gradient values ​​of all pixels in the i-th channel image; Represents the maximum value of the standard deviation of the gradient values ​​of pixels in all channel images; exp() represents an exponential function with a natural constant as the base;

[0048] Represents the pixel complexity of the i-th channel image. The larger its value is, the more details and textures the i-th channel image contains, and the greater the importance of the i-th channel image in the process of image enhancement. The smaller its value is, the fewer details and textures the i-th channel image usually contains, and the less important the i-th channel image is in the process of image enhancement.

[0049] The larger the value of , the more dramatic the change in the grayscale value of the pixel in the i-th channel image, the richer the edge or detail information in the channel image, which means that the i-th channel image may contain more useful information, and the greater the importance of the i-th channel image; The smaller the value of , the slower the gray value of the pixel in the i-th channel image changes, and the edge or detail information in the channel image is relatively scarce, which means that the importance of the i-th channel image is smaller;

[0050] The larger the value of , the more dispersed the gradient distribution of the i-th channel image is, the more complex the information changes are, and it may reflect more details and irregularities. The smaller the value of The larger the value of , the greater the importance of the i-th channel image; The smaller the value of, the more concentrated the gradient distribution of the i-th channel image is, and the simpler the information change is. The larger the value of The smaller the value of , the less important the i-th channel image is.

[0051] It should be noted that the contrast of the channel image reflects the visual impact and information hierarchy of the channel image. If the contrast of the channel image is smaller, it means that the channel image needs to be enhanced. In an embodiment of the present invention, the difference between the maximum grayscale value and the minimum grayscale value of the i-th channel image is obtained, and the ratio of the difference to 255 is used as the contrast of the i-th channel image.

[0052] It should be noted that different gamma transforms are known to have different adjustment capabilities. If the grayscale value of a pixel in an image is small, a gamma value less than 1 has a greater adjustment effect on the grayscale value. If the grayscale value of a pixel in an image is large, a gamma value greater than 1 has a greater adjustment effect on the grayscale value. Therefore, when the present invention obtains the gamma value of a channel image, it is first necessary to preset a grayscale value threshold to judge the grayscale value of the pixel in the channel image, and then obtain the gamma value corresponding to the channel image based on the judgment result.

[0053] First, when the importance of the channel image is greater, it means that there are more useful detail information in the channel image. In order to keep these important details from being overly affected by the gamma transform, using a gamma value closer to 1 can avoid excessive nonlinear enhancement of the channel image, thereby retaining key details and information; secondly, the greater the pixel complexity of the channel image, the higher the information complexity of the channel image and the more details there are. In order to avoid the loss of detail information in the channel image, the closer the gamma value used by the channel image is to 1, the more likely it is to retain the detail information in the channel image and avoid excessive processing of these details; finally, the contrast of the channel image reflects the visual impact and information hierarchy of the channel image. The larger its value is, the more details are contained in the channel image, and the gamma value should be closer to 1 to avoid excessive enhancement and blurred details. In summary, if the importance, pixel complexity and contrast of the channel image are greater, the gamma value of the channel image should be close to 1.

[0054] In an embodiment of the present invention, the gamma value of each channel image is obtained:

[0055] ;

[0056] In the formula, Represents the gamma value of the i-th channel image; Represents the importance of the i-th channel image; Represents the pixel complexity of the i-th channel image; Represents the contrast of the i-th channel image; Represents the mean gray value of the pixels in the i-th channel image; represents the gray value threshold. In the embodiment of the present invention, the gray value threshold T is preset to be 104. In other embodiments, the implementer may preset the gray value threshold according to the specific implementation situation.

[0057] when When the gray value is less than the threshold, the gamma value of the i-th channel image needs to be less than 1, and when The larger the value of The value of is less than 1 and close to 1, which ensures that the gamma value regulates the channel image while retaining the details of the channel image as much as possible. The smaller the value of The value of is less than 1 and far away from 1;

[0058] when When is greater than or equal to the gray value threshold, the gamma value of the i-th channel image needs to be greater than 1, and when The larger the value of The value of is greater than 1 and close to 1, which ensures that the gamma value regulates the channel image while retaining the details of the channel image as much as possible. The smaller the value of The value of is greater than 1 and far away from 1.

[0059] S004. Enhance each channel image according to the gamma value of each channel image to identify defective areas.

[0060] It should be noted that the gamma value of each channel image is used to enhance the channel image, so as to facilitate the identification of the accurate defect area.

[0061] In an embodiment of the present invention, a gamma transform algorithm is used, and each channel image is enhanced based on the gamma value of each channel image to obtain an enhanced image of each channel. Each channel enhanced image is fused to obtain an enhanced image of a titanium alloy forging, and defects in the enhanced image of the titanium alloy forging are detected using edge detection.

[0062] 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 forging auxiliary detection method based on image intelligent enhancement, characterized in that: include: Collect RGB images of titanium alloy forgings and separate them into multiple channel images; According to a number of pixel regions of each channel image, the dispersion degree of each type of pixel region of each channel image is obtained, wherein the pixel regions with the same grayscale value in each channel image are regarded as one type of pixel region; Based on the degree of dispersion, obtain the pixel complexity of each channel image , Represents the pixel complexity of the i-th channel image; Represents the number of types of pixel areas in the i-th channel image; Represents the dispersion degree of the z-th pixel area of ​​the i-th channel image; Represents the maximum value of the dispersion degree of all pixel regions of the i-th channel image; Get the importance of each channel image , Represents the importance of the i-th channel image; as well as Represents the mean gradient value of all pixels in the i-th channel image and the maximum gradient value of all pixels; as well as Represents the standard deviation of the gradient values ​​of all pixels in the i-th channel image and the maximum value of the standard deviation of the gradient values ​​of the pixels in all channel images; exp() represents an exponential function with a natural constant as the base; Get the gamma value of each channel image , Represents the gamma value of the i-th channel image; Represents the contrast of the i-th channel image; Represents the mean gray value of the pixels in the i-th channel image; represents the gray value threshold; A gamma transform algorithm is used, and each channel image is enhanced according to the gamma value of each channel image to obtain each channel enhanced image; based on each channel enhanced image, the defect area is identified.

2. The titanium alloy forging auxiliary detection method based on image intelligent enhancement according to claim 1 is characterized in that: The obtaining of the pixel area includes: Taking the jth pixel of the i-th channel image as an example, the pixel points with the same grayscale value in the eight neighborhoods of the j-th pixel of the i-th channel image are recorded as target pixels, and the area formed by the target pixel and the j-th pixel of the i-th channel image is recorded as the j-th pixel area of ​​the i-th channel image, so as to obtain several pixel areas of the i-th channel image.

3. The titanium alloy forging auxiliary detection method based on image intelligent enhancement according to claim 1 is characterized in that: The obtaining of the dispersion degree of various pixel regions of each channel image includes: Get the distance from the central pixel point of any z-th pixel area in the i-th channel image to the central area of ​​each of the remaining z-th pixel areas, and take the minimum distance value as the representative distance of the z-th pixel area in the i-th channel image; take the mean of the representative distances of each z-th pixel area in the i-th channel image as the dispersion degree of the z-th pixel area in the i-th channel image.

4. The titanium alloy forging auxiliary detection method based on image intelligent enhancement according to claim 1 is characterized in that: Acquisition of the contrast of the channel image includes: The difference between the maximum grayscale value and the minimum grayscale value of the i-th channel image is obtained, and the ratio of the difference to 255 is used as the contrast of the i-th channel image.

5. The titanium alloy forging auxiliary detection method based on image intelligent enhancement according to claim 1 is characterized in that: The method of enhancing the image based on each channel and identifying the defect area includes: The enhanced images of each channel are fused to obtain the enhanced image of the titanium alloy forging, and the defects in the enhanced image of the titanium alloy forging are detected using edge detection.