Image processing method and device, electronic equipment and computer readable storage medium

By performing scene recognition and image aesthetic evaluation on the image, matching sky material images are obtained for replacement, which solves the problem of low image sky changing quality in the existing technology and achieves a sky changing effect of higher quality and beauty.

CN118587228APending Publication Date: 2024-09-03SHANGHAI JINSHENG COMM TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202310188126.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-01
Publication Date
2024-09-03

AI Technical Summary

Technical Problem

In the existing technology, during the image changing process, the quality of the sky changing image obtained is not high, which affects the user's perception and the wide application of functions.

Method used

Through scene recognition of the image to be processed, the target scene type is determined, and the matching target sky material image is obtained from the candidate sky material image based on the image aesthetic evaluation, and the sky area of ​​the image is replaced to ensure that the aesthetics of the replaced image conforms to the scene type. Aesthetic requirements.

Benefits of technology

It improves the image quality and beauty after changing the sky, improves the visual effects, and meets the subjective aesthetic needs of users.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118587228A
    Figure CN118587228A
Patent Text Reader

Abstract

The invention provides an image processing method and device, electronic equipment and a computer readable storage medium, and relates to the technical field of image processing. The method comprises the steps of performing scene recognition on a to-be-processed first image to determine a target scene type of the first image; obtaining a target sky material image matched with the target scene type, wherein the target sky material image is determined from candidate sky material images corresponding to the target scene type based on image aesthetic evaluation; and replacing the sky area of the first image based on the target sky material image to obtain a sky-replaced image. The day-changing processing effect of the image can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] With the development of image processing technology, users' requirements for image processing functions are gradually increasing. Performing sky replacement processing on the sky area of ​​an image to obtain a sky replacement image can increase the diversity of the image and promote the application of the image in various scenes. However, the quality of the sky replacement image obtained by the image sky replacement algorithm in the related art is not high, which affects the user's perception and the wide application of the sky replacement function. Summary of the invention

[0003] The purpose of the present disclosure is to provide an image processing method, an image processing device, an electronic device and a computer-readable storage medium, thereby improving the image sky replacement processing effect at least to a certain extent.

[0004] According to a first aspect of the present disclosure, there is provided an image processing method, comprising: performing scene recognition on a first image to be processed to determine a target scene type of the first image; acquiring a target sky material image that matches the target scene type, the target sky material image being determined from candidate sky material images corresponding to the target scene type based on image aesthetic evaluation; and replacing a sky area of ​​the first image based on the target sky material image to obtain an image after sky replacement.

[0005] According to a second aspect of the present disclosure, there is provided an image processing device, comprising: a scene recognition module, used to perform scene recognition on a first image to be processed to determine a target scene type of the first image; a material acquisition module, used to acquire a target sky material image that matches the target scene type, wherein the target sky material image is determined from candidate sky material images corresponding to the target scene type based on image aesthetic evaluation; and a replacement module, used to replace the sky area of ​​the first image based on the target sky material image to obtain an image after the sky is replaced.

[0006] According to a third aspect of the present disclosure, there is provided an electronic device, comprising: a processor; and a memory for storing one or more programs, which, when the one or more programs are executed by one or more processors, enables the one or more processors to implement the above method.

[0007] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the above method is implemented.

[0008] The image processing method provided by the embodiment of the present disclosure performs scene recognition on the first image to be processed to determine the target scene type corresponding to the first image, and replaces the sky area of ​​the first image with the target sky material image corresponding to the target scene type to obtain an image after sky replacement, wherein the target sky material image is determined from the candidate sky material images corresponding to the target scene type based on image aesthetic evaluation. The target sky material image obtained based on image aesthetic evaluation can ensure that the sky material used when replacing the sky area meets the aesthetic requirements of the scene type, and obtain the optimal sky material under the scene type, thereby improving the beauty of the image after sky replacement, improving the quality of the image after sky replacement, and having an excellent visual effect.

[0009] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present disclosure, and together with the specification, are used to explain the principles of the present disclosure. Obviously, the drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0011] Figure 1 A schematic diagram showing an exemplary application environment involved in an image processing method and apparatus to which an embodiment of the present disclosure can be applied;

[0012] Figure 2 A flowchart schematically illustrates an image processing method in an exemplary embodiment of the present disclosure;

[0013] Figure 3 Schematic diagrams schematically showing several first images before and after sky change in an exemplary embodiment of the present disclosure;

[0014] Figure 4 A flowchart for establishing a correspondence between a scene type and a sky material image in an exemplary embodiment of the present disclosure is schematically shown;

[0015] Figure 5 A schematic diagram schematically illustrates a method of determining a third image corresponding to each scene in an exemplary embodiment of the present disclosure;

