Image processing method, device, equipment and storage medium

The neural network model identifies and filters the sky area, and automatically replaces the sky material in the image based on the shooting attribute parameters, which solves the problem of complex steps in the existing technology and improves the efficiency and effect of image processing.

CN110956063BActive Publication Date: 2024-09-20BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201811133926.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2018-09-27
Publication Date
2024-09-20
Estimated Expiration
2038-09-27

AI Technical Summary

Technical Problem

In the existing technology, the steps of replacing the sky area in the captured image with the ideal sky material are complicated, the operation is cumbersome, and the human-computer interaction efficiency is low.

Method used

Use the neural network model to identify the sky area in the image, read the shooting attribute parameters of the image, filter out the target sky material from the candidate sky materials based on the parameters, and replace it into the image, using filter processing to unify the tone and texture.

Benefits of technology

It reduces the user's manual operation steps and improves the efficiency of human-computer interaction. It can automatically select suitable sky materials to replace the original sky area and generate images that are comparable to professional shooting effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110956063B
    Figure CN110956063B
Patent Text Reader

Abstract

The present application discloses an image processing method, device, equipment and storage medium, and relates to the field of image processing. The method comprises: identifying the sky area in the image through a neural network model, selecting the target sky material from the candidate sky materials according to the shooting attribute parameters of the read image, replacing the sky area in the image with the target sky material, and obtaining the target image; solving the problem that at least 6 steps are required to manually replace the sky area in the related art, and automatically selecting the appropriate target sky material through the shooting attribute parameters to replace the original sky area in the image, without the need for the user's own post-production photo editing, reducing the user's manual operation steps, and improving the efficiency of human-computer interaction. Even if the user does not have the basic skills of photo editing, he can get a sky photo comparable to that taken by a professional SLR lens.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of image processing, and in particular to an image processing method, apparatus, device and storage medium. Background Art

[0002] Usually, users use terminals to take photos of things they are interested in. When the sky is included in the photo, the quality of the photo will be affected by the ambient light. For example, when taking photos, users may encounter bad weather conditions, poor lighting, etc., and the photo shooting effect of the scene may not meet the user's ideal effect. For example, on a cloudy day, the user takes a photo with the sky as the background, and the sky area in the resulting photo is gray, which does not meet the user's ideal effect.

[0003] In the related art, the user uses photo editing software to replace the sky area in the captured image with an ideal sky material, and the relevant steps are as follows: 1. After the user uses the terminal to capture the image, the user uploads the image to the computer; 2. On the premise that the computer has the photo editing software installed (if the computer does not have the photo editing software installed, the photo editing software needs to be installed first), open the photo editing software; 3. Open the image and the ideal sky material in the above-mentioned photo editing software; 4. Set the sky material as the background and the image as layer 1; 5. Use the cutout tool to select the non-sky area in the image, copy the non-sky area, and set the non-sky area as layer 2; 6. Delete layer 1 and feather layer 2; 7. Save the modified image.

[0004] The user needs to go through at least 7 steps to obtain the image after replacing the sky area. This method is complex to operate, has cumbersome steps, and has low human-computer interaction efficiency. Summary of the invention

[0005] The embodiments of the present application provide an image processing method, device, equipment and storage medium, which can solve the problem that replacing sky materials in the sky area of ​​a captured image requires a lot of manual operations, the steps are complicated, and the human-computer interaction efficiency is low. The technical solution is as follows:

[0006] According to a first aspect of the present application, there is provided an image processing method, the method comprising:

[0007] Identify the sky area in the image through a neural network model;

[0008] Read the shooting attribute parameters of the image;

[0009] Filtering target sky materials from candidate sky materials according to shooting attribute parameters;

[0010] The sky area in the image is replaced with the target sky material to obtain the target image.

[0011] In some embodiments, selecting a target sky material from candidate sky materials according to shooting attribute parameters includes:

[0012] Extracting a spatiotemporal parameter from the shooting attribute parameter, the spatiotemporal parameter including shooting time and / or shooting location;

[0013] The target sky material is selected from the candidate sky materials according to the spatiotemporal parameters.

[0014] In some embodiments, the spatiotemporal parameters include capture time;

[0015] Filter the target sky material from the candidate sky materials according to the temporal and spatial parameters, including:

[0016] According to the time period to which the shooting time belongs, the target sky material corresponding to the time period is screened out from the candidate sky materials.

[0017] In some embodiments, the spatiotemporal parameters include the location of the shooting;

[0018] Filter the target sky material from the candidate sky materials according to the temporal and spatial parameters, including:

[0019] According to the geographical area to which the shooting location belongs, the target sky material corresponding to the geographical area is screened out from the candidate sky materials.

[0020] In some embodiments, the spatiotemporal parameters include the time and / or location of the capture;

[0021] Filter target sky materials from candidate sky materials based on temporal and spatial parameters, including:

[0022] Determine the corresponding weather type according to the shooting time and location;

[0023] Filter out target sky materials corresponding to the weather type from the candidate sky materials.

[0024] In some embodiments, the method further comprises:

[0025] The target image is processed using a filter, where the filter is used to enhance the uniformity of tone and / or texture of the target sky material and other image parts in the target image.

[0026] In some embodiments, the target image is processed using a filter, including:

[0027] Determine the filter corresponding to the target image according to the shooting time and weather type;

[0028] The target image is processed using the filter corresponding to the target image.

[0029] In some embodiments, reading the shooting attribute parameters of the image includes:

[0030] The EXIF ​​(Exchangeable Image File) information of the image is read as the shooting attribute information.

[0031] According to a second aspect of the present application, there is provided an image processing device, the device comprising:

[0032] A recognition module, configured to recognize a sky area in the image through a neural network model;

[0033] A reading module, configured to read shooting attribute parameters of an image;

[0034] A screening module is configured to screen out a target sky material from candidate sky materials according to shooting attribute parameters;

[0035] The replacement module is configured to replace the sky area in the image with the target sky material to obtain the target image.

[0036] In some embodiments, the screening module comprises:

[0037] An extraction submodule is configured to extract time-space parameters from the shooting attribute parameters, where the time-space parameters include shooting time and / or shooting location;

[0038] The screening submodule is configured to screen out target sky materials from candidate sky materials according to spatiotemporal parameters.

[0039] In some embodiments, the spatiotemporal parameters include capture time;

[0040] The screening submodule is configured to screen out target sky materials corresponding to the time period from the candidate sky materials according to the time period to which the shooting time belongs.

[0041] In some embodiments, the spatiotemporal parameters include the location of the shooting;

[0042] The screening submodule is configured to screen out target sky materials corresponding to the geographical area from the candidate sky materials according to the geographical area to which the shooting location belongs.

[0043] In some embodiments, the spatiotemporal parameters include the time and / or location of the capture;

[0044] Screening modules include:

[0045] A determination submodule is configured to determine a corresponding weather type according to the shooting time and shooting location;

[0046] The screening submodule is configured to screen out target sky materials corresponding to the weather type from the candidate sky materials.

[0047] In some embodiments, the apparatus further comprises:

[0048] The processing module is configured to process the target image using a filter, where the filter is used to enhance the tone uniformity and / or texture uniformity of the target sky material and other image parts in the target image.

