Image restoration method, device, equipment, medium and program product

By loading the image to be repaired and the reference image in the image repair interface, using the repair trigger operation, and repairing the image to be repaired based on the reference image, the problem of users not being able to meet their expectations after shooting is solved, realizing convenient image repair and improving the user experience.

CN118628409APending Publication Date: 2024-09-10BEIJING ZITIAO NETWORK TECH CO LTD

Patent Information

Application Number
CN202410683637.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-29
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

After shooting, users find that the photos or videos cannot meet shooting expectations, especially the scene cannot be reproduced due to failure in expression management, making it difficult to achieve satisfactory results through image repair.

Method used

An image repair method and device are provided. By displaying the image repair interface, the user can load the image to be repaired and the reference image. Based on the repair trigger operation, the reference image is used to repair the image to be repaired, thereby achieving the repair of the target image and meeting the user's shooting expectations.

Benefits of technology

It realizes convenient image repair, solves the problem of unsatisfactory shooting results and difficult image repair, improves user experience, and can effectively repair scenes that cannot be reproduced, such as closed eyes, wide mouths, bad expressions or bad eyesight. image.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118628409A
    Figure CN118628409A
Patent Text Reader

Abstract

The embodiment of the invention provides an image restoration method and device, equipment, a medium and a program product. According to the method, in response to a trigger operation for a target control, an image restoration interface is displayed, and the image restoration interface comprises a to-be-restored image and a reference image loading control; in response to a loading operation for the reference image loading control, displaying a reference image on the image restoration interface; and in response to a repair triggering operation, displaying a target image on the image repair interface, the target image being obtained by repairing the to-be-repaired image based on the reference image. According to the embodiment of the invention, the to-be-repaired image can be repaired by selecting the reference image meeting the shooting expectation of the user, so that the effect of the repaired target image meets the shooting expectation, and convenient image repair is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to computer technology, and more particularly to an image restoration method, apparatus, device, medium, and program product. Background Art

[0002] With the development of computer technology, the shooting devices in electronic devices can achieve higher and higher shooting quality. In daily scenes, users can use electronic devices to take pictures. For example, they can take group photos and travel photos through mobile terminals.

[0003] Since the effect of a photo or video can only be seen after it is taken, for some scenes that cannot be reproduced, the user may fail to manage their facial expressions, such as closing their eyes, opening their mouths, or having bad eyesight or facial expressions, which may result in the photo not meeting the shooting expectations and making it difficult to repair the image by restoring the scene. Summary of the invention

[0004] The embodiments of the present disclosure provide an image restoration method, apparatus, device, medium, and program product, which can conveniently restore images taken by users to meet shooting expectations.

[0005] In a first aspect, an embodiment of the present disclosure provides an image restoration method, comprising:

[0006] In response to a trigger operation on a target control, an image restoration interface is displayed, wherein the image restoration interface includes controls for loading an image to be restored and a reference image;

[0007] In response to a loading operation on the reference image loading control, displaying a reference image on the image restoration interface;

[0008] In response to a repair triggering operation, a target image is displayed on the image repair interface, wherein the target image is obtained by repairing the image to be repaired based on the reference image.

[0009] In a second aspect, the present disclosure also provides an image restoration device, the device comprising:

[0010] An interface display module, for displaying an image restoration interface in response to a trigger operation on a target control, wherein the image restoration interface includes controls for loading an image to be restored and a reference image;

[0011] An image display module, configured to display a reference image on the image restoration interface in response to a loading operation on the reference image loading control;

[0012] The image restoration module is used to display a target image on the image restoration interface in response to a restoration triggering operation, wherein the target image is obtained by restoring the image to be restored based on the reference image.

[0013] In a third aspect, an embodiment of the present disclosure further provides an electronic device, the electronic device comprising:

[0014] one or more processors;

[0015] a storage device for storing one or more programs,

