Image processing method and device and readable storage medium
By adjusting the image size and using multiple autoencoder models to perform parallel defuzzing processing, the problem of time-consuming image processing in the prior art is solved, the image processing efficiency is improved and the accuracy of defuzzing is ensured.
Patent Information
- Application Number
- CN202311356898.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-19
- Publication Date
- 2025-04-22
AI Technical Summary
In the prior art, image processing takes a long time, resulting in low image processing efficiency, especially when defuzzing is performed using three convolutional neural networks in series.
By adjusting the size of the image to be processed, a plurality of first images of different sizes are obtained, and the deblurring process is performed using the autoencoder model corresponding to each size to obtain a plurality of second images. Then, the second images are sized to obtain a third image with the same size as the image to be processed, and finally a processed image is generated based on the third images.
By using multiple autoencoder models in parallel, this method reduces the processing time of image feature extraction, improves image processing efficiency, and ensures the accuracy of image deblurring.
Smart Images

Figure CN119863394A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to image processing technology, and in particular to an image processing method, device and readable storage medium. Background Art
[0002] During the process of image capture or transmission, the image becomes blurred due to various factors, such as out-of-focus blur caused by improper focusing during image capture, motion blur caused by the relative movement between the camera and the object being photographed, etc., which causes the image clarity to decrease, seriously affecting the image quality and thus having a negative impact on image analysis, processing and other applications. Therefore, it is necessary to deblur the blurred image to improve its clarity.
[0003] In the prior art, three convolutional neural networks are often connected in series to extract features of images at multiple scales, thereby obtaining high-definition images. However, this method requires the use of three convolutional neural networks in series to obtain images with high accuracy, and the image processing takes a long time, resulting in low image processing efficiency. Summary of the invention
[0004] The present application provides an image processing method, device and readable storage medium to improve image processing efficiency.
[0005] In a first aspect, the present application provides an image processing method, comprising:
[0006] Get the image to be processed;
[0007] Adjusting the size of the image to be processed to obtain N first images; different first images have different sizes; N is an integer greater than or equal to 2;
[0008] Obtaining second images corresponding to the first images respectively by using autoencoder models corresponding to the sizes of the first images; the autoencoder models are used to perform deblurring processing on the images;
[0009] adjusting the size of each of the second images according to the size of the image to be processed, to obtain a third image corresponding to each of the second images; the size of the third image is the same as the size of the image to be processed;
[0010] Obtaining a processed image according to each of the third images; the processed image is an image obtained by deblurring the image to be processed;
[0011] The processed image is output.
[0012] Optionally, adjusting the size of the image to be processed to obtain N first images includes:
[0013] According to the size of the image to be processed, obtaining a candidate size range corresponding to the size of the image to be processed;
[0014] Determine N target sizes from the candidate size range;
[0015] Based on the N target sizes, the size of the image to be processed is adjusted to obtain N first images.
[0016] Optionally, acquiring, according to the size of the image to be processed, a candidate size range corresponding to the size of the image to be processed includes:
[0017] According to the size of the image to be processed and the type of the image to be processed, a candidate size range corresponding to the size of the image to be processed and the number of the target sizes are acquired.
[0018] Optionally, obtaining a processed image according to each of the third images includes:
[0019] Averaging the same pixel in each of the third images to obtain an average value of the pixel;
[0020] Generate a processed image based on the average value of each pixel.
[0021] Optionally, the obtaining the second images corresponding to the first images by using the autoencoder models corresponding to the sizes of the first images respectively includes:
[0022] According to the size of the first image, searching from a model library for an autoencoder model corresponding to the size of the first image;
[0023] If an autoencoder model corresponding to the first image size is found, using the autoencoder model corresponding to the first image size to obtain a second image corresponding to the first image;
[0024] If the autoencoder model corresponding to the first image size cannot be found, correction prompt information is output, where the correction prompt information is used to prompt correction of the size of the first image.
[0025] Optionally, obtaining the image to be processed includes:
[0026] Acquiring the image to be processed;
[0027] Or, receiving the image to be processed sent by an image acquisition device or an electronic device.
[0028] Optionally, the method further includes:
[0029] Perform image recognition on the processed image to obtain the image recognition result.
[0030] In a second aspect, the present application provides an image processing device, comprising:
[0031] A first acquisition module, used for acquiring an image to be processed;
[0032] An adjustment module, used for adjusting the size of the image to be processed to obtain N first images; different first images have different sizes; N is an integer greater than or equal to 2;
[0033] A second acquisition module, used to respectively use an autoencoder model corresponding to each of the first image sizes to acquire a second image corresponding to each of the first images; the autoencoder model is used to perform deblurring processing on the image;
[0034] A first processing module, configured to adjust the size of each of the second images according to the size of the image to be processed, so as to obtain a third image corresponding to each of the second images; the size of the third image is the same as the size of the image to be processed;
[0035] A second processing module, used for obtaining a processed image according to each of the third images; the processed image is an image obtained by deblurring the image to be processed;
[0036] An output module is used to output the processed image.
[0037] In a third aspect, the present application provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor;
[0038] The memory stores computer-executable instructions;
[0039] The processor executes the computer-executable instructions stored in the memory to implement the image processing method as described in any one of the first aspects.
[0040] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the image processing method as described in any one of the first aspects.
[0041] In a fifth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the image processing method as described in any one of the first aspects.
[0042] In a sixth aspect, the present application provides a chip having a computer program stored thereon, wherein when the computer program is executed by the chip, the image processing method as described in any one of the first aspects is implemented.
[0043] The image processing method, device and readable storage medium provided by the present application resize the image to be processed to obtain a first image of different scales, use multiple autoencoder models of different scales to obtain multiple second images including image features after deblurring at different scales in parallel, resize the second image again to obtain a third image, and obtain a processed image based on the third image. The method uses autoencoder models of different scales to obtain image features of different scales, ensures the accuracy of image deblurring, and multiple autoencoder models can run in parallel, reducing the time consumption of image processing and improving the efficiency of image processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0045] Figure 1 A flowchart of an image processing method provided in this application;
[0046] Figure 2 A schematic diagram of the architecture of an image processing method provided in this application;
[0047] Figure 3 A schematic diagram of the structure of an autoencoder model provided in this application;
[0048] Figure 4 A flowchart of another image processing method is provided for this application;
[0049] Figure 5 A flowchart of another image processing method provided in this application;
[0050] Figure 6 A schematic diagram of the structure of an image processing device provided by the present application;
[0051] Figure 7 A schematic diagram of the structure of an electronic device provided in this application.
[0052] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0053] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0054] First, the terms involved in this application are explained:
[0055] Image clarity: The clarity of each detail and its boundary of the image. The blurriness of an image can be used to describe the blurriness of the image, which is inversely proportional to the clarity. Therefore, the clarity of an image can be described by its clarity or blurriness. For example, the blurriness of an image can be obtained through a blurriness evaluation algorithm, and then the clarity of the image can be obtained.
[0056] Blurry image: an image whose clarity is lower than a certain preset threshold. Correspondingly, a clear image refers to an image whose clarity is higher than a certain preset threshold.
[0057] During the process of image capture or transmission, the image becomes blurred due to the influence of various factors, such as defocus blur caused by incorrect focusing when capturing the image, motion blur caused by the relative movement between the camera and the photographed object, etc., resulting in a decrease in image clarity, seriously affecting the quality of the image, and thus having a negative impact on image analysis, processing and other applications.
[0058] In the prior art, a machine learning algorithm is often used to perform image deblurring. The machine learning algorithm is used to learn the features of a blurred image and a clear image pair, and then the machine learning algorithm is used to obtain a clear image of the input blurred image.
[0059] At present, most machine learning algorithms use three convolutional neural networks in series, and each network is used to extract image features of different scales to obtain clearer images with higher accuracy. However, this method requires three convolutional neural networks in series to extract image features of different scales, which takes a long time to process images, resulting in low image processing efficiency.
[0060] In view of this, the present application provides an image processing method, which replaces the convolutional neural network model with multiple autoencoder models of different scales, obtains image features of different scales in parallel, reduces the time consumption of image feature extraction and processing at different scales, and improves the efficiency of image processing.
[0061] The execution subject of this application is an electronic device with processing capabilities, such as a computer, a server, etc.; or an image processing device, which can be implemented by any software and / or hardware, such as a processing chip or a collection of processing chips. It should be noted that the image processing device can be set up separately or integrated in an electronic device.
[0062] The following takes the execution subject as an electronic device as an example, and describes in detail the technical solution of the present application and how the technical solution of the present application solves the above technical problems in combination with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in combination with the accompanying drawings.
[0063] Figure 1 A schematic diagram of a flow chart of an image processing method provided in this application, Figure 2 The following is a schematic diagram of the architecture of an image processing method provided in this application, which needs to be explained: Figure 2 It is only for illustration that the image to be processed corresponds to two first images. Figure 1 and Figure 2 As shown, the method includes:
[0064] S101: Obtain an image to be processed.
[0065] The above-mentioned image to be processed refers to an image whose clarity is lower than a preset threshold, that is, a blurred image. It should be noted that the threshold may be different in image applications in different fields, for example, the thresholds in the field of autonomous driving and the field of medical applications may be different.
[0066] In one possible implementation, the electronic device is provided with an image acquisition device, and the image to be processed may be acquired by the image acquisition device. In another possible implementation, the image to be processed is sent to the electronic device by the image acquisition device, or by other electronic devices. In another possible implementation, the image to be processed may be imported from an external device, such as a USB flash drive. In another possible implementation, the image to be processed may be obtained from the cloud or a database.
[0067] S102: Adjust the size of the image to be processed to obtain N first images.
[0068] The above-mentioned N is an integer greater than or equal to 2.
[0069] The sizes of the different first images are different. Figure 2, the first image-1 and the first image-2 can be obtained. The above-mentioned first image may include, for example, the image to be processed and other images to be processed of different sizes; or may only include other images to be processed of different sizes. Taking the size of the above-mentioned image to be processed as 256*256 as an example, the first image may be a first image of two sizes of 256*256 and 128*128, or a first image of two sizes of 128*128 and 64*64.
[0070] Regarding how to adjust the size of the image to be processed, one possible implementation method is to fix the size of the image to be processed and use a common size to adjust each image to be processed. For example, the size of the image to be processed is fixed to 256*256, and the image to be processed is adjusted to two sizes: 128*128 and 64*64. If the original size of the image to be processed is 512*512, first adjust it to 256*256, and then adjust the size of the image to be processed according to the above size.
[0071] Another possible implementation is that the electronic device has a preset size library, which includes target sizes corresponding to various size ranges. The target size corresponding to the image to be processed can be obtained according to the size of the image to be processed, and the image to be processed can be adjusted based on the target size.
[0072] Regarding how to adjust the size of the image to be processed, for example, the image to be processed may be downsampled to adjust the size of the image to be processed. The downsampling process may be, for example, a local mean method or an interpolation algorithm, such as bilinear interpolation or nearest neighbor interpolation.
[0073] It should be noted that the local mean method and interpolation algorithm can refer to the existing technology, and this application does not limit it. This application does not limit the downsampling processing method, and it only needs to ensure that the downsampling processing method adopted for the same image to be processed is the same.
[0074] S103. Obtain second images corresponding to the first images by using the autoencoder models corresponding to the sizes of the first images respectively.
[0075] The above-mentioned autoencoder model is used to perform deblurring processing on an image. The above-mentioned second image refers to an image deblurred by the autoencoder model. For example, referring to Figure 2 , the first image-1 uses its corresponding autoencoder model 1 to obtain the second image-1; the first image-2 uses its corresponding autoencoder model 2 to obtain the second image-2.
[0076] A possible implementation method is to search the autoencoder model corresponding to the first image size from the model library according to the above-mentioned first image sizes, and then use the autoencoder model to obtain the second image corresponding to each first image.
[0077] In another possible implementation, the sizes of the image to be processed and the first image are fixed, and the autoencoder model corresponding to the size of the first image is also determined. The second image corresponding to the first image can be obtained by simply inputting the first image into the autoencoder model corresponding to the size of the first image.
[0078] Figure 3 This is a schematic diagram of the structure of an autoencoder model provided in this application. Figure 3 As shown, the autoencoder model may include an input layer, an encoder, a hidden layer, a decoder, and an output layer.
[0079] The input layer is used to input the image to the encoder. The encoder includes multiple convolution layers (Conv) with a convolution kernel size of 3*3 and a step size of 2 (s=2), which are used to extract image feature information of the input image. The hidden layer includes a flattening layer, a reorganization layer and at least one fully connected layer, which is used to perform feature fusion on the extracted image feature information.
[0080] The decoder includes multiple layers of deconvolution layers with a convolution kernel size of 3*3 and a step size of 2 and a deconvolution layer (Deconv) with a convolution kernel size of 3*3 and a step size of 1, which are used to restore the image feature information after feature fusion to the size of the input image. The output layer is used to output the image obtained by the decoder.
[0081] The autoencoder model corresponding to the first image size means that the size of the first image is the same as the image size of the input layer of the autoencoder model.
[0082] It should be noted that the structure of the above autoencoder model is related to the image size of the input layer of the model.
[0083] S104: Adjust the size of each second image according to the size of the image to be processed to obtain a third image corresponding to each second image.
[0084] It should be noted that the size of the second image output by the above autoencoder model is the same as the size of the corresponding input first image. Therefore, in order to ensure that the size of the clear image to be processed does not change, the size of the second image needs to be adjusted to the same size as the image to be processed, that is, the size of the third image is the same as the size of the image to be processed.
[0085] The third image mentioned above refers to the second image after the size adjustment. Figure 2For example, the second image-1 is adjusted to obtain the third image-1, and the second image-2 is adjusted to obtain the third image-2.
[0086] In one possible implementation, the size of the second image is adjusted to the size of the image to be processed according to the size of the image to be processed. In another possible implementation, the size of the image to be processed is fixed, and the size of the second image is adjusted to the fixed size of the image to be processed. In yet another possible implementation, the size of the image to be processed is fixed, and the size of the second image is adjusted to the original size of the image to be processed.
[0087] Regarding how to adjust the size of each second image, for example, upsampling can be used to restore the size of the second image to the size of the image to be processed. Exemplarily, an interpolation algorithm can be used to adjust the image size, such as a bilinear interpolation algorithm, a bicubic interpolation algorithm, etc.
[0088] It should be noted that the prior art can be referred to for the bilinear interpolation algorithm and the bicubic interpolation algorithm, and this application does not limit this. This application does not limit the upsampling processing method, and only needs to ensure that the upsampling processing method adopted for the second image of the same image to be processed is the same.
[0089] S105: Obtain a processed image according to each third image.
[0090] The processed image is an image obtained by deblurring the image to be processed.
[0091] One possible implementation method is to average the data of the same pixel point in the above-mentioned third images to obtain the average value of the pixel point, and use the average value of each pixel point as the data of the corresponding pixel point of the processed image, or multiply the average value of each pixel point by a coefficient as the data of the corresponding pixel point of the processed image.
[0092] Another possible implementation method is to preset weight values of second images of different scales, and the third images corresponding to the second images have the same weight value. Based on the different weight values, the data of the same pixel point of each third image is weighted averaged to obtain the average value of the pixel point, and the average value of the pixel point is used as the data of the pixel point of the processed image, or the value obtained by multiplying the average value of each pixel point by a coefficient is used as the data of the corresponding pixel point of the processed image.
[0093] In another possible implementation, the size of the above-mentioned image to be processed is fixed. The size of the above-mentioned second image is first adjusted to the fixed size of the image to be processed, and then the above-mentioned two methods are used to obtain the initial processed image, and then the size of the initial processed image is adjusted to the original size of the image to be processed to obtain the processed image.
[0094] For example, referring to the above description, if the original size of the image to be processed is 512*512, the fixed size of the image to be processed is 256*256, the size of each of the third images is 256*256, and the size of the initial processed image obtained after the above processing is 256*256, which is then restored to the original size of the image to be processed, 512*512.
[0095] S106: Output the processed image.
[0096] In a possible implementation, the electronic device includes an image recognition device, and the processed image is output to the image recognition device of the electronic device for image recognition to obtain an image recognition result for subsequent image application. For example, autonomous driving is performed based on the image recognition result.
[0097] In another possible implementation, the electronic device outputs the deblurred image to an image recognition device for image recognition to obtain image recognition results for subsequent image applications. The image recognition device is independent of the electronic device and can be implemented by any software and / or hardware, such as a processing chip or a collection of processing chips.
[0098] The image processing method provided by the present application resizes the image to be processed to obtain first images of different scales, uses multiple autoencoder models of different scales to obtain multiple second images including image features after deblurring at different scales in parallel, resizes the second image again to obtain a third image, and obtains a processed image based on the third image. The method uses autoencoder models of different scales to obtain image features of different scales, ensures the accuracy of image deblurring, and multiple autoencoder models can run in parallel, reducing the time consumption of image processing and improving the efficiency of image processing.
[0099] The following describes how to adjust the size of the image to be processed to obtain N first images.
[0100] Figure 4 A schematic diagram of another image processing method provided in this application. Figure 4 As shown, the method includes:
[0101] S201. According to the size of the image to be processed, obtain a candidate size range corresponding to the size of the image to be processed.
[0102] In a possible implementation, the electronic device is preset with a size library, which includes a mapping relationship between a size range and a target size. For example, Table 1 is a schematic diagram of a size library. It should be noted that Table 1 is only a schematic diagram of a square image. According to the size of the image to be processed, the candidate size range corresponding to the size of the image to be processed can be obtained from the size library. For example, taking the size of the image to be processed as 256*256 as an example, the candidate size range is [256, 512].
[0103] Table 1 Size library
[0104] Size range Target size [256,512] 256*256、128*128、64*64 (128,256) 128*128、64*64
[0105] Another possible implementation is that the size library includes a mapping relationship between image type, image size, and target size. The image type may refer to the format of the image, such as bmp, jpg, tif, etc.; or it may refer to the type of image, such as grayscale image, true color RGB image, indexed image, etc., which can be set according to actual needs. For example, Table 2 is a schematic diagram of a size library. It should be noted that Table 2 is only a schematic diagram of a square image.
[0106] Table 2 Size library
[0107]
[0108] Referring to Table 2, the candidate size range corresponding to the size of the image to be processed can be obtained according to the size of the image to be processed and the type of the image to be processed.
[0109] S202: Determine N target sizes from the candidate size range.
[0110] The target size is the size to which the image to be processed is to be adjusted, that is, the size of the first image. Referring to Table 1 or Table 2, after determining the candidate size range according to the size of the image to be processed, N target sizes can be determined.
[0111] S203 . Based on the N target sizes, adjust the size of the image to be processed to obtain N first images.
[0112] The description of this step can refer to the aforementioned step S102 and will not be repeated here.
[0113] The image processing method provided in the present application can determine the adjustment size of the image to be processed based on the image to be processed, and can determine how to adjust the image based on the properties of the image itself, so that the adjusted first image is more accurate.
[0114] Taking the above-mentioned electronic device including a model library as an example, the following describes how to respectively use the autoencoder models corresponding to the sizes of each first image to obtain the second image corresponding to each first image.
[0115] Figure 5 This is a flow chart of another image processing method provided by this application. Figure 5 As shown, the method includes:
[0116] S301. According to the size of the first image, search for an autoencoder model corresponding to the size of the first image from a model library.
[0117] As mentioned above, the model library includes pre-trained autoencoder models of various scales. Therefore, according to the size of the first image, the autoencoder model corresponding to the size of the first image can be searched from the model library.
[0118] If an autoencoder model corresponding to the size of the first image is found, step S302 is executed; if an autoencoder model corresponding to the size of the first image is not found, a possible implementation method indicates that the size of the first image is not the target size of the image to be processed, and the size of the first image needs to be corrected, then correction prompt information is output, and the correction prompt information is used to prompt the correction of the size of the first image. Exemplarily, after receiving the correction prompt information, the electronic device resizes the image to be processed to obtain the first image again.
[0119] Another possible implementation method is that if the autoencoder model corresponding to the first image size is not found, it may be because the model library does not include the autoencoder model corresponding to the first image size. Then, based on the size of the first image, the image in the preset training data set can be resized to obtain an adjusted training data set, and the input layer of the initial autoencoder model can be adjusted to obtain an adjusted initial autoencoder model; the adjusted initial autoencoder model is trained using the adjusted training data set to obtain an autoencoder model corresponding to the first image size.
[0120] Exemplary, reference Figure 3 , taking the first image size of 256*256 as an example, how to train the autoencoder model of this structure is explained.
[0121] The above-mentioned preset training data set includes multiple blurred image-clear image pairs of 256*256 size, and the training data set is divided into a training set and a validation set in a ratio of 7:3. The blurred image in the training set is used as the input of the adjusted initial autoencoder model, and the loss function of the autoencoder model is the Euclidean distance between the output image and the clear image corresponding to the input blurred image. The optimizer of the autoencoder model can be an Adam optimizer, and based on the loss value, the weight parameters of the adjusted initial autoencoder model are updated until the model converges to obtain the autoencoder model corresponding to the first image size.
[0122] S302. Obtain a second image corresponding to the first image by using an autoencoder model corresponding to the size of the first image.
[0123] The first image is input into the autoencoder model, and the second image corresponding to the first image is output.
[0124] The image processing method provided in the present application is based on a model library. According to the size of the first image, the autoencoder model corresponding to the size of the first image is searched, and the second image is acquired using the autoencoder model corresponding to the size of the first image, thereby ensuring the accuracy of the second image.
[0125] Figure 6 This is a schematic diagram of the structure of an image processing device provided by this application. Figure 6 As shown, the device comprises:
[0126] A first acquisition module 11, used to acquire an image to be processed;
[0127] An adjustment module 12, configured to adjust the size of the image to be processed to obtain N first images; different first images have different sizes; and N is an integer greater than or equal to 2;
[0128] A second acquisition module 13 is used to respectively use an autoencoder model corresponding to each of the first image sizes to acquire a second image corresponding to each of the first images; the autoencoder model is used to perform deblurring processing on the image;
[0129] A first processing module 14 is used to adjust the size of each second image according to the size of the image to be processed, so as to obtain a third image corresponding to each second image; the size of the third image is the same as the size of the image to be processed;
[0130] A second processing module 15 is used to obtain a processed image according to each of the third images; the processed image is an image obtained by deblurring the image to be processed;
[0131] The output module 16 is used to output the processed image.
[0132] In a possible implementation, the adjustment module 12 is specifically used to obtain a candidate size range corresponding to the size of the image to be processed according to the size of the image to be processed; determine N target sizes from the candidate size range; and adjust the size of the image to be processed based on the N target sizes to obtain N first images.
[0133] In this implementation, the adjustment module 12 is specifically used to obtain a candidate size range corresponding to the size of the image to be processed and the number of target sizes according to the size of the image to be processed and the type of the image to be processed.
[0134] In a possible implementation, the second processing module 15 is specifically configured to average the same pixel in each of the third images to obtain an average value of the pixel; and generate a processed image based on the average value of each pixel.
[0135] In a possible implementation, the second acquisition module 13 is specifically used to search for an autoencoder model corresponding to the size of the first image from a model library according to the size of the first image; if an autoencoder model corresponding to the size of the first image is found, the autoencoder model corresponding to the size of the first image is used to obtain a second image corresponding to the first image; if the autoencoder model corresponding to the size of the first image is not found, correction prompt information is output, and the correction prompt information is used to prompt correction of the size of the first image.
[0136] In a possible implementation, the first acquisition module 11 is specifically configured to acquire the image to be processed; or receive the image to be processed sent by an image acquisition device or an electronic device.
[0137] In a possible implementation, the recognition module 17 is configured to perform image recognition on the processed image to obtain the image recognition result.
[0138] The functional modules of the above-mentioned image processing device can cooperate to execute the image processing method described in the above-mentioned embodiment. The implementation principle and technical effect are similar and will not be described in detail.
[0139] Figure 7 This is a schematic diagram of the structure of an electronic device provided in this application. Figure 7 As shown, the electronic device 500 may include: at least one processor 501 and a memory 502. The electronic device may be a terminal, a server, a computer device, or other device with processing capabilities.
[0140] The memory 502 is used to store programs. Specifically, the programs may include program codes, and the program codes include computer operation instructions.
[0141] The memory 502 may include a high-speed RAM memory, and may also include a non-volatile memory.
[0142] The processor 501 is used to execute the computer-executable instructions stored in the memory 502 to implement the image processing method described in the above method embodiment. The processor 501 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.
[0143] The electronic device 500 may further include a communication interface 503, so as to communicate and interact with an external device through the communication interface 503. The external device may be, for example, a computer, a tablet, and the like.
[0144] In specific implementation, if the communication interface 503, the memory 502 and the processor 501 are implemented independently, the communication interface 503, the memory 502 and the processor 501 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc., but it does not mean that there is only one bus or one type of bus.
[0145] Optionally, in a specific implementation, if the communication interface 503, the memory 502 and the processor 501 are integrated on a chip, the communication interface 503, the memory 502 and the processor 501 can complete communication through an internal interface.
[0146] The present application also provides a computer-readable storage medium, which may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, and other media that can store program codes. Specifically, the computer-readable storage medium stores computer execution instructions, and the computer execution instructions are used for the image processing method in the above-mentioned embodiment.
[0147] The present application also provides a computer program product, which includes an execution instruction, which is stored in a readable storage medium. At least one processor of the electronic device 500 can read the execution instruction from the readable storage medium, and at least one processor executes the execution instruction so that the electronic device 500 implements the methods provided in the various embodiments described above.
[0148] The present application also provides a chip having a computer program stored thereon, and when the computer program is executed by the chip, the methods provided in various implementation modes are implemented.
[0149] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0150] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. An image processing method, characterized in that: The method comprises: Get the image to be processed; Adjusting the size of the image to be processed to obtain N first images; different first images have different sizes; N is an integer greater than or equal to 2; Obtaining second images corresponding to the first images respectively by using autoencoder models corresponding to the sizes of the first images; the autoencoder models are used to perform deblurring processing on the images; adjusting the size of each of the second images according to the size of the image to be processed, to obtain a third image corresponding to each of the second images; the size of the third image is the same as the size of the image to be processed; Obtaining a processed image according to each of the third images; the processed image is an image obtained by deblurring the image to be processed; The processed image is output.
2. The method according to claim 1, characterized in that The step of adjusting the size of the image to be processed to obtain N first images includes: According to the size of the image to be processed, obtaining a candidate size range corresponding to the size of the image to be processed; Determine N target sizes from the candidate size range; Based on the N target sizes, the size of the image to be processed is adjusted to obtain N first images.
3. The method according to claim 2, characterized in that The acquiring, according to the size of the image to be processed, a candidate size range corresponding to the size of the image to be processed includes: According to the size of the image to be processed and the type of the image to be processed, a candidate size range corresponding to the size of the image to be processed and the number of the target sizes are acquired.
4. The method according to claim 1, characterized in that: The step of obtaining a processed image according to each of the third images comprises: Averaging the same pixel in each of the third images to obtain an average value of the pixel; Generate a processed image based on the average value of each pixel.
5. The method according to any one of claims 1 to 4, characterized in that: The obtaining the second images corresponding to the first images respectively by using the autoencoder models corresponding to the sizes of the first images includes: According to the size of the first image, searching from a model library for an autoencoder model corresponding to the size of the first image; If an autoencoder model corresponding to the first image size is found, using the autoencoder model corresponding to the first image size to obtain a second image corresponding to the first image; If the autoencoder model corresponding to the first image size cannot be found, correction prompt information is output, where the correction prompt information is used to prompt correction of the size of the first image.
6. The method according to any one of claims 1 to 4, characterized in that: The step of obtaining the image to be processed comprises: Acquiring the image to be processed; Or, receiving the image to be processed sent by an image acquisition device or an electronic device.
7. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: Perform image recognition on the processed image to obtain an image recognition result.
8. An image processing device, characterized in that: The device comprises: A first acquisition module, used for acquiring an image to be processed; An adjustment module, used for adjusting the size of the image to be processed to obtain N first images; different first images have different sizes; N is an integer greater than or equal to 2; A second acquisition module, used to respectively use an autoencoder model corresponding to each of the first image sizes to acquire a second image corresponding to each of the first images; the autoencoder model is used to perform deblurring processing on the image; A first processing module, configured to adjust the size of each of the second images according to the size of the image to be processed, so as to obtain a third image corresponding to each of the second images; the size of the third image is the same as the size of the image to be processed; A second processing module, used for obtaining a processed image according to each of the third images; the processed image is an image obtained by deblurring the image to be processed; An output module is used to output the processed image.
9. An electronic device, characterized in that: The electronic device comprises: a processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the image processing method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the image processing method according to any one of claims 1 to 7.