[0049] In some embodiments, the processing module includes:

[0050] A second determination submodule is configured to determine a filter corresponding to the target image according to the shooting time and weather type;

[0051] The processing submodule is configured to process the target image using a filter corresponding to the target image.

[0052] In some embodiments, the reading module is configured to read the EXIF ​​information of the image as the shooting attribute information.

[0053] According to the third aspect of the present application, a terminal is provided, comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the image processing method as described in any one of the first aspects above.

[0054] According to the fourth aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the image processing method as described in any one of the first aspects above.

[0055] The beneficial effects brought by the technical solution provided by the embodiment of the present application include at least:

[0056] The sky area in the image is identified through a neural network model, and the target sky material is selected from the candidate sky materials according to the shooting attribute parameters of the read image, and the sky area in the image is replaced with the target sky material to obtain the target image; this solves the problem that at least 7 steps are required in the related art to obtain the target image in which the sky area is replaced with the target sky material, and achieves the automatic selection of suitable target sky materials through shooting attribute parameters to replace the original sky area in the image, without the need for the user to perform post-production photo editing, reducing the user's manual operation steps and improving the efficiency of human-computer interaction. Even if the user does not have the basic skills in photo editing, he can still get a sky photo comparable to that taken with a professional SLR lens. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only 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.

[0058] Figure 1 is a structural block diagram of a terminal provided by an exemplary embodiment of the present application;

[0059] Figure 2 is a structural block diagram of a terminal provided by another exemplary embodiment of the present application;

[0060] Figure 3 is a flow chart of an image processing method provided by an exemplary embodiment of the present application;

[0061] Figure 4 is a schematic diagram of an interface of an image processing method provided by an exemplary embodiment of the present application;

[0062] Figure 5 is a schematic diagram of an interface of an image processing method provided by another exemplary embodiment of the present application;

[0063] Figure 6 is a flowchart of an image processing method provided by another exemplary embodiment of the present application;

[0064] Figure 7 is a flowchart of an image processing method provided by another exemplary embodiment of the present application;

[0065] Figure 8 is a flowchart of an image processing method provided by another exemplary embodiment of the present application;

[0066] Fig. 9 is a flowchart of an image processing method provided by another exemplary embodiment of the present application;

[0067] Fig.10 is a flowchart of an image processing method provided by another exemplary embodiment of the present application;

[0068] Fig.11 is a flowchart of an image processing method provided by another exemplary embodiment of the present application;

[0069] Fig.12 is a flowchart of an image processing method provided by another exemplary embodiment of the present application;

[0070] Fig.13 is a flowchart of an image processing method provided by another exemplary embodiment of the present application;

[0071] Fig.14 is a block diagram of an image processing device provided by an exemplary embodiment of the present application;

[0072] Fig.15 is a block diagram of an image processing device provided by another exemplary embodiment of the present application

[0073] Fig.16 is a block diagram of an image processing device provided by another exemplary embodiment of the present application. DETAILED DESCRIPTION

[0074] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0075] First, several terms involved in the embodiments of the present application are explained:

[0076] Neural network model: It is an artificial neural network formed by interconnecting n neurons, where n is a positive integer. In the present application, the neural network model is an artificial network model that can identify the sky area in the image. The neural network model can be divided into an input layer, a hidden layer, and an output layer. The terminal inputs the image into the input layer of the neural network model, and the hidden layer downsamples the input image, that is, performs convolution calculation on the pixels in the image, and finally outputs the recognition result through the output layer. Neural network models include CNN (Convolutional Neural Network) model, FCN (Fully Comvolutional Networks, Full Convolutional Neural Network) model, DNN (Deep Neural Network, Deep Neural Network) model, RNN (Recurrent Neural Networks, Recurrent Neural Network) model, embedding model, GBDT (Gradient Boosting Decision Tree, Gradient Boosting Decision Tree) model, LR (Logistic Regression, Logistic Regression) model, etc.

[0077] CNN model: It is a deep feedforward artificial neural network. CNN includes but is not limited to the following three parts: an input layer, a combination of n convolutional layers and pooling layers, and a fully connected multi-layer perceptron, where n is a positive integer. CNN contains a feature extractor consisting of a convolutional layer and a pooling layer. The feature extractor extracts features from the samples input by the input layer, obtains model parameters, and completes the final model training in the perceptron based on the model parameters. In recent years, CNN models have been widely used in speech recognition, general object recognition, face recognition, image recognition, motion analysis, natural language processing, brain wave analysis, etc. This application takes the application of CNN models in image recognition as an example, and the specific content is to identify the sky area in the image through the CNN model.

[0078] FCN model: It is a deep feedforward artificial neural network. The difference from the above CNN model is that the output layer is a convolutional layer, while the output layer of the CNN model is a fully connected layer. The FCN model goes through the convolution, pooling, and deconvolution processes, and finally outputs the recognized image.

[0079] DNN model: is a deep learning framework. The DNN model includes an input layer, at least one hidden layer (or intermediate layer) and an output layer. Optionally, the input layer, at least one hidden layer (or intermediate layer) and the output layer each include at least one neuron, and the neuron is used to process the received data. Optionally, the number of neurons in different layers can be the same; or, they can be different.

[0080] RNN model: It is a neural network with a feedback structure. In the RNN model, the output of a neuron can directly act on itself at the next timestamp, that is, the input of the i-th layer neuron at time m includes not only the output of the (i-1) layer neuron at that time, but also its own output at time (m-1).

[0081] Embedding model: It is based on the distributed vector representation of entities and relations, and regards the relationship in each triple instance as a translation from the entity head to the entity tail. Among them, the triple instance includes subject, relationship, and object. The triple instance can be expressed as (subject, relationship, object); the subject is the entity head and the object is the entity tail. For example: Xiao Zhang's father is Da Zhang, which is represented by the triple instance as (Xiao Zhang, father, Da Zhang).

[0082] GBDT model: It is an iterative decision tree algorithm that consists of multiple decision trees. The results of all trees are accumulated as the final result. Each node of the decision tree will get a predicted value. Taking age as an example, the predicted value is the average age of all people belonging to the node corresponding to age.

[0083] LR model: refers to a model established by applying a logistic function based on linear regression.

[0084] Sky area recognition model: a model established based on at least one of a CNN model, an FCN model, a DNN model, an RNN model, an embedding model, a GBDT model, and an LR model, and is used to recognize the sky area in an image.

[0085] View image: Image data collected by the photosensitive device, used to display the image in the shooting preview interface. If a shutter signal triggered by the user is received, the view image can be processed and saved as the target image.

[0086] Captured image: The image obtained by saving the viewfinder image according to the shutter signal.

[0087] Shooting attribute parameters: After shooting an image, you get an EXIF ​​format file of the image, which includes file header information. The file header information includes the aperture, shutter, white balance, sensitivity, focal length, date, time, location, etc. when the image was shot. The file header information is used as the shooting attribute parameters.

[0088] Candidate sky material: refers to a plurality of sky materials pre-stored in the memory, and the above sky materials include sky materials at different times, and / or different geographical areas, and / or different weather types. Candidate sky materials can be manually selected high-quality sky materials, or they can be sky materials shot by a high-performance SLR camera.

