Electronic device for editing video using objects of interest and operating method thereof
A method and an electronic device are provided for editing video using objects of interest included in the video. An electronic device includes a camera, a memory, and a processor. The processor may obtain first video data through the camera, while obtaining the first video data, determine a first object of interest in a plurality of image frames included in the first video data, store, in the memory, second video data generated from the first video data based on the first object of interest, after generating the second video data, receive a user input for determining a second object of interest, different from the first object of interest, in the plurality of the image frames included in the first video data, and in response to receiving the user input, store, in the memory, third video data generated from the first video data based on at least the second object of interest.
1 . An electronic device, comprising:
a camera;
a display;
at least one processor; and
memory storing instructions, being executable by the at least one processor, that cause the electronic device:
obtain first video data through the camera,
while obtaining the first video data, determine a first object of interest in a plurality of image frames included in the first video data,
determine a first region of interest including the first object of interest in the plurality of image frames,
store, in the memory, second video data generated by cropping and enlarging the first region of interest within the first video data, and region of interest information of the first region of interest,
based on the stored region of interest information, display, on the display, an image frame of the plurality of image frames with region of interest information within the image frame,
based on the displayed image frame with the region of interest information within the image frame, receive a user input to select a second object of interest, different from the first object of interest, in the plurality of the image frames included in the first video data, and
in response to receiving the user input, store, in the memory, third video data generated by cropping and enlarging, within the first video data, a second region of interest including the second object of interest in the plurality of image frames,
wherein the first video data, the second video data and the third video data have identical frame sizes.
2 . The electronic device of claim 1 , wherein the instructions further cause the electronic device to:
while obtaining the first video data, extract at least one object from the plurality of the image frames included in the first video data, and
determine the first object of interest in the extracted at least one object.
3 . The electronic device of claim 2 , wherein the instructions further cause the electronic device to store, in the memory, information of the at least one object with the first video data.
4 . The electronic device of claim 3 , wherein the
second object of interest is selected from among the at least one object.
5 . The electronic device of claim 3 , wherein the instructions further cause the electronic device to:
while obtaining the first video data, obtain key frame information corresponding to the image frame in which the at least one object is extracted in a pre-designated manner from the plurality of the image frames included in the first video data, and
store, in the memory, the key frame information with the first video data.
6 . The electronic device of claim 5 , wherein the
second object of interest in the image frame corresponding to the key frame information, among the plurality of the image frames included in the first video data, and
wherein the instructions further cause the electronic device to:
in response to receiving the user input, generate the third video data.
7 . The electronic device of claim 1 , wherein the instructions further cause the electronic device to:
before obtaining the first video data, obtain an image including the at least one object through the camera,
display the image on the display, and
receive a user input for determining the first object of interest among the at least one object included in the image.
8 . The electronic device of claim 1 , wherein the instructions further cause the electronic device to, while obtaining the first video data, display the second video data as a preview on the display.
9 . A method performed by an electronic device, the method comprising:
obtaining first video data through a camera included in the electronic device;
while the obtaining first video data, setting a first object of interest in a plurality of image frames included in the first video data;
determining a first region of interest including the first object of interest in the plurality of image frames;
storing, in a memory included in the electronic device, second video data generated by cropping and enlarging the first region of interest within the first video data, and region of interest information of the first region of interest;
based on the stored region of interest information, displaying, on a display, an image frame of the plurality of image frames with region of interest information within the image frame,
based on the displayed image frame with the region of interest information within the image frame, receiving a user input for determining a second object of interest, which is different from the first object of interest, in the plurality of the image frames included in the first video data; and
in response to receiving the user input, storing, in the memory, third video data generated by cropping and enlarging, within the first video data a second region of interest including at least the second object of interest in the plurality of image frames,
wherein the first video data, the second video data and the third video data have identical frame sizes.
10 . The method of claim 9 , further comprising:
while obtaining the first video data, extracting at least one object from the plurality of the image frames included in the first video data; and
setting the first object of interest in the extracted at least one object.
11 . The method of claim 10 , further comprising storing, in the memory, information of the at least one object with the first video data.
12 . The method of claim 11 , further comprising:
receiving the user input for determining the second object of interest among the at least one object;
determining the second region of interest including at least the second object of interest in the plurality of the image frames; and
generating the third video data based on the second region of interest.
13 . The method of claim 11 , further comprising:
while obtaining the first video data, obtaining key frame information corresponding to the image frame in which the at least one object is extracted in a pre-designated manner from the plurality of the image frames included in the first video data; and
storing, in the memory, the key frame information together with the first video data.
14 . The method of claim 13 ,
wherein the second object of interest in the image frame corresponds to the key frame information, among the plurality of the image frames included in the first video data; and
wherein the method further comprises:
in response to receiving the user input, generating the third video data.
15 . The method of claim 9 , further comprising:
before obtaining the first video data, obtaining, through the camera, an image including at least one object;
displaying the image on a display included in the electronic device; and
receiving the user input for setting the first object of interest among the at least one object included in the image.
16 . An electronic device, comprising:
a camera;
a display;
at least one processor; and
memory storing instructions, being executable by the at least one processor, the cause the electronic device:
using a first application,
obtain first video data through the camera,
determine a first object of interest in a plurality of image frames included in the first video data,
determine a first region of interest including the first object of interest in the plurality of image frames, and
store, in the memory, second video data generated by cropping and enlarging the first region of interest within the first video data, and region of interest information of the first region of interest, and
using a second application,
based on the stored region of interest information, display, on the display, an image frame of the plurality of image frames with region of interest information within the image frame,
based on the displayed image frame with the region of interest information within the image frame, receive a user input to select a second object of interest, which is different from the first object of interest, in the plurality of the image frames included in the first video data, and
store, in the memory, third video data generated from the first video data by cropping and enlarging, within the first video data, a second region of interest including the second object of interest in the plurality of image frames,
wherein the first video data, the second video data.
17 . The electronic device of claim 16 , wherein the first application further causes the electronic device to:
while obtaining the first video data, extract at least one object from the plurality of the image frames included in the first video data,
obtain key frame information corresponding to the image frame in which the at least one object is extracted in a pre-designated manner from the plurality of the image frames, and
store, in the memory, information of the at least one object and the key frame information together with the first video data.
18 . The electronic device of claim 17 , wherein the second application further causes the electronic device to generate the third video data, which is different from the second video data, through the first video data, the at least one object information, and the key frame information.
19 . The electronic device of claim 18 , wherein the
second object of interest corresponds to at least a part of the at least one object, in the image frame corresponding to the key frame information, among the plurality of the image frames included in the first video data, and
wherein the second application further causes the electronic device to:
in response to receiving the user input, determine the second region of interest including at least the second object of interest in the image frame corresponding to the key frame, and
generate the third video data based on the determined second region of interest.
20 . The electronic device of claim 19 , wherein the second application further causes the electronic device to:
in response to receiving the user input, calculate the second region of interest in an image frame not corresponding to the key frame information, among the plurality of the image frames included in the first video data, and
generate the third video data based on the calculated second region of interest.