Image Processing Method, Apparatus, Readable Storage Medium, and Electronic Device

Through the combination of color channel separation, bilateral filtering, image enhancement and particle swarm optimization algorithms in the image processing method, the problem of poor image filtering effect of power equipment is solved, high-quality image filtering effect is achieved, and the clarity and accuracy of the image are improved.

CN119151821BActive Publication Date: 2025-07-08SHANGHAI INVESTIGATION DESIGN & RES INST CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411604459.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-12
Publication Date
2025-07-08
Estimated Expiration
2044-11-12

AI Technical Summary

Technical Problem

The existing image processing methods are not effective in image filtering of power equipment and are difficult to meet the requirements of high-quality filtering, especially in the interference of light, aberration and environmental factors, halo and color distortion.

Method used

The image processing methods include color channel separation, bilateral filtering, image enhancement, color correction and particle swarm optimization algorithms. By acquiring noise images, bilateral filtering processing, removing incident components, performing color correction, and using particle swarm optimization algorithm to find the best denoising image.

Benefits of technology

It realizes high-quality image filtering effect, meets the high-quality filtering requirements of power equipment images, reduces halo and edge blur, and improves the clarity and accuracy of the image.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119151821B_ABST
    Figure CN119151821B_ABST
Patent Text Reader

Abstract

The present application provides an image processing method, apparatus, readable storage medium and electronic device, belonging to the field of image processing. The image processing method includes: obtaining a noisy image of a power device; performing color channel separation processing on the noisy image to obtain three single-channel images to be denoised; performing bilateral filtering processing on the images to be denoised based on a preset filtering radius to obtain an estimated incident component; removing the incident component based on the images to be denoised to obtain an enhanced image; performing color correction processing on the enhanced image to obtain an enhanced image after color correction; and performing optimization processing on the enhanced image after color correction through a particle swarm optimization algorithm to obtain an optimal denoised image. The image processing method can obtain a high-quality optimal denoised image, thereby meeting the high-quality filtering requirements for power device images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of image processing, and relates to an image processing method, in particular to an image processing method, device, readable storage medium and electronic device. Background Art

[0002] To ensure the safe and stable operation requirements of the power system, operation and maintenance personnel need to regularly conduct status assessment and maintenance work on power equipment in the substation. Visible light images and infrared images are two of the most common unstructured data in the remote monitoring and detection of power equipment. However, noise often accompanies the image acquisition and signal transmission processes, and they are often affected by factors such as illumination, aberration, and environmental factors, resulting in phenomena such as halos and color distortion, which bring many problems to the next-stage power equipment status assessment work. Currently, the algorithms for filtering images generally complete the filtering 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 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 this 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 the current image processing methods.

[0004] In a first aspect, this application provides an image processing method, which includes: acquiring a noisy image of a power equipment; performing 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; based on a preset filtering radius, performing bilateral filtering processing on the images to be denoised to obtain an estimated incident component; based on the images to be denoised, performing removal processing on the incident component to obtain an enhanced image; performing color correction processing on the enhanced image to obtain an enhanced image after color correction; performing optimization processing on the enhanced image after color correction through a particle swarm optimization algorithm to obtain an optimal denoised image, where the optimization parameters of the particle swarm optimization algorithm are the time-domain standard deviation and range 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 sharpness associated with the enhanced image after color correction, and the optimal denoised image is composed of the enhanced images after color correction of the three single channels.

[0005] In the image processing method, by combining bilateral filtering, image enhancement, color correction, and particle swarm optimization algorithm of the noisy image, a high-quality optimal denoised image can be obtained, so as to meet the high-quality filtering requirements for power equipment images.

[0006] In an embodiment of the present application, the implementation method for optimizing the color-corrected enhanced image through the particle swarm optimization algorithm to obtain the optimal denoised image includes: Step S1, obtaining the initial particle swarm parameter values; Step S2, obtaining the particle fitness values based on the color-corrected enhanced image, the fitness function, and the initial particle swarm parameter values; Step S3, updating the particle optimal values to obtain the updated particle optimal values; Step S4, updating the particle positions and particle velocities to obtain the updated particle positions and the updated particle velocities; Step S5, determining whether the preset number of iterations is reached. If so, obtaining the optimal denoised image based on the updated particle optimal values, otherwise returning to Step S2, where the particle positions and particle velocities in the initial particle swarm parameter values in Step S2 are respectively the updated particle positions and the updated particle velocities.

[0007] In an embodiment of the present application, the particle optimal values include particle individual optimal values and particle global optimal values. The implementation method for updating the particle optimal values to obtain the updated particle optimal values includes: If the particle fitness value is greater than the historical individual optimal value, obtaining the updated particle individual optimal value, where 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, obtaining the updated particle global optimal value, where the updated particle global optimal value is the position of the particle.

[0008] In an embodiment of the present application, the time-domain standard deviation is expressed as:

[0009]