[0089] Target sky material: a sky material determined from a plurality of candidate sky materials and corresponding to the shooting attribute parameters of the image.

[0090] Target image: is the image obtained after replacing the sky area in the image with the target sky material.

[0091] Please refer to Figure 1 , which shows a block diagram of a terminal provided by an exemplary embodiment of the present application. The terminal includes: a photosensitive device 101, an ISP (Image Signal Processing) module 102, a processor 103 and a memory 104.

[0092] The photosensitive device 101 is configured to sense the shooting environment and obtain a view image. The photosensitive device 101 can be a CCD (charge coupled device) image sensor or a CMOS (Complementary Metal Oxide Semiconductor) image sensor.

[0093] The ISP module 102 is electrically connected to the photosensitive device 101. Optionally, the ISP module 102 is connected to the photosensitive device 101 via a bus, or the ISP module 102 and the photosensitive device 101 are integrated into the same electrical package or chip. The photosensitive device 101 transmits the collected image data to the ISP module 102 for processing.

[0094] The ISP module 102 is configured to obtain the viewfinder image captured by the photosensitive device 101, and when a shutter signal is received, the viewfinder image is photographed to obtain a captured image. In some embodiments, the ISP module 102 is also configured to complete functions such as automatic exposure, automatic focus, and automatic white balance adjustment.

[0095] The processor 103 is electrically connected to the ISP module 102. Optionally, the processor 103 is connected to the ISP module 102 via a bus, or the processor 103 and the ISP module 102 are integrated into the same electrical package or chip. The processor 103 may include one or more processing cores for transmitting a shutter signal to the ISP module 102, and for acquiring and storing images captured by the ISP module 102. Optionally, the processor 103 includes a neural network model; the processor 103 identifies the sky area in the image through the neural network model, and then acquires the sky material stored in the memory 104 to process the sky area in the image.

[0096] The memory 104 is electrically connected to the processor 103. Optionally, the memory 104 is connected to the processor 103 via a bus. The memory 120 may include a RAM (Random Access Memory) or a ROM (Read-Only Memory). The memory 104 is used to store pre-set sky materials and images processed by the processor 103.

[0097] In some embodiments, the terminal further includes: an AI (Artificial Intelligence) chip 105. Figure 2 , the AI ​​chip 105 is electrically connected to the ISP module 102. Optionally, the AI ​​chip 105 is connected to the ISP module 102 via a bus. The AI ​​chip includes a neural network model; in some embodiments, the AI ​​chip recognizes the sky area in the image through the neural network recognition model.

[0098] The AI ​​chip 105 is also electrically connected to the memory 104. Optionally, the AI ​​chip 105 is connected to the memory 104 via a bus. The AI ​​chip is also used to obtain the sky material stored in the memory 104, and replace the sky area in the image with the obtained sky material.

[0099] Please refer to Figure 3 , shows a flowchart of an image processing method provided by an exemplary embodiment of the present application, in which the method is applied to Figure 1 or Figure 2 Taking the terminal shown as an example, the method includes:

[0100] Step 201, identifying the sky area in the image through a neural network model.

[0101] Optionally, after the terminal captures the image, the image is opened in an album, and the sky area in the image is identified through a neural network model.

[0102] Optionally, the above-mentioned neural network model includes but is not limited to at least one of an FCN model, a CNN model, a DNN model, an RNN model, an embedding model, a GBDT model, and an LR model.

[0103] Optionally, the sky in the sky area may be the sky photographed at different times and / or different locations and / or different weather types; for example, it may be photographed in the early morning, at noon, at sunrise, at sunset, in the city, on the grassland, on the ocean, on a sunny day, on a cloudy day, and so on.

[0104] Step 202: Read the shooting attribute parameters of the image.

[0105] There are many shooting parameters during the image shooting process, and these shooting parameters will be saved as shooting attribute parameters.

[0106] In the embodiment of the present application, the shooting attribute parameter can be used as reference data for the terminal to obtain the target sky material. Optionally, the shooting attribute parameter can also be used as reference data for the terminal to obtain the filter.

[0107] Optionally, the terminal reads the EXIF ​​information of the image as the shooting attribute parameter. For most shooting scenes, an EXIF ​​format file of the image will be obtained after shooting and saving the image. The file header information of the EXIF ​​format file is the EXIF ​​information. The terminal reads the EXIF ​​information of the EXIF ​​format file corresponding to the image and uses the EXIF ​​information as the shooting attribute parameter.

[0108] The shooting attribute parameters include at least one of aperture, shutter, white balance, sensitivity, focal length, date, time, and location when the image is shot.

[0109] Step 203: Filter out target sky material from candidate sky materials according to shooting attribute parameters.

[0110] Optionally, the terminal extracts a time-space parameter from the shooting attribute parameters, where the time-space parameter includes shooting time and / or shooting location; and selects a target sky material from a plurality of candidate sky materials according to the time-space parameter.

[0111] In an optional implementation, this step includes: the spatiotemporal parameters include shooting time;

[0112] According to the time period to which the shooting time belongs, the target sky material corresponding to the time period is screened out from the candidate sky materials.

[0113] In an optional implementation, this step includes: the spatiotemporal parameters include the shooting location;

[0114] According to the geographical area to which the shooting location belongs, the target sky material corresponding to the geographical area is screened out from the candidate sky materials.

[0115] In an optional implementation, this step includes: the spatiotemporal parameters include shooting time and / or shooting location;

[0116] Determine the corresponding weather type according to the shooting time and shooting location; and select the target sky material corresponding to the weather type from the candidate sky materials.

[0117] Optionally, the candidate sky material may be sky images taken at different times and / or different locations and / or different weather types; for example, it may be taken in the early morning, at noon, at sunrise, at sunset, in a city, on a grassland, on the ocean, on a sunny day, on a cloudy day, and so on.

[0118] Step 204: Replace the sky area in the image with the target sky material to obtain the target image.

[0119] The terminal replaces the sky area in the image with the target sky material to obtain the target image. Optionally, the terminal removes the sky area in the image recognized by the sky area recognition model to obtain a partial image of the non-sky area, and combines the partial image of the non-sky area with the target sky material, so that the sky area in the image is replaced with the target sky material, and finally the target image is obtained.

[0120] Optionally, a channel cutout method is used to obtain a partial image of the non-sky area in the image, and the partial image of the non-sky area is combined with the target sky material, so that the sky area in the image is replaced with the target sky material, and finally the target image is obtained.

[0121] Indicative, reference Figure 4, in the photo album in the terminal, the user selects and opens an image 31, the image includes a sky area, that is, the portion enclosed by a dotted line in the image 31; the user triggers the image processing function of replacing the sky area in the image in the photo album, schematically, the user clicks a control button 32; as shown in FIG. Figure 4 As shown in the figure below, the terminal identifies the sky area in image 31 through a neural network; determines the target sky material from the candidate sky materials according to the shooting attribute parameters of image 31; automatically replaces the sky area in image 31 with the target sky material to obtain target image 33, and there is a clear difference between the sky areas in image 31 and image 33. Optionally, the terminal creates a new image file and automatically saves image 33.

