An image enhancement method, system, and device for enhancing anomaly detection capabilities

CN117974482BActive Publication Date: 2026-10-30SCI & TECH TEZHI TECH (CHONGQING) CO LTD +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311200844.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-18
Publication Date
2026-10-30
Estimated Expiration
2043-09-18

AI Technical Summary

Technical Problem

这些图像在采集过程中易受工厂粉尘、扫描设备以及水下采集时的水流密度和浑浊度影响,容易产生伪缺陷,噪音,亮度不均匀等,在采集过程中的伪缺陷会影响异常检测精度

Benefits of technology

[0031]相比于现有技术,本发明的优点及有益效果在于:本发明对于质检过程中采集的图像中的噪音进行处理,对图像中异常位置进行针对性的分离,增强了异常位置的显示程度,减少噪音的干扰,解决了产品质检过程中因采集过程中不可控环境因素导致的噪音影响,提升了异常检测能力。本发明提出的图像增强方法有效地减少图像内不均匀对比度的影响,强化了异常部分的显示,有助于提高异常检测人员和异常检测模型的效率和精度。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117974482B_ABST
    Figure CN117974482B_ABST
Patent Text Reader

Abstract

The application provides an image enhancement method, system and device for enhancing abnormality detection capability, wherein the method comprises the following steps: acquiring a quality inspection image to be detected, performing gray processing on the quality inspection image to obtain a first processed image; performing background blurring processing on the first processed image to obtain a second processed image; and obtaining an enhanced image according to the first processed image and the second processed image. The application processes the noise in the image collected in the quality inspection process, separates the abnormal positions in the image in a targeted manner, enhances the display degree of the abnormal positions, reduces the interference of the noise, solves the noise influence caused by uncontrollable environmental factors in the acquisition process in the product quality inspection process, and improves the abnormality detection capability. The image enhancement method provided by the application effectively reduces the influence of uneven contrast in the image, strengthens the display of the abnormal part, and is helpful to improve the efficiency and precision of the abnormality detection personnel and the abnormality detection model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer vision technology, and in particular to an image enhancement method, system, and device for enhancing anomaly detection capabilities. Background Technology

[0002] With the development of computer vision, computer vision technology is being used more and more in the field of anomaly detection. Anomaly detection enables us to repair or eliminate parts that are in a bad condition from the production process.

[0003] Currently, most images used for product anomaly detection are structured light images, X-ray images, infrared images, or ultrasonic images. These images are easily affected during acquisition by factory dust, scanning equipment, and water flow density and turbidity during underwater acquisition, leading to false defects, noise, and uneven brightness. False defects during acquisition can affect the accuracy of anomaly detection. Excessive noise during acquisition also reduces the ability of anomaly detection personnel to recognize images. Since most anomaly detection and monitoring now uses machine learning or deep learning algorithms, images with noise and uneven contrast can significantly impact the learning and predictive capabilities of deep learning models. Summary of the Invention

[0004] Therefore, it is necessary to provide an image enhancement method, system, and device for enhancing anomaly detection capabilities to address the aforementioned technical problems.

[0005] An image enhancement method for improving anomaly detection capabilities includes the following steps:

[0006] In one embodiment, acquiring a quality inspection image to be inspected and performing grayscale processing on the quality inspection image to obtain a first processed image includes:

[0007] The quality inspection image is converted into a grayscale image to obtain a quality inspection grayscale image;

[0008] The grayscale image of the quality inspection is normalized to obtain a normalized image;

[0009] Histogram equalization is performed on the normalized image to obtain the first processed image.

[0010] In one embodiment, normalizing the quality inspection grayscale image to obtain a normalized image includes:

[0011] The quality inspection grayscale image is normalized according to the following formula:

[0012]

[0013] Where, x normThis represents the normalization formula, x k Let x represent the k-th pixel. min x represents the minimum grayscale value in the quality inspection grayscale image. max This represents the maximum grayscale value in the grayscale image used for quality inspection.

[0014] In one embodiment, performing histogram equalization on the normalized image to obtain a first processed image includes:

[0015] Histogram equalization is performed on the normalized image according to the following formula:

[0016]

[0017]

[0018]