[0016] Figure 6 A flowchart of determining a target sky material image of a target scene type in an exemplary embodiment of the present disclosure is schematically shown;

[0017] Figure 7A flowchart of determining a target sky material image from a plurality of candidate sky material images of a target scene type according to image aesthetic scores corresponding to each third image under the target scene type in an exemplary embodiment of the present disclosure is schematically shown;

[0018] Figure 8 A schematic diagram of an interactive interface presenting multiple sky-changing results in an exemplary embodiment of the present disclosure is schematically shown;

[0019] Fig. 9 A diagram schematically shows an interactive interface for adjusting a non-sky area in an exemplary embodiment of the present disclosure;

[0020] Fig.10 A schematic diagram schematically illustrates a flow chart of another image processing method in an exemplary embodiment of the present disclosure;

[0021] Fig.11 A schematic diagram schematically shows the composition of an image processing device in an exemplary embodiment of the present disclosure;

[0022] Fig.12 A schematic diagram of an electronic device to which the embodiments of the present disclosure can be applied is shown. DETAILED DESCRIPTION

[0023] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

[0024] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0025] Figure 1 A schematic diagram shows an exemplary application environment involved in an image processing method and apparatus according to an embodiment of the present disclosure.

[0026] like Figure 1As shown, the image processing method of the embodiment of the present disclosure can be executed by a terminal device with an image processing function, for example, it can be a smart phone, computer, tablet computer, smart watch, vehicle-mounted device, wearable device, monitoring equipment and other smart devices. The terminal device can also be called a smart device, mobile terminal, terminal, mobile device, etc. The present disclosure does not limit the type of terminal device.

[0027] Wherein, a correspondence between scene types and sky material images can be established in advance based on image aesthetic evaluation, and the sky material image of each scene type is determined from candidate sky material images corresponding to the scene type based on the image aesthetic evaluation.

[0028] In the embodiment of the present disclosure, the image processing device of the terminal device can perform scene recognition on the first image to be processed based on the image processing method of the embodiment of the present disclosure to determine the target scene type of the first image, obtain a target sky material image that matches the target scene type, the target sky material image is determined from the candidate sky material images corresponding to the target scene type based on the image aesthetic evaluation, and replace the sky area of ​​the first image based on the target sky material image to obtain an image after the sky is replaced. Determining the target sky material image based on the image aesthetic evaluation can make the image after the sky is replaced more beautiful and in line with the user's subjective aesthetics.

[0029] Furthermore, the image processing method provided in the embodiment of the present disclosure may also be executed by a server, and accordingly, the image processing device may also be provided in the server. The server may start to execute the steps in the image processing method in the embodiment of the present disclosure in response to the image processing operation, wherein the trigger execution command may be sent by a terminal device used by a user, or may be triggered locally by the server in response to some automation events. The server may be a background system that provides image processing related services in the embodiment of the present disclosure, and may include one electronic device with computing functions such as a portable computer, a desktop computer, a smart phone, or a cluster formed by multiple electronic devices.

[0030] In addition, the image processing method of the embodiment of the present disclosure can also be executed collaboratively by the terminal device and the server. In this manner of collaborative execution by the electronic device and the server, in this manner of the embodiment of the present disclosure, some steps in the image processing method provided by the embodiment of the present disclosure are executed by the terminal device, while other steps are executed by the server. It should be noted that in this manner of collaborative execution by the terminal device and the server, the steps respectively executed by the terminal device and the server can be dynamically adjusted according to actual conditions, and there is no special restriction on this.

[0031] In the embodiments of the present disclosure, an example is taken in which the image processing method is executed by a terminal device for description.

[0032] The sky area replacement operation, namely the sky replacement operation, is to replace the sky area of ​​the original image with the content of the sky material, while the non-sky area of ​​the original image is not replaced, and the content of the non-sky area of ​​the original image is retained.

[0033] The image sky replacement algorithm in the related art replaces the sky area of ​​the image according to the sky material template provided by the system or selected by the user, but does not consider whether the sky material template matches the image, whether the image after the sky replacement is aesthetically pleasing, and whether it conforms to the user's subjective aesthetics. Therefore, it is impossible to obtain a sky replacement effect that meets the user's expectations, affecting the user's experience. Based on one or more of the above problems, an exemplary embodiment of the present disclosure provides an image processing method, which determines the target scene type by performing scene recognition on the first image to be processed, and performs a sky replacement operation using a target sky material image obtained based on an image aesthetic evaluation corresponding to the target scene type, and obtains a target sky material image that meets the image aesthetic evaluation in combination with the scene type of the first image to be processed. This ensures that the sky material used to replace the sky area meets the aesthetic requirements of the scene type, obtains the optimal sky material under the scene type, and thereby improves the beauty of the image after the sky replacement.

