Image processing method and device, readable storage medium and electronic equipment
The image processing method addresses poor filtering in power equipment images by integrating bilateral filtering, color correction, and PSO optimization, resulting in high-quality denoised images with reduced noise and improved clarity.
Patent Information
- Application Number
- CN202411604459.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-12
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2044-11-12
AI Technical Summary
Current image processing methods for power equipment images suffer from poor filtering quality due to noise and environmental disturbances, leading to issues like halo and color distortion, which are not adequately addressed by existing filtering algorithms such as mean, median, and Gaussian filtering.
An image processing method combining bilateral filtering, color correction, and particle swarm optimization (PSO) algorithm to enhance and optimize power equipment images, involving color channel separation, bilateral filtering with incident component removal, color correction, and PSO-based optimization to achieve high-quality denoising.
The method effectively produces high-quality denoised images that meet the filtering requirements for power equipment images by reducing noise and preserving image details, as evidenced by improved metrics like MSE, PSNR, and SSIM.
Smart Images

Figure CN119151821A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of image processing and relates to an image processing method, and in particular to an image processing method, device, readable storage medium and electronic device. Background Art
[0002] In order to ensure the safe and stable operation of the power system, operation and maintenance personnel need to regularly evaluate and repair the power equipment in the station. Visible light images and infrared images are the two most common unstructured data in remote viewing and detection of power equipment. However, they are often accompanied by noise during image acquisition and signal transmission. They are often disturbed by illumination, aberration, and environmental factors, resulting in halo and color distortion, which brings many problems to the next stage of power equipment status assessment. The current algorithms for filtering images are generally completed through mean filtering, median filtering, Gaussian filtering, and guided filtering. The filtering quality of these algorithms is difficult to meet the high-quality filtering requirements required for power equipment images. Therefore, the current image processing methods have the problem of poor image filtering effect. Summary of the invention
[0003] The purpose of the present application is to provide an image processing method, device, readable storage medium and electronic device, which are used to solve the problem of poor image filtering effect existing in current image processing methods.
[0004] In a first aspect, the present application provides an image processing method, which includes: obtaining a noise image of an electric power device; performing color channel separation processing on the noise image to obtain three single-channel denoised images, wherein the denoised images are grayscale images; based on a preset filter radius, performing bilateral filtering processing on the image to be denoised to obtain an estimated incident component; based on the image to be denoised, removing the incident component to obtain an enhanced image; performing color correction processing on the enhanced image to obtain a color-corrected enhanced image; performing optimization processing on the color-corrected enhanced image through a particle swarm optimization algorithm to obtain an optimal denoised image, wherein the optimization parameters of the particle swarm optimization algorithm are the time domain standard deviation and the value domain standard deviation of the bilateral filtering processing, and the fitness function of the particle swarm optimization algorithm is a linear weighted function of brightness, contrast, naturalness, and clarity associated with the color-corrected enhanced image, and the optimal denoised image is composed of the three single-channel color-corrected enhanced images merged together.
[0005] In the image processing method, by combining bilateral filtering, image enhancement, color correction and particle swarm optimization algorithm of the noise image, a high-quality optimal denoised image can be obtained, thereby meeting the high-quality filtering requirements required for the power equipment image.
[0006] In one embodiment of the present application, a method for optimizing the color-corrected enhanced image by a particle swarm optimization algorithm to obtain an optimal denoised image includes: step S1, obtaining an initial particle swarm parameter value; step S2, obtaining a particle fitness value based on the color-corrected enhanced image, the fitness function and the initial particle swarm parameter value; step S3, updating the particle optimal value to obtain an updated particle optimal value; step S4, updating the particle position and the particle velocity to obtain an updated particle position and an updated particle velocity; step S5, determining whether a preset number of iterations has been reached, and if so, obtaining the optimal denoised image based on the updated particle optimal value, otherwise returning to step S2, wherein the particle position and the particle velocity in the initial particle swarm parameter value in step S2 are the updated particle position and the updated particle velocity, respectively.
[0007] In one embodiment of the present application, the particle optimal value includes a particle individual optimal value and a particle global optimal value. The particle optimal value is updated to obtain an updated particle optimal value. The implementation method includes: if the particle fitness value is greater than the historical individual optimal value, then obtaining the updated particle individual optimal value, and the updated particle individual optimal value is the position of the particle; if the particle fitness value is greater than the historical global optimal value, then obtaining the updated particle global optimal value, and the updated particle global optimal value is the position of the particle.
[0008] In one embodiment of the present application, the time domain standard deviation is expressed as: in, represents the spatial domain weighting coefficient of bilateral filtering, represents the horizontal coordinate of the center point of the pixel value in the image to be denoised, represents the ordinate of the center point of the pixel value in the image to be denoised, represents the horizontal coordinates of the neighboring points of the pixel values in the image to be denoised, represents the ordinate of the neighboring points of the pixel value in the image to be denoised, represents the time domain standard deviation, and the value domain standard deviation is expressed as: in, represents the range weighting coefficient of bilateral filtering, express For each pixel in the neighborhood, express For each pixel in the neighborhood, Represents the standard deviation of the value range.
[0009] In one embodiment of the present application, the enhanced image is represented as: in, represents the color restoration factor, represents the result of multi-scale enhancement of the image to be denoised, represents the enhanced image.
[0010] In one embodiment of the present application, the enhanced image after color correction is represented as: in, represents the enhanced image after the color correction, represents the gain factor, represents the enhanced image, Represents the coefficient of variation.
[0011] In one embodiment of the present application, the velocity and current position of the particle at time t+1 in the particle swarm optimization algorithm are respectively expressed as: in, represents the identity of the particle in the particle group, represents the velocity of the particle at time t+1, is the inertia factor, represents the velocity of the particle at time t, represents the first learning factor, Indicates between A random number between represents the optimal position of the individual found at time t, represents the current position of the particle at time t, represents the second learning factor, represents the global optimal position found at time t, Indicates the current position of the particle at time t+1.
[0012] In a second aspect, the present application provides an image processing device, which includes: a noise image acquisition module for acquiring a noise image of an electric power device; an image color separation module for performing color channel separation processing on the noise image to obtain three single-channel images to be denoised, wherein the images to be denoised are grayscale images; a bilateral filtering processing module for performing bilateral filtering processing on the images to be denoised based on a preset filtering radius to obtain an estimated incident component; an incident component removal module for removing the incident component based on the images to be denoised to obtain an enhanced image; and an image color correction module. , used for performing color correction processing on the enhanced image to obtain a color-corrected enhanced image; an image particle optimization module, used for performing optimization processing on the color-corrected enhanced image through a particle swarm optimization algorithm to obtain an optimal denoised image, wherein the optimization parameters of the particle swarm optimization algorithm are the time domain standard deviation and the range standard deviation of the bilateral filtering process, and the fitness function of the particle swarm optimization algorithm is a linear weighted function of brightness, contrast, naturalness, and clarity associated with the color-corrected enhanced image, and the optimal denoised image is composed of the three single-channel grayscale color-corrected enhanced images combined.
[0013] In a third aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the image processing method described in any one of the first aspects of the present application.
[0014] In a fourth aspect, the present application provides an electronic device, comprising: a memory storing a computer program; and a processor communicatively connected to the memory, for executing the image processing method described in any one of the first aspects of the present application when the computer program is called.
[0015] As described above, the image processing method, device, readable storage medium and electronic device of the present application have the following beneficial effects: In the image processing method, by combining bilateral filtering, image enhancement, color correction and particle swarm optimization algorithm of the noise image, a high-quality optimal denoised image can be obtained, thereby meeting the high-quality filtering requirements required for the power equipment image. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 Shown is a schematic diagram of the hardware structure for running the image processing method according to an embodiment of the present application.
[0017] Figure 2 Shown is a flowchart of an image processing method according to an embodiment of the present application.
[0018] Figure 3Shown is a flowchart of an implementation method of the present application for performing optimization processing on the color-corrected enhanced image by using a particle swarm optimization algorithm to obtain an optimal denoised image.
[0019] Figure 4 Shown is a flowchart of a method for updating the optimal value of a particle to obtain an updated optimal value of the particle in an embodiment of the present application.
[0020] Figure 5 Shown is the original image of the embodiment of this application.
[0021] Figure 6 The noise image described in the embodiment of the present application is displayed.
[0022] Figure 7 The image shown is the image after the noise image is mean filtered in the embodiment of the present application.
[0023] Figure 8 The image shown is the image after median filtering of the noise image in the embodiment of the present application.
[0024] Fig. 9 The image shown is the image after Gaussian filtering of the noise image in the embodiment of the present application.
[0025] Fig.10 Shown is an image obtained by guiding the filtering of the noise image in an embodiment of the present application.
[0026] Fig.11 The display is the optimal denoised image described in the embodiment of the present application.
[0027] Fig.12 Displayed is the grayscale histogram of the original image of the embodiment of the present application.
[0028] Fig.13 Shown is a grayscale histogram of a noise image according to an embodiment of the present application.
[0029] Fig.14 Shown is the optimal denoised image grayscale histogram of the embodiment of the present application.
[0030] Fig.15 Shown is the original image of the embodiment of this application.
[0031] Fig.16 The noise image described in the embodiment of the present application is displayed.
[0032] Fig.17 The image displayed is the image after the noise image mean filtering described in the embodiment of the present application.
[0033] Fig.18 The image shown is the image after median filtering of the noise image described in the embodiment of the present application.
[0034] Fig.19 The image displayed is the image after Gaussian filtering of the noise image described in the embodiment of the present application.
[0035] Fig. 20 The image shown is the image after the noise image guided filtering described in the embodiment of the present application.
[0036] Fig.21 The display is the optimal denoised image described in the embodiment of the present application.
[0037] Fig. 22 Displayed is the grayscale histogram of the original image of the embodiment of the present application.
[0038] Fig.23 Shown is a grayscale histogram of a noise image according to an embodiment of the present application.
[0039] Fig.24 Shown is the optimal denoised image grayscale histogram of the embodiment of the present application.
[0040] Fig.25 Shown is a schematic diagram of the structure of the image processing device described in an embodiment of the present application.
[0041] Component number description 10 computing device, 110 memory, 120 processor, 130 bus, 140 access device, 150 database, 200 image processing device, 210 noise image acquisition module, 220 image color separation module, 230 bilateral filtering processing module, 240 incident component removal module, 250 image color correction module, 260 image particle optimization module. DETAILED DESCRIPTION
[0042] The following describes the embodiments of the present application through specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0043] It should be noted that the illustrations provided in the following embodiments are only used to illustrate the basic concept of the present application in a schematic manner, and therefore the illustrations only show components related to the present application rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0044] The technical solutions in the embodiments of the present application are described in detail below in conjunction with the drawings in the embodiments of the present application.
[0045] The image processing method provided in the embodiment of the present application can be run in a computing device. Figure 1 For example, Figure 1 The hardware structure block diagram of the computing device for running the image processing method is shown in FIG. The computing device 10 includes but is not limited to a memory 110 and a processor 120. The processor 120 is connected to the memory 110 via a bus 130, and the database 150 is used to store data.
[0046] The computing device 10 also includes an access device 140 that enables the computing device 10 to communicate via one or more networks 160. Examples of these networks include a public switched telephone network, a local area network, a wide area network, a personal area network, or a combination of communication networks such as the Internet. The access device 140 may include any type of network interface, wired or wireless, for example, one or more of a network interface card, such as an IEEE 802.11 wireless LAN wireless interface, a World Wide Web Access interface, an Ethernet interface, a Universal Serial Bus interface, a cellular network interface, a Bluetooth interface, a near field communication interface, and the like.
[0047] In the embodiment of the present application, the above components of the computing device 10 and Figure 1 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 1 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of the present application. Those skilled in the art may add or replace other components as needed.
[0048] The computing device 10 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. The computing device 10 may also be a mobile or stationary server.
[0049] like Figure 2 As shown, this embodiment provides an image processing method, including: S11, obtaining a noise image of the power equipment.
[0050] Optionally, the electric power equipment may be a voltage transformer, a circuit breaker, etc. of a transformer substation, and the noise image is an image with noise.
[0051] S12, performing color channel separation processing on the noise image to obtain three single-channel images to be denoised, wherein the images to be denoised are grayscale images.
[0052] Optionally, if the noise image is a grayscale image, the grayscale image can be directly processed according to the method of S13-S15, which will not be described in detail in this embodiment.
[0053] Optionally, the color channel separation process refers to a process of dividing the RGB three-channel image into three single-channel grayscale images, which is not described in detail in this embodiment. The data type of the image to be denoised can be a double-precision floating point number, that is, a double type, and the three single channels in this embodiment can refer to three RGB single channels, that is, three color channels of red, green and blue.
[0054] S13, based on a preset filter radius, performing bilateral filtering on the image to be denoised to obtain an estimated incident component.
[0055] Optionally, the filter radius is the window size, and the preset filter radius can be flexibly set according to actual conditions, and this embodiment does not explicitly limit this. The estimated incident component can refer to the pixel value in the image to be denoised after bilateral filtering.
[0056] Optionally, the estimated incident component may be expressed as:
[0057] in, represents the estimated incident component, represents the spatial domain weighting coefficient of bilateral filtering, represents the range weighting coefficient of bilateral filtering, Indicates The neighborhood of the center, Represents each pixel in the neighborhood, Represents the normalization parameter.
[0058] in,
[0059] The time domain standard deviation is expressed as: in, represents the spatial domain weighting coefficient of bilateral filtering, represents the horizontal coordinate of the center point of the pixel value in the image to be denoised, represents the ordinate of the center point of the pixel value in the image to be denoised, represents the horizontal coordinates of the neighboring points of the pixel values in the image to be denoised, represents the ordinate of the neighboring points of the pixel value in the image to be denoised, represents the time domain standard deviation, and the value domain standard deviation is expressed as: in, represents the range weighting coefficient of bilateral filtering, express For each pixel in the neighborhood, express For each pixel in the neighborhood, Represents the standard deviation of the value range.
[0060] in, It can be expressed as:
[0061] in, It can be expressed as:
[0062] Among them, the performance of the bilateral filter is affected by three parameters: one is the size of the neighborhood r; the other is the standard deviation of the bilateral filter in the spatial domain , one is the standard deviation of the bilateral filter range Among them, the larger the neighborhood, the larger the scope involved in the calculation, and the more obvious the smoothing effect. and Then the attenuation speed of these two weighted coefficients is controlled, which affects the final filtering effect. The larger it is, the slower the Gaussian curve drops, the more obvious the Gaussian smoothing effect is, and the more blurred the image is. The larger it is, the more obvious the smoothing effect is, the more blurred the details are, and it tends to infinity. Then the bilateral filtering approximately degenerates into Gaussian filtering.
[0063] Gaussian filtering is a simple and commonly used noise reduction method. For an image, the pixel changes are small in the flat area, and using Gaussian filtering to reduce noise can have a significant improvement; but at the edge of the image, there will often be drastic changes in pixel values. Using Gaussian filtering will equally smooth the details such as the edge of the image that you want to retain with the noise, which is also called Gaussian smoothing, resulting in blurred edges, which is one of its most criticized shortcomings.
[0064] The classic Retinex algorithm assumes that the incident light is constant or changes slowly, that is, the incident light image corresponds to the low-frequency part of the image, and because of the slow change, an isotropic Gaussian filter is used to estimate the incident light image. However, in fact, the incident light image will produce mutations at the edge of the object, that is, the assumption is not true, which causes the classic Retinex algorithm to produce halo phenomenon and edge blur. Therefore, in order to solve this problem, a filter template with edge preservation is needed. Bilateral filtering is a weighted filtering method, which belongs to nonlinear filtering. The weighted average theory used is based on Gaussian distribution. The weight of bilateral filtering not only considers the Euclidean distance between the pixel and the center pixel in the spatial domain, but also considers the radiation difference in the pixel value domain, such as the similarity between the pixel and the center pixel in the convolution kernel, color intensity, depth distance, etc., which greatly reduces the edge loss and can retain more image information.
[0065] S14, based on the image to be denoised, removing the incident component to obtain an enhanced image.
[0066] Optionally, the enhanced image is represented as: in, represents the color restoration factor, represents the result of multi-scale enhancement of the image to be denoised, represents the enhanced image, The enhanced image under the i-th channel can be represented by The i in represents the i-th channel. The color restoration factor under the i-th channel can be represented by The i in the formula represents the i-th channel. Optionally, the result of multi-scale enhancement of the image to be denoised may be the result of multi-scale Retinex enhancement of the image to be denoised. Multi-scale Retinex enhancement refers to multi-scale image enhancement by the Retinex algorithm, which aims to simulate the perception of the human visual system and improve the visual effect of the image by adjusting the local contrast of the image. The word Retinex is composed of the two words Retina and Cortex. The Retinex model is based on the following three assumptions: a. The real world is colorless, and the colors we perceive are the result of the interaction between light and matter; b. Each color region is composed of three primary colors of red, green and blue of given wavelength; c. The three primary colors determine the color of each unit area.
[0067] The image observed by the human eye It can be regarded as the incident component and the reflected component Together, the incident light shines on the reflective object, and through the reflection of the reflective object, the reflected light enters the human eye. The core of the Retinex algorithm is to reduce the incident , enhance the reflective properties of objects Retinex algorithms generally include single-scale SSR, multi-scale MSR, and MSRCR.
[0068] In SSR, the purpose of reducing the incident properties and enhancing the reflective properties is mainly achieved by calculating the average value of the pixel at any point in the image and the pixels around it. The specific method is to select a suitable Gaussian template , for the original image A convolution operation is performed to obtain a low-pass filtered image after the Gaussian kernel low-pass filtering process.
[0069] Optionally,
[0070] in, represents the image to be denoised of the i-th channel, represents the center-surround function, N is the number of scales, Represents the weight of each scale, which can generally be , The output is represented as an image in the logarithmic domain.
[0071] The image to be denoised can be regarded as composed of incident components and the reflected component Together, they can be expressed as: in, represents the incident component of the image to be denoised. In this embodiment, the incident component may be the estimated incident component described above. represents the reflection component of the image to be denoised.
[0072] Taking the logarithm of both sides of the equation can be expressed as:
[0073] Depend on Convolution with kernel function is approximated as:
[0074] in, That is, it represents the kernel function.
[0075] Finally, you can Quantized to pixel values in the range 0-255:
[0076]
[0077] in, express The pixel value of express The minimum pixel value in express The maximum pixel value in represents the incident component of the image to be denoised under the i-th channel, represents the weight of the i-th channel, and The i in represents the i-th channel.
[0078] S15, performing color correction processing on the enhanced image to obtain a color-corrected enhanced image.
[0079] Optionally, the enhanced image after color correction is expressed as: in, represents the enhanced image after the color correction, represents the gain factor, represents the enhanced image, Represents the coefficient of variation. It can be further expressed as the enhanced image after color correction under the i-th channel, The i in represents the i-th channel.
[0080] in,
[0081]
[0082] in,
[0083]
[0084] in, represents the denoised image of the i-th channel, f\left [ {{I}^{,}_{i}\left ( {x,y} \right )} \right ] Represents the mapping function of the color space, Indicates the number of channels. In this embodiment It can be 3, represents the controlled nonlinear intensity, i.e. The constant value of express The constant value of , that is, the constant value of the deviation coefficient.
[0085] Optionally, the above , , and The value of can be flexibly set according to actual conditions, and this embodiment does not explicitly limit this. , , and The values can be 125, 46, 192, -30 respectively.
[0086] S16, performing optimization processing on the color-corrected enhanced image by a particle swarm optimization algorithm to obtain an optimal denoised image, wherein the optimization parameters of the particle swarm optimization algorithm are the time domain standard deviation and the range standard deviation of the bilateral filtering process, and the fitness function of the particle swarm optimization algorithm is a linear weighted function of brightness, contrast, naturalness, and clarity between the color-corrected enhanced image and the noise image, and the optimal denoised image is composed of the three single-channel grayscale color-corrected enhanced images combined.
[0087] Optionally, the dimension of particles in the particle group is 2.
[0088] Optionally, the velocity and current position of the particle at time t+1 in the particle swarm optimization algorithm can be expressed as: in, represents the identity of the particle in the particle group, represents the velocity of the particle at time t+1, is the inertia factor, represents the velocity of the particle at time t, represents the first learning factor, Indicates between A random number between represents the optimal position of the individual found at time t, represents the current position of the particle at time t, represents the second learning factor, represents the global optimal position found at time t, Indicates the current position of the particle at time t+1. The first learning factor, the second learning factor and the inertia weight can be flexibly set according to actual conditions, and this embodiment does not explicitly limit this.
[0089] Optionally, the fitness function can be expressed as:
[0090] in, represents the function associated with the color-corrected enhanced image under the i-th metric, represents a brightness function associated with the color-corrected enhanced image, represents a contrast function associated with the color-corrected enhanced image, represents a naturalness function associated with the color-corrected enhanced image, represents a sharpness function associated with the color-corrected enhanced image, represents the weight of the ith metric, which can be flexibly set according to actual conditions, and this embodiment does not explicitly limit this. In this embodiment, the weight of each metric can be set to 0.25, It can be expressed as:
[0091] in, represents the noise image, It can represent a denoised image, which can be composed of three single-channel color-corrected enhanced images. represents the mean value of the denoised image, represents the mean value of the noise image, It can be expressed as:
[0092] in, is the length of the noise image, is the width of the noise image, represents the enhanced image after color correction of a single channel, represents the edge image calculated according to the Sobel operator, Represents a Sobel edge image The sum of pixel intensities, represents the number of edge pixels about the edge image, is the entropy based on the histogram. The calculation process of the edge image calculated based on the Sobel operator is not repeated in this embodiment to save the space of this specification, and can be expressed as:
[0093]
[0094] in, Indicates the probability of image value i appearing. For naturalness, the color preservation effect of image enhancement is expressed by calculating the relative brightness order difference of the image. It can be expressed as:
[0095]
[0096]
[0097]
[0098]
[0099] in, Represents each pixel in the noise image The maximum value of the three RGB channels, Represents each pixel in the enhanced image after color correction The maximum value of the three RGB channels, is the exclusive OR operator, Represents each pixel The corresponding relative brightness order difference is Represents each pixel of the image to be denoised , that is, each pixel of the noisy image under a single channel , Each pixel of the enhanced image after color correction is represented by . It can be expressed as:
[0100] in, Right now Each pixel of the color-corrected enhanced image can be represented by , Right now represents the mean value of the enhanced image after color correction.
[0101] Optionally, the optimal denoised image refers to an RGB three-channel image obtained by merging three single-channel grayscale color-corrected enhanced images.
[0102] According to the above description, the image processing method described in this embodiment includes: obtaining a noise image of the power equipment; performing color channel separation processing on the noise image to obtain three single-channel grayscale denoising images, and the images to be denoised are grayscale images; based on a preset filter radius, performing bilateral filtering processing on the image to be denoised to obtain an estimated incident component; based on the image to be denoised, removing the incident component to obtain an enhanced image; performing color correction processing on the enhanced image to obtain a color-corrected enhanced image; performing optimization processing on the color-corrected enhanced image through a particle swarm optimization algorithm to obtain an optimal denoised image, the optimization parameters of the particle swarm optimization algorithm are the time domain standard deviation and the value domain standard deviation of the bilateral filtering processing, the fitness function of the particle swarm optimization algorithm is a linear weighted function of brightness, contrast, naturalness, and clarity associated with the color-corrected enhanced image, and the optimal denoised image is composed of the three single-channel grayscale color-corrected enhanced images merged.
[0103] In the image processing method, by combining bilateral filtering, image enhancement, color correction and particle swarm optimization algorithm of the noise image, a high-quality optimal denoised image can be obtained, thereby meeting the high-quality filtering requirements required for the power equipment image.
[0104] See also Figure 3 ,like Figure 3 As shown, this embodiment provides a method for optimizing the enhanced image after color correction by using a particle swarm optimization algorithm to obtain an optimal denoised image, including: Step S1, obtaining initial particle swarm parameter values.
[0105] Optionally, the initial particle swarm parameter value refers to the initialized particle swarm parameter value, which may include population size, preset number of iterations, particle position, particle speed, inertia weight, learning factor and wait.
[0106] Step S2, obtaining a particle fitness value based on the color-corrected enhanced image, the fitness function and the initial particle swarm parameter value.
[0107] Step S3, updating the particle optimal value to obtain an updated particle optimal value.
[0108] Step S4, updating the particle position and particle velocity to obtain an updated particle position and an updated particle velocity.
[0109] Step S5, determining whether the preset number of iterations has been reached, if so, obtaining the optimal denoised image based on the updated optimal particle value, otherwise returning to step S2, where the particle position and particle velocity in the initial particle swarm parameter value in step S2 are the updated particle position and the updated particle velocity, respectively.
[0110] See also Figure 4 , the particle optimal value includes the particle individual optimal value and the particle global optimal value, such as Figure 4 As shown, the method for updating the particle optimal value to obtain the updated particle optimal value includes: S21, if the fitness value of the particle is greater than the historical individual optimal value, then obtaining an updated individual optimal value of the particle, wherein the updated individual optimal value of the particle is the position of the particle.
[0111] S22, if the fitness value of the particle is greater than the historical global optimal value, then obtaining an updated global optimal value of the particle, where the updated global optimal value of the particle is the position of the particle.
[0112] In one embodiment of the present application, please refer to Figures 5 to 11 The noise image is an image obtained by adding Gaussian noise with a variance of 0.01 to the original image. The original image is a group of voltage transformer photos of a 500kV substation. The noise image is denoised by using the image processing method, and four traditional methods, including mean filtering, median filtering of [3 3] filter window, Gaussian filtering, and guided filtering, are used for comparative verification.
[0113] This embodiment adopts Figure 2 The image processing method shown in the figure denoises the noisy image and compares its performance with the mean filtering algorithm, the median filtering algorithm, the Gaussian filtering algorithm, and the guided filtering algorithm. The noisy image includes Gaussian noise with a variance of 0.01. The grayscale histogram of the original image, the grayscale histogram of the noisy image, and the grayscale histogram of the optimal denoised image can be compared with the grayscale histogram of the original image, the grayscale histogram of the noisy image, and the grayscale histogram of the optimal denoised image. Figure 12-14 , the denoising effect can be shown in Table 1 below: MSE PSNR SSIM Mean Filter 40.3666 32.0706 0.68042 Median Filter 46.68 31.4395 0.64599 Gaussian filtering 56.826 30.5853 0.56611 Guided Filtering 28.6988 33.5522 0.74764 The image processing method 0.0024261 74.2817 0.78015 In one embodiment of the application, please refer to Figures 15 to 21 The noise image is an image obtained by adding salt and pepper noise with a density of 0.01 to a group of circuit breaker photos of a 500kV substation. The noise image is denoised by the image processing method, and four traditional methods, including mean filtering, median filtering of [3 3] filter window, Gaussian filtering, and guided filtering, are used for comparative verification.
[0114] This embodiment will also Figure 2The image processing method shown in the figure compares the denoising effect of adding salt and pepper noise with a density of 0.01 with the mean filter algorithm, median filter algorithm, Gaussian filter algorithm, and guided filter algorithm. The grayscale histogram of the original image, the grayscale histogram of the noisy image, and the grayscale histogram of the optimal denoised image can be found in Figure 22-24 , the denoising effect can be shown in Table 2 below: MSE PSNR SSIM Mean Filter 10.2621 38.0185 0.82677 Median Filter 5.9787 40.3647 0.8667 Gaussian filtering 27.288 33.7711 0.4671 Guided Filtering 17.6089 35.6735 0.81415 The image processing method 0.0011518 77.5171 0.97831 Among them, mean square error (MSE), peak signal-to-noise ratio (PSNR), and structural similarity (SSIM) are three commonly used indicators for evaluating image results. MSE is the mean square error between the original image and the processed image. To a certain extent, it can be used to measure the degree of difference between the original image and the enhanced image, that is, to evaluate the contrast of the image. The smaller the value, the better the accuracy of the experimental data, the higher the image contrast, and the better the quality.
[0115] Alternatively, the mean square error can be expressed as:
[0116] in, is the image height, is the image width, is the gray value of the pixel at the i-th row and j-th column of the noise image, is the grayscale value of the pixel in the i-th row and j-th column of the optimal denoised image.
[0117] Alternatively, PSNR is the most commonly used objective observation method for evaluating image quality. It is generally used in an engineering project between the maximum signal and the background noise. The larger the PSNR value between two images, the better the denoising effect and the more similar the images are. The peak signal-to-noise ratio can be expressed as:
[0118] Where n is the number of bits per pixel, MSE is the mean square error between the original image and the processed image, represents the peak signal-to-noise ratio.
[0119] SSIM indicates the similarity between the actual image and the predicted image. It ranges from 0 to 1, and the closer to 1 the better. The larger the value, the smaller the image distortion. Its definition is:
[0120] in, for The average value of for The average value of for The variance of for The variance of for and The covariance of and is the image quality index. In this implementation In The noise image can be represented by The optimal denoised image may be represented by .
[0121] The protection scope of the image processing method described in the embodiment of the present application is not limited to the execution order of the steps listed in the present embodiment. All solutions implemented by adding, reducing or replacing steps in the prior art based on the principles of the present application are included in the protection scope of the present application.
[0122] See also Fig.25 ,like Fig.25 As shown, this embodiment provides an image processing device 200, and the image processing device 200 includes: The noise image acquisition module 210 is used to acquire the noise image of the power equipment.
[0123] The image color separation module 220 is used to perform color channel separation processing on the noisy image to obtain three single-channel images to be denoised, and the images to be denoised are grayscale images.
[0124] The bilateral filtering processing module 230 is used to perform bilateral filtering on the image to be denoised based on a preset filtering radius. To obtain the estimated incident component.
[0125] The incident component removal module 240 is used to remove the incident component based on the image to be denoised to obtain an enhanced image.
[0126] The image color correction module 250 is used to perform color correction processing on the enhanced image to obtain a color-corrected enhanced image.
[0127] The image particle optimization module 260 is used to optimize the color-corrected enhanced image through a particle swarm optimization algorithm to obtain an optimal denoised image. The optimization parameters of the particle swarm optimization algorithm are the time domain standard deviation and the range standard deviation of the bilateral filtering process. The fitness function of the particle swarm optimization algorithm is a linear weighted function of the brightness, contrast, naturalness, and clarity between the color-corrected enhanced image and the noise image. The optimal denoised image is composed of the three single-channel grayscale color-corrected enhanced images combined.
[0128] In the image processing device 200 provided in this embodiment, the noise image acquisition module 210 and Figure 2The image color separation module 220 corresponds to step S11 of the image processing method shown in FIG. Figure 2 The bilateral filtering processing module 230 corresponds to step S12 of the image processing method shown in FIG. Figure 2 The incident component removal module 240 corresponds to step S13 of the image processing method shown in FIG. Figure 2 The image color correction module 250 corresponds to step S14 of the image processing method shown in FIG. Figure 2 The image processing method shown in FIG. 1 corresponds to step S15, wherein the image particle optimization module 260 is Figure 2 This corresponds to step S16 of the image processing method shown.
[0129] In the several embodiments provided in the present application, it should be understood that the disclosed device or method can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of modules / units is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or units can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules or units, which can be electrical, mechanical or other forms.
[0130] The modules / units described as separate components may or may not be physically separated, and the components displayed as modules / units may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules / units may be selected according to actual needs to achieve the purpose of the embodiments of the present application. For example, the functional modules / units in the various embodiments of the present application may be integrated into one processing module, or each module / unit may exist physically separately, or two or more modules / units may be integrated into one module / unit.
[0131] Those of ordinary skill in the art should further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0132] This embodiment provides an electronic device, the electronic device comprising a memory storing a computer program; a processor connected to the memory for communication, and executing the computer program when the computer program is called. Figure 2 The image processing method shown.
[0133] The embodiment of the present application also provides a computer-readable storage medium. A person of ordinary skill in the art can understand that all or part of the steps in the method for implementing the above embodiment can be completed by instructing the processor through a program, and the program can be stored in a computer-readable storage medium, and the storage medium is a non-transitory medium, such as a random access memory, a read-only memory, a flash memory, a hard disk, a solid-state hard disk, a magnetic tape, a floppy disk, an optical disc, and any combination thereof. The above storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or a data center that includes one or more available media integrated. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a tape), an optical medium (for example, a digital video disc (DVD)), or a semiconductor medium (for example, a solid-state disk (SSD)), etc.
[0134] The embodiment of the present application may also provide a computer program product, which includes one or more computer instructions. When the computer instructions are loaded and executed on a computing device, the process or function described in the embodiment of the present application is generated in whole or in part. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer or data center to another website, computer or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means.
[0135] When the computer program product is executed by a computer, the computer executes the method described in the above method embodiment. The computer program product may be a software installation package, and when the above method is required, the computer program product may be downloaded and executed on a computer.
[0136] The descriptions of the processes or structures corresponding to the above-mentioned figures have different emphases. For parts that are not described in detail in a certain process or structure, please refer to the relevant descriptions of other processes or structures.
[0137] The above embodiments are merely illustrative of the principles and effects of the present application and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.
Claims
1. An image processing method, characterized in that: include: Obtain noise images of power equipment; Performing color channel separation processing on the noise image to obtain three single-channel denoised images, wherein the denoised images are grayscale images; Based on a preset filter radius, performing bilateral filtering on the image to be denoised to obtain an estimated incident component; Based on the image to be denoised, removing the incident component to obtain an enhanced image; Performing color correction processing on the enhanced image to obtain a color-corrected enhanced image; The color-corrected enhanced image is optimized by a particle swarm optimization algorithm to obtain an optimal denoised image. The optimization parameters of the particle swarm optimization algorithm are the time domain standard deviation and the range standard deviation of the bilateral filtering process. The fitness function of the particle swarm optimization algorithm is a linear weighted function of brightness, contrast, naturalness, and clarity associated with the color-corrected enhanced image. The optimal denoised image is composed of the three single-channel color-corrected enhanced images combined.
2. The image processing method according to claim 1, characterized in that: The method for optimizing the enhanced image after color correction by using a particle swarm optimization algorithm to obtain an optimal denoised image includes: Step S1, obtaining the initial particle swarm parameter value; Step S2, obtaining a particle fitness value based on the color-corrected enhanced image, the fitness function and the initial particle swarm parameter value; Step S3, updating the particle optimal value to obtain an updated particle optimal value; Step S4, updating the particle position and the particle velocity to obtain an updated particle position and an updated particle velocity; Step S5, determining whether the preset number of iterations has been reached, if so, obtaining the optimal denoised image based on the updated optimal particle value, otherwise returning to step S2, where the particle position and particle velocity in the initial particle swarm parameter value in step S2 are the updated particle position and the updated particle velocity, respectively.
3. The image processing method according to claim 2, characterized in that: The particle optimal value includes the particle individual optimal value and the particle global optimal value. The particle optimal value is updated to obtain the updated particle optimal value. The implementation method includes: If the fitness value of the particle is greater than the historical individual optimal value, then obtaining an updated individual optimal value of the particle, wherein the updated individual optimal value of the particle is the position of the particle; If the fitness value of the particle is greater than the historical global optimal value, an updated global optimal value of the particle is obtained, and the updated global optimal value of the particle is the position of the particle.
4. The image processing method according to claim 1, characterized in that: The time domain standard deviation is expressed as: in, represents the spatial domain weighting coefficient of bilateral filtering, represents the horizontal coordinate of the center point of the pixel value in the image to be denoised, represents the ordinate of the center point of the pixel value in the image to be denoised, represents the horizontal coordinates of the neighboring points of the pixel values in the image to be denoised, represents the ordinate of the neighboring points of the pixel value in the image to be denoised, represents the time domain standard deviation, and the value domain standard deviation is expressed as: in, represents the range weighting coefficient of bilateral filtering, express For each pixel in the neighborhood, express For each pixel in the neighborhood, Represents the standard deviation of the value range.
5. The image processing method according to claim 1, characterized in that: The enhanced image is represented as: in, represents the color restoration factor, represents the result of multi-scale enhancement of the image to be denoised, represents the enhanced image.
6. The image processing method according to claim 1, characterized in that: The enhanced image after color correction is expressed as: in, represents the enhanced image after the color correction, represents the gain factor, represents the enhanced image, Represents the coefficient of variation.
7. The image processing method according to claim 1, characterized in that: The velocity and current position of the particle at time t+1 in the particle swarm optimization algorithm are expressed as: in, represents the identity of the particle in the particle group, represents the velocity of the particle at time t+1, is the inertia factor, represents the velocity of the particle at time t, represents the first learning factor, Indicates between A random number between represents the optimal position of the individual found at time t, represents the current position of the particle at time t, represents the second learning factor, represents the global optimal position found at time t, Indicates the current position of the particle at time t+1.
8. An image processing device, characterized in that: The image processing device comprises: A noise image acquisition module, used for acquiring a noise image of the electric power equipment; An image color separation module is used to perform color channel separation processing on the noise image to obtain three single-channel grayscale images to be denoised, wherein the images to be denoised are grayscale images; A bilateral filtering processing module, used for performing bilateral filtering on the image to be denoised based on a preset filtering radius to obtain an estimated incident component; An incident component removal module, used for removing the incident component based on the image to be denoised, so as to obtain an enhanced image; An image color correction module, used for performing color correction processing on the enhanced image to obtain a color-corrected enhanced image; The image particle optimization module is used to optimize the color-corrected enhanced image through a particle swarm optimization algorithm to obtain an optimal denoised image. The optimization parameters of the particle swarm optimization algorithm are the time domain standard deviation and the range standard deviation of the bilateral filtering process. The fitness function of the particle swarm optimization algorithm is a linear weighted function of brightness, contrast, naturalness, and clarity associated with the color-corrected enhanced image. The optimal denoised image is composed of the three single-channel grayscale color-corrected enhanced images combined.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the image processing method according to any one of claims 1 to 7 is implemented.
10. An electronic device, characterized in that: The electronic device comprises: A memory storing a computer program; A processor is communicatively connected to the memory, and executes the image processing method according to any one of claims 1 to 7 when calling the computer program.
Citation Information
Patent Citations
Bivariate nonlocal average filtering de-noising method for X-ray image
CN102609904A
Wavelet transform, multi-strategy PSO (particle swarm optimization) and SVM (support vector machine) integrated based remote sensing image classification method
CN104732244A
Image enhancement method and system based on adaptive color correction and guided filtering
CN117252773A
Fruit image segmentation method based on color features and depth information
CN118429366A
Image processing method and apparatus for correcting photographic images
US20040184672A1