[0016] When the one or more programs are executed by the one or more processors, the one or more processors implement the image restoration method as described in any embodiment of the present disclosure.

[0017] In a fourth aspect, an embodiment of the present disclosure further provides a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute the image restoration method as described in any embodiment of the present disclosure.

[0018] In a fifth aspect, an embodiment of the present disclosure further provides a computer program product, including a computer program, which, when executed by a processor, implements the image restoration method as described in any embodiment of the present disclosure.

[0019] The disclosed embodiment provides an image restoration method, which triggers the display of an image restoration interface through a target control, and the image restoration interface includes a to-be-restored image and a reference image loading control. A loading operation is input for the reference image loading control to load the reference image into the image restoration interface. Then, based on the restoration triggering operation, the reference image is used to restore the to-be-restored image to obtain a target image, and the target image is displayed on the image restoration interface. The disclosed embodiment can restore the to-be-restored image by selecting a reference image that meets the user's shooting expectations, so that the effect of the restored target image meets the shooting expectations, and convenient image restoration can be achieved. For some scenes that cannot be reproduced, the problem that the shooting effect does not meet expectations and the image is difficult to restore can be solved, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.

[0021] Figure 1 A schematic diagram of a flow chart of an image restoration method provided by an embodiment of the present disclosure;

[0022] Figure 2 A schematic diagram of an image restoration interface provided by an embodiment of the present disclosure;

[0023] Figure 3A schematic diagram of a reference image loading process provided by an embodiment of the present disclosure;

[0024] Figure 4 A schematic diagram of the structure of an image restoration device provided by an embodiment of the present disclosure;

[0025] Figure 5 A schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0026] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0027] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0028] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0029] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0030] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0031] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0032] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0033] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.

[0034] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0035] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0036] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.

[0037] Figure 1 The present invention is a flowchart of an image restoration method provided by an embodiment of the present invention. The present invention is applicable to the situation of restoring images, especially to repairing images with failed expression management in some scenes that cannot be reproduced. For example, images with closed eyes, wide open mouth, bad expression or bad eyesight. The method can be executed by an image restoration device, which can be implemented in the form of software and / or hardware, and optionally, by an electronic device, which can be a mobile terminal or a PC, etc.

[0038] like Figure 1 As shown, the method includes:

[0039] S110 . In response to a trigger operation on a target control, display an image restoration interface, wherein the image restoration interface includes controls for loading an image to be restored and a reference image.

[0040] Among them, the target control can represent a control that triggers the display of the image restoration interface. The image restoration interface is used to perform interactive operations of image restoration. For example, the image restoration interface includes an image to be restored and a reference image loading control. In some embodiments, the image restoration interface may include an image to be restored, a reference image loading control, and candidate restoration items. The reference image loading control is used to trigger an image loading operation. If a trigger operation is input for the reference image loading control, the interface jumps to the image selection interface to select a reference image. Candidate restoration items include expression restoration, closed eye restoration, eye restoration, and mouth restoration.

[0041] Exemplarily, in response to a trigger operation on a target control, displaying an image repair interface includes: displaying a candidate control set interface, the candidate control set interface including the target control; in response to a click operation on the target control, displaying the image repair interface.

[0042] The candidate control set interface includes control information of the candidate controls. After selecting the image to be repaired, if it is identified that the image to be repaired includes objects such as portraits or animals, the candidate control set interface is displayed. Optionally, in response to an input editing operation, the candidate control set interface is displayed. The candidate control set interface includes one-click beautification, beauty and target controls, etc. If a click operation on the target control in the candidate control set interface is detected, the image repair interface is displayed.

[0043] Figure 2 Schematic diagram of an image restoration interface provided by an embodiment of the present disclosure. Figure 2 As shown, the candidate control set interface 200 displays a target control 210. If the target control 210 is clicked, an image restoration interface 220 is displayed. The image restoration interface 220 may include an image display area 230 and an information setting area 240. The image to be restored is displayed in the image display area 230. The information setting area 240 includes a reference image loading control 250 and candidate restoration items 260.