[0034] refer to Figure 2 As shown, the image processing method may include the following steps S210 to S230:

[0035] In step S210, scene recognition is performed on the first image to be processed to determine the target scene type of the first image.

[0036] In an exemplary embodiment of the present disclosure, the first image to be processed is an image that needs to have a sky area replaced, and the first image includes a sky area and a non-sky area. The scene types may include cloudy city, sunny seaside, rainy city, cloudy city, snowy city, rainbow seaside, sunset city, sunset city, etc. The present disclosure embodiment may preset the scene type according to actual needs, and no special limitation is made thereto.

[0037] The first image can be classified based on the pre-trained scene classification model to determine the target scene type corresponding to the first image. The scene classification model can be any one of SENet (Squeeze-and-Excitation Networks), DenseNet (Dense Convolutional Network), ResNet (Deepresidual network), deep network model VGG, MobileNets, etc. The disclosed embodiment does not specifically limit the type of scene classification model.

[0038] In step S220, a target sky material image matching the target scene type is acquired, where the target sky material image is determined from candidate sky material images corresponding to the target scene type based on image aesthetic evaluation.

[0039] In an exemplary embodiment of the present disclosure, image aesthetic evaluation is a process of evaluating the beauty of an image by calculating the quality of the image and simulating human cognition and perception of beauty. The target sky material image is a sky material image that meets the target scene type and meets the image aesthetic evaluation conditions.

[0040] Different scene types have their own corresponding sky material images. The embodiment of the present disclosure determines the sky material images corresponding to each scene type from the candidate sky material images according to the image aesthetic evaluation results of the image after sky replacement based on the candidate sky material images. The candidate sky materials used in each scene can be the same, different, or not completely the same, which can be determined according to actual needs.

[0041] In step S230, the sky area of ​​the first image is replaced based on the target sky material image to obtain an image after the sky is replaced.

[0042] In an exemplary embodiment of the present disclosure, the sky area of ​​the first image is replaced according to the target sky material image, while the non-sky area is not replaced, so as to obtain an image after the sky is replaced, so that the content of the sky area of ​​the image after the sky is replaced is close to the target sky material image, and the content of the non-sky area is consistent with the first image.

[0043] The process of replacing the sky area of ​​the first image based on the target sky material image may include: firstly, performing region segmentation on the first image based on the sky cutout network, that is, dividing the sky area image and the non-sky area image; secondly, performing a replacement operation on the sky area image according to the target sky material image to obtain a replaced sky area image; finally, fusing the non-sky area image with the replaced sky area image to obtain a sky-replaced image. Figure 3 Schematic diagrams of several first images before and after sky change according to exemplary embodiments of the present disclosure are shown.

[0044] It should be noted that the embodiments of the present disclosure may select a corresponding sky replacement algorithm according to actual needs, and there is no special limitation on this.

[0045] Through the image processing method of the embodiment of the present invention, the target sky material image obtained based on image aesthetic evaluation can ensure that the sky material used to replace the sky area meets the aesthetic requirements of the scene type, and obtain the optimal sky material under the scene type, thereby improving the beauty of the image after the sky is replaced, improving the quality of the image after the sky is replaced, and having an excellent visual effect.

[0046] In an exemplary embodiment, a correspondence between different scene types and respective sky material images may be pre-established. Figure 4 A flowchart of establishing a correspondence between a scene type and a sky material image according to an exemplary embodiment of the present disclosure is shown. Figure 4 The process includes:

[0047] Step S410: Acquire multiple second images of scene types and multiple candidate sky material images.

[0048] For any scene type, first obtain multiple second images and multiple candidate sky material images of the scene type. The second images are images that can be used for sky changing operations. The number of second images and the number of candidate sky material images can be set according to actual conditions, such as the number of second images is 50, 60, 80, 100, etc., and the number of candidate sky material images is 500, 600, 650, 700, etc.

[0049] Among them, the number of second images corresponding to different scene types may be the same, different, or not completely the same, and the number of candidate sky material images corresponding to different scene types may be the same, different, or not completely the same.

[0050] Step S420: for each second image, the sky area of ​​the second image is replaced based on the candidate sky material image to obtain a plurality of third images corresponding to the second image after sky replacement.

[0051] In each scene type, for each second image, the sky area of ​​the second image is replaced by the candidate sky material image in the scene type, so as to obtain a plurality of third images after sky replacement corresponding to the second image in the scene type. In other words, a plurality of third images after sky replacement corresponding to each scene type are obtained, and the number of the third images is equal to the product of the number of the second images in the scene type and the number of the candidate sky material images.