[0122] In some embodiments, the triggering method of the image processing function of replacing the sky area in the image in the album can be at least one of a long press operation, a pressure touch operation, a two-finger press operation, a knuckle double-click operation, and a multiple-click operation.

[0123] In some other embodiments, a button control is provided on the image display interface to trigger the replacement of the sky area in the image, such as Figure 4 Control button 32 in.

[0124] Optionally, users can customize the target sky material. For example, refer to Figure 5 , the terminal displays image 35 in the album, and image 36 corresponding to candidate sky material 1 and image 37 corresponding to candidate sky material 2 are also displayed below image 35; the user selects candidate sky material 2 in image 37 as the target sky material, and the terminal replaces the sky area of ​​image 35 with candidate sky material 2 to obtain image 38, as shown in FIG. Figure 5 , the sky area in image 35 is obviously different from the sky area in image 38; the user triggers the "Save" control, the terminal creates a new image file, and saves image 38.

[0125] In summary, the image processing method provided by the embodiment of the present application identifies the sky area in the image through a neural network model, selects the target sky material from the candidate sky materials according to the shooting attribute parameters of the read image, replaces the sky area in the image with the target sky material, and obtains the target image; solves the problem that at least 7 steps are required in the related art to obtain the target image in which the sky area is replaced with the target sky material, and achieves the automatic selection of suitable target sky materials by shooting attribute parameters to replace the original sky area in the image, without the need for the user's own post-production photo editing, reducing the user's manual operation steps and improving the efficiency of human-computer interaction. Even if the user does not have the basic skills in photo editing, he can get a sky photo comparable to that taken by a professional SLR lens.

[0126] In addition, with the image processing method provided in the embodiment of the present application, the user can also obtain sky photos under different sky materials by customizing the target sky material, thereby improving the user experience.

[0127] It should be noted that before the terminal calls the neural network model, it is necessary to obtain a neural network model capable of recognizing the sky area in the image through image training: a sky area recognition model.

[0128] Indicative, Figure 6 A flowchart of an image training method for a sky area recognition model provided by an exemplary embodiment is shown. The following training process takes the FCN model as an example of a neural network model, and the steps are as follows:

[0129] Step 11: for at least one group of historical image samples, extract a feature segmentation map from the image samples.

[0130] At least one group of historical image samples is image samples including a sky region in the image, and the sky region includes different sky regions divided by time and / or location.

[0131] The terminal downsamples at least one set of historical image samples to obtain a feature segmentation map of the image samples. Optionally, the terminal uses the historical image samples as input, performs segmentation mapping through stacked convolutional layers, and outputs a low-resolution feature segmentation map.

[0132] Optionally, the terminal uses the Argmax function to segment and map each pixel in the image, and creates an output channel by a one-hot encoding (One-Hot Code) or a label encoding (Label Encoder) method. Among them, the Argmax function is a function in the field of mathematics that maps the maximum function value of a dependent variable through the maximum function value of a function. In this application, the Argmax function is used to segment and map each pixel in the image.

[0133] Illustratively, the terminal performs segmentation mapping on the image samples including the sky area to obtain a feature segmentation map, in which the sky area and the non-sky area are divided.

[0134] Step 12, input the feature segmentation map into the decoder unit to obtain the training result.

[0135] The neural network model includes a decoder unit, which is used to deconvolve each feature value in the feature segmentation map and restore the feature segmentation map to a segmentation map of original resolution.

[0136] The terminal upsamples the feature segmentation map in the decoder unit to obtain a segmentation map of the original resolution. Optionally, the terminal uses a transposed convolution method to upsample to obtain a segmentation map of the original resolution; and creates an output channel to output the segmentation map of the original resolution through one-hot encoding or encoding labels.

[0137] Illustratively, the terminal inputs the feature segmentation map into the decoder unit for upsampling to obtain a segmentation map of the sky area at the original resolution.

[0138] Step 13, compare the training result with the standard result to obtain a calculation loss, where the calculation loss is used to indicate the error between the training result and the standard result.

[0139] The standard result is used to indicate the area of ​​sky contained in the image.

[0140] Optionally, the computational loss is represented by cross-entropy. Optionally, the terminal calculates the computational loss H(p, q) by the following formula:

[0141]

[0142] Among them, p(x) and q(x) are discrete distribution vectors of equal length, p(x) represents the training result; q(x) represents the output parameter; x is a vector in the training result or output parameter.

[0143] Step 14, according to the calculated losses corresponding to at least one group of historical image samples, an error back propagation algorithm is used to train a sky area recognition model.

[0144] Optionally, the terminal determines the gradient direction of the sky area recognition model according to the calculated loss through a back propagation algorithm, and updates the model parameters in the sky area recognition model layer by layer from the output layer of the sky area recognition model.

[0145] Optionally, before each error back propagation, the terminal detects whether the current iteration meets the training end condition, and the training end condition may be that the calculated loss is less than the error threshold, or the number of iterations reaches a preset number (e.g., 20,000 times). When the training end condition is not met, step 14 is entered; when the training end condition is met, a trained neural network model is obtained.

[0146] It should be noted that the model training method provided in this embodiment is only for illustrative purposes and does not constitute a limitation on the training method of the neural network model.

[0147] Based on Figure 3 In an optional embodiment, step 203 is replaced by steps 2031 and 2032 for implementation, such as Figure 7 As shown:

[0148] Step 2031: extracting spatiotemporal parameters from the shooting attribute parameters.

[0149] The time and space parameters are used to obtain the target sky material. Optionally, the terminal obtains the time and space parameters in the shooting attribute parameters by calling a function, and the time and space parameters include shooting time and / or shooting location.

[0150] Step 2032: Filter out target sky material from candidate sky materials according to the spatiotemporal parameters.

[0151] The terminal selects the target sky material from the candidate sky materials according to the shooting time and / or shooting location included in the spatiotemporal parameters.

[0152] In summary, this embodiment also determines the target sky material according to the spatiotemporal parameters, so that the target sky material is more consistent with the sky background required by the user.

[0153] It should be noted that Figure 7 In the exemplary embodiment shown, the terminal selects the target sky material from the candidate sky materials according to the shooting time and / or shooting location, which can be divided into at least the following three situations:

[0154] 1. The terminal determines the target sky material according to the shooting time;

[0155] 2. The terminal determines the target sky material according to the shooting location;

[0156] 3. The terminal determines the target sky material according to the shooting time and shooting location.

[0157] In the following exemplary embodiments, Figure 8 This is an explanation of the image processing method in the first case mentioned above; Fig. 9 This is an explanation of the image processing method in the second case mentioned above; Fig.10 This is an explanation of the image processing method in the third case mentioned above.

[0158] Please refer to Figure 8 , shows a flowchart of an image processing method provided by another exemplary embodiment of the present application, based on Figure 7 In an optional embodiment, step 2032 is replaced by step 21, and the first case is described. The method includes the following working process:

[0159] Step 21, according to the time period to which the shooting time belongs, select the target sky material corresponding to the time period from the candidate sky materials.

[0160] After obtaining the shooting time of the image from the shooting attributes, the terminal determines the time period to which the shooting time belongs, and finds the target sky material from a corresponding table of time periods preset in the terminal and candidate sky materials according to the time period.

