Cooperative photographing method and apparatus, electronic device, and computer-readable storage medium
A cooperative photographing method is provided, which includes: acquiring a first image captured by a first terminal and a second image captured by a second terminal, and composing a third image based on the first image and the second image. In the third image, a first object in the first image and a second object in the second image are used as foreground objects and superimposed on a specified background image. The first object is a foreground object of the first image, and the second object is a foreground object of the second image.
1 . A cooperative photographing method, comprising:
acquiring a first image captured in real time by a first terminal and a second image captured in real time by a second terminal;
in real time, composing a third image based on the first image and the second image, the real-time composed third image being displayed, in real time, on the first terminal and the second terminal; and
generating a cooperative video based on the real-time composed third image,
wherein in the third image, a first object in the first image and a second object in the second image are used as foreground objects and superimposed on a specified background image, the first object is a foreground object of the first image, and the second object is a foreground object of the second image,
wherein the first object in the cooperative video is dynamic, and the second object in the cooperative video is dynamic,
wherein the first object is obtained based on an image recognition processing on the first image, and the second object is obtained based on an image recognition processing on the second image, and
wherein a superimposing position of the foreground object is determined according to an image recognition result of the background image.
2 . The method according to claim 1 , wherein the background image is a fourth image selected by a user.
3 . The method according to claim 1 , wherein the background image is a background image of the first image or a background image of the second image.
4 . The method according to claim 2 , wherein the composing a third image based on the first image and the second image comprises:
determining a first superimposing position corresponding to the first object and a second superimposing position corresponding to the second object according to a determined target cooperative photographing template; and
composing the third image by superimposing the first object in the first superimposing position on the background image and superimposing the second object in the second superimposing position on the background image.
5 . The method according to claim 3 , wherein the composing a third image based on the first image and the second image comprises:
determining a target superimposing position corresponding to a target object, wherein in a case that the background image is the background image of the first image, the target object is the second object, and in a case that the background image is the background image of the second image, the target object is the first object; and
composing the third image by superimposing the target object in the target superimposing position on the background image.
6 . The method according to claim 5 , wherein the determining a target superimposing position corresponding to a target object comprises:
determining the target superimposing position corresponding to the target object according to a determined target cooperative photographing template.
7 . The method according to claim 4 , wherein before the composing a third image based on the first image and the second image, the method further comprises:
obtaining a template selection instruction; and
determining, according to the template selection instruction, a target cooperative photographing template from a plurality of candidate cooperative photographing templates, wherein the target cooperative photographing template is used to determine a superimposing position where the foreground object is to be superimposed on the background image.
8 . The method according to claim 1 , further comprising:
acquiring a special effect input instruction, wherein the special effect input instruction comprises a target special effect to be added and a displaying position corresponding to the target special effect,
wherein after the composing a third image based on the first image and the second image, the method further comprises:
rendering the target special effect in the displaying position on the third image to obtain the third image subjected to a special effect process.
9 . The method according to claim 1 , wherein the method is applied to a first terminal, and before the acquiring a first image captured by a first terminal and a second image captured by a second terminal, the method further comprises:
generating a cooperative photographing request in responses to a received cooperative photographing trigger instruction inputted by a user; and
sending the cooperative photographing request to the second terminal, wherein the second image is sent by the second terminal to the first terminal in response to the cooperative photographing request.
10 . A cooperative photographing apparatus, comprising:
at least one processor, and
at least one memory communicatively coupled to the at least one processor and storing instructions that upon execution by the at least one processor cause the apparatus to:
acquire a first image captured in real time by a first terminal and a second image captured in real time by a second terminal;
in real time, compose a third image based on the first image and the second image, the real-time composed third image being displayed, in real time, on the first terminal and the second terminal; and
generate a cooperative video based on the real-time composed third image,
wherein in the third image, a first object in the first image and a second object in the second image are used as foreground objects and superimposed on a specified background image, the first object is a foreground object of the first image, and the second object is a foreground object of the second image,
wherein the first object in the cooperative video is dynamic, and the second object in the cooperative video is dynamic,
wherein the first object is obtained based on an image recognition processing on the first image, the second object is obtained based on an image recognition processing on the second image, and
wherein a superimposing position of the foreground object is determined according to an image recognition result of the background image.
11 . The apparatus of claim 10 , wherein the background image is a fourth image selected by a user.
12 . The apparatus of claim 10 , wherein the background image is a background image of the first image or a background image of the second image.
13 . The apparatus of claim 11 , the at least one memory further storing instructions that upon execution by the at least one processor cause the apparatus to:
determine a first superimposing position corresponding to the first object and a second superimposing position corresponding to the second object according to a determined target cooperative photographing template; and
compose the third image by superimposing the first object in the first superimposing position on the background image and superimposing the second object in the second superimposing position on the background image.
14 . The apparatus of claim 12 , the at least one memory further storing instructions that upon execution by the at least one processor cause the apparatus to:
determine a target superimposing position corresponding to a target object, wherein in a case that the background image is the background image of the first image, the target object is the second object, and in a case that the background image is the background image of the second image, the target object is the first object; and
compose the third image by superimposing the target object in the target superimposing position on the background image.
15 . The apparatus of claim 14 , the at least one memory further storing instructions that upon execution by the at least one processor cause the apparatus to:
determine the target superimposing position corresponding to the target object according to a determined target cooperative photographing template.
16 . The apparatus of claim 12 , the at least one memory further storing instructions that upon execution by the at least one processor cause the apparatus to:
obtain a template selection instruction; and
determine, according to the template selection instruction, a target cooperative photographing template from a plurality of candidate cooperative photographing templates, wherein the target cooperative photographing template is used to determine a superimposing position where the foreground object is to be superimposed on the background image.
17 . The apparatus of claim 10 , the at least one memory further storing instructions that upon execution by the at least one processor cause the apparatus to:
acquire a special effect input instruction, wherein the special effect input instruction comprises a target special effect to be added and a displaying position corresponding to the target special effect,
wherein after the composing a third image based on the first image and the second image, the method further comprises:
render the target special effect in the displaying position on the third image to obtain the third image subjected to a special effect process.
18 . The apparatus of claim 10 , wherein the apparatus is a first terminal, and before the acquiring a first image captured by a first terminal and a second image captured by a second terminal, the at least one memory further storing instructions that upon execution by the at least one processor cause the apparatus to:
generate a cooperative photographing request in responses to a received cooperative photographing trigger instruction inputted by a user; and
send the cooperative photographing request to the second terminal, wherein the second image is sent by the second terminal to the first terminal in response to the cooperative photographing request.
19 . A computer-readable non-transitory storage medium, bearing computer-readable instructions that upon execution on a computing device cause the computing device at least to:
acquire a first image captured in real time by a first terminal and a second image captured in real time by a second terminal;
in real time, compose a third image based on the first image and the second image, the real-time composed third image being displayed, in real time, on the first terminal and the second terminal; and
generate a cooperative video based on the real-time composed third image,
wherein in the third image, a first object in the first image and a second object in the second image are used as foreground objects and superimposed on a specified background image, the first object is a foreground object of the first image, and the second object is a foreground object of the second image,
wherein the first object in the cooperative video is dynamic, and the second object in the cooperative video is dynamic,
wherein the first object is obtained based on an image recognition processing on the first image, the second object is obtained based on an image recognition processing on the second image, and
wherein a superimposing position of the foreground object is determined according to an image recognition result of the background image.