[0052] For example, see Figure 5 As shown, scene type 1 includes N1 second images and M1 candidate sky material images, then N1×M1 third images after sky change under scene type 1 are obtained, scene type 2 includes N2 second images and M2 candidate sky material images, then N2×M2 third images after sky change under scene type 2 are obtained, and so on. Scene type n includes N n The second image and M n candidate sky material images, then we get N images under scene type n. n ×M n The third image after the sky change.

[0053] Step S430: performing image aesthetic evaluation on the third images corresponding to each second image based on a preset image aesthetic evaluation network to obtain an image aesthetic score corresponding to each third image.

[0054] For any scene type, image aesthetic evaluation is performed on the third images in the scene according to a preset image aesthetic evaluation network to obtain image aesthetic scores for each third image in the scene.

[0055] Step S440: determining a sky material image corresponding to the scene type from a plurality of candidate sky material images according to the image aesthetic scores corresponding to the third images.

[0056] For any scene type, a sky material image of the scene type is determined from a plurality of candidate sky materials of the scene type according to the image aesthetic scores of the third images of the scene type.

[0057] Continue to see Figure 5 For example, the sky material image of scene type 1 can be determined from M1 candidate sky material images according to the image aesthetic scores of N1×M1 third images under scene type 1, and accordingly, the sky material image of scene type n can be determined according to the image aesthetic scores of N1×M1 third images under scene type 1. n ×M n The image aesthetic score of the third image is obtained from M n Determine a sky material image of scene type n from the candidate sky material images.

[0058] Step S450: establishing a correspondence between scene types and respective sky material images based on sky material images corresponding to different scene types.

[0059] Based on the pre-established correspondence between different scene types and respective sky material images, a target sky material image matching the target scene type can be obtained, thereby improving the aesthetic quality and acquisition efficiency of the sky material.

[0060] In an exemplary embodiment, it is not necessary to preset the correspondence between the scene type and the sky material image. After determining the target scene type, the target sky material image is determined from the candidate sky material images corresponding to the target scene type based on the image aesthetic evaluation. Figure 6 A flowchart of determining a target sky material image of a target scene type according to an exemplary embodiment of the present disclosure is shown. The process may include:

[0061] First, multiple second images of the target scene type and multiple candidate sky material images are obtained; secondly, for each second image, the sky area of ​​the second image is replaced based on the candidate sky material image to obtain multiple third images corresponding to the second image after the sky is replaced; then, image aesthetics evaluation is performed on the third images corresponding to each second image based on a preset image aesthetics evaluation network to obtain an image aesthetics score corresponding to each third image; finally, according to the image aesthetics score corresponding to each third image, the target sky material image is determined from the multiple candidate sky material images.

[0062] It should be noted that the specific implementation details of obtaining the target sky material image of the target scene type can be found in the process of obtaining the sky material image corresponding to any scene type from step S410 to step S440, which will not be repeated here.

[0063] In an exemplary embodiment, for a target scene type, determining a target sky material image from a plurality of candidate sky material images of the target scene type according to the image aesthetic scores corresponding to each third image under the target scene type may include steps S710 and S720:

[0064] Step S710: for each candidate sky material image, determine the target image aesthetic score corresponding to the candidate sky material image according to the image aesthetic scores of each third image corresponding to the candidate sky material image.

[0065] For any candidate sky material image under the target scene type, the average of the image aesthetic scores of all third images corresponding to the candidate scene type image can be obtained, and the average is used as the target image aesthetic score corresponding to the candidate sky material image.

[0066] Step S720: determining a target sky material image from a plurality of candidate sky material images according to the target image aesthetic score corresponding to each candidate sky material image.

[0067] After obtaining the target image aesthetic scores of the candidate sky material images corresponding to the target scene type, the target sky material image can be determined according to the target image aesthetic scores corresponding to each candidate sky material image, so that the target image aesthetic score of the target sky material image is higher than that of other candidate sky material images in the candidate sky material images.

[0068] For example, the first four candidate sky material images with the highest target image aesthetic scores among the X candidate sky material images corresponding to the target scene type can be obtained as the target sky material images of the target scene type. Of course, the number of target sky materials obtained can be set according to actual conditions, and there is no special limitation on this.

[0069] Based on this, the target sky material image can be made into a sky material with the highest image aesthetic quality under the target scene type, so as to improve the quality of the image after the sky is replaced.

[0070] In an exemplary embodiment, a method for implementing image aesthetic evaluation on an image is also provided. Performing image aesthetic evaluation on the third image corresponding to each second image based on a preset image aesthetic evaluation network, and obtaining the image aesthetic evaluation results corresponding to each third image may include:

[0071] For each third image, the third image and the aesthetic feature set are input into a preset image aesthetic evaluation network to obtain an image aesthetic evaluation result corresponding to the third image, wherein the aesthetic feature set includes aesthetic features of multiple sample images corresponding to multiple score levels, and the multiple score levels are obtained based on multiple aesthetic scores of the multiple sample images, wherein the multiple aesthetic scores corresponding to each sample image include scores corresponding to different evaluators.

[0072] Among them, the aesthetic feature set is used to store aesthetic features that represent aesthetic prior knowledge, so that the multiple aesthetic scores of each sample image can represent the aesthetic evaluation of the sample image by the general public.

[0073] In addition, the preset image aesthetic evaluation network can be obtained by training the neural network to be trained based on the aesthetic feature set.

[0074] By performing image aesthetic evaluation on each third image based on a preset image aesthetic evaluation network, an image aesthetic evaluation result of each third image can be obtained, and the image aesthetic evaluation result can reflect the aesthetic evaluation results of a large number of users with a high accuracy rate, thereby improving the aesthetic feeling of the target sky material image.

[0075] In an exemplary embodiment, if there are multiple target sky material images matching the target scene type, the sky area of ​​the first image can be replaced based on each target sky material image to obtain multiple fourth images, and the image after the sky change can be determined based on each fourth image.

[0076] Optionally, the obtained fourth images can be respectively used as images after sky change and presented, see Figure 8 In the interactive interface shown, users can Figure 8 The interactive interface shown shows a plurality of different sky-changing results corresponding to the first image, that is, a plurality of fourth images. In addition, the sky-changing result corresponding to the selection operation can be used as the sky-changing image corresponding to the first image in response to the user's selection operation. Based on this, while obtaining a plurality of aesthetically pleasing sky-changing images, the user can make a self-selection so that the sky-changing image is more in line with the user's subjective feelings.

[0077] In an exemplary embodiment, determining the image after the sky is changed based on each fourth image may also include: first, performing image aesthetic evaluation on each fourth image based on a preset image aesthetic evaluation network to obtain an image aesthetic score corresponding to each fourth image, and then determining the image after the sky is changed from each fourth image based on the image aesthetic score corresponding to each fourth image.

[0078] In practical applications, the fourth image can be evaluated again based on the preset image aesthetic evaluation network to further improve the aesthetic quality of the image after sky replacement, thereby improving the quality of the image after sky replacement. Based on this, a sky replacement result with aesthetic feeling for the first image can be obtained at one time.

[0079] In addition, in order to further improve the beauty of the first image after the sky is changed and avoid the abruptness between the sky area and the non-sky area, the style of the non-sky area of ​​the first image after the sky is changed can also be adjusted based on the style of the sky area of ​​the first image after the sky is changed to obtain the image after the sky is changed.

[0080] The style includes at least one of color, brightness, contrast, style, etc. By adjusting the non-sky area of ​​the first image after sky change according to the style of the sky area of ​​the first image after sky change, the overall aesthetic feeling of the image after sky change is improved.

[0081] For example, see Fig. 9 An interactive interface diagram for adjusting the non-sky area according to an exemplary embodiment of the present disclosure is shown. The user can Fig. 9 The interactive interface shown in the figure selects whether to adjust the non-sky area and how to adjust it. Fig. 9 This is merely exemplary, and the embodiments of the present disclosure may determine the above interaction interface diagram according to actual conditions.

[0082] Fig.10 A schematic diagram of another image processing method according to an exemplary embodiment of the present disclosure is shown below. Fig.10 The image processing method of the embodiment of the present disclosure is fully described.

[0083] Step S1010: Determine a first image to be processed.

[0084] Step 1020: Perform scene recognition on the first image to be processed to determine the target scene type.

[0085] See also Fig.10 As shown, the target scene type of the first image is determined to be “cloudy city”.

[0086] Step S1030: Acquire a target sky material image that matches the target scene type “cloudy city”.

[0087] Among them, the target sky material image corresponding to the target scene type can be determined based on the pre-established correspondence between scene types and sky material images, or the target sky material image can be determined from candidate sky material images corresponding to the target scene type based on image aesthetic evaluation in the current scene.

[0088] The process of determining the target sky material image based on the image aesthetic evaluation may refer to step S410 to step S440, which will not be described in detail herein.

[0089] Step S1040: replacing the sky area of ​​the first image based on the target sky material image to obtain a sky-replaced image.

[0090] If there are multiple target sky material images, the sky area of ​​the first image can be replaced based on the target sky material images to obtain multiple sky-changed images and display them. Of course, the style of the non-sky area of ​​the first image after sky-changed can also be adjusted based on the style of the sky area of ​​the first image after sky-changed to obtain the sky-changed image. The embodiment of the present disclosure can be selected according to actual needs.