[0044] S120: In response to a loading operation on the reference image loading control, display a reference image on the image restoration interface.

[0045] Among them, the reference image can be used to repair the image to be repaired. The reference image can be a local image or an image downloaded from the Internet, etc. The reference image can be an image containing an object in the image to be repaired and the object has a similar angle. For example, the reference image can contain a person in the image to be repaired, and the facial angle of the person in the reference image is similar to that in the image to be repaired. It should be noted that the reference image can also contain an image with a similar angle of a different person from the image to be repaired. Alternatively, the reference image contains an animal in the image to be repaired, and the facial angle of the animal in the reference image is similar to that in the image to be repaired. The disclosed embodiment does not limit the reference image and the object in the image to be repaired to be the same object, nor does it limit the facial angle of the object in the reference image to be consistent with the object to be repaired. When the angle deviation between the facial angle of the object in the reference image and the facial angle of the object to be repaired is greater than a set threshold, the error of the generated image caused by the large angle deviation can be overcome by a pre-trained generation model. For example, in the training stage of the generation model, some image samples with large angle deviations can be used to train the generation model so that the generation model learns the experience of generating an expected repair image that meets the expectations of images with large angle deviations.

[0046] It should be noted that if the reference image includes multiple faces, prompt information is output. In some embodiments, the prompt information is used to prompt the selection of the target face for reference. For example, if the reference image includes multiple faces, prompt information is output to prompt the selection of one face as the target face for reference. Alternatively, the prompt information is used to prompt the reselection of the reference image. In other embodiments, the target face with a similar angle to the face of the object to be repaired among the multiple faces in the reference image can be automatically determined, and the embodiments of the present disclosure do not specifically limit this. In some other embodiments, if the image to be repaired is a group photo, a reference image with multiple faces can be selected, and the correspondence between the faces in the reference image and the objects to be repaired in the image to be repaired can be specified, so that different objects to be repaired in the group photo can be repaired based on the reference features of different faces in the reference image, thereby achieving diversified repair options and enriching the image display effect.

[0047] Exemplarily, in response to a loading operation on the reference image loading control, displaying a reference image on the image restoration interface includes: in response to a triggering operation on the reference image loading control, displaying an image selection interface; in response to an image selection operation on the image selection interface, displaying a thumbnail of the reference image at a position corresponding to the reference image loading control.

[0048] The image selection interface includes multiple candidate images and selection prompt information. The selection prompt information is used to prompt the user to select a reference image. For example, the user may be prompted to select an image with a similar angle to the object in the image to be repaired, so as to increase the repair speed.

[0049] Figure 3 A schematic diagram of a reference image loading process provided by an embodiment of the present disclosure. Figure 3 As shown, click the reference image loading control 310 in the image restoration interface 300 to display the image selection interface 320. The image selection interface 320 includes a plurality of candidate images, etc. Based on the selection operation of the reference image, a thumbnail of the reference image is displayed at a position corresponding to the reference image loading control 310.

[0050] Optionally, the method further includes: in response to a replacement triggering operation for the reference image, replacing the reference image in the image restoration interface.

[0051] The replacement trigger operation represents an operation that triggers the replacement of the reference image. For example, the replacement trigger operation includes clicking the image loading control again, or voice inputting a new reference image.

[0052] If a click operation on the reference image loading control is detected, it is considered that a replacement trigger operation on the reference image is detected, and the image selection interface is displayed again. Thus, a new reference image is selected from the image selection interface, and the thumbnail of the newly selected reference image is loaded to the corresponding position of the reference image loading control. By flexibly setting the reference image, the image restoration effect can be enriched.

[0053] S130. In response to a repair triggering operation, display a target image on the image repair interface, wherein the target image is obtained by repairing the image to be repaired based on the reference image.