[0019] Where H(v) represents the grayscale conversion formula, round() represents the rounding function, cdf(i) represents the cumulative distribution function of the image, M represents the length of the normalized image, N represents the width of the normalized image, and cdf min Let L represent the minimum value of the cumulative distribution function, L represent the image bit depth, i represent the gray value i, j represent the gray value j, and p represent the minimum value of the cumulative distribution function. x (j) represents the probability of a pixel with gray level j appearing, p x (i) represents the probability of a pixel with gray level i appearing, and n represents the probability of all pixels in the image after normalization. i This represents the number of pixels with grayscale value i.

[0020] In one embodiment, performing background blurring on the first processed image to obtain a second processed image includes:

[0021] The weights of each pixel in the first processed image are reset to obtain the second processed image.

[0022] In one embodiment, reweighting each pixel in the first processed image to obtain the second processed image includes:

[0023] The weights are reset according to the following formula:

[0024]

[0025] Where G(x,y) represents a two-dimensional Gaussian function, σ represents the standard deviation, x represents the x-coordinate of the current pixel, and y represents the y-coordinate of the current pixel.

[0026] An image enhancement system for improving anomaly detection capabilities, used to implement the image enhancement method for improving anomaly detection capabilities as described above, includes:

[0027] The grayscale processing module is used to acquire the quality inspection image to be inspected, and to perform grayscale processing on the quality inspection image to obtain a first processed image;

[0028] A blurring module is used to blur the background of the first processed image to obtain a second processed image;

[0029] An image enhancement module is used to obtain an enhanced image based on the first processed image and the second processed image.

[0030] An apparatus includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of an image enhancement method for enhancing anomaly detection capabilities as described in the various embodiments above.

[0031] Compared to existing technologies, the advantages and beneficial effects of this invention are as follows: This invention processes noise in images acquired during quality inspection, specifically separates abnormal locations within the images, enhances the visibility of abnormal locations, reduces noise interference, and solves the problem of noise impact caused by uncontrollable environmental factors during product quality inspection, thereby improving anomaly detection capabilities. The image enhancement method proposed in this invention effectively reduces the impact of uneven contrast within the image, strengthens the display of abnormal parts, and helps improve the efficiency and accuracy of anomaly detection personnel and anomaly detection models. Attached Figure Description

[0032] Figure 1 This is a flowchart illustrating an image enhancement method for improving anomaly detection capabilities in one embodiment.

[0033] Figure 2 This is a schematic diagram of a quality inspection image in one embodiment;

[0034] Figure 3 This is a schematic diagram of a normalized image in one embodiment;

[0035] Figure 4 This is a schematic diagram of the first processed image in one embodiment;

[0036] Figure 5 This is a schematic diagram of the second processed image in one embodiment;

[0037] Figure 6 This is a schematic diagram of the structure of an image enhancement system for enhancing anomaly detection capabilities in one embodiment;

[0038] Figure 7This is a schematic diagram of the internal structure of the device in one embodiment. Detailed Implementation

[0039] Before describing the specific embodiments of the present invention, the overall concept of the present invention will be explained as follows:

[0040] This invention primarily focuses on the development of anomaly detection processes. Currently, most images used for product anomaly detection are structured light images, X-ray images, infrared images, or ultrasonic images. These images are easily affected during acquisition by factory dust, scanning equipment, and water flow density and turbidity during underwater acquisition, leading to false defects, noise, and uneven brightness. False defects during acquisition can affect the accuracy of anomaly detection. Excessive noise during acquisition also reduces the ability of anomaly detection personnel to recognize images. Since most anomaly detection and monitoring now utilize machine learning or deep learning algorithms, images with noise and uneven contrast significantly impact the learning and predictive capabilities of deep learning models.

[0041] The inventors discovered through analysis that the main reason for the above problems is the insufficient clarity of the image to be detected. Improving the clarity of the image can avoid these problems. Therefore, this invention proposes an image enhancement method to enhance anomaly detection capabilities. This method involves processing the image to be detected in grayscale, then performing background processing on the grayscale-processed image, and finally removing the processed background from the grayscale-processed image to obtain a clear image.

[0042] After introducing the overall concept of the present invention, in order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below through specific embodiments and in conjunction with the accompanying drawings.

[0043] It should be noted that, unless otherwise defined, the technical or scientific terms used in one or more embodiments of this specification should have the ordinary meaning understood by one of ordinary skill in the art to which this invention pertains. The terms "first," "second," and similar terms used in one or more embodiments of this specification do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" mean that the element or object preceding the word covers the element or object listed following the word and its equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are used only to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0044] In one embodiment, such as Figure 1 As shown, an image enhancement method for improving anomaly detection capabilities is provided, comprising the following steps:

[0045] Step S101: Obtain the quality inspection image to be inspected, and perform grayscale processing on the quality inspection image to obtain the first processed image.

[0046] Specifically, quality inspection images of the product to be inspected are acquired using non-destructive testing equipment or quality monitoring equipment. In one embodiment, the quality inspection images are as follows: Figure 2 As shown.

[0047] In this embodiment, the quality inspection image is converted into a grayscale image, and then grayscale processing is performed to control some of the noise, making the defects in the image clearer.

[0048] Based on this, the quality inspection image to be inspected is obtained, and the quality inspection image is processed in grayscale to obtain a first processed image, including:

[0049] The quality inspection image is converted into a grayscale image to obtain a quality inspection grayscale image;

[0050] The grayscale image of the quality inspection is normalized to obtain a normalized image;

[0051] Histogram equalization is performed on the normalized image to obtain the first processed image.

[0052] Specifically, a desaturation tool is used to convert the quality inspection image into a grayscale image, resulting in a quality inspection grayscale image. This grayscale image is then normalized to ensure a uniform distribution of grayscale values, resulting in a normalized image. This normalized image is then converted into an image with a balanced histogram, resulting in the first processed image.

[0053] Based on this, the quality inspection grayscale image is normalized to obtain a normalized image including:

[0054] The quality inspection grayscale image is normalized according to the following formula:

[0055]

[0056] Where, x norm This represents the normalization formula, x k Let x represent the k-th pixel. min x represents the minimum grayscale value in the quality inspection grayscale image. max This represents the maximum grayscale value in the grayscale image used for quality inspection.

[0057] Specifically, the maximum and minimum grayscale values ​​in the quality inspection grayscale image are obtained. Then, using a normalization formula, the grayscale value of each pixel in the quality inspection grayscale image is processed to obtain a normalized image. In one embodiment, the normalized image obtained after processing is as follows: Figure 3 As shown.

[0058] In this embodiment, normalizing the grayscale image of the quality inspection can enhance the contrast of the image, better display the details and features of the image, and improve the visual effect and information content of the image.

[0059] Based on this, histogram equalization is performed on the normalized image to obtain the first processed image, including:

[0060] Histogram equalization is performed on the normalized image according to the following formula:

[0061]

[0062]

[0063]

[0064] Where H(v) represents the grayscale conversion formula, round() represents the rounding function, cdf(i) represents the cumulative distribution function of the image, M represents the length of the normalized image, N represents the width of the normalized image, and cdf min Let L represent the minimum value of the cumulative distribution function, L represent the image bit depth, i represent the gray value i, j represent the gray value j, and p represent the minimum value of the cumulative distribution function. x (j) represents the probability of a pixel with gray level j appearing, p x (i) represents the probability of a pixel with gray level i appearing, and n represents the probability of all pixels in the normalized image. i This represents the number of pixels with grayscale value i.

[0065] Specifically, the normalized image is converted into a first processed image with a balanced histogram using a grayscale transformation formula, meaning that each grayscale level has the same number of pixels. The image bit depth L is different for different bit levels; the image bit depth L of the 8-bit normalized image is 256, and the image bit depth L of the 16-bit normalized image is 65536. In one embodiment, the resulting first processed image is as follows: Figure 4 As shown.

[0066] In this embodiment, the normalized image is histogram equalized to obtain the first processed image, which can increase the local contrast of the image, especially when the contrast of the useful data of the image is quite similar. This method allows brightness to be better distributed on the histogram. This can be used to enhance local contrast without affecting the overall contrast. It is very useful for images where both the background and foreground are too bright or too dark, providing better display of skeletal structure and better detail in overexposed or underexposed images.

[0067] Step S102: Perform background blurring on the first processed image to obtain the second processed image.

[0068] Specifically, each pixel in the first processed image is recalculated according to the weight of the Gaussian function to generate a blurred second processed image containing only the background.

[0069] Based on this, the first processed image is subjected to background blurring to obtain the second processed image, which includes:

[0070] The weights of each pixel in the first processed image are reset to obtain the second processed image. Based on this,

[0071] The second processed image is obtained by reweighting each pixel in the first processed image, including:

[0072] The weights are reset according to the following formula:

[0073]

[0074] Where G(x,y) represents a two-dimensional Gaussian function, σ represents the standard deviation, x represents the x-coordinate of the current pixel, and y represents the y-coordinate of the current pixel.