[0091] The image processing method provided by the embodiment of the present disclosure performs scene recognition on the first image to be processed to determine the target scene type corresponding to the first image, and replaces the sky area of ​​the first image with the target sky material image corresponding to the target scene type to obtain an image after sky replacement, wherein the target sky material image is determined from the candidate sky material images corresponding to the target scene type based on image aesthetic evaluation. The target sky material image obtained based on image aesthetic evaluation can ensure that the sky material used to replace the sky area meets the aesthetic requirements of the scene type, and obtain the optimal sky material under the scene type, thereby improving the beauty of the image after sky replacement, improving the quality of the image after sky replacement, and having an excellent visual effect.

[0092] It should be noted that the above figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.

[0093] For further reference, Fig.11 As shown, in an exemplary embodiment of the present disclosure, an image processing device 1100 is provided, comprising a scene recognition module 1110, a material acquisition module 1120 and a replacement module 1130. Among them:

[0094] A scene recognition module 1110 is used to perform scene recognition on the first image to be processed to determine a target scene type of the first image;

[0095] A material acquisition module 1120 is used to acquire a target sky material image matching the target scene type, where the target sky material image is determined from candidate sky material images corresponding to the target scene type based on image aesthetic evaluation;

[0096] The replacement module 1130 is used to replace the sky area of ​​the first image based on the target sky material image to obtain an image after the sky is replaced.

[0097] In an exemplary embodiment, the material acquisition module 1120 is configured to: establish a correspondence between different scene types and respective sky material images, and the sky material image of each scene type is determined from candidate sky material images corresponding to the scene type based on image aesthetic evaluation; the scene recognition module 1110 is configured to: acquire a target sky material image matching the target scene type based on the correspondence.

[0098] In an exemplary embodiment, the material acquisition module 1120 is configured to: acquire multiple second images of the target scene type and multiple candidate sky material images; for each second image, replace the sky area of ​​the second image based on the candidate sky material image, and obtain multiple third images after sky replacement corresponding to the second image; perform image aesthetic evaluation on the third images corresponding to each second image based on a preset image aesthetic evaluation network, and obtain an image aesthetic score corresponding to each third image; and determine the target sky material image from the multiple candidate sky material images according to the image aesthetic score corresponding to each third image.

[0099] In an exemplary embodiment, the material acquisition module 1120 is configured to: for each candidate sky material image, determine the target image aesthetic score corresponding to the candidate sky material image based on the image aesthetic scores of each third image corresponding to the candidate sky material image; and determine the target sky material image from multiple candidate sky material images based on the target image aesthetic scores corresponding to each candidate sky material image.

[0100] In an exemplary embodiment, the material acquisition module 1120 is configured to: acquire the average of the image aesthetic scores of the third images corresponding to the candidate sky material image; and use the average as the target image aesthetic score corresponding to the candidate sky material image.

[0101] In an exemplary embodiment, the material acquisition module 1120 is configured to determine the target sky material image according to the target image aesthetic scores corresponding to each candidate sky material image, so that the target image aesthetic score of the target sky material image is higher than that of other candidate sky material images in the candidate sky material images.

[0102] In an exemplary embodiment, the material acquisition module 1120 is configured to: for each third image, input the third image and the aesthetic feature set into a preset image aesthetic evaluation network to obtain an image aesthetic evaluation result corresponding to the third image, wherein the aesthetic feature set includes aesthetic features of multiple sample images corresponding to multiple score levels, the multiple score levels are obtained based on multiple aesthetic scores of the multiple sample images, and the multiple aesthetic scores corresponding to each sample image include scores corresponding to different evaluators; wherein the preset image aesthetic evaluation network is obtained after training the neural network model to be trained based on the aesthetic feature set.

[0103] In an exemplary embodiment, there are multiple target sky material images; the replacement module 1130 is configured to: replace the sky area of ​​the first image based on each target sky material image to obtain multiple fourth images; and determine the image after the sky is replaced based on each fourth image.

[0104] In an exemplary embodiment, the replacement module 1130 is configured to: perform image aesthetic evaluation on each fourth image based on a preset image aesthetic evaluation network to obtain an image aesthetic score corresponding to each fourth image; and determine the image after the sky is replaced from each fourth image according to the image aesthetic score corresponding to each fourth image.

[0105] In an exemplary embodiment, the replacement module 1130 is further configured to adjust the style of the non-sky region of the first image after the sky is replaced based on the style of the sky region of the first image after the sky is replaced to obtain the image after the sky is replaced.