[0161] Schematically, referring to Table 1, each time period corresponds to a candidate sky material. For example, the image shooting time is in the time period 04:00-06:00, corresponding to the target sky material 1, and the target sky material 1 is determined to be the target sky material; the image shooting time is in the time period 06:00-10:00, corresponding to the target sky material 2, and the target sky material 2 is determined to be the target sky material; the image shooting time is in the time period 10:00-14:00, corresponding to the target sky material 3, and the target sky material 3 is determined to be the target sky material; the image shooting time is in the time period 14:00-16:00, corresponding to the target sky material 4, and the target sky material 4 is determined to be the target sky material; the image shooting time is in the time period 16:00-18:00, corresponding to the target sky material 5, and the target sky material 5 is determined to be the target sky material.

[0162] Table 1

[0163] Time period Candidate sky material 04:00-06:00 Target sky material 1 06:00-10:00 Target sky material 2 10:00-14:00 Target sky material 3 14:00-16:00 Target sky material 4 16:00-18:00 Target sky material 5

[0164] In summary, in this embodiment, the terminal also obtains the target sky material corresponding to the time period according to the shooting time, so that the target sky material is more appropriate or more matched with the part of the image shot by the user except the sky area.

[0165] Please refer to Fig. 9 , shows a flowchart of an image processing method provided by another exemplary embodiment of the present application, based on Figure 7 In an optional embodiment, step 2032 is replaced by step 22 to illustrate the second situation. The method includes the following working process:

[0166] Step 22, based on the geographical area to which the shooting location belongs, select target sky materials corresponding to the geographical area from the candidate sky materials.

[0167] After obtaining the shooting location of the image from the shooting attributes, the terminal determines the geographical area to which the shooting location belongs, and finds the target sky material from a corresponding table of geographical areas and candidate sky materials pre-set by the terminal according to the geographical area.

[0168] Optionally, the geographical area is a region divided according to humanities, and / or topography, and / or climate.

[0169] Optionally, different shooting locations correspond to the same geographical area, and their corresponding target sky materials are the same.

[0170] Schematically, referring to Table 2, each location corresponds to a geographical area, and each geographical area corresponds to a candidate sky material. For example, the image shooting location is in Shanghai, the corresponding geographical area is the urban area, and the relative target sky material is target sky material 6; the image shooting location is in Hulunbuir grassland, the corresponding geographical area is the grassland area, and the relative target sky material is target sky material 7; the image shooting location is the Qinghai-Tibet Plateau, the corresponding geographical area is the plateau area, and the relative target sky material is target sky material 8; the image shooting location is in Yan'an, the corresponding geographical area is the urban area, and the relative target sky material is target sky material 6. Combined with the situation when the above shooting location is Shanghai, when the shooting locations are different but the geographical areas are the same, it is determined that the obtained target sky materials are the same.

[0171] Table 2

[0172] Filming Locations Geographical area Candidate sky material Shanghai Urban Area Target sky material 6 Hulunbuir Prairie Grassland area Target sky material 7 Qinghai-Tibet Plateau Plateau area Target sky material 8 Yan'an Urban Area Target sky material 6

[0173] Optionally, the terminal can also determine the corresponding target sky material according to the shooting time and the shooting location. Schematically, referring to Table 3, the same geographical area belongs to the shooting location, the same time period belongs to the shooting time, and the corresponding target sky material is the same. For example, when the shooting time is in the time period 06:00-08:00, when the shooting location is Nanchang, the corresponding geographical area is an urban area, and the corresponding target sky material is target sky material 9; when the shooting location is Wuhan, the corresponding geographical area is also an urban area, and the corresponding target sky material is also target sky material 9.

[0174] Optionally, the geographical area to which the shooting location belongs is the same, but the time periods to which the shooting time belongs are different, corresponding to different target sky materials. For example, the shooting location is Wuhan, and the corresponding geographical area is the urban area. When the shooting time is within the time period 06:00-08:00, the corresponding target sky material is target sky material 9; when the shooting time is within the time period 08:00-10:00, the corresponding target sky material is target sky material 10.

[0175] Optionally, the shooting locations belong to different geographical areas, but the shooting time belongs to the same time period, corresponding to different target sky materials. For example, the shooting time is within the time period 08:00-10:00, when the shooting location is Wuhan, the corresponding geographical area is the urban area, and the corresponding target sky material is target sky material 10; when the shooting location is Yili grassland, the corresponding geographical area is the grassland area, and the corresponding target sky material is target sky material 11.

[0176] Optionally, the shooting location belongs to different geographical areas and the shooting time belongs to different time periods, corresponding to different target sky materials. For example, the shooting location is in Nanchang, the corresponding geographical area is the urban area, and the shooting time is within 06:00-08:00, then the corresponding target sky material is target sky material 9; the shooting location is in Yili grassland, the corresponding geographical area is the grassland area, and the shooting time is within 08:00-10:00, then the corresponding target sky material is target sky material 11.

[0177] Table 3

[0178]

[0179] In summary, in this embodiment, the terminal also obtains the target sky material corresponding to the geographical area according to the shooting location, so that the target sky material is more appropriate or more matched with the part of the image shot by the user except the sky area.

[0180] Please refer to Fig.10 , shows a flowchart of an image processing method provided by another exemplary embodiment of the present application, based on Figure 7 In an optional embodiment, step 2032 is replaced by step 23 to illustrate the third case. The method includes the following working process:

[0181] Step 23, determining the corresponding weather type according to the shooting time and shooting location; and selecting the target sky material corresponding to the weather type from the candidate sky materials.

[0182] The shooting attribute parameters of the image also include: the shooting date of the image. Optionally, the terminal determines the weather type at the time of shooting according to the shooting date, shooting time and shooting location; and determines the corresponding target sky material according to the weather type.

[0183] Schematically, referring to Table 4, different weather types correspond to different target sky materials. For example, if the weather type is sunny, the corresponding target sky material is target sky material 12; if the weather type is cloudy, the corresponding target sky material is target sky material 13; if the weather type is overcast, the corresponding target sky material is target sky material 14; if the weather type is light rain, the corresponding target sky material is target sky material 15.

[0184] Table 4

[0185] Weather Type Candidate sky material sunny Target sky material 12 partly cloudy Target sky material 13 cloudy day Target sky material 14 light rain Target sky material 15

[0186] Optionally, the terminal determines the corresponding target sky material according to the shooting location and the weather type. Referring to Table 5 for example, if the shooting location belongs to the same geographical area but different weather types, the corresponding target sky material is different. For example, if the shooting location is Gulangyu Island and the corresponding geographical area is the coastal area, when the weather type is sunny, the corresponding target sky material is 16; when the weather type is cloudy, the corresponding target sky material is 17.

[0187] Optionally, if the shooting location belongs to different geographical areas but the weather type is the same, the corresponding target sky materials are different. For example, if the weather type is sunny, when the shooting location is Gulangyu Island, the corresponding geographical area is the coastal area, then the corresponding target sky material is 16; when the shooting location is the Tarim Basin, the corresponding geographical area is the basin area, then the corresponding target sky material is 18.

