An image-based production inspection method for power generation equipment parts
By blocking and noise assessment of power generation equipment part images, combined with non-pure chromaticity and neighborhood analysis, the problem of blurred details and noise caused by the bilinear interpolation method in processing complex images is solved, significantly improving detection accuracy and efficiency.
Patent Information
- Application Number
- CN202410995541.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-24
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2044-07-24
AI Technical Summary
When the traditional bilinear interpolation method is used to process images of power generation equipment parts, it is difficult to maintain detail clarity and is prone to produce sawtooth noise, resulting in low detection accuracy.
By dividing the part image into blocks, using the gradient direction of the pixel with the maximum gradient value as the gradient change direction of the block, the possibility of non-pure chromaticity and noise is calculated, and the degree of noise is evaluated by combining the similarity and grayscale deviation of neighborhood blocks. , and update the gray value of the abnormal block according to the gray value of the normal block, reducing noise and improving image clarity.
The detection accuracy and reliability are significantly improved, and it is suitable for processing images of power generation equipment parts with complex curved surfaces and color gradients. It overcomes the limitations of the traditional bilinear interpolation method and improves the accuracy and efficiency of detection.
Smart Images

Figure CN118552522B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to an image-based production detection method for power generation equipment parts. Background Art
[0002] In the field of power generation equipment manufacturing, defect detection of parts in the production process is of great significance to ensure product quality. The traditional method is to manually observe whether there are manufacturing defects on the surface of the parts, such as cracks, deformations and flaws, but it is inefficient and highly subjective. With the development of technology, detection technology based on image processing and analysis is widely used in the production and detection of power generation equipment parts. This technology timely identifies potential manufacturing defects such as cracks, deformations and flaws by real-time analysis and processing of part images in the production process, ensuring that the finished parts meet strict quality standards and can effectively monitor manufacturing quality. For example, the patent document with announcement number CN113267502B provides a micro-motor friction plate defect detection system and detection method based on machine vision, including: placing the part to be inspected on the stage, and collecting the image of the friction plate to be inspected by the camera; the industrial computer performs a series of image processing and image analysis on the collected image of the friction plate to be inspected to determine whether the friction plate to be inspected is defective.
[0003] In the process of inspecting power generation equipment parts using detection technology based on image processing and analysis, in order to detect subtle defects more accurately, it is usually necessary to enlarge the captured image, usually by using bilinear interpolation to scale the image. For example, a patent application document with publication number CN104866862A discloses a method for identifying and classifying area defects on the surface of strip steel, which mainly involves extracting a surface image of the strip steel, scaling it using a bilinear difference algorithm, and then extracting image features. The extracted feature data is input into an improved random forest classifier to complete defect recognition and detection.
[0004] However, since the surfaces of power generation equipment parts often contain complex curved structures, resulting in delicate color gradients, sharp detail edges and potential tiny defects, it is difficult to perfectly maintain detail clarity when processing such images using bilinear interpolation, which often leads to blurred image details and prone to aliasing noise, seriously affecting the visual effect of the scaled image and reducing detection accuracy. Summary of the invention
[0005] In order to solve the problem that when bilinear interpolation is used to scale parts, image details are unclear, sawtooth noise is easily generated, and detection accuracy is low, the present invention proposes an image-based power generation equipment parts production detection method, which specifically adopts the following scheme:
[0006] A method for detecting the production of power generation equipment parts based on an image, comprising:
[0007] Preprocess the image of the parts of the power generation equipment and divide it into blocks, and use the gradient direction corresponding to the pixel point with the maximum gradient value in the block as the gradient change direction of the block;
[0008] Select any block as the target block, take the product of the grayscale variance of the pixels in the target block and the gradient mean and the gradient variance as the impure chromaticity of the target block, and calculate the noise possibility of the target block according to the impure chromaticity and the grayscale difference between the pixels in the target block and the adjacent pixels in the gradient direction, wherein the noise possibility is positively correlated with the impure chromaticity and the grayscale difference;
[0009] A parallel line is drawn through the central pixel point of the target block in the direction of the gradient change, and the blocks adjacent to the target block on the parallel line are taken as the neighborhood blocks of the target block, and the product of the noise possibility of the target block, the similarity between the neighborhood blocks, and the grayscale deviation between the target block and the neighborhood blocks is taken as the noise degree of the target block;
[0010] Normal blocks and abnormal blocks are screened out according to the noise level, and the grayscale value of the abnormal block is updated according to the grayscale value of the normal block to obtain an updated part image.
[0011] The above technical solution effectively solves the limitations of the traditional bilinear interpolation method in processing complex part images by introducing a series of innovative image analysis and processing strategies, and significantly improves the detection accuracy and reliability. Specifically, the part image is divided into multiple blocks, and the gradient direction corresponding to the pixel point with the maximum gradient value in the block is used as a reference. Then, the grayscale variance, gradient mean and gradient variance of the pixel points in the target block are calculated to form a comprehensive indicator, namely, non-pure chromaticity. This indicator can effectively reflect the complexity of color and texture in the block. The higher the non-pure chromaticity, the greater the change in pixel value in the block, and there may be more details or noise. Then, the target is evaluated by combining the noise possibility of the target block, the similarity between neighboring blocks, and the grayscale deviation between the target block and the neighboring blocks. The noise degree of the block, among which the noise possibility reflects the inconsistency within the target block, while the similarity and grayscale deviation are examined from the neighborhood perspective. This comprehensive analysis helps to distinguish between real noise and detail changes in the image to avoid misjudgment. Normal blocks and abnormal blocks are distinguished according to the noise degree. Abnormal blocks usually represent noise blocks in the image. Using the grayscale value of the normal block to update the grayscale value of the abnormal block can effectively reduce image noise, keep the texture of the image consistent, and improve the overall clarity and visual quality of the image. Compared with traditional image scaling technology, the method of the present invention is particularly suitable for processing images of power generation equipment parts containing complex surfaces, color gradients and sharp edges, effectively overcomes the limitations of traditional bilinear interpolation methods, and significantly improves the accuracy and efficiency of power generation equipment parts detection.
[0012] Preferably, the noise probability of the target block satisfies the following relationship:
[0013]
[0014] In the formula, For the The noise probability of each target block, For the The impure chromaticity of the target block, For the The first target block The gray value of a pixel, For the said The gradient direction of the pixel The grayscale values of adjacent pixels are is the serial number of the adjacent pixel points, is the total number of adjacent pixels, For the The total number of pixels in a block.
[0015] The above technical solution takes into account the gradient direction and grayscale value differences of pixel points. The formula can adapt to different image features, such as curved surfaces, gradient colors or sharp edges. It can maintain a high noise recognition accuracy even when the lighting changes or the image quality varies. This adaptability is crucial for processing diverse images of power generation equipment parts, and improves the robustness and applicability of the algorithm.
[0016] Preferably, the pixel points in the target block and the pixel points adjacent to it in the gradient direction are centered on any pixel point in the target block, and the adjacent pixel points on both sides of the pixel point along the gradient direction of the pixel point are regarded as the adjacent pixel points in the gradient direction of the pixel point.
[0017] Preferably, the number of the neighborhood blocks is 2, and they are located on both sides of the target block respectively.
[0018] Preferably, the method for obtaining the grayscale deviation between the target block and the neighborhood block is:
[0019] Taking the pixel points located on the parallel lines in the neighborhood block as the neighborhood pixel points of the central pixel point of the target block;
[0020] The grayscale deviation between the target block and the neighboring block is calculated according to the following formula:
[0021]
[0022] In the formula, For the The grayscale deviation between the target block and the neighboring block, For the The sequence number of the pixel points in the target block, For the The total number of pixels in the target block, For the The target block The grayscale difference between a pixel point and the next adjacent pixel point in the gradient change direction, wherein the grayscale difference is the absolute value of the grayscale difference. is the mean of the first-order differences of the grayscale values of the neighborhood pixels, is the absolute value symbol.
[0023] The above technical solution calculates the absolute value of the grayscale difference between each pixel in the target block and its adjacent pixel in the gradient direction. , and the first-order difference mean of the grayscale values of the neighboring pixels By comparison, the formula can accurately quantify the grayscale deviation between the target block and the neighboring block. This quantification method fully considers the grayscale distribution characteristics of the local area of the image, which helps to more finely evaluate the uniformity and consistency of the image.
[0024] Preferably, the method for obtaining the similarity between the neighborhood blocks is:
[0025] The distances from the pixel points with the maximum gradient values of the two neighborhood blocks to the pixel points with the maximum gradient value of the target block are D1 and D2 respectively;
[0026] The similarity between the two neighborhood blocks is calculated according to the following formula:
[0027]
[0028] In the formula, For the The similarity between two neighboring blocks of a target block, , are the noise possibilities of the two neighborhood blocks respectively.
[0029] The above technical solution introduces the spatial position factor by calculating the distance between the pixel point with the maximum gradient value of the two neighborhood blocks and the pixel point with the maximum gradient value of the target block, ensuring that the similarity evaluation is not limited to grayscale or color information, but comprehensively considers the relative position of the blocks in the image. This spatial positioning helps to identify specific geometric features or defects, and by comparing the consistency of the noise possibilities of the two neighborhood blocks, it helps to screen out areas with similar noise characteristics, thereby more accurately locating and processing abnormal areas in the image and avoiding misjudging normal texture changes as noise.
[0030] Preferably, the method for screening out normal blocks and abnormal blocks is: taking target blocks with noise levels greater than a preset noise level threshold as abnormal blocks, and taking target blocks with noise levels less than or equal to the preset noise level threshold as normal blocks.
[0031] Preferably, the method for updating the grayscale value of the abnormal block according to the grayscale value of the normal block is:
[0032] The normalized values of the noise levels of all blocks are obtained through normalization operation;
[0033] The pixels in the normal block are regarded as normal pixels, and the pixels in the abnormal block are regarded as abnormal pixels;
[0034] The normal pixel closest to each abnormal pixel is selected, and the product of the grayscale value of the normal pixel and the noise level of the block where the abnormal pixel is located is used as the updated grayscale value of the abnormal pixel.
[0035] The above technical solution multiplies the noise level of the block where the abnormal pixel is located with the grayscale value of the normal pixel to update the grayscale value of the abnormal point, thereby reducing the impact of noise on the overall image quality and realizing dynamic updating of the grayscale value of the abnormal pixel in the image. By updating the grayscale value, the contrast of different areas in the image can be enhanced, making important features (such as cracks, dents, scratches, etc.) more obvious, easier to detect and identify, and improving the accuracy of detection.
[0036] Preferably, the size of the blocks is Pixel size, is the default value.
[0037] Preferably, the preprocessing includes enlarging the part image using a bilinear interpolation method and gray-scaling the image.
[0038] The present invention has the following effects:
[0039] The present invention uses innovative image segmentation and feature analysis, utilizes non-pure chromaticity indicators to accurately identify noise, combines neighborhood analysis to optimize noise evaluation, effectively distinguishes and reduces image noise, greatly improves image clarity and detail retention, and is suitable for processing power generation equipment parts with complex structures. It overcomes the limitations of traditional bilinear interpolation methods and improves detection accuracy and efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] 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:
[0041] Figure 1 It is a schematic flow chart of the method of the present invention;
[0042] Figure 2 It is a schematic diagram of the method flow of step S2 in the present invention. DETAILED DESCRIPTION
[0043] 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.
[0044] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0045] Reference Figure 1 , the image-based power generation equipment parts production detection method includes steps S1-S3, which are as follows:
[0046] S1: Preprocess the images of power generation equipment parts and divide them into blocks.
[0047] In order to inspect the parts of power generation equipment, it is necessary to collect images. In this step, a high-resolution industrial camera is first selected to ensure that the captured image is clear and detailed enough for subsequent magnification operations and analysis. During the shooting process, the lighting conditions must be strictly controlled to ensure uniform light and avoid shadows and highlights. This helps to reduce the difficulty in image processing, especially for power generation equipment parts with complex surfaces and color gradients. Use a configured high-definition industrial camera to shoot the produced power generation equipment parts from multiple angles to cover all important areas of the parts and ensure that comprehensive image data is obtained.
[0048] The collected part images are then preprocessed, including: enlarging the collected power generation equipment part images using a bilinear interpolation algorithm, which can smoothly increase pixels and maintain image continuity, and then converting the enlarged image into a grayscale image to simplify the image processing process and reduce computational complexity.
[0049] Finally, in order to perform a detailed analysis of the image, the grayscale image is divided into blocks of N×N pixels. The block size should be adjusted according to the actual part size and the complexity of the feature details to ensure that each block can reflect the local features of the part while maintaining sufficient resolution for detail analysis. This embodiment believes that blocks of 9×9 pixels are more suitable for image detail analysis, so N is set to 9.
[0050] After the above operations, the block operation of the part image is completed. Since the bilinear interpolation method may cause blurred image details, measures will be taken in the subsequent steps to optimize the image quality.
[0051] In image processing, the gradient direction reflects the direction of pixel brightness change, that is, the direction of the edge or texture in the image. The pixel with the maximum gradient value in the block usually represents the most significant brightness change in the area, that is, the most obvious feature direction. Therefore, selecting this direction as the gradient change direction of the block can effectively capture and represent the most prominent image features in the block. In addition, in image areas with noise or complex details, the gradient direction may appear chaotic due to local disturbances. The pixel with the maximum gradient value, as the dominant direction, can be used as an "anchor point" to help filter out some inconsistent gradient directions caused by noise, thereby playing a role in noise suppression to a certain extent.
[0052] S2: Evaluate the noise level of the target block.
[0053] Reference Figure 2 , specifically including S21-S23:
[0054] S21: Calculate the impure chromaticity of the target block.
[0055] The purpose of image block processing is to accurately identify and quantify the noise in the image, especially the edge jagged noise, by calculating the characteristic parameters of each block, so as to improve the accuracy and efficiency of part detection. Here, an indicator for comprehensively reflecting the complexity of the block is introduced, which is called non-pure chromaticity. Its calculation method is:
[0056] Any block is selected as a target block, and the product of the grayscale variance, gradient mean, and gradient variance of the pixels in the target block is used as the impure chromaticity of the target block.
[0057] Among them, the grayscale variance measures the discreteness of the grayscale values of pixels in the target block. A larger grayscale variance indicates that the pixel values are widely distributed in the target block, which may be due to the rich details or the presence of noise in the image. Therefore, the size of the grayscale variance can be used as an important basis for evaluating the impact of edge aliasing noise on the target block. The gradient mean reflects the average level of the gradient values of the pixels in the target block, that is, the average performance of the edge strength. A high gradient mean usually means that there are obvious edges or details in the target block, especially in the image scaling process, the target block is easily affected by aliasing noise. The gradient variance further quantifies the fluctuation of the gradient values of the pixels in the target block. A larger gradient variance implies that the edge strength in the target block varies greatly, which may be caused by complex textures or noise in the image, especially edge aliasing noise.
[0058] Therefore, the non-pure chromaticity of the target block can be obtained by combining the three factors to preliminarily evaluate the noise distribution in the image. The size of the non-pure chromaticity directly reflects the degree to which the block is affected by edge aliasing noise. A higher non-pure chromaticity means that the pixel values within the block vary greatly and there are more details or potential noise, indicating that the block may be significantly affected by edge aliasing noise. According to the degree to which the block is affected by edge aliasing noise, the pure color area and the gradient area can be preliminarily distinguished. The pure color area usually has lower noise, while the gradient area may contain more noise.
[0059] Based on the above analysis, a noise processing algorithm can be designed specifically to take more stringent filtering or correction measures for target blocks that are more affected by noise, thereby optimizing the overall image quality and improving the accuracy and reliability of detection.
[0060] S22: Analyze the noise possibility of the target block.
[0061] The gradient caused by noise usually changes slowly when it is close to the pure color area and changes sharply when it is close to the strong edge. The gradient caused by the characteristics of the image itself shows a strong regularity and a uniform change trend. Therefore, it is necessary to further distinguish whether the gradient area in the image is caused by the characteristics of the image itself or by noise.
[0062] Analyze the pixels in each target block, focusing on the association between the gradient change direction and non-pure chromaticity to obtain clues about the possibility of noise. Select the pixel with the largest gradient value in the target block as the dominant point, extract the gradient direction of the point, which indicates the main direction of the pixel brightness change. Calculate the grayscale difference between the dominant point and the adjacent pixel in the gradient direction, and then continue to select the pixel with the largest gradient value from the remaining pixels. Repeat the above operation, and obtain the grayscale difference between each pixel in the block and the adjacent pixel in the gradient direction in order from large to small gradient values to reflect the speed of the pixel change rhythm, that is, the speed of the grayscale change of the pixel in the block.
[0063] Then, the possibility of the block being affected by edge aliasing noise is comprehensively evaluated by combining the non-pure chromaticity and grayscale change differences of the blocks. The non-pure chromaticity reflects the complexity of the blocks, while the grayscale change difference reveals the rhythm and regularity of the pixel changes within the blocks.
[0064] Therefore, this step calculates the noise possibility of the target block based on the non-pure chromaticity and the grayscale difference between the pixel point in the target block and the pixel points adjacent to it in the gradient direction. Taking the i-th block as an example, the j-th pixel point in the i-th block is the pixel point with the largest gradient value in the block. Starting from the j-th pixel point, the grayscale difference between each pixel point and the adjacent pixel points in the gradient direction is calculated in descending order of gradient values. The adjacent pixel points in the gradient direction are centered on any pixel point in the target block, and the adjacent pixel points on both sides of the pixel point along the gradient direction of the pixel point are regarded as the adjacent pixel points in the gradient direction of the pixel point. Therefore, any pixel point in the target block has two adjacent pixel points in its gradient direction. Calculating the grayscale difference between the grayscale value of each pixel point in the target block and the two adjacent pixel points in its gradient direction can capture the rhythm and regularity of the changes of the pixel points in the block, so as to fully reflect the characteristics of the block.
[0065] The calculation formula is:
[0066]
[0067] In the formula, For the The noise probability of each target block, For the The non-pure chromaticity of the target block reflects the complexity of the block. For the The first target block The gray value of a pixel, For the said The gradient direction of the pixel The grayscale values of adjacent pixels are is the serial number of the adjacent pixel points, is the total number of adjacent pixels, For the The total number of pixels in each block, The value of is 2, By accumulating the grayscale differences, the rhythm of the grayscale changes of pixels in the target block is quantified, and then the possibility of the block being affected by edge aliasing noise is evaluated.
[0068] It can be seen that the noise possibility is positively correlated with the non-pure chromaticity and the grayscale difference. By analyzing the relationship between the rhythm of pixel changes and non-pure chromaticity, this formula can effectively distinguish the irregular changes caused by noise from the gradual changes of the inherent characteristics of the image, thereby accurately locating the area affected by noise.
[0069] S23: Determine the noise level of the target block.
[0070] The gradient area in the image usually shows a uniform gradient correlation across the entire area, that is, the grayscale changes of the pixels show a regular trend. In contrast, the blocks affected by edge jagged noise lack this uniformity, and the grayscale changes are irregular, especially when close to the pure color area, the changes are smaller, and the changes are drastic near the color edge.
[0071] First, all blocks in the image are identified. Then, with these blocks as the center, their neighborhood blocks are obtained to analyze the gradient correlation between the blocks and the neighborhood. The gradient trend of the blocks in the relevant neighborhood is reflected through the adjacent blocks in the gradient change direction of the central block and the pixels in these adjacent blocks.
[0072] Draw a parallel line in the gradient change direction through the central pixel of the target block, and use the adjacent blocks of the target block on the parallel line as the neighborhood blocks of the target block, and use the pixel points in the neighborhood blocks located on the parallel line as the neighborhood pixel points of the central pixel of the target block;
[0073] Calculate the grayscale deviation between the target block and the neighborhood block:
[0074]
[0075] In the formula, For the The grayscale deviation between the target block and the neighboring block, For the The sequence number of the pixel points in the target block, For the The total number of pixels in the target block, For the The target block The grayscale difference between a pixel point and the next adjacent pixel point in the gradient change direction, wherein the grayscale difference is the absolute value of the grayscale difference. is the mean of the first-order differences of the grayscale values of the neighborhood pixels, is the absolute value symbol.
[0076] In this formula, It is obtained by accumulating the absolute value of the grayscale difference between each pixel in the target block and its adjacent pixel in the gradient direction, then subtracting the first-order difference mean of the grayscale values of the neighboring pixels, and finally summing them up. This calculation process aims to quantify the grayscale consistency of the target block relative to its neighboring blocks. The larger the value, the greater the difference between the grayscale distribution of the target block and the neighborhood block, which may be caused by noise, defects or structural mutations. The first-order difference mean of the grayscale values of the neighborhood pixels reflects the average level of grayscale changes of the pixels in the neighborhood block.
[0077] In this formula, the mean of the first-order differences of the grayscale values of the neighboring pixels is calculated by first calculating the first-order differences of the grayscale values of multiple neighboring pixels. For example, the first-order differences of the grayscale values 25, 30, and 35 are , , and then calculate the mean of the first-order differences, for example, the mean of the first-order differences of 25, 30, and 35 is equal to 5.
[0078] In the image detection of power generation equipment parts, quantifying grayscale deviation helps to more accurately identify and locate abnormal areas in the image, providing more precise data for subsequent image processing and analysis. The target blocks with high values may contain potential defects that need further inspection, such as cracks, pits, or foreign objects. The noise suppression algorithm can be applied in a targeted manner to the area with high noise values.
[0079] In summary, by quantifying the grayscale deviation between the target block and the neighborhood block, key information is provided for image-based production inspection of power generation equipment parts, which is helpful for defect identification, noise suppression and optimization of image processing flow, and is an important tool for improving the performance of the inspection system.
[0080] Calculate the similarity between the neighborhood blocks:
[0081] Set up The two neighboring blocks of the target block are and , The pixel with the maximum gradient value in The distance between the pixels with the maximum gradient value in the target block is , The pixel with the maximum gradient value in The distance between the pixels with the maximum gradient value in the target block is ;
[0082] Neighborhood Block and The similarity between them is calculated according to the following formula:
[0083]
[0084] In the formula, For the The similarity between two neighboring blocks of a target block, , are the noise possibilities of the two neighborhood blocks respectively.
[0085] This formula is compared and , which can evaluate the spatial proximity of the neighborhood blocks relative to the target blocks, which is important information for understanding the local features and structural layout of the image. and Represents neighborhood blocks and By comparing these two values, we can quantify the similarity of the noise characteristics of the neighborhood blocks. Blocks with high noise probability may contain more aliasing noise or other types of image noise.
[0086] This formula combines the spatial position relationship and noise characteristics, reflecting the neighborhood block and The similarity of spatial position and noise characteristics to the target block is When the value is close to 1, it means that the two neighborhood blocks have high similarity with the target block in terms of spatial position and noise characteristics. By calculating the similarity between neighborhood blocks, it can assist in identifying possible noise areas in the image. Neighborhood blocks with low similarity may contain abnormal noise or defects and require further inspection and processing. The similarity between neighborhood blocks can also be used to analyze the continuity and consistency of image features and help identify texture, pattern or structural mutations in the image, which is particularly important for detecting subtle defects or changes in power generation equipment parts.
[0087] In summary, by calculating the similarity between neighborhood blocks, it can not only help identify noise and potential defects in images, but also optimize the image processing process and improve detection efficiency and accuracy, which is of great significance for image-based production inspection of power generation equipment parts.
[0088] Finally, the noise probability of the target block, the similarity between the neighboring blocks, and the grayscale deviation between the target block and the neighboring blocks are multiplied as the noise degree of the target block, as shown in the first The noise level of each target block is , , The product of the three, noise probability It reflects the complexity of the block and the possibility of being affected by noise. It is the basic indicator of noise evaluation. The similarity between the neighborhood blocks and the target blocks in terms of spatial position and noise characteristics is considered, which helps to identify the consistency or anomaly of local structure and grayscale deviation. The difference in grayscale distribution between the target block and the neighboring blocks is quantified to reveal potential noise or structural mutations.
[0089] Through the comprehensive evaluation of these three dimensions, we can have a more comprehensive understanding of the noise characteristics of specific areas in the image and avoid the one-sidedness that may be caused by a single indicator.
[0090] S3: Update the part image based on the noise level.
[0091] Specifically, normal blocks and abnormal blocks are screened out according to the noise level, and the grayscale value of the abnormal block is updated according to the grayscale value of the normal block to obtain an updated part image.
[0092] Among them, the method for screening out normal blocks and abnormal blocks is: presetting the noise level threshold to 0.3, taking the target block with a noise level greater than the preset noise level threshold as an abnormal block, taking the target block with a noise level less than or equal to the preset noise level threshold as a normal block, the pixel points in the abnormal block as abnormal pixel points, and the pixel points in the normal block as normal pixel points.
[0093] The method for updating the grayscale value of the abnormal block according to the grayscale value of the normal block is as follows: normalize the noise level of all blocks, select the normal pixel closest to each abnormal pixel, and use the product of the grayscale value of the normal pixel and the noise level of the block where the abnormal pixel is located as the updated grayscale value of the abnormal pixel. In the block The pixels are abnormal pixels, The blocks are normal blocks and the distance The most recent block, Find the one that matches the The normal pixel closest to the pixel is the gray value of the normal pixel and the The product of the noise levels of the blocks is taken as the In the block In this way, the grayscale values of all abnormal pixels in the part image are updated to obtain a part image with clearer details and higher quality, based on which accurate detection can be performed.
[0094] Although this specification has shown and described a number of embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will conceive of many modifications, changes and alternatives without departing from the ideas and spirit of the present invention. It should be understood that in the practice of the present invention, various alternatives to the embodiments of the present invention described herein may be employed.
Claims
1. An image-based production inspection method for power generation equipment parts, characterized in that: include: Preprocess the image of the parts of the power generation equipment and divide it into blocks, and use the gradient direction corresponding to the pixel point with the maximum gradient value in the block as the gradient change direction of the block; wherein the gradient direction is used to reflect the direction of the pixel brightness change; A block is selected as a target block, and the product of the grayscale variance, gradient mean, and gradient variance of the pixel points in the target block is used as the impure chromaticity of the target block. According to the impure chromaticity and the grayscale difference between the pixel points in the target block and the adjacent pixel points in the gradient direction, the noise possibility of the target block is calculated, and the noise possibility is positively correlated with the impure chromaticity and the grayscale difference; wherein the impure chromaticity is used to reflect the degree to which the block is affected by edge jagged noise; The noise probability of the target block satisfies the following relationship: In the formula, For the The noise probability of each target block, For the The impure chromaticity of the target block, For the The first target block The gray value of a pixel, For the The gradient direction of the pixel The grayscale values of adjacent pixels are is the serial number of the adjacent pixel points, is the total number of adjacent pixels, For the The sequence number of the pixel points in the target block, For the The total number of pixels in the target block; A parallel line is drawn through the central pixel point of the target block in the direction of the gradient change, and the blocks adjacent to the target block on the parallel line are taken as the neighborhood blocks of the target block, and the product of the noise possibility of the target block, the similarity between the neighborhood blocks, and the grayscale deviation between the target block and the neighborhood blocks is taken as the noise degree of the target block; The method for obtaining the similarity between the neighborhood blocks is: The distances from the pixel points with the maximum gradient values of the two neighborhood blocks to the pixel points with the maximum gradient values of the target block are respectively and ; The similarity between the two neighborhood blocks is calculated according to the following formula: In the formula, For the The similarity between two neighboring blocks of a target block, , are respectively the noise possibilities of the two neighborhood blocks; The method for obtaining the grayscale deviation between the target block and the neighborhood block is: Taking the pixel points located on the parallel lines in the neighborhood block as the neighborhood pixel points of the central pixel point of the target block; The grayscale deviation between the target block and the neighboring block is calculated according to the following formula: In the formula, For the The grayscale deviation between the target block and the neighboring block, For the The sequence number of the pixel points in the target block, For the The total number of pixels in the target block, For the The target block The grayscale difference between a pixel point and the next adjacent pixel point in the gradient change direction, wherein the grayscale difference is the absolute value of the grayscale difference. is the mean of the first-order differences of the grayscale values of the neighborhood pixels, is the absolute value symbol; Screening out normal blocks and abnormal blocks according to the noise level, and updating the grayscale value of the abnormal block according to the grayscale value of the normal block to obtain an updated part image; The updating method is: The normalized values of the noise levels of all blocks are obtained through normalization operation; the pixels in the normal blocks are taken as normal pixels, and the pixels in the abnormal blocks are taken as abnormal pixels; the normal pixels closest to each abnormal pixel are selected, and the product of the grayscale value of the normal pixel and the noise level of the block where the abnormal pixel is located is taken as the updated grayscale value of the abnormal pixel.
2. The image-based power generation equipment parts production detection method according to claim 1, characterized in that: The pixel points adjacent to the pixel point in the target block and its gradient direction are centered on any pixel point in the target block, and the adjacent pixel points on both sides of the pixel point along the gradient direction of the pixel point are regarded as the adjacent pixel points in the gradient direction of the pixel point.
3. The image-based power generation equipment parts production detection method according to claim 1, characterized in that: The number of the neighboring blocks is 2, and they are located on both sides of the target block respectively.
4. The image-based power generation equipment parts production detection method according to claim 1, characterized in that: The method for screening out normal blocks and abnormal blocks is: taking target blocks with noise levels greater than a preset noise level threshold as abnormal blocks, and taking target blocks with noise levels less than or equal to the preset noise level threshold as normal blocks.
5. The image-based power generation equipment parts production detection method according to claim 4, characterized in that: The size of the block is Pixel size, is the default value.
6. The image-based power generation equipment parts production detection method according to claim 4, characterized in that: The preprocessing includes enlarging the part image by bilinear interpolation and graying it.
