Image processing method and device based on artificial intelligence, computer equipment and medium
Through the image processing method based on artificial intelligence, including normalization processing, image extension coefficient calculation, Gaussian model fitting and color offset correction algorithm, combined with the convolutional neural network model, the dust image is processed, and the existing technology is solved The problem of poor sand and dust image enhancement significantly improves image clarity and detail recovery.
Patent Information
- Application Number
- CN202411027337.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-29
- Publication Date
- 2024-11-01
AI Technical Summary
The existing image enhancement algorithm based on prior knowledge of image processing has weak generalization ability in dust degradation scenarios, resulting in poor image clarity effect after processing.
Using an image processing method based on artificial intelligence, pixel value update and visual enhancement of sand and dust images through normalization processing, image extension coefficient calculation, Gaussian model fitting and color offset correction algorithms, and image enhancement is performed using convolutional neural network model. deal with.
Accurate color offset correction and color equalization processing of sand and dust images is realized, which significantly improves the visual clarity of the image and restores local details information, solving the problem of poor image enhancement effect in the prior art.
Smart Images

Figure CN118887115A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence development technology and financial technology, and in particular to an image processing method, apparatus, computer equipment and storage medium based on artificial intelligence. Background Art
[0002] In dusty weather, the large amount of dust particles suspended in the atmosphere scatter visible light to varying degrees, resulting in blurry, low-quality images captured by imaging devices. In the claims settlement scenario of financial insurance, dust images are often involved in the claims settlement process, such as vehicle images, human images, and environmental images related to claims settlement captured by claims adjusters through cameras in dusty weather.
[0003] In order to smoothly process the claims business, it is usually necessary to enhance the dust images collected by the claims adjusters. At present, the image enhancement method adopted by insurance companies for the dust images collected by the claims adjusters is usually an image enhancement algorithm based on image processing prior knowledge. Due to the complexity and variability of dust degradation scenes, the generalization ability of the image enhancement algorithm based on image processing prior knowledge is weak, and the clarity of the processed images is poor. Summary of the invention
[0004] The purpose of the embodiments of the present application is to propose an image processing method, device, computer equipment and storage medium based on artificial intelligence to solve the technical problem that the existing insurance companies usually use an image enhancement algorithm based on image processing prior knowledge to perform image enhancement processing on dust images collected by claims adjusters. Due to the complexity and variability of dust degradation scenes, the image enhancement algorithm based on image processing prior knowledge has weak generalization ability and the clarity of the processed image is poor.
[0005] In order to solve the above technical problems, the embodiment of the present application provides an image processing method based on artificial intelligence, which adopts the following technical solutions:
[0006] Acquire dust images;
[0007] Normalizing the dust image to obtain a corresponding first dust image;
[0008] Calculating a corresponding image stretch coefficient based on the first dust image;
[0009] Get the preset initial pixel mean of the image;
[0010] Performing pixel value updating processing on the first dust image based on the image stretch coefficient, the initial pixel mean value of the image, and a preset Gaussian model to obtain a corresponding corrected image;
[0011] Visual enhancement processing is performed on the corrected image to obtain a target dust image.
[0012] Furthermore, the step of calculating the corresponding image stretch coefficient based on the first dust image specifically includes:
[0013] Acquire pixel values of each color channel contained in the first dust image; wherein each of the color channels includes a red channel, a green channel, and a blue channel;
[0014] Get the preset target ratio value;
[0015] Call the preset extension coefficient calculation formula;
[0016] Calculating and processing the pixel value of each color channel and the target ratio value based on the stretch coefficient calculation formula to obtain the stretch coefficient of each color channel;
[0017] The image stretch coefficient is generated based on the stretch coefficients of each of the color channels.
[0018] Furthermore, the step of performing pixel value updating processing on the first dust image based on the image stretch coefficient, the initial pixel mean of the image and a preset Gaussian model to obtain a corresponding corrected image specifically includes:
[0019] Performing fitting processing on each color channel included in the first dust image based on the Gaussian model to obtain a channel mean and a channel standard deviation respectively corresponding to each color channel;
[0020] Calculating a global standard deviation of the first dust image;
[0021] Call the preset color cast correction algorithm;
[0022] Based on the color shift correction algorithm, the image stretch coefficient, the initial pixel mean of the image, the global standard deviation, the channel mean and the channel standard deviation are calculated and processed to obtain updated channel pixel values corresponding to each of the color channels;
[0023] The designated color channels that match the updated channel pixel values are merged to obtain the corrected image.
[0024] Furthermore, the step of performing visual enhancement processing on the corrected image to obtain a target dust image specifically includes:
[0025] Call the preset image enhancement model;
[0026] Inputting the corrected image into the image enhancement model;
[0027] Performing visual enhancement processing on the corrected image through the image enhancement model, and obtaining a specified image output by the image enhancement model and corresponding to the corrected image;
[0028] The designated image is used as the target dust image.
[0029] Furthermore, before the step of calling the preset image enhancement model, the method further includes:
[0030] Acquire a pre-constructed training image data set; wherein the training image data set includes a training image and an enhanced image corresponding to the training image;
[0031] Get the preset convolutional neural network model;
[0032] Inputting the training image into the convolutional neural network model for training, and obtaining a predicted image output by the convolutional neural network model corresponding to the training image;
[0033] Calculating a loss between the predicted image and the enhanced image;
[0034] Optimizing the convolutional neural network model based on the loss to obtain a target convolutional neural network model that meets preset expectations;
[0035] The target convolutional neural network model is used as the image enhancement model.
[0036] Furthermore, the step of acquiring the dust image specifically includes:
[0037] Acquire a pre-collected initial dust image;
[0038] Performing denoising processing on the initial dust image to obtain a corresponding second dust image;
[0039] performing smoothing processing on the second dust image to obtain a corresponding third dust image;
[0040] The third dust image is used as the dust image.
[0041] Furthermore, after the step of performing visual enhancement processing on the corrected image to obtain a target dust image, the method further includes:
[0042] Acquire a designated storage mode corresponding to the target dust image;
[0043] Calling a designated storage medium corresponding to the designated storage method;
[0044] The target dust image is stored in the designated storage medium.
[0045] In order to solve the above technical problems, the embodiment of the present application further provides an image processing device based on artificial intelligence, which adopts the following technical solution:
[0046] A first acquisition module is used to acquire dust images;
[0047] A first processing module, used for performing normalization processing on the dust image to obtain a corresponding first dust image;
[0048] A calculation module, used for calculating a corresponding image stretch coefficient based on the first dust image;
[0049] The second acquisition module is used to acquire a preset initial pixel mean of the image;
[0050] An updating module, configured to perform pixel value updating processing on the first dust image based on the image stretch coefficient, the initial pixel mean of the image, and a preset Gaussian model to obtain a corresponding corrected image;
[0051] The second processing module is used to perform visual enhancement processing on the corrected image to obtain a target dust image.
[0052] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:
[0053] Acquire dust images;
[0054] Normalizing the dust image to obtain a corresponding first dust image;
[0055] Calculating a corresponding image stretch coefficient based on the first dust image;
[0056] Get the preset initial pixel mean of the image;
[0057] Performing pixel value updating processing on the first dust image based on the image stretch coefficient, the initial pixel mean value of the image, and a preset Gaussian model to obtain a corresponding corrected image;
[0058] Visual enhancement processing is performed on the corrected image to obtain a target dust image.
[0059] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:
[0060] Acquire dust images;
[0061] Normalizing the dust image to obtain a corresponding first dust image;
[0062] Calculating a corresponding image stretch coefficient based on the first dust image;
[0063] Get the preset initial pixel mean of the image;
[0064] Performing pixel value updating processing on the first dust image based on the image stretch coefficient, the initial pixel mean value of the image, and a preset Gaussian model to obtain a corresponding corrected image;
[0065] Visual enhancement processing is performed on the corrected image to obtain a target dust image.
[0066] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0067] The present application performs fitting processing on each color channel contained in the first dust image based on the Gaussian model to obtain the channel mean and channel standard deviation corresponding to each color channel; then calculates the global standard deviation of the first dust image; then calls a preset color cast correction algorithm; subsequently, based on the color cast correction algorithm, the image stretch coefficient, the initial pixel mean of the image, the global standard deviation, the channel mean and the channel standard deviation are calculated and processed to obtain the updated channel pixel values corresponding to each color channel; finally, each specified color channel that matches the updated channel pixel value is merged to obtain the corrected image. The present application performs fitting processing on each color channel contained in the first dust image based on the use of a Gaussian model to obtain the channel mean and channel standard deviation corresponding to each color channel, and then calculates and processes the image stretch coefficient, the image initial pixel mean, the global standard deviation of the first dust image, the channel mean and the channel standard deviation based on the use of a color shift correction algorithm to obtain updated channel pixel values corresponding to each color channel, and then merges each designated color channel that matches the updated channel pixel value, so as to quickly and accurately complete the pixel value update processing of the first dust image and obtain the corresponding color-balanced corrected image. The present application uses a color shift correction algorithm based on a Gaussian model to perform color balancing processing on the first dust image, so as to achieve accurate color shift correction and color balancing processing for the first dust image, and effectively improve the image visual clarity of the corrected image. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0069] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;
[0070] Figure 2 A flowchart of an embodiment of an artificial intelligence-based image processing method according to the present application;
[0071] Figure 3 is a schematic structural diagram of an embodiment of an image processing device based on artificial intelligence according to the present application;
[0072] Figure 4 It is a structural diagram of an embodiment of a computer device according to the present application. DETAILED DESCRIPTION
[0073] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.
[0074] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0075] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.
[0076] like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0077] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0078] The terminal devices 101, 102, and 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III), MP4 (Moving Picture Experts Group Audio Layer IV) players, laptop computers, desktop computers, etc.
[0079] The server 105 may be a server that provides various services, such as a background server that provides support for web pages displayed on the terminal devices 101 , 102 , and 103 .
[0080] It should be noted that the artificial intelligence-based image processing method provided in the embodiment of the present application is generally executed by a server / terminal device, and accordingly, the artificial intelligence-based image processing device is generally set in the server / terminal device.
[0081] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0082] Continue to refer Figure 2 , showing a flow chart of an embodiment of an artificial intelligence-based image processing method according to the present application. According to different requirements, the order of the steps in the flow chart can be changed, and some steps can be omitted. The artificial intelligence-based image processing method provided in the embodiment of the present application can be applied to any scene that requires image sharpening processing of dust images, and the artificial intelligence-based image processing method can be applied to products in these scenes, for example, image sharpening processing of dust images in the financial insurance field. The artificial intelligence-based image processing method comprises the following steps:
[0083] Step S201, obtaining a dust image.
[0084] In this embodiment, the electronic device (eg, Figure 1 The server / terminal device shown in the figure) can obtain the dust image through a wired connection or a wireless connection. It should be pointed out that the above-mentioned wireless connection method may include but is not limited to 3G / 4G / 5G connection, Wi-Fi connection, Bluetooth connection, WiMAX connection, Zigbee connection, UWB (Ultra Wi-Fi Band) connection, and other wireless connection methods currently known or to be developed in the future. The above-mentioned dust image may be an image obtained after denoising and smoothing the initial dust image collected in advance. The above-mentioned initial dust image refers to the most original dust image obtained by an imaging device in dusty weather, and the initial dust image is usually a blurred and low-quality image. In the claims settlement scenario of financial insurance, the above-mentioned initial dust image may be a vehicle image, a person image, an environmental image, etc. related to the claims settlement business obtained by the claims adjuster through a camera in dusty weather.
[0085] Step S202: normalize the dust image to obtain a corresponding first dust image.
[0086] In this embodiment, the above-mentioned normalization processing refers to scaling the pixel values of the dust image to a specific range, usually between 0 and 1, to facilitate subsequent image processing and improve the convergence speed and stability of the image processing algorithm. Specifically, each color channel (red R, green G, blue B) of the dust image is normalized separately. The normalization formula includes:
[0087]
[0088] Where c represents the color channel (one of R, G, B), I c is the pixel value of the color channel in the dust image, is the maximum value of the color channel among all pixels, It is the minimum value of the color channel among all pixels.
[0089] Step S203: calculating a corresponding image stretch coefficient based on the first dust image.
[0090] In this embodiment, the specific implementation process of calculating the corresponding image stretch coefficient based on the first dust image will be further described in detail in subsequent specific embodiments of the present application and will not be elaborated on here.
[0091] Step S204, obtaining a preset initial pixel mean of the image.
[0092] In this embodiment, the channel stretching process of the image is prone to overflow or underflow of the channel pixel value, resulting in loss of image information. To solve this problem, the present application fixes the image initial pixel mean of the first dust image to 0.5 before updating the color-shifted image pixel value, so that the problem of image information loss due to overflow can be avoided to the greatest extent. Specifically, by fixing the image initial pixel mean of the first dust image to 0.5, a more balanced starting point can be provided for subsequent image processing operations, reducing processing difficulties caused by extreme brightness or contrast. When the image is very dark or very bright, overflow is more likely to occur when performing operations such as color cast correction or contrast enhancement. By adjusting the mean of the RGB channels to 0.5 (normalized to a range of 0-1), the image can be made more moderate visually, thereby possibly reducing the risk of overflow in subsequent stretching or enhancement processes.
[0093] Step S205 , performing pixel value update processing on the first dust image based on the image stretch coefficient, the initial pixel mean value of the image and a preset Gaussian model to obtain a corresponding corrected image.
[0094] In this embodiment, the above-mentioned specific implementation process of updating the pixel value of the first dust image based on the image stretch coefficient, the initial pixel mean of the image and the preset Gaussian model to obtain the corresponding corrected image will be described in further details in subsequent specific embodiments of the present application and will not be elaborated here.
[0095] Step S206: Perform visual enhancement processing on the corrected image to obtain a target dust image.
[0096] In this embodiment, the specific implementation process of performing visual enhancement processing on the corrected image to obtain the target dust image will be further described in detail in subsequent specific embodiments of the present application and will not be elaborated on here.
[0097] The present application first obtains a dust image; then normalizes the dust image to obtain a corresponding first dust image; then calculates a corresponding image stretch coefficient based on the first dust image; subsequently obtains a preset image initial pixel mean; further updates the pixel value of the first dust image based on the image stretch coefficient, the image initial pixel mean, and a preset Gaussian model to obtain a corresponding corrected image; finally, visually enhances the corrected image to obtain a target dust image. The present application obtains a first dust image by normalizing the acquired dust image, and obtains a preset image initial pixel mean, then updates the pixel value of the first dust image based on the image stretch coefficient, the image initial pixel mean, and a preset Gaussian model to obtain a corrected image, and finally, visually enhances the corrected image to obtain a target dust image. The present application uses an improved color correction method based on a Gaussian model to perform color equalization processing on the normalized first dust image, which can achieve accurate color deviation correction and color equalization processing for the first dust image, effectively improve the image visual clarity of the obtained corrected image, and effectively solve the problem that the existing image enhancement algorithm based on prior knowledge of image processing has weak generalization ability and poor clarity effect of the processed image. In addition, the obtained corrected image will be further subjected to visual enhancement processing, which can effectively restore the local detail information of the dust image, thereby further improving the image visual clarity of the obtained target dust image.
[0098] In some optional implementations, step S203 includes the following steps:
[0099] Pixel values of each color channel contained in the first dust image are obtained; wherein each of the color channels includes a red channel, a green channel, and a blue channel.
[0100] In this embodiment, the pixel values of the above-mentioned color channels refer to pixel values obtained after normalization processing is performed on the original color channels in the dust image, that is, the red channel, the green channel, and the blue channel.
[0101] Get the preset target ratio value.
[0102] In this embodiment, the target ratio value may be 1%. To avoid calculation errors due to chance, the average value of the first 1% and the last 1% of the pixels is taken as a reference to calculate the extension coefficient of the first dust image.
[0103] Call the preset extension coefficient calculation formula.
[0104] In this embodiment, the above-mentioned extension coefficient calculation formula specifically includes:
[0105]
[0106] Among them, λ is the extension coefficient of the color channel, c is the color channel, and the color channel includes the red channel R, the green channel G and the blue channel B. Represents the top 1% average value of pixels in a color channel. Represents the average value of the bottom 1% of pixels in a color channel.
[0107] The pixel value of each color channel and the target ratio value are calculated and processed based on the stretch coefficient calculation formula to obtain the stretch coefficient of each color channel.
[0108] In this embodiment, the pixel value of each color channel and the target ratio value may be respectively filled into the corresponding position in the above stretch coefficient calculation formula for calculation, so as to calculate and obtain the stretch coefficient of each color channel.
[0109] The image stretch coefficient is generated based on the stretch coefficients of each of the color channels.
[0110] In this embodiment, the obtained stretch coefficients of all the color channels are used as image stretch coefficients corresponding to the first dust image.
[0111] The present application obtains the pixel values of each color channel contained in the first dust image; then obtains the preset target ratio value; then calls the preset extension coefficient calculation formula; then calculates and processes the pixel values of each color channel and the target ratio value based on the extension coefficient calculation formula to obtain the extension coefficient of each color channel; finally, generates the image extension coefficient based on the extension coefficient of each color channel. The present application calculates and processes the pixel values of each color channel and the target ratio value contained in the first dust image obtained based on the use of the extension coefficient calculation formula, so as to quickly and accurately obtain the extension coefficient of each color channel and finally generate the image extension coefficient of the corresponding first dust image, thereby improving the generation efficiency of the image extension coefficient, ensuring the data accuracy of the obtained image extension coefficient, and facilitating the subsequent accurate pixel value update processing of the first dust image based on the obtained image extension coefficient.
[0112] In some optional implementations of this embodiment, step S205 includes the following steps:
[0113] Based on the Gaussian model, a fitting process is performed on each color channel included in the first dust image to obtain a channel mean and a channel standard deviation respectively corresponding to each color channel.
[0114] In this embodiment, the first dust image is divided into three color channels of RGB, and then a Gaussian model is fitted for each color channel to obtain the channel mean and channel standard deviation of each color channel. The channel mean of a color channel refers to the average pixel value of the color channel.
[0115] The global standard deviation of the first dust image is calculated.
[0116] In this embodiment, the global standard deviation refers to the standard deviation of the entire image corresponding to the first dust image. The global standard deviation of the first dust image can be calculated using a common image standard deviation calculation method.
[0117] Call the preset color cast correction algorithm.
[0118] In this embodiment, the color cast correction algorithm specifically includes:
[0119]
[0120] Among them, I c ′ is the updated channel pixel value of the color channel, μ is the initial pixel mean of the image, λ is the extension coefficient of the color channel, σ is the global standard deviation of the first dust image, σ c is the channel standard deviation of the color channel, is the pixel value of the color channel obtained after normalization, μ c is the channel mean of the color channel.
[0121] Based on the color shift correction algorithm, the image stretch coefficient, the initial pixel mean of the image, the global standard deviation, the channel mean and the channel standard deviation are calculated and processed to obtain updated channel pixel values corresponding to each of the color channels;
[0122] In this embodiment, the image stretch coefficient, the image initial pixel mean, the global standard deviation, the channel mean and the channel standard deviation are substituted into the corresponding positions in the above-mentioned color cast correction algorithm for calculation and processing, so as to obtain the updated channel pixel values corresponding to each of the color channels.
[0123] The designated color channels that match the updated channel pixel values are merged to obtain the corrected image.
[0124] In this embodiment, by merging the designated color channels whose updated channel pixel values obtained by the color cast correction process match, a color-balanced dust image, ie, the above-mentioned corrected image, can be obtained.
[0125] The present application performs fitting processing on each color channel contained in the first dust image based on the Gaussian model to obtain the channel mean and channel standard deviation corresponding to each color channel; then calculates the global standard deviation of the first dust image; then calls a preset color cast correction algorithm; subsequently, based on the color cast correction algorithm, the image stretch coefficient, the initial pixel mean of the image, the global standard deviation, the channel mean and the channel standard deviation are calculated and processed to obtain the updated channel pixel values corresponding to each color channel; finally, each specified color channel that matches the updated channel pixel value is merged to obtain the corrected image. The present application performs fitting processing on each color channel contained in the first dust image based on the use of a Gaussian model to obtain the channel mean and channel standard deviation corresponding to each color channel, and then calculates and processes the image stretch coefficient, the image initial pixel mean, the global standard deviation of the first dust image, the channel mean and the channel standard deviation based on the use of a color shift correction algorithm to obtain updated channel pixel values corresponding to each color channel, and then merges each designated color channel that matches the updated channel pixel value, so as to quickly and accurately complete the pixel value update processing of the first dust image and obtain the corresponding color-balanced corrected image. The present application uses a color shift correction algorithm based on a Gaussian model to perform color balancing processing on the first dust image, so as to achieve accurate color shift correction and color balancing processing for the first dust image, and effectively improve the image visual clarity of the corrected image.
[0126] In some optional implementations, step S206 includes the following steps:
[0127] Call the preset image enhancement model.
[0128] In this embodiment, the above-mentioned image enhancement model is obtained by training the convolutional neural network model based on a pre-constructed training image data set. The specific implementation process of training the convolutional neural network model based on the pre-constructed training image data set will be further described in detail in the subsequent specific embodiments of this application, and will not be elaborated on here.
[0129] The corrected image is input into the image enhancement model.
[0130] In this embodiment, the corrected image may be used as a model input and input into the image enhancement model.
[0131] The corrected image is subjected to visual enhancement processing by the image enhancement model, and a designated image corresponding to the corrected image output by the image enhancement model is obtained.
[0132] In this embodiment, the above-mentioned visual enhancement processing means that the image enhancement model will perform pixel reconstruction processing on the input corrected image to restore local detail information of the dust image, further improve the visual clarity of the image, and output the corresponding designated image.
[0133] The designated image is used as the target dust image.
[0134] The present application calls a preset image enhancement model; then inputs the corrected image into the image enhancement model; then performs visual enhancement processing on the corrected image through the image enhancement model, and obtains a designated image corresponding to the corrected image output by the image enhancement model; and subsequently uses the designated image as the target dust image. The present application uses a pre-built image enhancement model to perform pixel reconstruction processing on the corrected image, so as to quickly and intelligently complete the visual enhancement processing of the corrected image and obtain the final target dust image. Through the visual enhancement processing of the corrected image by the image enhancement model, the local detail information of the dust image can be effectively restored, thereby further improving the image visual clarity of the obtained target dust image.
[0135] In some optional implementations, before the step of calling the preset image enhancement model, the electronic device may further perform the following steps:
[0136] Get a pre-built training image dataset.
[0137] In this embodiment, the training image data set includes training images and enhanced images corresponding to the training images. The enhanced images refer to real high-resolution images that match the training images. In addition, the number of the training images is not specifically limited and can be set according to actual training needs. In addition, since the imaging process of the dust image is based on the haze image, the original haze particles are replaced by dust particles, so the training image can specifically use the existing haze image.
[0138] Get the preset convolutional neural network model.
[0139] In this embodiment, the above-mentioned convolutional neural network model is a pre-built CNN (Convolutional Neural Networks, convolutional neural network) model suitable for pixel reconstruction. The convolutional neural network model includes multiple convolutional layers, upsampling layers (for restoring image resolution) and residual connections (helping to maintain image details). Among them, convolutional layer: used to extract image features. Convolution kernels of different sizes and numbers can be used to capture features of different scales. Upsampling layer: used to amplify feature maps and restore image resolution. Common upsampling methods include transposed convolution (deconvolution) and pixel rearrangement (such as sub-pixel convolution). Residual connection: If the model is deeper, residual connection can be introduced to help gradient propagation to prevent gradient disappearance or explosion problems during training.
[0140] The training image is input into the convolutional neural network model for training, and a predicted image corresponding to the training image output by the convolutional neural network model is obtained.
[0141] In this embodiment, before the training image is input into the convolutional neural network model for training, the training parameters of the convolutional neural network model are set according to the actual training requirements. The training parameters include learning rate, batch size, number of iterations, etc.
[0142] A loss between the predicted image and the enhanced image is calculated.
[0143] In this embodiment, loss is an indicator used in machine learning to measure the difference between the model prediction result and the true label. During the training process, the model minimizes the training loss by continuously adjusting parameters to improve its performance. A loss function suitable for the pixel reconstruction task is determined in advance, and specifically a mean square error loss function, a perceptual loss function, or an adversarial loss function can be used. Then, based on the determined loss function, the loss between the predicted image and the enhanced image is calculated.
[0144] Optimizing the convolutional neural network model based on the loss to obtain a target convolutional neural network model that meets preset expectations;
[0145] In this embodiment, after obtaining the above-mentioned loss, the model parameters of the convolutional neural network model can be reversely optimized according to the loss. Specifically, multiple rounds of optimization can be performed, and the model training is stopped when the optimization cutoff condition, that is, the above-mentioned preset expectation, is reached, thereby obtaining the target convolutional neural network model. Among them, the setting of the above-mentioned optimization cutoff condition is not specifically limited. For example, it can be a training cutoff condition, it can be that the number of training iterations reaches a preset number, or it can be that the comprehensive loss is lower than a preset loss threshold. The above-mentioned target convolutional neural network model is the image enhancement model that is finally trained and optimized.
[0146] The target convolutional neural network model is used as the image enhancement model.
[0147] The present application obtains a pre-constructed training image data set; then obtains a preset convolutional neural network model; then inputs the training image into the convolutional neural network model for training, and obtains the predicted image corresponding to the training image output by the convolutional neural network model; subsequently calculates the loss between the predicted image and the enhanced image; further optimizes the convolutional neural network model based on the loss to obtain a target convolutional neural network model that meets the preset expectations; and finally uses the target convolutional neural network model as the image enhancement model. The present application trains the convolutional neural network model by using the training image, and optimizes the convolutional neural network model by using the calculated loss between the predicted image and the enhanced image, so that an image enhancement model that meets the preset expectations can be accurately obtained, and the model effect of the obtained image enhancement model is guaranteed. It is beneficial to the subsequent use of the image enhancement model to realize the intelligent and accurate completion of the visual enhancement processing of the dust image, thereby improving the image visual clarity of the target dust image obtained after the visual enhancement processing.
[0148] In some optional implementations of this embodiment, step S201 includes the following steps:
[0149] Obtain the pre-collected initial dust image.
[0150] In this embodiment, the initial dust image refers to the most original dust image acquired by an imaging device in dusty weather. The initial dust image is usually a blurred image with low quality.
[0151] The initial dust image is subjected to denoising processing to obtain a corresponding second dust image.
[0152] In this embodiment, the initial dust image may be denoised by using a bilateral filtering method or a block matching and 3D filtering method to obtain a second dust image.
[0153] The second dust image is smoothed to obtain a corresponding third dust image.
[0154] In this embodiment, the second dust image may be smoothed by using a mean filter to obtain a third dust image.
[0155] The third dust image is used as the dust image.
[0156] The present application obtains a pre-collected initial dust image; then performs denoising on the initial dust image to obtain a corresponding second dust image; then performs smoothing on the second dust image to obtain a corresponding third dust image; and subsequently uses the third dust image as the dust image. The present application performs denoising and smoothing on the pre-collected initial dust image to quickly generate a corresponding dust image, which is beneficial to effectively reduce the impact of subsequent color cast correction and visual enhancement processing on the dust image, thereby improving the accuracy of the generated target dust image.
[0157] In some optional implementations of this embodiment, after step S206, the electronic device may further perform the following steps:
[0158] Obtain a designated storage mode corresponding to the target dust image.
[0159] In this embodiment, there is no specific limitation on the selection of the above-mentioned designated storage method, and it can be set according to actual storage requirements. Exemplarily, the designated storage method can adopt any one of cloud server storage, local database storage, network disk storage, blockchain storage, etc. Among them, blockchain storage is preferably used as the above-mentioned designated storage method. By using the blockchain storage method to store and manage the target sand and dust image, the security and non-tamperability of the target sand and dust image can be effectively guaranteed.
[0160] The designated storage medium corresponding to the designated storage mode is called.
[0161] In this embodiment, if the storage method is cloud server storage, local database storage, network disk storage, and blockchain storage, the corresponding storage media are: cloud server, local database, network disk, and blockchain.
[0162] The target dust image is stored in the designated storage medium.
[0163] In this embodiment, the target dust image can be stored in the designated storage medium by acquiring the location information of the designated storage medium and then storing the target dust image in the designated storage medium according to the location information.
[0164] The present application obtains the designated storage method corresponding to the target dust image; then calls the designated storage medium corresponding to the designated storage method; and subsequently stores the target dust image in the designated storage medium. After completing the color cast correction and visual enhancement processing of the dust image and obtaining the corresponding target dust image, the present application also intelligently obtains the designated storage method corresponding to the target dust image, and calls the designated storage medium corresponding to the designated storage method to store the target dust image, so as to effectively ensure the data security and non-tamperability of the target dust image, and improve the storage intelligence of the target dust image.
[0165] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0166] It should be emphasized that in order to further ensure the privacy and security of the above-mentioned target sand and dust image, the above-mentioned target sand and dust image can also be stored in a node of a blockchain.
[0167] The blockchain referred to in this application is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0168] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0169] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0170] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0171] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0172] Further references Figure 3 , as a response to the above Figure 2 The present application provides an embodiment of an image processing device based on artificial intelligence. Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0173] like Figure 3 As shown, the artificial intelligence-based image processing device 300 described in this embodiment includes: a first acquisition module 301, a first processing module 302, a calculation module 303, a second acquisition module 304, an update module 305 and a second processing module 306. Among them:
[0174] The first acquisition module 301 is used to acquire a dust image;
[0175] A first processing module 302 is used to perform normalization processing on the dust image to obtain a corresponding first dust image;
[0176] A calculation module 303, configured to calculate a corresponding image stretch coefficient based on the first dust image;
[0177] The second acquisition module 304 is used to acquire a preset initial pixel mean of the image;
[0178] An updating module 305 is used to perform pixel value updating processing on the first dust image based on the image stretch coefficient, the initial pixel mean value of the image and a preset Gaussian model to obtain a corresponding corrected image;
[0179] The second processing module 306 is used to perform visual enhancement processing on the corrected image to obtain a target dust image.
[0180] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the artificial intelligence-based image processing method in the aforementioned implementation, and will not be repeated here.
[0181] In some optional implementations of this embodiment, the calculation module 303 includes:
[0182] A first acquisition submodule is used to acquire pixel values of each color channel contained in the first dust image; wherein each color channel includes a red channel, a green channel and a blue channel;
[0183] The second acquisition submodule is used to obtain a preset target ratio value;
[0184] The first calling submodule is used to call a preset extension coefficient calculation formula;
[0185] A first calculation submodule, configured to calculate and process the pixel value of each color channel and the target ratio value based on the stretch coefficient calculation formula to obtain the stretch coefficient of each color channel;
[0186] A generating submodule is used to generate the image stretch coefficient based on the stretch coefficients of each of the color channels.
[0187] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the artificial intelligence-based image processing method in the aforementioned implementation, and will not be repeated here.
[0188] In some optional implementations of this embodiment, the updating module 305 includes:
[0189] A first processing submodule is used to perform fitting processing on each color channel included in the first dust image based on the Gaussian model to obtain a channel mean and a channel standard deviation respectively corresponding to each color channel;
[0190] A second calculation submodule, used for calculating the global standard deviation of the first dust image;
[0191] The second calling submodule is used to call a preset color deviation correction algorithm;
[0192] A third calculation submodule is used to calculate and process the image stretch coefficient, the initial pixel mean of the image, the global standard deviation, the channel mean and the channel standard deviation based on the color deviation correction algorithm to obtain updated channel pixel values corresponding to each color channel;
[0193] The merging submodule is used to merge the designated color channels that match the updated channel pixel values to obtain the corrected image.
[0194] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the artificial intelligence-based image processing method in the aforementioned implementation, and will not be repeated here.
[0195] In some optional implementations of this embodiment, the second processing module 306 includes:
[0196] The third calling submodule is used to call a preset image enhancement model;
[0197] An input submodule, used for inputting the corrected image into the image enhancement model;
[0198] An enhancement submodule, used to perform visual enhancement processing on the corrected image through the image enhancement model, and obtain a specified image output by the image enhancement model corresponding to the corrected image;
[0199] The first determination submodule is used to use the designated image as the target dust image.
[0200] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the artificial intelligence-based image processing method in the aforementioned implementation, and will not be repeated here.
[0201] In some optional implementations of this embodiment, the second processing module 306 further includes:
[0202] A third acquisition submodule is used to acquire a pre-constructed training image data set; wherein the training image data set includes a training image and an enhanced image corresponding to the training image;
[0203] The fourth acquisition submodule is used to obtain a preset convolutional neural network model;
[0204] A training submodule, used to input the training image into the convolutional neural network model for training, and obtain a predicted image output by the convolutional neural network model corresponding to the training image;
[0205] A fourth calculation submodule, used to calculate the loss between the predicted image and the enhanced image;
[0206] An optimization submodule, used to optimize the convolutional neural network model based on the loss to obtain a target convolutional neural network model that meets preset expectations;
[0207] The second determination submodule is used to use the target convolutional neural network model as the image enhancement model.
[0208] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the artificial intelligence-based image processing method in the aforementioned implementation, and will not be repeated here.
[0209] In some optional implementations of this embodiment, the first processing module 302 includes:
[0210] The fifth acquisition submodule is used to acquire the initial dust image collected in advance;
[0211] A second processing submodule is used to perform denoising on the initial dust image to obtain a corresponding second dust image;
[0212] A third processing submodule is used to perform smoothing processing on the second dust image to obtain a corresponding third dust image;
[0213] The third determining submodule is configured to use the third dust image as the dust image.
[0214] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the artificial intelligence-based image processing method in the aforementioned implementation, and will not be repeated here.
[0215] In some optional implementations of this embodiment, the image processing device based on artificial intelligence further includes:
[0216] A third acquisition module is used to acquire a designated storage mode corresponding to the target dust image;
[0217] A calling module, used for calling a designated storage medium corresponding to the designated storage mode;
[0218] A storage module is used to store the target dust image in the designated storage medium.
[0219] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the artificial intelligence-based image processing method in the aforementioned implementation, and will not be repeated here.
[0220] To solve the above technical problems, the present application also provides a computer device. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.
[0221] The computer device 4 includes a memory 41, a processor 42, and a network interface 43 that are interconnected through a system bus. It should be noted that the figure only shows a computer device 4 having components 41-43, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital processors (DSPs), embedded devices, etc.
[0222] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.
[0223] The memory 41 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 41 can be an internal storage unit of the computer device 4, such as a hard disk or memory of the computer device 4. In other embodiments, the memory 41 can also be an external storage device of the computer device 4, such as a plug-in hard disk equipped on the computer device 4, a smart memory card (Smart Med ia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Of course, the memory 41 can also include both the internal storage unit of the computer device 4 and its external storage device. In this embodiment, the memory 41 is generally used to store the operating system and various application software installed on the computer device 4, such as computer-readable instructions of an image processing method based on artificial intelligence, etc. In addition, the memory 41 can also be used to temporarily store various types of data that have been output or are to be output.
[0224] The processor 42 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 42 is generally used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to run computer-readable instructions stored in the memory 41 or process data, such as computer-readable instructions for running the artificial intelligence-based image processing method.
[0225] The network interface 43 may include a wireless network interface or a wired network interface. The network interface 43 is generally used to establish a communication connection between the computer device 4 and other electronic devices.
[0226] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0227] In the embodiment of the present application, by using an improved color correction method based on a Gaussian model to perform color equalization processing on the normalized first dust image, accurate color cast correction and color equalization processing can be achieved for the first dust image, effectively improving the image visual clarity of the obtained corrected image, and effectively solving the problem that the existing image enhancement algorithm based on prior knowledge of image processing has weak generalization ability and poor clarity effect of the processed image. In addition, the obtained corrected image will be further subjected to visual enhancement processing, which can effectively restore the local detail information of the dust image, thereby further improving the image visual clarity of the obtained target dust image.
[0228] The present application also provides another embodiment, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions can be executed by at least one processor to enable the at least one processor to perform the steps of the above-mentioned artificial intelligence-based image processing method.
[0229] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0230] In the embodiment of the present application, by using an improved color correction method based on a Gaussian model to perform color equalization processing on the normalized first dust image, accurate color cast correction and color equalization processing can be achieved for the first dust image, effectively improving the image visual clarity of the obtained corrected image, and effectively solving the problem that the existing image enhancement algorithm based on prior knowledge of image processing has weak generalization ability and poor clarity effect of the processed image. In addition, the obtained corrected image will be further subjected to visual enhancement processing, which can effectively restore the local detail information of the dust image, thereby further improving the image visual clarity of the obtained target dust image.
[0231] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0232] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.
Claims
1. An image processing method based on artificial intelligence, It is characterized in that The steps include: Acquire dust images; Normalizing the dust image to obtain a corresponding first dust image; Calculating a corresponding image stretch coefficient based on the first dust image; Get the preset initial pixel mean of the image; Perform pixel value updating processing on the first dust image based on the image stretch coefficient, the initial pixel mean value of the image, and a preset Gaussian model to obtain a corresponding corrected image; Visual enhancement processing is performed on the corrected image to obtain a target dust image.
2. The image processing method based on artificial intelligence according to claim 1, It is characterized in that The step of calculating the corresponding image stretch coefficient based on the first dust image specifically includes: Acquire pixel values of each color channel contained in the first dust image; wherein each of the color channels includes a red channel, a green channel, and a blue channel; Get the preset target ratio value; Call the preset extension coefficient calculation formula; Calculating and processing the pixel value of each color channel and the target ratio value based on the stretch coefficient calculation formula to obtain the stretch coefficient of each color channel; The image stretch coefficient is generated based on the stretch coefficients of each of the color channels.
3. The image processing method based on artificial intelligence according to claim 2, It is characterized in that The step of performing pixel value updating processing on the first dust image based on the image stretch coefficient, the initial pixel mean of the image and a preset Gaussian model to obtain a corresponding corrected image specifically includes: Performing fitting processing on each color channel included in the first dust image based on the Gaussian model to obtain a channel mean and a channel standard deviation respectively corresponding to each color channel; Calculating a global standard deviation of the first dust image; Call the preset color cast correction algorithm; Based on the color shift correction algorithm, the image stretch coefficient, the initial pixel mean of the image, the global standard deviation, the channel mean and the channel standard deviation are calculated and processed to obtain updated channel pixel values corresponding to each of the color channels; The designated color channels that match the updated channel pixel values are merged to obtain the corrected image.
4. The image processing method based on artificial intelligence according to claim 1, It is characterized in that The step of performing visual enhancement processing on the corrected image to obtain a target dust image specifically includes: Call the preset image enhancement model; Inputting the corrected image into the image enhancement model; Performing visual enhancement processing on the corrected image through the image enhancement model, and obtaining a specified image output by the image enhancement model and corresponding to the corrected image; The designated image is used as the target dust image.
5. The image processing method based on artificial intelligence according to claim 4, It is characterized in that Before the step of calling the preset image enhancement model, the method further includes: Acquire a pre-constructed training image data set; wherein the training image data set includes a training image and an enhanced image corresponding to the training image; Get the preset convolutional neural network model; Inputting the training image into the convolutional neural network model for training, and obtaining a predicted image output by the convolutional neural network model corresponding to the training image; Calculating a loss between the predicted image and the enhanced image; Optimizing the convolutional neural network model based on the loss to obtain a target convolutional neural network model that meets preset expectations; The target convolutional neural network model is used as the image enhancement model.
6. The image processing method based on artificial intelligence according to claim 1, It is characterized in that The step of obtaining the dust image specifically includes: Acquire a pre-collected initial dust image; Performing denoising processing on the initial dust image to obtain a corresponding second dust image; performing smoothing processing on the second dust image to obtain a corresponding third dust image; The third dust image is used as the dust image.
7. The image processing method based on artificial intelligence according to claim 1, It is characterized in that After the step of performing visual enhancement processing on the corrected image to obtain a target dust image, the method further includes: Acquire a designated storage mode corresponding to the target dust image; Calling a designated storage medium corresponding to the designated storage method; The target dust image is stored in the designated storage medium.
8. An image processing device based on artificial intelligence, It is characterized in that include: A first acquisition module is used to acquire dust images; A first processing module, used for performing normalization processing on the dust image to obtain a corresponding first dust image; A calculation module, used for calculating a corresponding image stretch coefficient based on the first dust image; The second acquisition module is used to acquire a preset initial pixel mean of the image; An updating module, configured to perform pixel value updating processing on the first dust image based on the image stretch coefficient, the initial pixel mean of the image, and a preset Gaussian model to obtain a corresponding corrected image; The second processing module is used to perform visual enhancement processing on the corrected image to obtain a target dust image.
9. A computer device comprising a memory and a processor, wherein the memory stores computer-readable instructions, and when the processor executes the computer-readable instructions, the steps of the artificial intelligence-based image processing method as described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, implement the steps of the artificial intelligence-based image processing method according to any one of claims 1 to 7.