[0075] Specifically, the weights of each pixel are recalculated. In one embodiment, the standard deviations of the horizontal and vertical coordinates are calculated differently. The standard deviation of the horizontal coordinate is calculated using the following formula: sigmaX = 0.3 × [(ksize.width - 1) × 0.5 - 1] + 0.8. The standard deviation of the vertical coordinate is calculated using the following formula: sigmaY = 0.3 × [(ksize.height - 1) × 0.5 - 1] + 0.8. Here, ksize is a user-defined value, which in this embodiment is (65, 65), i.e., ksize.width = 65 and ksize.height = 65. The resulting second processed image is shown below. Figure 5 As shown.

[0076] In this embodiment, Gaussian blur is applied to the first processed image, and the weight of each pixel is recalculated, which can better preserve the image's detailed information.

[0077] Step S103: Obtain an enhanced image based on the first processed image and the second processed image.

[0078] Specifically, since the second processed image is only a background image, the second processed image and the first processed image are compared, and the second processed image (background image) in the first processed image is removed to obtain an enhanced image with the useless background removed.

[0079] This invention provides an image enhancement method to improve anomaly detection capabilities. It processes noise in images acquired during quality inspection, specifically separating anomaly locations to enhance their visibility and reduce noise interference. This solves the problem of noise impact caused by uncontrollable environmental factors during image acquisition, thus improving anomaly detection capabilities. The image enhancement method proposed in this invention effectively reduces the impact of uneven contrast within images, strengthens the display of anomalies, and helps improve the efficiency and accuracy of anomaly detection personnel and models.

[0080] It should be noted that the method of this embodiment can be executed by a single device, such as a computer or server. The method of this embodiment can also be applied to a distributed scenario, where multiple devices cooperate to complete the task. In such a distributed scenario, one of these devices may execute only one or more steps of the method of this embodiment, and the multiple devices will interact with each other to complete the method described.

[0081] It should be noted that the above description describes some embodiments of the present invention. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims may be performed in a different order than that shown in the above embodiments and still achieve the desired results. Furthermore, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0082] Based on the same inventive concept, corresponding to any of the above embodiments, the present invention also provides an image enhancement system for enhancing anomaly detection capabilities.

[0083] refer to Figure 6 An image enhancement system for improving anomaly detection capabilities includes:

[0084] The grayscale processing module 601 is used to acquire the quality inspection image to be inspected, and to perform grayscale processing on the quality inspection image to obtain a first processed image;

[0085] The blurring module 602 is used to perform background blurring on the first processed image to obtain the second processed image;

[0086] The image enhancement module 603 is used to obtain an enhanced image based on the first processed image and the second processed image.

[0087] For ease of description, the above system is described by dividing it into various modules based on their functions. Of course, in implementing this invention, the functions of each module can be implemented in one or more software and / or hardware components.

[0088] The system described in the above embodiments is used to implement an image enhancement method for enhancing anomaly detection capability in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0089] Based on the same inventive concept, corresponding to the methods of any of the above embodiments, the present invention also provides an apparatus, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement an image enhancement method for enhancing anomaly detection capability as described in any of the above embodiments.

[0090] Figure 7 This embodiment illustrates a more specific hardware structure of a device, which may include a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, memory 1020, input / output interface 1030, and communication interface 1040 are interconnected internally via the bus 1050.

[0091] The processor 1010 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.

[0092] The memory 1020 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program code is stored in the memory 1020 and is called and executed by the processor 1010.

[0093] The input / output interface 1030 is used to connect input / output modules to realize information input and output. Input / output modules can be configured as components within the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Input devices may include keyboards, mice, touchscreens, microphones, various sensors, etc., while output devices may include displays, speakers, vibrators, indicator lights, etc.

[0094] The communication interface 1040 is used to connect a communication module (not shown in the figure) to enable communication between this device and other devices. The communication module can communicate via wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).

[0095] Bus 1050 includes a pathway for transmitting information between various components of the device, such as processor 1010, memory 1020, input / output interface 1030, and communication interface 1040.

[0096] It should be noted that although the above-described device only shows the processor 1010, memory 1020, input / output interface 1030, communication interface 1040, and bus 1050, in specific implementations, the device may also include other components necessary for normal operation. Furthermore, those skilled in the art will understand that the above-described device may only include the components necessary for implementing the embodiments of this specification, and not necessarily all the components shown in the figures.