[0188] Optionally, if the shooting location belongs to different geographical areas and has different weather types, the corresponding target sky materials will be different. For example, when the shooting location is Gulangyu Island, the corresponding geographical area is the coastal area, and the weather type is cloudy, then the corresponding target sky material is 17; when the shooting location is the Tarim Basin, the corresponding geographical area is the basin area, and the weather type is sunny, then the corresponding target sky material is 18.

[0189] Table 5

[0190]

[0191]

[0192] Optionally, the terminal determines the corresponding target sky material according to the shooting time, shooting location and weather type. Schematically, referring to Table 6, the same geographical area to which the shooting location belongs, the same time period to which the shooting time belongs, and different weather types correspond to different target sky materials. For example, if the shooting location is Shijiazhuang, the corresponding geographical area is the urban area, and the shooting time is within the time period 12:00-14:00, when the weather type is cloudy, the corresponding target sky material is determined to be target sky material 19; when the weather type is sunny, the corresponding target sky material is determined to be target sky material 20.

[0193] Optionally, the shooting locations belong to the same geographical area and the same weather type, but the shooting times belong to different time periods, corresponding to different target sky materials. For example, the shooting location is Beidaihe, the corresponding geographical area is the coastal area, and the weather type is sunny. When the shooting time is within the time period of 12:00-14:00, the corresponding target sky material is determined to be target sky material 21; when the shooting time is within the time period of 14:00-16:00, the corresponding target sky material is determined to be target sky material 23.

[0194] Optionally, the geographical area to which the shooting location belongs is the same, but the time periods to which the shooting time belongs are different, and the weather types are different, corresponding to different target sky materials. For example, the shooting location is Suzhou, and the corresponding geographical area is the urban area. When the shooting time is within the time period of 12:00-14:00 and the weather type is cloudy, the corresponding target sky material is determined to be target sky material 19; the shooting location is Beijing, and the corresponding geographical area is the urban area. When the shooting time is within the time period of 16:00-18:00 and the weather type is sunny, the corresponding target sky material is determined to be target sky material 24.

[0195] Optionally, the shooting time belongs to the same time period, the same weather type, and the shooting location belongs to different geographical areas, corresponding to different target sky materials. For example, the shooting time is in the time period 12:00-14:00, the weather type is sunny, and when the shooting location is Shijiazhuang, the corresponding geographical area is the urban area, and the corresponding target sky material is determined to be target sky material 20; when the shooting location is Beidaihe, the corresponding geographical area is the coastal area, and the corresponding target sky material is determined to be target sky material 21.

[0196] Optionally, the shooting time belongs to the same time period, but the weather type is different, and the shooting location belongs to different geographical areas, corresponding to different target sky materials. For example, the shooting time is within the time period 12:00-14:00, when the shooting location is Suzhou, the corresponding geographical area is the urban area, and the weather type is cloudy, the corresponding target sky material is determined to be target sky material 19; when the shooting location is Beidaihe, the corresponding geographical area is the coastal area, and the weather type is light rain, the corresponding target sky material is determined to be target sky material 22.

[0197] Optionally, the weather type is the same, the time period of the shooting time is different, the geographical area of ​​the shooting location is different, and the corresponding target sky material is different. For example, when the weather type is sunny, when the shooting location is Beidaihe, the corresponding geographical area is the coastal area, and the shooting time is within the time period of 12:00-14:00, the corresponding target sky material is determined to be target sky material 21; when the shooting location is Beijing, the corresponding geographical area is the urban area, and the shooting time is within the time period of 16:00-18:00, the corresponding target sky material is determined to be target sky material 24.

[0198] Optionally, the shooting location belongs to different geographical areas, the shooting time belongs to different time periods, and the weather types are different, and the corresponding target sky materials are different. For example, the shooting location is Beidaihe, the corresponding geographical area is the coastal area, the shooting time is within the time period 12:00-14:00, and the weather type is light rain, and the corresponding target sky material is determined to be target sky material 22; the shooting location is Beijing, the corresponding geographical area is the urban area, the shooting time is within the time period 16:00-18:00, and the weather type is sunny, and the corresponding target sky material is determined to be target sky material 24.

[0199] Table 6

[0200]

[0201] In summary, in this embodiment, the terminal further obtains the corresponding target sky material according to the weather type, so that the target sky material is more appropriate or more matched with the part of the image captured by the user except the sky area.

[0202] Please refer to Fig.11 , shows a flowchart of an image processing method provided by another exemplary embodiment of the present application, based on Figure 7 In an optional embodiment, the terminal uses the EXIT information as the attribute parameter, and step 202 is replaced by step 2021. The method includes the following working process:

[0203] Step 2021, read the EXIF ​​information in the image as shooting attribute parameters.

[0204] The terminal reads the EXIF ​​information of the image as the shooting attribute parameter. After shooting an image, an EXIF ​​format file of the image is obtained. The file header information of the EXIF ​​format file is the EXIF ​​information. The terminal reads the EXIF ​​information of the EXIF ​​format file corresponding to the image and uses the EXIF ​​information as the shooting attribute parameter, wherein the shooting attribute parameter includes at least one of the aperture, shutter, white balance, sensitivity, focal length, date, time, and location when the image was shot.

[0205] In summary, in this embodiment, the terminal also obtains spatiotemporal parameters through EXIF ​​information, and obtains target sky material according to the spatiotemporal parameters, so that the target sky material is more appropriate or more matched with the part of the image taken by the user except the sky area.

[0206] Please refer to Fig.12 , shows a flowchart of an image processing method provided by another exemplary embodiment of the present application, based on Figure 7 In an optional embodiment, after obtaining the target image, the terminal further uses a filter to process the image, and step 205 is added after step 204. The method includes the following working process:

[0207] Step 205: Process the target image using a filter.

[0208] Optionally, the filter includes at least one of an internal filter, a built-in filter, and an external filter.

[0209] In order to enhance the uniformity of tone and / or texture of the target sky material and other image parts in the target image, the terminal processes the target image using a filter.

[0210] To sum up, in this embodiment, after obtaining the target image, the terminal also uses a filter to process the image, thereby enhancing the uniformity of tone and / or texture of the target sky material and other image parts in the target image; for example, the light direction of each frame in the target image after filtering is the same, and / or the tone of the sky area of ​​the target image and the parts other than the sky area is uniform.

[0211] Please refer to Fig.13 , shows a flowchart of an image processing method provided by another exemplary embodiment of the present application, based on Fig.12 In an optional embodiment, step 205 is replaced by steps 2051 and 2052 to illustrate the selection of filters. The method includes the following working process:

[0212] Step 2051, determining a filter corresponding to the target image according to the shooting time and / or weather type.

[0213] Optionally, the terminal determines a filter corresponding to the target image according to the shooting time.

[0214] Schematically, referring to Table 7, each time period corresponds to a group of filters, wherein a group of filters includes at least one filter. For example, the image capture time is in the time period 04:00-10:00, corresponding to the first group of filters, and the filter corresponding to the target image is determined to be the first group of filters; the image capture time is in the time period 10:00-16:00, corresponding to the second group of filters, and the filter corresponding to the target image is determined to be the second group of filters; the image capture time is in the time period 16:00-18:00, corresponding to the third group of filters, and the filter corresponding to the target image is determined to be the third group of filters.