[0106] The specific details of each module in the above device have been described in detail in the implementation method of the method part. The undisclosed details can be found in the implementation method of the method part, so they will not be repeated here.

[0107] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as "circuits", "modules" or "systems".

[0108] The exemplary embodiments of the present disclosure also provide an electronic device for the above method, which may be the above imaging device or server. Generally, the electronic device includes at least a processor and a memory, the memory is used to store executable instructions of the processor, and the processor is configured to execute the above method by executing the executable instructions.

[0109] Below Fig.12Taking the mobile terminal 1200 in the example, the structure of the electronic device in the embodiment of the present disclosure is exemplarily described. It should be understood by those skilled in the art that, in addition to the components specifically used for mobile purposes, Fig.12 The structure in the figure can also be applied to fixed type devices. In other embodiments, the mobile terminal 1200 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure can be implemented in hardware, software, or a combination of software and hardware. The interface connection relationship between the components is only shown schematically and does not constitute a structural limitation of the mobile terminal 1200. In other embodiments, the mobile terminal may also adopt the same Fig.12 Different interface connection methods, or a combination of multiple interface connection methods.

[0110] like Fig.12 As shown, the mobile terminal 1200 may specifically include: a processor 1201, a memory 1202, a bus 1203, a mobile communication module 1204, an antenna 1, a wireless communication module 1205, an antenna 2, a display screen 1206, a camera module 1207, an audio module 1208, a power module 1209, and a sensor module 1210.

[0111] Processor 1201 may include one or more processing units, for example: processor 1201 may include AP (Application Processor), modem processor, GPU (Graphics Processing Unit), ISP (Image Signal Processor), controller, encoder, decoder, DSP (Digital Signal Processor), baseband processor and / or NPU (Neural-Network Processing Unit), etc.

[0112] The encoder can encode (i.e. compress) an image or video to reduce the data size for easy storage or transmission. The decoder can decode (i.e. decompress) the encoded data of the image or video to restore the image or video data. The mobile terminal 1200 can support one or more encoders and decoders, for example: image formats such as JPEG (Joint Photographic Experts Group), PNG (Portable Network Graphics), BMP (Bitmap), and video formats such as MPEG (Moving Picture Experts Group) 1, MPEG10, H.1063, H.1064, and HEVC (High Efficiency Video Coding).

[0113] The processor 1201 may be connected to the memory 1202 or other components via a bus 1203 .

[0114] The memory 1202 may be used to store computer executable program codes, which may include instructions. The processor 1201 executes various functional applications and data processing of the mobile terminal 1200 by running the instructions stored in the memory 1202. The memory 1202 may also store application data, such as images, videos, and other files.

[0115] The communication function of the mobile terminal 1200 can be implemented by the mobile communication module 1204, antenna 1, wireless communication module 1205, antenna 2, modulation and demodulation processor and baseband processor. Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. The mobile communication module 1204 can provide 3G, 4G, 5G and other mobile communication solutions applied to the mobile terminal 1200. The wireless communication module 1205 can provide wireless communication solutions such as wireless LAN, Bluetooth, near field communication, etc. applied to the mobile terminal 1200.

[0116] The display screen 1206 is used to implement display functions, such as displaying user interfaces, images, videos, etc., and displaying abnormal prompt information. The camera module 1207 is used to implement shooting functions, such as shooting images, videos, etc., to collect scene images. The audio module 1208 is used to implement audio functions, such as playing audio, collecting voice, etc. The power module 1209 is used to implement power management functions, such as charging the battery, powering the device, monitoring the battery status, etc. The sensor module 1210 may include one or more sensors to implement corresponding induction detection functions.

[0117] In addition, the exemplary embodiments of the present disclosure further provide a computer-readable storage medium on which a program product capable of implementing the above-mentioned method of the present specification is stored. In some possible implementations, various aspects of the present disclosure may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary embodiments of the present disclosure described in the above-mentioned "Exemplary Method" section of the present specification.

[0118] It should be noted that the computer-readable medium shown in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0119] In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0120] In addition, program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).

[0121] 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 technical means in the art that are not disclosed in the present disclosure. The specification and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.

Claims

1. An image processing method, characterized in that: include: Performing scene recognition on the first image to be processed to determine a target scene type of the first image; Acquire a target sky material image matching the target scene type, wherein the target sky material image is determined from candidate sky material images corresponding to the target scene type based on image aesthetic evaluation; The sky area of ​​the first image is replaced based on the target sky material image to obtain a sky-replaced image.

2. The method according to claim 1, characterized in that Before acquiring the target sky material image matching the scene type, the method further includes: Establishing a correspondence between different scene types and respective sky material images, wherein the sky material image of each scene type is determined from candidate sky material images corresponding to the scene type based on image aesthetic evaluation; The step of acquiring a target sky material image matching the target scene type includes: A target sky material image matching the target scene type is acquired based on the corresponding relationship.