[0054] The repair trigger operation may be used to trigger the repair of the image to be repaired. For example, the repair trigger operation may include a selection operation for a candidate repair item, or voice input to start repair, or input of a set repair gesture, etc. The present disclosure does not specifically limit the meaning of the repair trigger operation.

[0055] Specifically, after the reference image is selected, the candidate repair item is converted into an operable state, and in response to the selection operation on the candidate repair item, the selected candidate repair item can be determined as a target repair item. The target repair item represents the area to be repaired in the image to be repaired. For example, the target repair item can be expression repair, closed eye repair, eye repair or mouth repair, etc. Correspondingly, the area to be repaired can be eyes and / or mouth, etc.

[0056] Exemplarily, in response to a selection operation on the candidate restoration item, a target restoration item is determined; based on a reference feature corresponding to the target restoration item in the reference image, a target feature corresponding to the target restoration item in the image to be restored is restored to obtain a candidate image; in response to a selection operation on the candidate image, a target image is determined, and the target image is displayed on the image restoration interface.

[0057] The reference feature represents the image feature corresponding to the target restoration item in the reference image. For example, the reference feature may include physiological features of the eye or the mouth. The physiological features of the eye may represent the pupil, the white of the eye, and other eye details. The physiological features of the mouth may represent information such as lips, corners of the mouth, teeth, and gums. The target feature represents the image feature corresponding to the target restoration item in the image to be restored. For example, the target feature may include eye makeup features or makeup features of the mouth.

[0058] Optionally, based on the reference feature corresponding to the target restoration item in the reference image, repairing the target feature corresponding to the target restoration item in the image to be repaired to obtain the candidate image includes: obtaining the reference feature corresponding to the target restoration item in the reference image. Obtaining the target feature corresponding to the target restoration item in the image to be repaired. Inputting the reference feature and the target feature into a preset generation model to obtain the candidate image output by the preset generation model.

[0059] Among them, the preset generation model converts the target features of the image to be repaired into pure noise through the forward diffusion process, and under the guidance of the reference features, recovers the generation results similar to the reference features from the pure noise through the reverse diffusion process. The similarity can be calculated through the attention module.

[0060] The reference features and target features are input into the preset generation model, and the generation results and corresponding confidence levels are determined according to the preset generation model. Multiple generation results are selected according to the confidence levels and fused into the image to be repaired to obtain multiple candidate images.

[0061] Taking the closed-eye restoration as an example, since the image to be restored is an image with closed eyes, it is impossible to obtain information about eye features from the closed-eye image. In order to solve the above problem, a clear image with open eyes is selected to provide the physiological characteristics of the eyes as reference features. Since the purpose of closed-eye restoration is to redraw the eye area of ​​the image to be restored, so as to maintain the eye makeup information in the image to be restored, and generate a natural open-eye image based on the reference features. Therefore, the redrawn image has eye makeup consistent with the image to be restored, and has eyes consistent with the reference image.

[0062] Optionally, obtaining a target feature corresponding to the target restoration item in the image to be restored includes: if the image to be restored includes at least two objects to be restored, displaying prompt information, wherein the prompt information is used to prompt selection of a target restoration object from the at least two objects to be restored; in response to an object selection operation, determining a target restoration object from the at least two objects to be restored; and obtaining a target feature corresponding to the target restoration object and the target restoration item.

[0063] For example, if the image to be repaired includes at least two human faces, prompt information is displayed to prompt the user to select a target human face from the at least two human faces. Based on the selection operation, the target human face is selected from the at least two human faces. A target feature corresponding to the target repair item in the target human face is obtained. Taking the target repair item as closed eye repair as an example, the target feature represents the eye physiological information of the target human face. For example, the eye physiological information includes the pupil, the white of the eye, and other detailed information of the eye.