[0215] Table 7

[0216]

[0217]

[0218] Optionally, the shooting attribute parameters also include: shooting location; the terminal searches for the weather type when the image was shot according to the shooting time and shooting location of the image; and determines a filter corresponding to the target image according to the weather type.

[0219] Schematically, referring to Table 8, each weather type corresponds to a group of filters, wherein a group of filters includes at least one filter. For example, if the weather type when the image is taken is sunny, it corresponds to the fourth group of filters, and the filter corresponding to the target image is determined to be the fourth group of filters; if the weather type when the image is taken is cloudy, it corresponds to the fifth group of filters, and the filter corresponding to the target image is determined to be the fifth group of filters.

[0220] Table 8

[0221] Weather Type Filters sunny Filter Group 4 partly cloudy Filter Group 5

[0222] Step 2052: Process the target image using a filter corresponding to the target image.

[0223] The terminal processes the target image using the filter corresponding to the target image obtained above, so as to enhance the uniformity of tone and / or texture of the target sky material and other image parts in the target image.

[0224] To sum up, in this embodiment, the terminal determines the filter corresponding to the target image according to the shooting time and / or weather type, and selects a filter that matches the tone and / or texture of the captured image, thereby further enhancing the tone uniformity and / or texture uniformity of the target sky material and other image parts in the target image; for example, the light direction of each frame in the target image after filtering is the same, and / or the tone of the sky area of ​​the target image and the parts other than the sky area is uniform.

[0225] In addition, in this embodiment, the terminal determines the filter according to the shooting time and / or weather type of the target image, which is closer to the influence of factors such as color temperature and light intensity of the environment during shooting, and has a higher degree of restoration of the shooting scene.

[0226] Please refer to Fig.14 , shows a block diagram of an image processing device provided by an exemplary embodiment of the present application, the device can be implemented as a part or all of a terminal through software, hardware, or a combination of both, and the device includes:

[0227] The recognition module 301 is configured to recognize the sky area in the image through a neural network model;

[0228] The reading module 302 is configured to read the shooting attribute parameters of the image;

[0229] A screening module 303 is configured to screen out a target sky material from candidate sky materials according to shooting attribute parameters;

[0230] The replacement module 304 is configured to replace the sky area in the image with the target sky material to obtain the target image.

[0231] In summary, the image processing device provided by the embodiment of the present application identifies the sky area in the image through a neural network model, selects the target sky material from the candidate sky materials according to the shooting attribute parameters of the read image, replaces the sky area in the image with the target sky material, and obtains the target image; it solves the problem that at least 7 steps are required in the related art to obtain the target image in which the sky area is replaced with the target sky material, and achieves the automatic selection of suitable target sky materials through shooting attribute parameters to replace the original sky area in the image, without the need for the user's own post-production photo editing, reducing the user's manual operation steps and improving the efficiency of human-computer interaction. Even if the user does not have the basic skills in photo editing, he can get a sky photo comparable to that taken by a professional SLR lens.

[0232] Please refer to Fig.15 , shows a block diagram of an image processing device provided by another exemplary embodiment of the present application, the device can be implemented as a part or all of a terminal through software, hardware, or a combination of both, and the device includes:

[0233] The recognition module 301 is configured to recognize the sky area in the image through a neural network model;

[0234] The reading module 302 is configured to read the shooting attribute parameters of the image;

[0235] A screening module 303 is configured to screen out a target sky material from candidate sky materials according to shooting attribute parameters;

[0236] The replacement module 304 is configured to replace the sky area in the image with the target sky material to obtain the target image.

[0237] In some embodiments, the screening module 303 includes:

[0238] An extraction submodule 41 is configured to extract time-space parameters from the shooting attribute parameters, where the time-space parameters include shooting time and / or shooting location;

[0239] The screening submodule 42 is configured to screen out target sky materials from candidate sky materials according to spatiotemporal parameters.

[0240] In some embodiments, the spatiotemporal parameters include capture time;

[0241] The screening submodule 42 is configured to screen out target sky materials corresponding to the time period from the candidate sky materials according to the time period to which the shooting time belongs.

[0242] In some embodiments, the spatiotemporal parameters include the location of the shooting;

[0243] The screening submodule 42 is configured to screen out target sky materials corresponding to the geographical area to which the shooting location belongs from the candidate sky materials.

[0244] In some embodiments, the spatiotemporal parameters include the time and / or location of the capture;

[0245] The screening module 303 includes:

[0246] The first determination submodule 43 is configured to determine the corresponding weather type according to the shooting time and shooting location;

[0247] The screening submodule 42 is configured to screen out target sky materials corresponding to the weather type from the candidate sky materials.

[0248] In some embodiments, the apparatus further comprises:

[0249] The processing module 305 is configured to process the target image using a filter, where the filter is used to enhance the tone uniformity and / or texture uniformity of the target sky material and other image parts in the target image.

[0250] In some embodiments, the processing module includes:

[0251] The second determination submodule 44 is configured to determine a filter corresponding to the target image according to the shooting time and weather type;

[0252] The processing submodule 45 is configured to process the target image using a filter corresponding to the target image.

[0253] In some embodiments, the reading module is configured to read the EXIF ​​information of the image as the shooting attribute information.

[0254] In summary, the image processing device provided by the embodiment of the present application identifies the sky area in the image through a neural network model, selects the target sky material from the candidate sky materials according to the shooting attribute parameters of the read image, replaces the sky area in the image with the target sky material, and obtains the target image; it solves the problem that at least 7 steps are required in the related art to obtain the target image in which the sky area is replaced with the target sky material, and achieves the automatic selection of suitable target sky materials through shooting attribute parameters to replace the original sky area in the image, without the need for the user's own post-production photo editing, reducing the user's manual operation steps and improving the efficiency of human-computer interaction. Even if the user does not have the basic skills in photo editing, he can get a sky photo comparable to that taken by a professional SLR lens.

[0255] In this embodiment, the device also obtains time and space parameters through EXIF ​​information, and obtains target sky material according to the time and space parameters, so that the target sky material is more appropriate or more matched with the part of the image taken by the user except the sky area.

[0256] In this embodiment, after obtaining the target image, the device also uses a filter to process the image, thereby enhancing the uniformity of tone and / or texture of the target sky material and other image parts in the target image; for example, the light direction of each frame in the target image after filtering is the same, and / or the tone of the sky area of ​​the target image and the parts other than the sky area is uniform.

[0257] Fig.16 4 is a block diagram of an image processing device 400 shown in an exemplary embodiment of the present application. For example, the device 400 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0258] Reference Fig.16 , the device 400 may include one or more of the following components: a processing component 402 , a memory 404 , a power component 406 , a multimedia component 408 , an audio component 410 , an input / output (I / O) interface 412 , a sensor component 414 , and a communication component 416 .

[0259] The processing component 402 generally controls the overall operation of the device 400, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 402 may include one or more processors 418 to execute instructions to complete all or part of the steps performed by the UE 20 in the above-mentioned method embodiment. In addition, the processing component 402 may include one or more modules to facilitate the interaction between the processing component 402 and other components. For example, the processing component 402 may include a multimedia module to facilitate the interaction between the multimedia component 408 and the processing component 402.