[0010] where represents the spatial-domain weighting coefficient of bilateral filtering, represents the abscissa of the central point of the pixel value in the image to be denoised, represents the ordinate of the central point of the pixel value in the image to be denoised, represents the abscissa of the neighboring point of the pixel value in the image to be denoised, represents the ordinate of the neighboring point of the pixel value in the image to be denoised, represents the time-domain standard deviation, and the range-domain standard deviation is expressed as:

[0011]

[0012] where represents the range-domain weighting coefficient of bilateral filtering, represents each pixel point in the neighborhood, represents each pixel point in the neighborhood, Represents the standard deviation of the value range.

[0013] In an embodiment of the present application, the enhanced image is represented as:

[0014]

[0015] Wherein, Represents the color restoration factor, Represents the result after multi-scale enhancement of the image to be denoised, Represents the enhanced image.

[0016] In an embodiment of the present application, the enhanced image after color correction is represented as:

[0017]

[0018] Wherein, Represents the enhanced image after color correction, Represents the gain coefficient, Represents the enhanced image, Represents the deviation coefficient.

[0019] In an embodiment of the present application, the velocity and the current position of the particle at the (t + 1)-th moment in the particle swarm optimization algorithm are respectively represented as:

[0020]

[0021]

[0022] Wherein, Represents the identification of the particle in the particle swarm, Represents the velocity of the particle at the (t + 1)-th moment, Is the inertia factor, Represents the velocity of the particle at the t-th moment, Represents the first learning factor, Represents between The random number between, Represents the individual optimal position found at the t-th moment, Represents the current position of the particle at the t-th moment, Represents the second learning factor, Represents the global optimal position found at the t-th moment, Represents the current position of the particle at the (t + 1)-th moment.

[0023] Second aspect, the present application provides an image processing apparatus, the image processing apparatus comprising: a noise image acquisition module for acquiring a noise image of a 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, the images to be denoised being 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; an image color correction module for performing color correction processing on the enhanced image to obtain an enhanced image after color correction; an image particle optimization module for performing optimization processing on the enhanced image after color correction through a particle swarm optimization algorithm to obtain an optimal denoised image, the optimization parameters of the particle swarm optimization algorithm being the time domain standard deviation and the range standard deviation of the bilateral filtering processing, the fitness function of the particle swarm optimization algorithm being a linear weighted function of brightness, contrast, naturalness, and sharpness associated with the enhanced image after color correction, the optimal denoised image being composed of the three single-channel grayscale enhanced images after color correction.

[0024] Third aspect, the present application provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the image processing method according to any one of the first aspect of the present application.

[0025] Fourth aspect, the present application provides an electronic device, the electronic device comprising: a memory storing a computer program; a processor communicatively connected to the memory and, when calling the computer program, executing the image processing method according to any one of the first aspect of the present application.

[0026] As described above, the image processing method, apparatus, readable storage medium, and electronic device of the present application have the following beneficial effects:

[0027] 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 of the power device image. Description of the Drawings

[0028] Figure 1 It shows a schematic hardware structure diagram for running the image processing method in an embodiment of the present application.

[0029] Figure 2 It shows a flowchart of the image processing method in an embodiment of the present application.

[0030] Figure 3It shows a flowchart of the implementation method for the present application embodiment to optimize the enhanced image after color correction through the particle swarm optimization algorithm to obtain the optimal denoised image.

[0031] Figure 4 It shows a flowchart of the implementation method for the present application embodiment to update the particle optimal value to obtain the updated particle optimal value.

[0032] Figure 5 It shows the original image of the present application embodiment.

[0033] Figure 6 It shows the noise image of the present application embodiment.

[0034] Figure 7 It shows the image after mean filtering of the noise image in the present application embodiment.

[0035] Figure 8 It shows the image after median filtering of the noise image in the present application embodiment.

[0036] Figure 9 It shows the image after Gaussian filtering of the noise image in the present application embodiment.

[0037] Figure 10 It shows the image after guided filtering of the noise image in the present application embodiment.

[0038] Figure 11 It shows the optimal denoised image of the present application embodiment.

[0039] Figure 12 It shows the gray histogram of the original image in the present application embodiment.

[0040] Figure 13 It shows the gray histogram of the noise image in the present application embodiment.

[0041] Figure 14 It shows the gray histogram of the optimal denoised image in the present application embodiment.

[0042] Figure 15 It shows the original image of the present application embodiment.

[0043] Figure 16 It shows the noise image of the present application embodiment.

[0044] Figure 17 It shows the image after mean filtering of the noise image in the present application embodiment.

[0045] Figure 18 It shows the image after median filtering of the noise image in the present application embodiment.

[0046] Figure 19 It shows the image after Gaussian filtering of the noise image described in the embodiment of the present application.

[0047] Figure 20 It shows the image after guided filtering of the noise image described in the embodiment of the present application.

[0048] Figure 21 It shows the optimal denoised image described in the embodiment of the present application.

[0049] Figure 22 It shows the grayscale histogram of the original image in the embodiment of the present application.

[0050] Figure 23 It shows the grayscale histogram of the noise image in the embodiment of the present application.

