Shooting restoration method and electronic device
A method includes, in a process of shooting a photo or recording a video by a user, a restoration template file that is generated and stored based on one or more shooting parameters. When the photo shot or the video recorded by the user is lost or mistakenly deleted, shooting restoration is implemented based on the restoration template file. The user restores a shooting process by using the restoration template file, re-shoots another different object, and restores a photo or a video having same effect. Alternatively, the user selects a same framing range, and restores a photo or a video having same effect and the same framing range.
1 . A method comprising:
generating one or more restoration templates based on one or more original shooting parameters extracted from a first multimedia file;
storing the one or more restoration templates;
displaying a shooting preview interface of an electronic device based on one or more first shooting parameters of a first parameter set, wherein the shooting preview interface comprises a picture;
selecting, from the one or more restoration templates, a first restoration template that is associated with the first multimedia file, wherein the first multimedia file comprises a first photo, a first picture, or a first video clip;
obtaining a second parameter set corresponding to the first restoration template, wherein the second parameter set comprises one or more second shooting parameters for shooting the first multimedia file, wherein the second shooting parameters do not match the first shooting parameters;
receiving a first operation of a user;
obtaining, in response to the first operation and through re-shooting, a second multimedia file based on the one or more second shooting parameters, wherein the second multimedia file and the first multimedia file have a same display effect, and wherein the second multimedia file comprises a second photo, a second picture, or a second video clip; and
storing the second multimedia file as a restored version of the first multimedia file, thereby restoring the first multimedia file.
2 . The method according to claim 1 , wherein the one or more restoration templates comprise a preset restoration template or a restoration template based on one or more shooting parameters of an associated multimedia file.
3 . The method according to claim 1 , wherein selecting the first restoration template comprises:
receiving a second operation of the user, and selecting, in response to the second operation, the first restoration template from the one or more restoration templates; or
selecting, based on a shooting environment in which the electronic device is located, a restoration template with a highest shooting effect in the one or more restoration templates as the first restoration template.
4 . The method according to claim 1 , wherein the method further comprises:
displaying the one or more second shooting parameters;
receiving a second operation of the user;
modifying the one or more second shooting parameters in response to the second operation to obtain a modified second parameter set;
updating the first restoration template based on the modified second parameter set;
generating, based on the modified second parameter set, a second restoration template associated with the first multimedia file; and
storing the second restoration template.
5 . The method according to claim 1 , wherein the method further comprises:
detecting that the first multimedia file is lost or damaged; and
displaying, in a shooting restoration mode in response to the detecting, prompt information to prompt the user to restore the first multimedia file.
6 . The method according to claim 1 , wherein the second parameter set further comprises framing information of the first multimedia file, and wherein the method further comprises:
obtaining a framing range of the first multimedia file based on the framing information of the first multimedia file;
receiving a second operation of the user; and
obtaining, in response to the second operation, a third multimedia file based on the one or more second shooting parameters, wherein the third multimedia file and the first multimedia file have a same display effect and a same framing range.
7 . The method according to claim 1 , wherein the second parameter set further comprises an operation parameter for performing editing processing on the first multimedia file, and wherein the method further comprises performing editing processing on the second multimedia file based on the operation parameter to obtain a processed second multimedia file, wherein the editing processing comprises ratio cropping, filter color adjustment, beauty parameter adjustment, or brightness level adjustment.
8 . The method according to claim 1 , wherein the method further comprises updating, based on the one or more second shooting parameters, the picture.
9 . The method according to claim 1 , wherein the second shooting parameters comprise a focal length, a focusing mode, a resolution, a camera, geographical location information, a beauty parameter, a filter color, a flash effect, a horizontal level effect, an exposure, or a photosensitivity.
10 . The method according to claim 1 , wherein the method further comprises:
receiving a second operation of the user;
enabling a shooting restoration function of the electronic device in response to the second operation;
receiving a third operation of the user; and
enabling, in response to the third operation, the electronic device to enter a shooting restoration mode.
11 . An electronic device, comprising:
one or more memories configured to store instructions and one or more restoration templates; and
one or more processors coupled to the one or more memories and configured to execute the instructions to cause the electronic device to:
generate the one or more restoration templates based on one or more original shooting parameters extracted from a first multimedia file;
display a shooting preview interface of the electronic device based on one or more first shooting parameters of a first parameter set, wherein the shooting preview interface comprises a picture;
select, from the one or more restoration templates, a first restoration template that is associated with the first multimedia file, wherein the first multimedia file comprises a first photo, a first picture, or a first video clip;
obtain a second parameter set corresponding to the first restoration template, wherein the second parameter set comprises one or more second shooting parameters for shooting the first multimedia file, wherein the second shooting parameters do not match the first shooting parameters;
receive a first operation of a user;
obtain, in response to the first operation and through re-shooting, a second multimedia file based on the one or more second shooting parameters, wherein the second multimedia file and the first multimedia file have a same display effect, and wherein the second multimedia file comprises a second photo, a second picture, or a second video clip; and
store the second multimedia file as a restored version of the first multimedia file, thereby restoring the first multimedia file.
12 . The electronic device according to claim 11 , wherein the one or more restoration templates comprise a preset restoration template, or a restoration template based on one or more shooting parameters of an associated multimedia file.
13 . The electronic device according to claim 11 , wherein the one or more processors are further configured to execute the instructions to cause the electronic device to:
select, based on the picture, a restoration template with a highest shooting effect in the one or more restoration templates as the first restoration template;
select, based on a use frequency of the user, a restoration template that is most frequently used in the one or more restoration templates as the first restoration template; or
select, based on a use record of the user, a restoration template that is last used in the one or more restoration templates as the first restoration template.
14 . The electronic device according to claim 11 , wherein the one or more processors are further configured to execute the instructions to cause the electronic device to:
display the one or more second shooting parameters;
receive a second operation of the user;
modify the one or more second shooting parameters in response to the second operation to obtain a modified second parameter set;
update the first restoration template based on the modified second parameter set;
generate, based on the modified second parameter set, a second restoration template associated with the first multimedia file; and
store the second restoration template.
15 . The electronic device according to claim 11 , wherein the one or more processors are further configured to execute the instructions to cause the electronic device to:
detect that the first multimedia file is lost or damaged; and
display, in a shooting restoration mode in response to detecting that the first multimedia file is lost or damaged, prompt information to prompt the user to restore the first multimedia file.
16 . The electronic device according to claim 11 , wherein the second parameter set further comprises framing information of the first multimedia file, and wherein the one or more processors are further configured to execute the instructions to cause the electronic device to:
obtain a framing range of the first multimedia file based on the framing information of the first multimedia file;
receive a second operation of the user; and
obtain, in response to the second operation, a third multimedia file based on the one or more second shooting parameters, wherein the third multimedia file and the first multimedia file have a same display effect and a same framing range.
17 . The electronic device according to claim 11 , wherein the second parameter set further comprises an operation parameter for performing editing processing on the first multimedia file, and wherein the one or more processors are further configured to execute the instructions to cause the electronic device to perform editing processing on the second multimedia file based on the operation parameter to obtain a processed second multimedia file, wherein the editing processing comprises ratio cropping, filter color adjustment, beauty parameter adjustment, or brightness level adjustment.
18 . The electronic device according to claim 11 , wherein the one or more processors are further configured to execute the instructions to cause the electronic device to update, based on the one or more second shooting parameters, the picture.
19 . A computer program product comprising computer-executable instructions that are stored on a non-transitory computer-readable storage medium and that, when executed by one or more processors, cause an electronic device to:
generate one or more restoration templates based on one or more original shooting parameters extracted from a first multimedia file;
store the one or more restoration templates;
display a shooting preview interface of the electronic device based on one or more first shooting parameters of a first parameter set, wherein the shooting preview interface comprises a picture;
select, from the one or more restoration templates, a first restoration template that is associated with the first multimedia file, wherein the first multimedia file comprises a first photo, a first dynamic picture, or a first video clip;
obtain a second parameter set corresponding to the first restoration template, wherein the second parameter set comprises one or more second shooting parameters for shooting the first multimedia file, wherein the second shooting parameters do not match the first shooting parameters;
receive a first operation of a user;
obtain, in response to the first operation and through re-shooting by using a camera, a second multimedia file based on the one or more second shooting parameters, wherein the second multimedia file and the first multimedia file have same display effect, and wherein the second multimedia file comprises a second photo, a second picture, or a second video clip; and
store the second multimedia file as a restored version of the first multimedia file, thereby restoring the first multimedia file.
20 . The computer program product according to claim 19 , wherein the one or more restoration templates comprise a preset restoration template or a restoration template based on one or more shooting parameters of an associated multimedia file.