[0260] The memory 404 is configured to store various types of data to support operations on the device 400. Examples of such data include instructions for any application or method operating on the device 400, contact data, phone book data, messages, pictures, videos, etc. The memory 404 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0261] The power supply component 406 provides power to the various components of the device 400. The power supply component 406 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 400.

[0262] The multimedia component 408 includes a screen that provides an output interface between the device 400 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 408 includes a front camera and / or a rear camera. When the device 400 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0263] The audio component 410 is configured to output and / or input audio signals. For example, the audio component 410 includes a microphone (MIC), and when the device 400 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 404 or sent via the communication component 416. In some embodiments, the audio component 410 also includes a speaker for outputting audio signals.

[0264] I / O interface 412 provides an interface between processing component 402 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.

[0265] The sensor assembly 414 includes one or more sensors for providing various aspects of the status assessment of the device 400. For example, the sensor assembly 414 can detect the open / closed state of the device 400, the relative positioning of components, such as the display and keypad of the device 400, and the sensor assembly 414 can also detect the position change of the device 400 or a component of the device 400, the presence or absence of user contact with the device 400, the orientation or acceleration / deceleration of the device 400, and the temperature change of the device 400. The sensor assembly 414 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 414 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 414 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0266] The communication component 416 is configured to facilitate wired or wireless communication between the apparatus 400 and other devices. The apparatus 400 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 416 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel.

[0267] In an exemplary embodiment, the device 400 can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to execute the image processing method in the above method embodiments.

[0268] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 404 including instructions, and the instructions can be executed by a processor 418 of the device 400 to complete the image processing method in the above method embodiment. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0269] In an exemplary embodiment, a computer-readable storage medium is also provided. The computer-readable storage medium is a non-volatile computer-readable storage medium. A computer program is stored in the computer-readable storage medium. When the stored computer program is executed by a processing component, the image processing method provided in the above embodiment of the present disclosure can be implemented.

[0270] The embodiment of the present disclosure further provides a computer program product, in which instructions are stored. When the computer program product is run on a computer, the computer is enabled to execute the image processing method provided by the embodiment of the present disclosure.

[0271] The embodiment of the present disclosure further provides a chip, which includes a programmable logic circuit and / or program instructions, and when the chip is running, it can execute the image processing method provided by the embodiment of the present disclosure.

[0272] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0273] It should be understood that the present disclosure is not limited to the exact 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 disclosure is limited only by the appended claims.

Claims

1. An image processing method, characterized in that: The method comprises: In response to the triggered image processing function of replacing the sky area in the first target image in the album, identifying the sky area in the first target image through a neural network model; Reading the EXIF ​​information corresponding to the shooting of the first target image as a shooting attribute parameter; Extracting a spatiotemporal parameter from the shooting attribute parameter, the spatiotemporal parameter including a shooting time and a shooting location; determining a weather type corresponding to the first target image according to the shooting time and the shooting location; Filtering a target sky material from at least one first candidate sky material in a first preset material table according to the time period to which the shooting time belongs, the geographical area to which the shooting location belongs, and the weather type, wherein the geographical area is an area divided according to topography and / or climate, different geographical areas in the first preset material table have different corresponding first candidate sky materials according to different weather types in different time periods, and the at least one first candidate sky material is a sky image shot at different times and / or different locations and / or different weather types; A channel cutout method is used to obtain a partial image of a non-sky area in the first target image, and the partial image of the non-sky area is combined with the target sky material to obtain a second target image; Creating a new image file, automatically saving the second target image, wherein the presentation effect of the target sky material is better than the presentation effect of the sky area in the first target image; Determining a filter corresponding to the second target image according to the time period to which the shooting time belongs and the weather type, the filter being used to enhance the uniformity of tone and texture of the target sky material and other image parts of the second target image except the target sky material; and processing the second target image using the filter corresponding to the second target image; At least two candidate sky materials are displayed in the album; in response to any one of the at least two candidate sky materials receiving a trigger operation, the target sky material is replaced with any one of the candidate sky materials to obtain a third target image, and the presentation effect of any one of the candidate sky materials is better than the presentation effect of the sky area in the first target image; in response to receiving a save operation for the third target image, a new image file is created to save the third target image.

2. The method according to claim 1, characterized in that The method further comprises: According to the time period to which the shooting time belongs, other target sky materials corresponding to the time period are screened out from at least one second candidate sky material in the second preset material table.

3. The method according to claim 1, characterized in that: The method further comprises: According to the geographical area to which the shooting location belongs, other target sky materials corresponding to the geographical area are screened out from at least one third candidate sky material in the third preset material table.

4. An image processing device, characterized in that: The device comprises: an identification module, configured to identify the sky area in the first target image through a neural network model in response to a triggered image processing function of replacing the sky area in the first target image in the album; A reading module, configured to read the EXIF ​​information corresponding to the shooting of the first target image as a shooting attribute parameter; An extraction submodule is configured to extract time-space parameters from the shooting attribute parameters, wherein the time-space parameters include shooting time and shooting location; A first determination submodule is configured to determine the weather type corresponding to the image according to the shooting time and the shooting location; a screening submodule, configured to screen out a target sky material from at least one first candidate sky material in a first preset material table according to the time period to which the shooting time belongs, the geographical area to which the shooting location belongs, and the weather type, wherein the geographical area is an area divided according to topography and / or climate, wherein different geographical areas in the first preset material table have different corresponding first candidate sky materials in different time periods according to different weather types, and the at least one first candidate sky material is a sky image shot at different times and / or different locations and / or different weather types; a replacement module configured to obtain a partial image of a non-sky area in the first target image by using a channel cutout method, and combine the partial image of the non-sky area with the target sky material to obtain a second target image; a module for creating a new image file and automatically saving the second target image, wherein the presentation effect of the target sky material is better than the presentation effect of the sky area in the first target image; a second determination submodule, configured to determine a filter corresponding to the second target image according to the time period described by the shooting time and the weather type, the filter being used to enhance the uniformity of tone and texture of the target sky material and other image parts of the second target image except the target sky material; a processing submodule, configured to process the second target image using a filter corresponding to the second target image; The first module is configured to display at least two candidate sky materials in the album; in response to any one of the at least two candidate sky materials receiving a trigger operation, replace the target sky material with any one of the candidate sky materials to obtain a third target image, and the presentation effect of any one of the candidate sky materials is better than the presentation effect of the sky area in the first target image; in response to receiving a save operation for the third target image, create a new image file and save the third target image.

5. The device according to claim 4, characterized in that The screening submodule is configured to screen out a target sky material corresponding to the time period from at least one second candidate sky material in the second preset material table according to the time period to which the shooting time belongs.

6. The device according to claim 4, characterized in that The spatiotemporal parameters include the shooting location; The screening submodule is configured to screen out a target sky material corresponding to the geographical area to which the shooting location belongs from at least one third candidate sky material in the third preset material table.

7. A terminal, characterized in that: The terminal includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the image processing method as described in any one of claims 1 to 3.

8. A computer-readable storage medium, characterized in that: The readable storage medium stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the image processing method as described in any one of claims 1 to 3.