[0051] Figure 24 It shows the grayscale histogram of the optimal denoised image in the embodiment of the present application.

[0052] Figure 25 It shows the structural schematic diagram of the image processing device described in the embodiment of the present application.

[0053] Description of component labels

[0054] 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 implementation manners

[0055] The following uses specific specific examples to illustrate the implementation manners of the present application. Those skilled in the art can easily understand other advantages and effects of the present application from the content disclosed in this specification. The present application can also be implemented or applied through other different specific implementation manners. Various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that, without conflict, the following embodiments and the features in the embodiments can be combined with each other.

[0056] It should be noted that the diagrams provided in the following embodiments only illustrate the basic concept of the present application in a schematic manner. Therefore, only the components related to the present application are shown in the diagrams, rather than being drawn according to the number, shape, and size of the components in actual implementation. The type, quantity, and ratio of each component in actual implementation can be arbitrarily changed, and the component layout type may also be more complex.

[0057] The following describes in detail the technical solutions in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application.

[0058] The image processing method provided by the embodiments of the present application can run on a computing device. Taking Figure 1 as an example, Figure 1 FIG. 1 is a block diagram of the hardware structure of a computing device for running the image processing method. 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 through a bus 130, and the database 150 is used to store data.

[0059] The computing device 10 further includes an access device 140, and the access device 140 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 wired or wireless network interface, for example, one or more of network interface cards, such as an IEEE802.11 wireless local area network wireless interface, a Worldwide Interoperability for Microwave 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.

[0060] In the embodiments of the present application, the above components of the computing device 10 and Figure 1 other components not shown in FIG. 1 may also be connected to each other, for example, through a bus. It should be understood that Figure 1 the block diagram of the computing device structure shown in FIG. 1 is only for illustrative purposes and is not a limitation on the scope of the present application. Those skilled in the art can add or replace other components as needed.