[0064] If the image to be repaired includes at least two human faces, the corresponding area of ​​each human face and the target repair item can be identified to determine the target repair object. The target features corresponding to the target repair object and the target repair item are obtained. Taking the target repair item as closed eye repair as an example, if the image to be repaired includes at least two human faces, the target human face with closed eyes is identified in at least two human faces. The eye physiological information of the target human face is obtained as the target feature.

[0065] Optionally, the reference features and the target features are input into a preset generation model to obtain a candidate image output by the preset generation model, including: injecting the reference features and the target features into a noise prediction network of the preset generation model through an attention module; and generating the candidate image through the noise prediction network.

[0066] For example, the image to be repaired is input into the compression module of the preset generation model, and the image to be repaired is compressed into a low-dimensional latent space by the compression module to obtain the features of the image to be repaired. The features of the image to be repaired are input into the noise prediction network of the preset generation model, and noise is added to the area corresponding to the target repair item in the image to be repaired through forward diffusion processing to obtain a local noise map. If the target repair item is closed-eye repair, noise is added to the eye area in the image to be repaired to obtain a local noise map. In the local noise map, only the eye area is pure noise, and the remaining area is the features of the image to be repaired in the latent space of the image to be repaired. The reference feature is injected into the noise prediction network of the preset generation model through the attention module, and the target feature is injected into the noise prediction network of the preset generation model through the attention module. Thus, through the noise prediction network in the reverse diffusion process, a generation result similar to the reference feature is restored from the local noise map based on the reference feature. For example, through the noise prediction network in the reverse diffusion process, a naturally open eye is restored from the local noise map based on the physiological features of the eye in the reference image, and the image features of the image to be repaired are maintained in other areas. Then, the repaired generated image is restored to the same size as the image to be repaired through the decompression module to obtain the generation result. Optionally, the generated results whose confidence exceeds a set threshold may be used as candidate images.

[0067] Taking closed-eye restoration as an example, the makeup features in the image to be restored are extracted and injected into the noise prediction network through the attention module. The eye physiological features in the reference image are extracted and injected into the noise prediction network through the attention module. Thus, the noise prediction network generates eye features similar to the reference image during the denoising process and can retain the makeup features of the image to be restored.

[0068] The technical solution of the disclosed embodiment triggers the display of the image restoration interface through the target control, and the image restoration interface includes the image to be restored and the reference image loading control. A loading operation is input for the reference image loading control to load the reference image into the image restoration interface. Then, based on the restoration trigger operation, the reference image is used to restore the image to be restored to obtain the target image, and the target image is displayed in the image restoration interface. The disclosed embodiment can restore the image to be restored by selecting a reference image that meets the user's shooting expectations, so that the effect of the restored target image meets the shooting expectations, and convenient image restoration can be achieved. For some scenes that cannot be reproduced, the disclosed embodiment repairs the target restoration object in the image to be restored based on the reference image, without the need to restore the scene for image restoration, which can solve the problem that the shooting effect does not meet expectations and the image is difficult to repair, thereby improving the user experience.

[0069] Figure 4 This is a schematic diagram of the structure of an image restoration device provided in an embodiment of the present disclosure. The device can be implemented in the form of software and / or hardware. Optionally, it can be implemented by an electronic device, which can be a mobile terminal or a PC.

[0070] like Figure 4 As shown, the device includes: an interface display module 410, an image display module 420 and an image restoration module 430.

[0071] The interface display module 410 is used to display an image restoration interface in response to a trigger operation on a target control, wherein the image restoration interface includes controls for loading an image to be restored and a reference image;

[0072] An image display module 420 is used to display a reference image on the image restoration interface in response to a loading operation on the reference image loading control;

[0073] The image restoration module 430 is configured to display a target image on the image restoration interface in response to a restoration triggering operation, wherein the target image is obtained by restoring the image to be restored based on the reference image.

[0074] Optionally, the interface display module 410 is specifically used for:

[0075] Displaying a candidate control set interface, wherein the candidate control set interface includes a target control;

[0076] In response to a click operation on the target control, the image repair interface is displayed.

[0077] Optionally, the image display module 420 is specifically used for:

[0078] In response to a triggering operation on the reference image loading control, displaying an image selection interface;

[0079] In response to an image selection operation on the image selection interface, a thumbnail of the reference image is displayed at a position corresponding to the reference image loading control.

[0080] Optionally, the device further comprises:

[0081] The replacement module is used to replace the reference image in the image restoration interface in response to a replacement trigger operation on the reference image.

[0082] Optionally, the image restoration interface further includes candidate restoration items;

[0083] The image restoration module 430 is specifically used for:

[0084] In response to a selection operation on the candidate repair item, determining a target repair item;

[0085] Based on the reference feature corresponding to the target restoration item in the reference image, the target feature corresponding to the target restoration item in the image to be restored is restored to obtain a candidate image;

[0086] In response to a selection operation on the candidate image, a target image is determined, and the target image is displayed on the image restoration interface.

[0087] Further, the step of repairing the target feature corresponding to the target restoration item in the image to be repaired based on the reference feature corresponding to the target restoration item in the reference image to obtain the candidate image includes:

[0088] Acquire reference features corresponding to the reference image and the target restoration item;

[0089] Acquire a target feature corresponding to the target restoration item in the image to be restored;

[0090] The reference features and target features are input into a preset generation model to obtain a candidate image output by the preset generation model.

[0091] Furthermore, the obtaining of a target feature corresponding to the target restoration item in the image to be restored includes:

[0092] If the image to be repaired includes at least two objects to be repaired, displaying prompt information, wherein the prompt information is used to prompt the user to select a target repair object from the at least two objects to be repaired;

[0093] In response to the object selection operation, determining a target repair object among the at least two objects to be repaired;

[0094] Obtain target features corresponding to the target repair object and the target repair item.

[0095] Furthermore, the step of inputting the reference feature and the target feature into a preset generation model to obtain a candidate image output by the preset generation model includes:

[0096] Injecting the reference features and the target features into the noise prediction network of the preset generation model through an attention module;

[0097] The candidate image is generated by the noise prediction network.

[0098] The image restoration device provided in the embodiments of the present disclosure can execute the image restoration method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.

[0099] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present disclosure.

[0100] Figure 5 This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. Figure 5 , which shows an electronic device (eg, Figure 5 The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0101] like Figure 5As shown, the electronic device 500 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An edit / output (I / O) interface 505 is also connected to the bus 504.

[0102] Typically, the following devices may be connected to the I / O interface 505: an input device 506 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 508 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 509. The communication device 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 5 The electronic device 500 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0103] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 509, or installed from a storage device 508, or installed from a ROM 502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0104] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0105] The electronic device provided by the embodiment of the present disclosure and the image restoration method provided by the above embodiment belong to the same inventive concept. The technical details not fully described in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.

[0106] The embodiment of the present disclosure provides a computer storage medium on which a computer program is stored. When the program is executed by a processor, the image restoration method provided by the above embodiment is implemented.

[0107] It should be noted that the computer-readable medium disclosed above 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. 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, device 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, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The 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 conjunction 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: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0108] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0109] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0110] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device:

[0111] In response to a trigger operation on a target control, an image restoration interface is displayed, wherein the image restoration interface includes controls for loading an image to be restored and a reference image;

[0112] In response to a loading operation on the reference image loading control, displaying a reference image on the image restoration interface;

[0113] In response to a repair triggering operation, a target image is displayed on the image repair interface, wherein the target image is obtained by repairing the image to be repaired based on the reference image.

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

[0115] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0116] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit does not, in some cases, constitute a limitation on the unit itself.

[0117] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0118] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, 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 foregoing.

[0119] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0120] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0121] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.

Claims