3. The method according to claim 1, characterized in that Determining the target sky material image from the candidate sky material images corresponding to the target scene type based on image aesthetic evaluation includes: Acquire a plurality of second images of the target scene type and a plurality of the candidate sky material images; For each of the second images, replacing the sky area of ​​the second image based on the candidate sky material image, to obtain a plurality of third images corresponding to the second image after sky replacement; Performing image aesthetic evaluation on the third images corresponding to each of the second images based on a preset image aesthetic evaluation network to obtain an image aesthetic score corresponding to each of the third images; The target sky material image is determined from the plurality of candidate sky material images according to the image aesthetic scores corresponding to the third images.

4. The method according to claim 3, characterized in that The step of determining the target sky material image from the plurality of candidate sky material images according to the image aesthetic scores corresponding to the third images comprises: For each of the candidate sky material images, determining the target image aesthetic score corresponding to the candidate sky material image according to the image aesthetic scores of the third images corresponding to the candidate sky material image; The target sky material image is determined from the plurality of candidate sky material images according to the target image aesthetic score corresponding to each of the candidate sky material images.

5. The method according to claim 4, characterized in that The step of determining, for each of the candidate sky material images, the target image aesthetic score corresponding to the candidate sky material image according to the image aesthetic scores of the third images corresponding to the candidate sky material image, comprises: Obtaining an average of the image aesthetic scores of the third images corresponding to the candidate sky material images; The mean is used as the aesthetic score of the target image corresponding to the candidate sky material image.

6. The method according to claim 4, characterized in that Determining the target sky material image from the plurality of candidate sky material images according to the target image aesthetic scores corresponding to the candidate sky material images comprises: The target sky material image is determined according to the target image aesthetic scores corresponding to each of the candidate sky material images, so that the target image aesthetic score of the target sky material image is higher than that of other candidate sky material images in the candidate sky material images.

7. The method according to claim 3, characterized in that The performing image aesthetic evaluation on the third images corresponding to each of the second images based on a preset image aesthetic evaluation network to obtain image aesthetic evaluation results corresponding to each of the third images includes: For each of the third images, the third image and the aesthetic feature set are input into a preset image aesthetic evaluation network to obtain an image aesthetic evaluation result corresponding to the third image, wherein the aesthetic feature set includes aesthetic features of a plurality of sample images corresponding to a plurality of score levels, wherein the plurality of score levels are obtained based on a plurality of aesthetic scores of the plurality of sample images, and the plurality of aesthetic scores corresponding to each sample image include scores corresponding to different evaluators; The preset image aesthetic evaluation network is obtained by training the neural network model to be trained based on the aesthetic feature set.

8. The method according to claim 3, characterized in that The number of the target sky material images is multiple; and the sky area of ​​the first image is replaced based on the target sky material images to obtain a sky-replaced image, including: Replacing the sky area of ​​the first image based on each of the target sky material images to obtain a plurality of fourth images; The sky-changed image is determined according to each of the fourth images.

9. The method according to claim 8, characterized in that The step of determining the sky-changed image according to each of the fourth images comprises: Performing image aesthetic evaluation on each of the fourth images based on the preset image aesthetic evaluation network to obtain an image aesthetic score corresponding to each of the fourth images; The image after sky change is determined from each of the fourth images according to the image aesthetic scores corresponding to the fourth images.

10. The method according to claim 1, characterized in that The step of replacing the sky area of ​​the first image based on the target sky material image to obtain a sky-replaced image further includes: The style of the non-sky area of ​​the first image after the sky is changed is adjusted based on the style of the sky area of ​​the first image after the sky is changed to obtain the image after the sky is changed.

11. An image processing device, characterized in that: include: A scene recognition module, configured to perform scene recognition on the first image to be processed to determine a target scene type of the first image; A material acquisition module, used to acquire a target sky material image matching the target scene type, wherein the target sky material image is determined from candidate sky material images corresponding to the target scene type based on image aesthetic evaluation; A replacement module is used to replace the sky area of ​​the first image based on the target sky material image to obtain an image after the sky is replaced.

12. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to perform the method of any one of claims 1 to 10 by executing the executable instructions.

13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.

Citation Information

Patent Citations

  • Image processing method and device, equipment and storage medium

    CN110956063A

  • Face beautifying method and device, equipment and medium

    CN111861875A

  • Image processing method and device, electronic equipment and storage medium

    CN113554658A

  • Material generation method and device, computer equipment and storage medium

    CN115454942A

  • Sky editing based on image composition

    US20170294000A1