[0097] The device described in the above embodiments is used to implement an image enhancement method for enhancing anomaly detection capability in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0098] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of the invention (including the claims) is limited to these examples; within the framework of the invention, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of the embodiments of the invention as described above, which are not provided in the details for the sake of brevity.

[0099] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process, and the scope of the preferred embodiments of the invention includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as will be understood by those skilled in the art to which embodiments of the invention pertain.

[0100] Additionally, to simplify the description and discussion, and to avoid obscuring the embodiments of the invention, the well-known power / ground connections to the integrated circuit (IC) chip and other components may or may not be shown in the provided drawings. Furthermore, systems may be illustrated in block diagram form to avoid obscuring the embodiments of the invention, and this also takes into account the fact that the details of implementation of these block diagram systems are highly dependent on the platform on which the embodiments of the invention will be implemented (i.e., these details should be fully understood by those skilled in the art). While specific details (e.g., circuits) have been set forth to describe exemplary embodiments of the invention, it will be apparent to those skilled in the art that the embodiments of the invention may be implemented without these specific details or with variations thereof. Therefore, these descriptions should be considered illustrative rather than restrictive.

[0101] Although the invention has been described in conjunction with specific embodiments thereof, many substitutions, modifications, and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may be used with the embodiments discussed.

[0102] The embodiments of this invention are intended to cover all such substitutions, modifications, and variations falling within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the embodiments of this invention should be included within the protection scope of this invention.

Claims

1. An image enhancement method for improving anomaly detection capabilities, characterized in that, include: Acquire the quality inspection image to be inspected, and perform grayscale processing on the quality inspection image to obtain the first processed image; The first processed image is subjected to background blurring to obtain the second processed image; An enhanced image is obtained based on the first processed image and the second processed image; The process of blurring the background of the first processed image to obtain the second processed image includes: The weights of each pixel in the first processed image are reset to obtain the second processed image; the second processed image is the background image. The second processed image and the first processed image are compared, and the second processed image in the first processed image is removed to obtain an enhanced image with the useless background removed. The step of resetting the weights of each pixel in the first processed image to obtain the second processed image includes: The weights are reset according to the following formula: , in, Represents a two-dimensional Gaussian function. Indicates standard deviation, This represents the x-coordinate of the current pixel. This represents the ordinate of the current pixel.

2. The image enhancement method for enhancing anomaly detection capability according to claim 1, characterized in that, The process of acquiring the quality inspection image to be inspected and performing grayscale processing on the quality inspection image to obtain a first processed image includes: The quality inspection image is converted into a grayscale image to obtain a quality inspection grayscale image; The grayscale image of the quality inspection is normalized to obtain a normalized image; Histogram equalization is performed on the normalized image to obtain the first processed image.

3. The image enhancement method for enhancing anomaly detection capability according to claim 2, characterized in that, The normalization process for the quality inspection grayscale image to obtain the normalized image includes: The quality inspection grayscale image is normalized according to the following formula: , in, This represents the normalization formula. Indicates the first 1 pixel This represents the minimum grayscale value in the quality inspection grayscale image. This represents the maximum grayscale value in the grayscale image used for quality inspection.

4. The image enhancement method for enhancing anomaly detection capability according to claim 2, characterized in that, The step of performing histogram equalization on the normalized image to obtain the first processed image includes: Histogram equalization is performed on the normalized image according to the following formula: , , , in, This represents the grayscale conversion formula. () represents the rounding function. Represents the cumulative distribution function of the image. Indicates the length of the normalized image. This represents the width of the normalized image. This represents the minimum value of the cumulative distribution function. Indicates the image bit depth. Represents grayscale value , Represents grayscale value , Indicates grayscale The probability of a pixel appearing. Indicates grayscale The probability of a pixel appearing. This indicates that the normalization process has been applied to all pixels in the image. Indicates grayscale The number of pixels.

5. An image enhancement system for enhancing anomaly detection capabilities, characterized in that, An image enhancement method for enhancing anomaly detection capability as described in claims 1-4 includes: The grayscale processing module is used to acquire the quality inspection image to be inspected, and to perform grayscale processing on the quality inspection image to obtain a first processed image; A blurring module is used to blur the background of the first processed image to obtain a second processed image; An image enhancement module is used to obtain an enhanced image based on the first processed image and the second processed image.

6. An image enhancement device for enhancing anomaly detection capabilities, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • System and method for dynamic background subtraction

    CA1185381A

  • Monitoring video-based video foreground extraction method

    CN106204636A