1. An image restoration method, characterized in that: include: In response to a trigger operation on a target control, an image restoration interface is displayed, wherein the image restoration interface includes controls for loading an image to be restored and a reference image; In response to a loading operation on the reference image loading control, displaying a reference image on the image restoration interface; In response to a repair triggering operation, a target image is displayed on the image repair interface, wherein the target image is obtained by repairing the image to be repaired based on the reference image.

2. The method according to claim 1, characterized in that The displaying of the image repair interface in response to the triggering operation on the target control includes: Displaying a candidate control set interface, wherein the candidate control set interface includes a target control; In response to a click operation on the target control, the image repair interface is displayed.

3. The method according to claim 1, characterized in that: In response to the loading operation on the reference image loading control, displaying the reference image on the image restoration interface includes: In response to a triggering operation on the reference image loading control, displaying an image selection interface; In response to an image selection operation on the image selection interface, a thumbnail of the reference image is displayed at a position corresponding to the reference image loading control.

4. The method according to claim 1, characterized in that: Also includes: In response to a replacement triggering operation for the reference image, the reference image in the image restoration interface is replaced.

5. The method according to claim 1, characterized in that The image restoration interface also includes candidate restoration items; In response to the repair triggering operation, displaying the target image on the image repair interface includes: In response to a selection operation on the candidate repair item, determining a target repair item; Based on the reference feature corresponding to the target restoration item in the reference image, the target feature corresponding to the target restoration item in the image to be restored is restored to obtain a candidate image; In response to a selection operation on the candidate image, a target image is determined, and the target image is displayed on the image restoration interface.

6. The method according to claim 5, characterized in that The step of repairing the target feature corresponding to the target repair item in the image to be repaired based on the reference feature corresponding to the target repair item in the reference image to obtain the candidate image includes: Acquire reference features corresponding to the reference image and the target restoration item; Acquire a target feature corresponding to the target restoration item in the image to be restored; The reference features and target features are input into a preset generation model to obtain a candidate image output by the preset generation model.

7. The method according to claim 6, characterized in that The acquiring the target feature corresponding to the target restoration item in the image to be restored includes: If the image to be repaired includes at least two objects to be repaired, displaying prompt information, wherein the prompt information is used to prompt the user to select a target repair object from the at least two objects to be repaired; In response to the object selection operation, determining a target repair object among the at least two objects to be repaired; Obtain target features corresponding to the target repair object and the target repair item.

8. The method according to claim 6, characterized in that The step of inputting the reference feature and the target feature into a preset generation model to obtain a candidate image output by the preset generation model includes: Injecting the reference features and the target features into the noise prediction network of the preset generation model through an attention module; The candidate image is generated by the noise prediction network.

9. An image restoration device, characterized in that: include: An interface display module, for displaying an image restoration interface in response to a trigger operation on a target control, wherein the image restoration interface includes controls for loading an image to be restored and a reference image; An image display module, configured to display a reference image on the image restoration interface in response to a loading operation on the reference image loading control; The image restoration module is used to display a target image on the image restoration interface in response to a restoration triggering operation, wherein the target image is obtained by restoring the image to be restored based on the reference image.

10. An electronic device, characterized in that: The electronic device comprises: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the image restoration method as described in any one of claims 1-8.

11. A storage medium containing computer executable instructions, characterized in that: The computer executable instructions are used to perform the image restoration method as described in any one of claims 1 to 8 when executed by a computer processor.

12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the computer program implements the image restoration method as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Image processing method, terminal device and computer readable medium

    CN109785256A

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

    CN111553864A

  • Portrait restoration method and electronic equipment

    CN111696051A

  • Image restoration method and device

    CN114331912A

  • Photo restoration method, electronic equipment and related medium

    CN117274106A

Cited By

  • Image processing method, electronic device, storage medium and program product

    CN121967905A

  • Image inpainting method and apparatus, and device, medium and program product

    WO2025247222A1