[0061] The computing device 10 can be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (for example, a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (for example, a smart phone), a wearable computing device (for example, a smart watch, smart glasses, etc.) or other types of mobile devices, or a stationary computing device such as a desktop computer or a PC. The computing device 10 can also be a mobile or stationary server.

[0062] As shown in Figure 2 FIG. 2, this embodiment provides an image processing method, including:

[0063] S11, obtaining a noise image of a power device.

[0064] Optionally, the power device may be a voltage transformer, a circuit breaker, etc. of a substation, and the noise image is an image with noise.

[0065] S12. Perform color channel separation processing on the noise image to obtain three single-channel images to be denoised, where the images to be denoised are grayscale images.

[0066] Optionally, if the noise image is a grayscale image, the grayscale image can be directly processed according to the methods of S13 - S15, and this embodiment will not elaborate on this.

[0067] Optionally, color channel separation processing refers to a process of dividing an RGB three-channel image into 3 single-channel grayscale images, and this embodiment will not elaborate on this. The data type of the images to be denoised can be double-precision floating-point numbers, i.e., double type. In this embodiment, the three single channels can refer to the RGB three single channels, namely the red, green, and blue color channels.

[0068] S13. Based on a preset filtering radius, perform bilateral filtering on the image to be denoised to obtain an estimated incident component.

[0069] Optionally, the filtering radius is the window scale, and the preset filtering radius can be flexibly set according to the actual situation, and this embodiment does not clearly limit this. The estimated incident component can refer to the pixel values in the image to be denoised after bilateral filtering.

[0070] Optionally, the estimated incident component can be expressed as:

[0071]

[0072] Where, represents the estimated incident component, represents the spatial domain weighting coefficient of bilateral filtering, represents the range domain weighting coefficient of bilateral filtering, represents the neighborhood centered on , represents each pixel point in the neighborhood, represents the normalization parameter.

[0073] Where,

[0074] The standard deviation in the time domain is expressed as:

[0075]

[0076] Where, represents the spatial domain weighting coefficient of bilateral filtering, represents the abscissa 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 abscissa of the neighboring points of the pixel values in the image to be denoised, represents the ordinate of the neighboring points of the pixel values in the image to be denoised, represents the standard deviation in the time domain, and the standard deviation in the value domain is expressed as:

[0077]

[0078] where, represents the value domain weighting coefficient of the bilateral filtering, represents each pixel point in the neighborhood, represents each pixel point in the neighborhood, represents the standard deviation in the value domain.

[0079] where, can be expressed as:

[0080]

[0081] where, can be expressed as:

[0082]

[0083] where, the performance of the bilateral filter is affected by three parameters: one is the size of the neighborhood r; one is the standard deviation in the spatial domain of the bilateral filter, and one is the standard deviation in the value domain of the bilateral filter. Among them, the larger the neighborhood, the larger the range involved in the calculation, and the more obvious the smoothing effect. and control the attenuation rate of these two weighting coefficients, that is, they affect the final filtering effect. If is larger, the Gaussian curve descends more slowly, the Gaussian smoothing effect is more obvious, and the image is more blurred. If is larger, the same smoothing effect is more obvious, the details are more blurred and tend to infinity, then the bilateral filtering is approximately degraded to Gaussian filtering.

[0084] Gaussian filtering is a simple and commonly used noise reduction method. For an image, the pixel change degree is small in flat areas, and using Gaussian filtering for noise reduction can have obvious improvement; but at the edges of the image, there are often drastic pixel value changes. Using Gaussian filtering will equally smooth the details such as the image edges that are hoped to be retained and the noise together, that is, Gaussian smoothing, resulting in edge blurring, which is also one of its most criticized disadvantages.

[0085] In the classical Retinex algorithm, it is assumed 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 since it changes slowly, an isotropic Gaussian filter is used when estimating the incident light image. However, in fact, the incident light image undergoes sudden changes at the object edges, that is, the assumption does not hold, thus causing the classical Retinex algorithm to produce halation phenomena and edge blurring. Therefore, to address this problem, a filtering template with edge preservation needs to be used to solve this problem. Bilateral filtering is a weight filtering method, belonging to non-linear filtering, and the idea of weighted averaging it uses is based on the Gaussian distribution. The weights of bilateral filtering not only consider the Euclidean distance in the spatial domain between the pixel and the central pixel, but also consider the radiometric differences in the pixel value domain, such as the similarity degree, color intensity, depth distance, etc. between the pixel in the convolution kernel and the central pixel, greatly reducing the edge loss and being able to retain more image information.

[0086] S14. Based on the image to be denoised, perform removal processing on the incident component to obtain an enhanced image.

[0087] Optionally, the enhanced image is expressed as:

[0088]

[0089] Wherein, represents the color restoration factor, represents the result after multi-scale enhancement of the image to be denoised, represents the enhanced image, can represent the enhanced image in the i-th channel, where i in represents the i-th channel. can represent the color restoration factor in the i-th channel, where i in represents the i-th channel

[0090] Optionally, the result after multi-scale enhancement of the image to be denoised can be the result after multi-scale Retinex enhancement of the image to be denoised. Multi-scale Retinex enhancement refers to the multi-scale image enhancement through the Retinex algorithm, aiming to simulate the perception mode 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 two words, retina and cortex. The Retinex model is based on the following three assumptions:

[0091] a. The real world is colorless, and the colors we perceive are the result of the interaction between light and matter;

[0092] b. Each color area is composed of the three primary colors of red, green, and blue with a given wavelength;

[0093] c. The three primary colors determine the color of each unit area.

[0094] The image observed by the human eye can be regarded as being composed of an incident component and a reflection component together. The incident light irradiates 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 and enhance the reflection attribute of the object . The Retinex algorithm generally includes three types: single-scale SSR, multi-scale MSR, and MSRCR.

[0095] In SSR, mainly by calculating the average value of the pixel at any point in the image and its surrounding pixel points, the purpose of reducing the incident property and enhancing the reflection property is achieved. The specific method is to select a suitable Gaussian template , and perform a convolution operation on the original image to obtain a low-pass filtered image after the Gaussian kernel low-pass filtering process.

[0096] Optionally,

[0097] Among them, represents the image to be denoised in the i-th channel, represents the center surround function, N is the number of scales, represents the weight of each scale, generally can be , represents the output of the image in the logarithmic domain.

[0098] The image to be denoised can be regarded as being composed of an incident component and a reflection component together, and can be expressed as:

[0099]

[0100] Among them, represents the incident component of the image to be denoised. In this embodiment, this incident component can be the estimated incident component described above, represents the reflection component of the image to be denoised.

[0101] Taking the logarithm on both sides of the equation can be expressed as:

[0102]

[0103] From Approximate representation by convolution with a kernel function:

[0104]

[0105] Among them, That is, it represents the kernel function.

[0106] Finally, Can be quantized into pixel values in the range of 0 - 255:

[0107]

[0108]

[0109] Among them, Represents The pixel value of, Represents The minimum pixel value in, Represents 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 both represents the i-th channel.

[0110] S15. Perform color correction processing on the enhanced image to obtain an enhanced image after color correction.

[0111] Optionally, the enhanced image after color correction is represented as:

[0112]

[0113] Among them, Represents the enhanced image after color correction, Represents the gain coefficient, Represents the enhanced image, Represents the bias coefficient. Furthermore, it can be represented as the enhanced image after color correction under the i-th channel, The i in represents the i-th channel.

[0114] Among them,

[0115]

[0116] Among them,

[0117]

[0118] Among them, Denote the image to be denoised of the \(i\)-th channel as \(f\left [ {{I}^{,}_{i}\left ( {x,y} \right )} \right ]\). Denote the mapping function of the color space. Denote the number of channels, which is 3 in this embodiment. Denote the controlled non-linear intensity, i.e., the constant value of Denote the constant value of

[0119] Optionally, the values of the above , , and can be flexibly set according to the actual situation, and this embodiment does not clearly limit this. In this embodiment, , , and can be 125, 46, 192, -30 respectively.

[0120] S16. Perform an optimization process on the enhanced image after color correction through the particle swarm optimization algorithm to obtain the optimal denoised image. The optimization parameters of the particle swarm optimization algorithm are the standard deviation in the time domain and the standard deviation in the value domain of the bilateral filtering process. The fitness function of the particle swarm optimization algorithm is a linearly weighted function of the brightness, contrast, naturalness, and sharpness between the enhanced image after color correction and the noise image. The optimal denoised image is composed of the enhanced images after color correction of the three single-channel grayscales.

[0121] Optionally, the dimension of the particles in the particle swarm is 2.

[0122] Optionally, the velocity and the current position of the particle at the \((t + 1)\)-th moment in the particle swarm optimization algorithm can be respectively expressed as:

[0123]

[0124]

[0125] where denotes the identification of the particle in the particle swarm, denotes the velocity of the particle at the \((t + 1)\)-th moment, is the inertia factor, denotes the velocity of the particle at the \(t\)-th moment, denotes the first learning factor, denotes a random number between . Denotes the individual optimal position found at time t, Denotes the current position of the particle at time t, Denotes the second learning factor, Denotes the global optimal position found at time t, Denotes 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 the actual situation, and this embodiment does not specifically limit this.

[0126] Optionally, the fitness function can be expressed as:

[0127]

[0128] Wherein, Denotes the function associated with the enhanced image after color correction under the i-th metric, Denotes the luminance function associated with the enhanced image after color correction, Denotes the contrast function associated with the enhanced image after color correction, Denotes the naturalness function associated with the enhanced image after color correction, Denotes the sharpness function associated with the enhanced image after color correction, Denotes the weight of the i-th metric, and this weight can be flexibly set according to the actual situation. This embodiment does not specifically limit this. In this embodiment, the weights of each metric can be set to 0.25 respectively, Can be expressed as:

[0129]

[0130] Wherein, Denotes the noise image, Can denote the denoised image, and the denoised image can be composed of three single-channel enhanced images after color correction, Denotes the mean value of the denoised image, Denotes the mean value of the noise image, Can be expressed as:

[0131]

[0132] Wherein, Is the length of the noise image, Is the width of the noise image, Denotes a single-channel enhanced image after color correction, Denotes the edge image calculated according to the Sobel operator, Denotes the Sobel edge image The sum of the pixel intensities, represents the number of edge pixels of the edge image with respect to, is the entropy based on the histogram, and the calculation process of the edge image calculated according to the Sobel operator on the basis of is not elaborated in this embodiment to save space in this specification and can be expressed as:

[0133]

[0134]

[0135] wherein, represents the probability that the image value is i. For naturalness, the color preservation effect of image enhancement is represented by calculating the relative brightness order difference of the image, and can be expressed as:

[0136]

[0137]

[0138]

[0139]

[0140]

[0141] wherein, represents each pixel in the noise image at the maximum value of the three rgb channels, represents each pixel in the enhanced image after color correction at the maximum value of the three rgb channels, is the exclusive OR operator, represents the relative brightness order difference corresponding to each pixel , represents each pixel of the image to be denoised , that is, each pixel of the noise image in a single channel , represents each pixel of the enhanced image after color correction . and can be expressed as:

[0142]

[0143] wherein, that is, can represent each pixel of the enhanced image after color correction , that is, Represents the mean value of the enhanced image after color correction.

[0144] Optionally, the optimal denoised image refers to an RGB three-channel image obtained by combining the enhanced images after color correction of the three single-channel grayscale images.

[0145] According to the above description, the image processing method described in this embodiment includes: obtaining a noisy image of a power device; performing color channel separation processing on the noisy image to obtain three single-channel grayscale images to be denoised, where the images to be denoised are grayscale images; based on a preset filtering radius, performing bilateral filtering processing on the images to be denoised to obtain an estimated incident component; based on the images to be denoised, performing removal processing on the incident component to obtain an enhanced image; performing color correction processing on the enhanced image to obtain an enhanced image after color correction; performing optimization processing on the enhanced image after color correction through a particle swarm optimization algorithm to obtain an optimal denoised image, where the optimization parameters of the particle swarm optimization algorithm are the standard deviations in the time domain and the value domain 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 sharpness associated with the enhanced image after color correction, and the optimal denoised image is composed of the enhanced images after color correction of the three single-channel grayscale images.

[0146] In the image processing method, by combining bilateral filtering, image enhancement, color correction, and particle swarm optimization algorithm of the noisy image, a high-quality optimal denoised image can be obtained, thereby meeting the high-quality filtering requirements for power device images.

[0147] Please refer to Figure 3 , as Figure 3 shown, this embodiment provides a method for obtaining an optimal denoised image by performing optimization processing on the enhanced image after color correction through a particle swarm optimization algorithm, including:

[0148] Step S1, obtaining initial particle swarm parameter values.

[0149] Optionally, the initial particle swarm parameter values refer to the initialized particle swarm parameter values, which may include population size, preset number of iterations, particle position, particle velocity, inertia weight, learning factor and etc.

[0150] Step S2, obtaining particle fitness values based on the enhanced image after color correction, the fitness function, and the initial particle swarm parameter values.

[0151] Step S3, updating the particle optimal values to obtain the updated particle optimal values.

[0152] Step S4: Update the particle positions and particle velocities to obtain the updated particle positions and the updated particle velocities.

[0153] Step S5: Determine whether the preset number of iterations is reached. If so, obtain the optimal denoised image based on the updated particle optimal values. Otherwise, return to Step S2, where the particle positions and particle velocities in the initial particle swarm parameter values in Step S2 are respectively the updated particle positions and the updated particle velocities.

[0154] Please refer to Figure 4 , where the particle optimal values include particle individual optimal values and particle global optimal values. As Figure 4 shown, the implementation method for updating the particle optimal values to obtain the updated particle optimal values includes:

[0155] S21: If the particle fitness value is greater than the historical individual optimal value, obtain the updated particle individual optimal value, where the updated particle individual optimal value is the position of the particle.

[0156] S22: If the particle fitness value is greater than the historical global optimal value, obtain the updated particle global optimal value, where the updated particle global optimal value is the position of the particle.

[0157] In an embodiment of the present application, please refer to Figures 5 to 11 , where the noisy image is an image obtained by adding Gaussian noise with a variance of 0.01 to the original image, and the original image is a photo of a set of voltage transformers in a 500 kV substation. The noisy image is denoised by using the image processing method, and four traditional methods, namely mean filtering, median filtering with a [3 3] filtering window, Gaussian filtering, and guided filtering, are used for comparative verification.

[0158] In this embodiment, the Figure 2 shown image processing method is used to denoise the noisy image, and performance comparisons are made with the mean filtering algorithm, median filtering algorithm, Gaussian filtering algorithm, and guided filtering algorithm. The noisy image includes Gaussian noise with a variance of 0.01. For the comparison of the gray histograms of the original image, the noisy image, and the optimal denoised image, please refer to Figures 12 - 14 , and the denoising effect can be as shown in Table 1 below:

[0159] MSE PSNR SSIM Mean filtering 40.3666 32.0706 0.68042 Median filtering 46.68 31.4395 0.64599 Gaussian filtering 56.826 30.5853 0.56611 Guided filtering 28.6988 33.5522 0.74764 This image processing method 0.0024261 74.2817 0.78015

[0160] In an 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 breaker photos of a certain 500 kV substation. The noise image is denoised by the image processing method, and four traditional methods, namely mean filtering, median filtering with a [3 3] filtering window, Gaussian filtering, and guided filtering, are used for comparison and verification.

[0161] This embodiment also Figure 2 compares the denoising effect of the shown image processing method for salt-and-pepper noise with a density of 0.01 with the performance of the mean filtering algorithm, median filtering algorithm, Gaussian filtering algorithm, and guided filtering algorithm. For the comparison of the original image gray histogram, noise image gray histogram, and optimal denoised image gray histogram, refer to Figures 22 - 24 , and the denoising effect can be shown in Table 2 below:

[0162] MSE PSNR SSIM Mean filtering 10.2621 38.0185 0.82677 Median filtering 5.9787 40.3647 0.8667 Gaussian filtering 27.288 33.7711 0.4671 Guided filtering 17.6089 35.6735 0.81415 This image processing method 0.0011518 77.5171 0.97831

[0163] Among them, mean squared 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 squared error between the original image and the processed image. To some 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.

[0164] Optionally, the mean squared error can be expressed as:

[0165]

[0166] Among them, 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 gray value of the pixel at the i-th row and j-th column of the optimal denoised image.

[0167] Optionally, PSNR is the most commonly used objective observation method for evaluating image quality. Generally, it is used for an engineering project between the maximum signal and background noise. The larger the PSNR value between two images, the better the denoising effect and the more similar the images. The peak signal-to-noise ratio can be expressed as:

[0168]

[0169] Among them, n is the number of bits per pixel, MSE is the mean squared error between the original image and the processed image, represents the peak signal-to-noise ratio.

[0170] The SSIM represents the degree of 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, and its definition formula is:

[0171]

[0172] where is the average value of is the average value of is the variance of is the variance of is and the covariance of and is the image quality index. In this embodiment in can represent the noise image, can represent the optimal denoised image.

[0173] The protection scope of the image processing method described in the embodiments of the present application is not limited to the execution order of the steps listed in this embodiment. Any solution achieved by adding or subtracting steps of the prior art and replacing steps according to the principle of the present application is included in the protection scope of the present application.

[0174] Please refer to Figure 25 As Figure 25 shown, this embodiment provides an image processing apparatus 200, and the image processing apparatus 200 includes:

[0175] A noise image acquisition module 210, configured to acquire a noise image of an electrical device.

[0176] An image color separation module 220, configured to perform color channel separation processing on the noise image to obtain three single-channel images to be denoised, and the images to be denoised are grayscale images.

[0177] A bilateral filtering processing module 230, configured to perform bilateral filtering processing on the images to be denoised based on a preset filtering radius,

[0178] to obtain an estimated incident component.

[0179] An incident component removal module 240, configured to perform removal processing on the incident component based on the images to be denoised to obtain an enhanced image.

[0180] An image color correction module 250, configured to perform color correction processing on the enhanced image to obtain an enhanced image after color correction.

[0181] The image particle optimization module 260 is configured to perform optimization processing on the enhanced image after color correction 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 sharpness between the enhanced image after color correction and the noise image. The optimal denoised image is composed of the enhanced images after color correction of the three single-channel grayscales.

[0182] In the image processing apparatus 200 provided in this embodiment, the noise image acquisition module 210 corresponds to Figure 2 step S11 of the image processing method shown, the image color separation module 220 corresponds to Figure 2 step S12 of the image processing method shown, the bilateral filtering processing module 230 corresponds to Figure 2 step S13 of the image processing method shown, the incident component removal module 240 corresponds to Figure 2 step S14 of the image processing method shown, the image color correction module 250 corresponds to Figure 2 step S15 of the image processing method shown, and the image particle optimization module 260 corresponds to Figure 2 step S16 of the image processing method shown.

[0183] In several embodiments provided in the present application, it should be understood that the disclosed apparatus or method can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For example, the division of modules / units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple modules or units can be combined or integrated into another system, or some features can be ignored or not executed. Another point, the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of devices or modules or units can be in electrical, mechanical or other forms.

[0184] The modules / units described as separate components may or may not be physically separated. The components shown as modules / units may or may not be physical modules, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the modules / units can be selected according to actual needs to achieve the purpose of the embodiments of the present application. For example, in each embodiment of the present application, the various functional modules / units can be integrated in a processing module, or each module / unit can exist physically alone, or two or more modules / units can be integrated in one module / unit.

[0185] Those of ordinary skill in the art should further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods for each specific application to implement the described functions, but such implementation should not be considered to exceed the scope of this application.

[0186] This embodiment provides an electronic device, which includes a memory storing a computer program; a processor communicatively connected to the memory and executing Figure 2 the image processing method shown.

[0187] This application embodiment also provides a computer-readable storage medium. Those of ordinary skill in the art can understand that all or part of the steps in the method for implementing the above embodiments can be completed by instructing a processor through a program. The program can be stored in a computer-readable storage medium. 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 drive, a magnetic tape, a floppy disk, an optical disc, and any combination thereof. The above storage medium can be any available medium that a computer can access or a data storage device such as a server or a data center integrating one or more available media. The available medium can be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a digital video disc (DVD)), or a semiconductor medium (such as a solid-state drive (SSD)), etc.

