Electronic device, operating method and computer readable storage medium for providing post masking within image when shooting video
An electronic device includes a processor configured to: store a masking review image and store an image after the masking review image is stored, identify a first visual object of the image, store the identified first visual object of the image, identify a second visual object in the masking review image. The second visual object corresponds to the identified first visual object. The processor is further configured to: store the identified second visual object, perform a masking on the image based on first data corresponding to the first visual object, perform a masking on the masking review image based on second data corresponding to the second visual object, and encode the masking review image based on a remaining capacity of a storage device. The remaining capacity of the storage device is smaller than a designated reference capacity.
1 . An electronic device comprising:
a camera;
memory; and
at least one processor comprising processing circuitry, and
wherein the at least one processor is configured to:
based on an input for generating a video, obtain, via the camera, image frames including a first image frame, a second image frame, and a third image frame, wherein the second image frame is obtained prior to the first image frame, and wherein the third image frame is obtained prior to the second image frame;
identify a visual object to which an image masking is to be applied in the first image frame;
based on identifying the visual object in a portion of the first image frame:
apply the image masking to the first image frame, and
identify the visual object in the second image frame;
based on identifying the visual object in a portion of the second image frame:
apply the image masking to the second image frame, and
identify a positional difference, for determining a search area to be used for identifying the visual object included in the third image frame, between the portion of the first image frame and the portion of the second image frame;
determine a movement direction of the visual object based on the positional difference;
in accordance with the movement direction of the visual object, determine a center point for the search area, wherein the center point for the search area is spaced apart from a center point of the portion of the second image frame by the positional difference in a direction opposite to the movement direction;
determine the search area using the center point for the search area determined based on the movement direction of the visual object;
identify whether the visual object is included in the search area of the third image frame;
based on identifying that the visual object is included in the search area of the third image frame, apply the image masking to the third image frame;
based on identifying that the visual object is not included in the search area of the third image frame, search for the visual object in a remaining area different from the search area in the third image frame; and
generate the video including the image frames.
2 . The electronic device of claim 1 , wherein the at least one processor is further configured to:
identify a user input for releasing the image masking with respect to the generated video; and
based on the user input, perform an operation of releasing the image masking with respect to the generated video.
3 . The electronic device of claim 1 , wherein the visual object to which the image masking is to be applied is identified based on an operation of a neural network.
4 . The electronic device of claim 1 , wherein the at least one processor is further configured to:
based on the positional difference between the portion of the first image frame and the portion of the second image frame, determine a speed of the visual object; and
determine a size of the search area in accordance with the speed of the visual object, and
wherein the size of the search area increases as the speed of the visual object increases.
5 . The electronic device of claim 1 , wherein the image frames correspond to intra (I) frames.
6 . A non-transitory computer readable storage medium storing one or more programs, the one or more programs comprising instructions to, when executed by an electronic device with a camera, cause the electronic device to:
based on an input for generating a video, obtain, via the camera, image frames including a first image frame, a second image frame, and a third image frame, wherein the second image frame is obtained prior to the first image frame, and wherein the third image frame is obtained prior to the second image frame;
identify a visual object to which an image masking is to be applied in the first image frame;
based on identifying the visual object in a portion of the first image frame:
apply the image masking to the first image frame, and
identify the visual object in the second image frame;
based on identifying the visual object in a portion of the second image frame:
apply the image masking to the second image frame, and
identify a positional difference, for determining a search area to be used for identifying the visual object included in the third image frame, between the portion of the first image frame and the portion of the second image frame;
determine a movement direction of the visual object based on the positional difference;
in accordance with the movement direction of the visual object, determine a center point for the search area, wherein the center point for the search area is spaced apart from a center point of the portion of the second image frame by the positional difference in a direction opposite to the movement direction;
determine the search area using the center point for the search area determined based on the movement direction of the visual object;
identify whether the visual object is included in the search area of the third image frame;
based on identifying that the visual object is included in the search area of the third image frame, apply the image masking to the third image frame;
based on identifying that the visual object is not included in the search area of the third image frame, search for the visual object in a remaining area different from the search area in the third image frame; and
generate the video including the image frames.
7 . The non-transitory computer readable storage medium of claim 6 , wherein the one or more programs comprise the instructions further causing the electronic device to:
identify a user input for releasing the image masking with respect to the generated video; and
based on the user input, perform an operation of releasing the image masking with respect to the generated video.
8 . The non-transitory computer readable storage medium of claim 6 , wherein the visual object to which the image masking is to be applied is identified based on an operation of a neural network.
9 . The non-transitory computer readable storage medium of claim 6 , wherein the one or more programs comprise the instructions further causing the electronic device to:
based on the positional difference between the portion of the first image frame and the portion of the second image frame, determine a speed of the visual object; and
determine a size of the search area in accordance with the speed of the visual object, and
wherein the size of the search area increases as the speed of the visual object increases.