[0188] This application embodiment can 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 processes or functions according to the embodiments of this application are generated in whole or in part. The computer instructions can 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 can be transmitted from a website, a computer, or a data center to another website, a computer, or a data center in a wired manner (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or a wireless manner (such as infrared, wireless, microwave, etc.).

[0189] When the computer program product is executed by a computer, the computer executes the method described in the foregoing method embodiments. The computer program product may be a software installation package. In the case where the foregoing method needs to be used, the computer program product can be downloaded and executed on the computer.

[0190] The descriptions of the processes or structures corresponding to the foregoing respective drawings each have their own focuses. For parts not detailed in a certain process or structure, reference may be made to the relevant descriptions of other processes or structures.

[0191] The foregoing embodiments are merely illustrative of the principles and effects of the present application and are not intended to limit the present application. Any person familiar with this technology can modify or change the foregoing embodiments without departing from the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by those with ordinary knowledge in the technical field to which the present application pertains without departing from the spirit and technical ideas disclosed by the present application should still be covered by the claims of the present application.

Claims

1. An image processing method, characterized in that, Including: Obtain the noise image of the power equipment; Perform color channel separation processing on the noise image to obtain three single-channel denoising target images, and the denoising target image is a grayscale image; Based on a preset filtering radius, perform bilateral filtering on the denoising target image to obtain an estimated incident component; Based on the denoising target image, perform removal processing on the incident component to obtain an enhanced image; Perform color correction processing on the enhanced image to obtain an enhanced image after color correction; Perform optimization processing on the enhanced image after color correction through a particle swarm optimization algorithm to obtain an optimal denoising image. The optimization parameters of the particle swarm optimization algorithm are the time-domain standard deviation and range 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 sharpness associated with the enhanced image after color correction. The optimal denoising image is composed of the enhanced images after color correction of the three single channels; The time-domain standard deviation is expressed as: Among them, G C represents the spatial domain weighting coefficient of bilateral filtering, x represents the abscissa of the central point of the pixel value in the image to be denoised, y represents the ordinate of the central point of the pixel value in the image to be denoised, i represents the abscissa of the adjacent point of the pixel value in the image to be denoised, j represents the ordinate of the adjacent point of the pixel value in the image to be denoised, and σ C represents the time domain standard deviation, and the range standard deviation is expressed as: Among them, G S represents the range weighting coefficient of bilateral filtering, s(i, y) represents each pixel point in the neighborhood of (i, y), s(x, y) represents each pixel point in the neighborhood of (x, y), and σ S represents the range standard deviation.

2. The image processing method according to claim 1, wherein The implementation method of performing optimization processing on the enhanced image after color correction through a particle swarm optimization algorithm to obtain an optimal denoising image includes: Step S1, obtain the initial particle swarm parameter values; Step S2, based on the enhanced image after color correction, the fitness function, and the initial particle swarm parameter values, obtain the particle fitness values; Step S3, update the particle optimal values to obtain the updated particle optimal values; Step S4, update the particle positions and particle velocities to obtain the updated particle positions and the updated particle velocities; Step S5, determine whether the preset number of iterations is reached. If so, obtain the optimal denoising image based on the updated particle optimal values. Otherwise, return to Step S2, and the particle positions and particle velocities in the initial particle swarm parameter values in Step S2 are the updated particle positions and the updated particle velocities respectively.

3. The image processing method according to claim 2, wherein The particle optimal values include particle individual optimal values and particle global optimal values. The implementation method of updating the particle optimal values to obtain the updated particle optimal values includes: If the particle fitness value is greater than the historical individual optimal value, obtain 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, obtain the updated particle global optimal value, and the updated particle global optimal value is the position of the particle.

4. The image processing method according to claim 1, characterized in that, The enhanced image is expressed as: R MSRCRi (x,y) = C i (x,y)R MSR (x,y) Among them, C i (x, y) represents the color restoration factor, R MSR (x, y) represents the result after multi-scale enhancement of the image to be denoised, R MSRCRi (x, y) represents the enhanced image.

5. The image processing method according to claim 1, wherein, The enhanced image after color correction is expressed as: R MSRCRi (x,y)' = GR MSRCRi (x,y) + O wherein, R MSRCRi (x,y)' represents the enhanced image after the color correction, G represents the gain coefficient, R MSRCRi (x,y) represents the enhanced image, and O represents the deviation coefficient.

6. The image processing method according to claim 1, wherein The particle swarm optimization algorithm is expressed as: v id (t + 1)= wv id (t)+ c1rand()(p bestid (t)- x id (t))+ c2rand()(p gd (t)- x id (t)) x id (t + 1)= x id (t)+ v id (t + 1) Among them, id represents the identification of the particle in the particle swarm, and v id (t + 1) represents the velocity of the particle at time t + 1, w is the inertia factor, and v id (t) represents the velocity of the particle at time t, c1 is the first learning factor, rand() represents a random number between (0, 1), and p bestid (t) represents the individual optimal position found at time t, and x id (t) represents the current position of the particle at time t, c2 is the second learning factor, and p gd (t) represents the global optimal position found at time t, and x id (t + 1) represents the current position of the particle at time t + 1.

7. An image processing apparatus, characterized in that, The image processing device includes: A noise image acquisition module for acquiring the noise image of the power equipment; An image color separation module for performing color channel separation processing on the noise image to obtain three single-channel grayscale denoising target images, and the denoising target image is a grayscale image; A bilateral filtering processing module for performing bilateral filtering on the denoising target image based on a preset filtering radius to obtain an estimated incident component; An incident component removal module, configured to remove the incident component based on the image to be denoised to obtain an enhanced image; An image color correction module, configured to perform color correction processing on the enhanced image to obtain an enhanced image with color correction; An image particle optimization module, configured to perform optimization processing on the enhanced image with color correction through a particle swarm optimization algorithm to obtain an optimal denoised image. The optimization parameters of the particle swarm optimization algorithm are the standard deviation in the time domain and the standard deviation in the range domain of the bilateral filtering processing. The fitness function of the particle swarm optimization algorithm is a linear weighted function of brightness, contrast, naturalness, and sharpness associated with the enhanced image with color correction. The optimal denoised image is composed of the three single-channel grayscale enhanced images with color correction merged together; The standard deviation in the time domain is expressed as: Among them, G C represents the spatial domain weighting coefficient of bilateral filtering, x represents the abscissa of the center point of the pixel value in the image to be denoised, y represents the ordinate of the center point of the pixel value in the image to be denoised, i represents the abscissa of the neighboring point of the pixel value in the image to be denoised, j represents the ordinate of the neighboring point of the pixel value in the image to be denoised, and σ C represents the time domain standard deviation, and the value domain standard deviation is expressed as: Among them, G S represents the range weighting coefficient of bilateral filtering, s(i, y) represents each pixel point in the neighborhood of (i, y), s(x, y) represents each pixel point in the neighborhood of (x, y), and σ S represents the standard deviation of the range.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the image processing method according to any one of claims 1-6.

9. An electronic device, characterized in that, The electronic device includes: A memory storing a computer program; A processor communicatively connected to the memory, and when calling the computer program, executes the image processing method according to any one of claims 1-6.

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