Shooting method and device, electronic equipment and storage medium
By identifying and processing the target object in the preview during the shooting process, placing it in the center of the video or eliminating other objects, the problem of not being able to highlight the main subject in existing technologies is solved, achieving shooting results that satisfy users.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-11
- Publication Date
- 2026-03-13
AI Technical Summary
Existing shooting techniques cannot effectively highlight the main subject and fail to achieve the desired shooting effect for users.
By identifying the target object in the preview screen as the main subject, and responding to the shooting operation, the video frame is processed based on the target object's position information. Other objects are cropped or eliminated/blurred to generate the target video, placing the target object in the center area or in the background, thus forming a video with the main subject as the main focus.
It enables the target object to become the main character in the video, achieving the shooting effect desired by the user and improving the user experience.
Smart Images

Figure CN121665102A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and in particular to a shooting method, apparatus, electronic device and storage medium. Background Technology
[0002] With the development of electronic devices, the functions of cameras within these devices have become increasingly powerful. Electronic devices can typically be equipped with multiple cameras, including wide-angle, ultra-wide-angle, and telephoto lenses. At the same time, users have increasingly higher demands for shooting. For example, in some scenarios, users want to highlight the subject in their photos, but the existing shooting techniques may not be able to achieve the desired effect. Summary of the Invention
[0003] To overcome the problems existing in the related technologies, this disclosure provides a shooting method, apparatus, electronic device and storage medium.
[0004] According to a first aspect of the present disclosure, a shooting method is provided, the method comprising:
[0005] Identify the target object in the preview screen, where the target object is the selected main character;
[0006] In response to the detection of a shooting operation, a target video is captured based on the target object; the target object is located in the central region of each target video frame in the target video, and / or the target video is a video obtained by eliminating or blurring other objects in the captured video except for the target object and the shooting background.
[0007] In some embodiments, the step of capturing a target video based on the target object in response to detecting a shooting operation includes:
[0008] In response to detecting the shooting operation, the position information of the target object in the captured video frame is determined;
[0009] Based on the location information, the video frame is processed to obtain the target video frame after processing.
[0010] The target video is determined based on the target video frame processed from each of the multiple captured video frames.
[0011] In some embodiments, determining the position information of the target object in the captured video frame includes:
[0012] Based on the feature information of the target object, the target object in the video frame is identified, and the position information of the target object in the video frame is obtained. The feature information is used to characterize the appearance of the target object.
[0013] In some embodiments, processing the video frame based on the location information of the target object to obtain the processed target video frame includes:
[0014] Based on the location information and the target background range, the video frame is cropped with the target object as the center to obtain the target video frame. The target background range includes the background range of the target video frame, and the background range is used to characterize the aspect ratio of the target video frame.
[0015] In some embodiments, cropping the video frame centered on the target object based on the location information and the target background range to obtain the target video frame includes:
[0016] Based on the location information, the target background range, and the target object proportion, the video frame is cropped with the target object as the center to obtain the target video frame, where the target object proportion is the percentage of the target object in the target video frame.
[0017] In some embodiments, the method further includes:
[0018] The shooting interface displays multiple preset background ranges;
[0019] In response to the selection operation of any preset background range, the selected preset background range is determined as the target background range.
[0020] In some embodiments, after processing the video frame based on the location information to obtain the processed target video frame, the method further includes:
[0021] The target video frame is displayed on the shooting interface.
[0022] In some embodiments, processing the video frame based on the location information to obtain a processed target video frame includes:
[0023] Based on the location information, objects other than the target object and the shooting background in the video frame are eliminated to obtain the target video frame; or...
[0024] Based on the location information, other objects in the video frame besides the target object and the shooting background are blurred to obtain the target video frame.
[0025] In some embodiments, the step of eliminating objects other than the target object and the shooting background in the video frame based on the location information to obtain the target video frame includes:
[0026] When the target object in the video frame is occluded, based on the position information, other objects in the video frame besides the target object and the shooting background are eliminated to obtain a video frame after elimination.
[0027] Based on the feature information of the target object, the target object in the eliminated video frame is completed to obtain the target video frame, and the feature information is used to characterize the appearance of the target object.
[0028] In some embodiments, the method further includes:
[0029] Obtain the shooting background information from multiple video frames captured;
[0030] After eliminating objects other than the target object and the shooting background in the video frame based on the location information to obtain the target video frame, the method further includes:
[0031] If the missing background in the target video frame appears in multiple video frames, the background in the target video frame is filled in based on the background information to obtain a filled target video frame; or...
[0032] If the missing shooting background in the target video frame does not appear in multiple video frames, the shooting background in the target video frame is filled based on a preset filling model to obtain the filled target video frame.
[0033] The missing shooting background in the target video frame refers to the background at the location of the object that was eliminated in the target video frame.
[0034] In some embodiments, determining the target object in the preview screen includes:
[0035] In response to a selection operation on any object in the preview screen, the selected object is determined as the target object.
[0036] In some embodiments, the method further includes:
[0037] Display protagonist mode in the shooting interface;
[0038] In response to the selection operation of the protagonist mode, the shooting mode is determined to be the protagonist mode;
[0039] Determining the target object in the preview screen includes:
[0040] When the shooting mode is the main character mode, the target object in the preview screen is determined.
[0041] In some embodiments, the method further includes:
[0042] Acquire a first video, which is a video captured by the current electronic device or a video acquired from another electronic device;
[0043] Identify the first target object in the first video;
[0044] The first video is edited based on the first target object to obtain a first target video; the first target object is located in the center region of each first target video frame in the first target video, and / or the first target video is a video obtained by eliminating or blurring other objects in the first video except for the first target object and the first shooting background.
[0045] According to a second aspect of the present disclosure, a shooting apparatus is provided, the apparatus comprising:
[0046] The object determination module is configured to determine the target object in the preview screen, wherein the target object is the selected main character;
[0047] The shooting module is configured to, in response to detecting a shooting operation, capture a target video based on the target object; the target object is located in the central region of each target video frame in the target video, and / or the target video is a video obtained by eliminating or blurring other objects in the captured video besides the target object and the shooting background.
[0048] In some embodiments, the shooting module is configured to:
[0049] In response to detecting the shooting operation, the position information of the target object in the captured video frame is determined;
[0050] Based on the location information, the video frame is processed to obtain the target video frame after processing.
[0051] The target video is determined based on the target video frame processed from each of the multiple captured video frames.
[0052] In some embodiments, the shooting module is configured to:
[0053] Based on the feature information of the target object, the target object in the video frame is identified, and the position information of the target object in the video frame is obtained. The feature information is used to characterize the appearance of the target object.
[0054] In some embodiments, the shooting module is configured to:
[0055] Based on the location information and the target background range, the video frame is cropped with the target object as the center to obtain the target video frame. The target background range includes the background range of the target video frame, and the background range is used to characterize the aspect ratio of the target video frame.
[0056] In some embodiments, the shooting module is configured to:
[0057] Based on the location information, the target background range, and the target object proportion, the video frame is cropped with the target object as the center to obtain the target video frame, where the target object proportion is the percentage of the target object in the target video frame.
[0058] In some embodiments, the apparatus further includes:
[0059] The background range display module is configured to display multiple preset background ranges in the shooting interface;
[0060] The background range selection module is configured to determine the selected preset background range as the target background range in response to a selection operation on any preset background range.
[0061] In some embodiments, the apparatus further includes:
[0062] The video frame display module is configured to display the target video frame on the shooting interface.
[0063] In some embodiments, the shooting module is configured to:
[0064] Based on the location information, objects other than the target object and the shooting background in the video frame are eliminated to obtain the target video frame; or...
[0065] Based on the location information, other objects in the video frame besides the target object and the shooting background are blurred to obtain the target video frame.
[0066] In some embodiments, the shooting module is configured to:
[0067] When the target object in the video frame is occluded, based on the position information, other objects in the video frame besides the target object and the shooting background are eliminated to obtain a video frame after elimination.
[0068] Based on the feature information of the target object, the target object in the eliminated video frame is completed to obtain the target video frame, and the feature information is used to characterize the appearance of the target object.
[0069] In some embodiments, the apparatus further includes:
[0070] The background information acquisition module is configured to acquire the shooting background information from multiple video frames.
[0071] The device further includes:
[0072] The background filling module is configured to, when a missing shooting background appears in multiple video frames, fill the shooting background in the target video frame based on the shooting background information to obtain a filled target video frame; or...
[0073] The background filling module is configured to fill the shooting background in the target video frame based on a preset filling model when the shooting background missing in the target video frame has not appeared in multiple video frames, so as to obtain the filled target video frame.
[0074] The missing shooting background in the target video frame refers to the background at the location of the object that was eliminated in the target video frame.
[0075] In some embodiments, the object determination module is configured to:
[0076] In response to a selection operation on any object in the preview screen, the selected object is determined as the target object.
[0077] In some embodiments, the apparatus further includes:
[0078] The mode display module is configured to display the main character mode in the shooting interface;
[0079] The mode selection module is configured to determine the shooting mode as the main character mode in response to the selection operation of the main character mode;
[0080] The object determination module is configured to determine the target object in the preview screen when the shooting mode is the main character mode.
[0081] In some embodiments, the apparatus further includes:
[0082] The video acquisition module is configured to acquire a first video, which is either a video captured by the current electronic device or a video acquired from another electronic device.
[0083] The object determination module is further configured to determine a first target object in the first video;
[0084] The video editing module is configured to edit the first video based on the first target object to obtain a first target video; the first target object is located in the center region of each first target video frame in the first target video, and / or the first target video is a video obtained by eliminating or blurring other objects in the first video except for the first target object and the first shooting background.
[0085] According to a third aspect of the present disclosure, an electronic device is provided, comprising:
[0086] processor;
[0087] Memory used to store processor-executable instructions;
[0088] The processor is configured to perform the method described in the first aspect of the embodiments of this disclosure.
[0089] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium is provided, wherein when instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the method described in the first aspect of the present disclosure.
[0090] The method described above, as disclosed in this invention, has the following beneficial effects:
[0091] This disclosure provides a shooting method in which a user can select a target object in the preview screen as the main subject of the shooting. Then, during the shooting process, a target video is shot based on the target object, which is located in the center area of each target video frame in the target video. And / or, the target video is a video obtained after eliminating or blurring other objects in the shot video except for the target object and the shooting background. That is, the target object becomes the main subject in the target video, thereby achieving the shooting effect desired by the user and improving the user experience.
[0092] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0093] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0094] Figure 1 This is a flowchart illustrating a shooting method according to an exemplary embodiment;
[0095] Figure 2 This is a flowchart illustrating a shooting method according to an exemplary embodiment;
[0096] Figure 3 This is a flowchart illustrating a shooting method according to an exemplary embodiment;
[0097] Figure 4 This is a schematic diagram illustrating a shooting process according to an exemplary embodiment;
[0098] Figure 5 This is a flowchart illustrating a shooting method according to an exemplary embodiment;
[0099] Figure 6 This is a schematic diagram illustrating a shooting process according to an exemplary embodiment;
[0100] Figure 7 This is a flowchart illustrating a video editing process according to an exemplary embodiment;
[0101] Figure 8 This is a block diagram illustrating a shooting device according to an exemplary embodiment;
[0102] Figure 9 This is a block diagram of an electronic device according to an exemplary embodiment. Detailed Implementation
[0103] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the invention as detailed in the appended claims.
[0104] The shooting method provided in this disclosure can be applied to various shooting scenarios. For example, it can be applied to shooting videos related to performances. When there are multiple people performing, users often want to highlight a particular person, placing that person in the center of the frame as much as possible or making the frame contain only that person. In this case, the shooting method provided in this disclosure can be used to shoot videos that satisfy the user.
[0105] The shooting method provided in this embodiment is executed by an electronic device, which can be a mobile phone, tablet computer, laptop computer, wearable device, smart home device, or other device with shooting function.
[0106] Figure 1 This is a flowchart illustrating a photographing method according to an exemplary embodiment, performed by an electronic device. See also... Figure 1 The method includes the following steps:
[0107] Step S101: Determine the target object in the preview screen. The target object is the selected main character.
[0108] The preview screen is the real-time image captured by the camera, which can be a front-facing camera or a rear-facing camera. The preview screen can include one or more objects, with the target object being the selected main character. In other words, the target object is the object selected by the user from one or more objects, which can be a person, animal, plant, or other object.
[0109] It should be noted that identifying the target object is an operation performed before shooting. Before shooting, the target object is selected, and after shooting begins, the video with that target object as the main subject can be shot directly.
[0110] Step S102: In response to detecting the shooting operation, a target video is captured based on the target object; the target object is located in the center region of each target video frame in the target video, and / or the target video is a video obtained after removing or blurring other objects in the captured video except for the target object and the shooting background.
[0111] Among them, the shooting operation can be the operation of controlling the electronic device to start shooting video. For example, the shooting operation is the user's triggering operation of the shooting control in the shooting interface.
[0112] In one shooting method, to capture a video featuring a target object, the subject must be the focal point during filming. This ensures the target object is always centered within each frame of the video, thus highlighting it. The center area of the video frame refers to the region defined by the center point of the video frame; the center point of this center area coincides with the center point of the video frame. The size of this center area can be pre-set or determined based on the target object. Furthermore, in this scenario, the video may or may not include other objects.
[0113] In one shooting mode, the target video is the video obtained by removing or blurring objects other than the target object and the shooting background from the captured video. Here, the captured video refers to the unprocessed video, and the shooting background is the scene that exists as a backdrop during shooting and remains unchanged. For example, in a performance video, the background set up on the stage is the shooting background. In this case, to highlight the target object in the target video, objects other than the target object and the shooting background can be removed from the captured video, so that the target video only includes the target object and the shooting background, without any other objects. Alternatively, objects other than the target object and the shooting background can be blurred from the captured video, making the target object and the shooting background clearer than other objects in the target video, thus highlighting the target object.
[0114] In another shooting mode, the two shooting modes mentioned above can be combined. The target video is a video obtained by eliminating or blurring objects other than the target object and the shooting background in the video, and the target object is located in the center area of each target video frame in the target video.
[0115] This disclosure provides a shooting method in which a user can select a target object in the preview screen as the main subject of the shooting. Then, during the shooting process, a target video is shot based on the target object, which is located in the center area of each target video frame in the target video. And / or, the target video is a video obtained after eliminating or blurring other objects in the shot video except for the target object and the shooting background. That is, the target object becomes the main subject in the target video, thereby achieving the shooting effect desired by the user and improving the user experience.
[0116] Figure 2 This is a flowchart illustrating a photographing method according to an exemplary embodiment, performed by an electronic device. See also... Figure 2 The method includes the following steps:
[0117] Step S201: Display the main character mode in the shooting interface.
[0118] Shooting mode refers to the mode set when shooting images or videos. Shooting modes include main subject mode, beauty mode, portrait mode, etc. Main subject mode is the mode where you need to select the main subject being shot. To make it easier for users to select the main subject mode, it is displayed directly in the shooting interface, for example, it can be displayed below the preview screen. For example, see... Figure 4 middle Figure 4 The shooting interface shown in image 'a' displays the main character mode in the lower left corner of the preview screen. Of course, the main character mode can also be displayed in other locations on the shooting interface. Additionally, the main character mode can be directly accessed as shown in image 'a'. Figure 4 The control shown in a is displayed in text form, but other forms of control representing the main character mode can also be used. This disclosure does not limit this.
[0119] Of course, in another embodiment, the main character mode can also be displayed in the camera application's settings interface. In this case, you need to enter the settings interface first and then select the main character mode in the settings interface.
[0120] Step S202: In response to the selection operation of protagonist mode, the shooting mode is determined to be protagonist mode.
[0121] The selection operation for the protagonist mode can be the user's selection of the control corresponding to the protagonist mode. For example, see... Figure 4 middle Figure 4 As shown in the shooting interface, the "Main Character Mode" control is selected.
[0122] Step S203: In response to the selection operation of any object in the preview screen, the selected object is determined as the target object.
[0123] After selecting the main character mode, users can choose the main character for this shoot. The selection operation for any object in the preview screen can be a click operation, a double click operation, or other operations.
[0124] In some embodiments, after selecting a target object, the target object can be marked in the preview screen, allowing the user to directly see the main character in the current screen. For example, the target object can be selected by drawing a box, or a label indicating the main character can be displayed at the location of the target object. Of course, other methods can also be used to mark the target object, and this disclosure does not limit this approach.
[0125] In some embodiments, after the user selects the main character mode, the camera can be switched to an ultra-wide-angle camera to expand the camera's field of view. In this case, the preview image is the image captured by the ultra-wide-angle camera.
[0126] Step S204: In response to detecting the shooting operation, determine the position information of the target object in the captured video frame.
[0127] Since the target object is the main subject during filming, it is necessary to determine its position in the captured video frames in real time, i.e., to locate the target object in real time. This positional information represents the target object's position within the captured video, and can be expressed in coordinates or other forms.
[0128] Step S205: Based on the location information, process the video frame to obtain the target video frame after video frame processing.
[0129] In this embodiment of the disclosure, the position of the target object in the video frame can be determined based on the location information, and then the video frame can be processed accordingly for the target object to obtain the processed target video frame.
[0130] It should be noted that for each video frame captured, the processing procedure in step S205 needs to be performed to obtain the target video frame after processing each video frame.
[0131] Step S206: Determine the target video based on the target video frame processed from each of the multiple captured video frames.
[0132] Combining multiple target video frames together yields the final target video.
[0133] The method provided in this disclosure allows users to select a protagonist mode, then select the object they want to be the protagonist as the target object, and then process each video frame captured during the shooting process to achieve the shooting effect desired by the user after processing the target video frame, thereby improving the user experience.
[0134] In this embodiment of the disclosure, when shooting a target video with the target object as the main subject, three shooting methods can be adopted: Method 1, cropping the video with the target object as the center so that the target object is located in the central area of the final target video, that is, the target object is located in the central area of each target video frame in the target video; Method 2, eliminating other objects in the shot video except for the target object and the shooting background, so that the target video does not include any content other than the target object and the shooting background of the target video, or blurring other objects in the shot video except for the target object and the shooting background, so that the target object and the shooting background in the target video are clearer; Method 3, combining Method 1 and Method 2, that is, cropping the video with the target object as the center so that the target object is located in the central area of the final target video, and eliminating or blurring other objects in the shot video except for the target object and the shooting background. Since Method 3 is a combination of Method 1 and Method 2, it will be described below through Figure 3 The illustrated embodiment explains method one, through Figure 5 The embodiments shown illustrate method two, and method three will not be described separately.
[0135] Figure 3 This is a flowchart illustrating a photographing method according to an exemplary embodiment, performed by an electronic device. See also... Figure 3 The method includes the following steps:
[0136] Step S301: When the shooting mode is in protagonist mode, identify the target object in the preview screen.
[0137] The implementation method of step S301 is the same as that of steps S201-S203 described above, and will not be repeated here.
[0138] Step S302: Obtain the feature information of the target object.
[0139] Among them, feature information is used to characterize the appearance of the target object.
[0140] In some embodiments, a target object is identified and its characteristic information is obtained. This characteristic information can also be regarded as a person profile created for the target object.
[0141] Step S303: Display multiple preset background ranges in the shooting interface. In response to the selection operation of any preset background range, the selected preset background range is determined as the target background range.
[0142] In this embodiment of the disclosure, in the method of cropping the captured video centered on the target object, in order to ensure that the target object is always located in the center of the frame and to minimize other objects in the frame besides the target object, a background range can be set so that the target object is always located within a fixed background range. The background range is used to characterize the aspect ratio of the target video frame; for example, the background range can be a 3:4, 1:1, 4:3, or other aspect ratios.
[0143] Multiple preset background ranges represent different aspect ratios, and users can select any preset background range as the target background range. This target background range is the background range that the target video frame after subsequent processing must meet; that is, the target background range includes the background range of the target video frame.
[0144] Step S304: In response to the detection of the shooting operation, based on the feature information of the target object, the target object in the captured video frame is identified, and the position information of the target object in the video frame is obtained.
[0145] Since the feature information of the target object has already been obtained, when locating the target object, the target object in the captured video frame can be identified based on this feature information to obtain its location information. For example, the feature information of each object in the video frame can be identified, and then the similarity between the feature information of each object and the feature information of the target object can be determined. The object with the highest similarity is identified as the target object, and at this point, the location information of the target object in the video frame can be determined.
[0146] Step S305: Based on the location information and target background range, the video frame is cropped with the target object as the center to obtain the target video frame.
[0147] Based on location information, the position of the target object within the video frame is determined. Then, the video frame is cropped with the target object as the center, according to the target background range, to obtain the target video frame. This ensures that the target object is located in the central area of the target video frame, and that the background range of the target video frame is the target background range. For example, if the target background range is 4:3, then the target video frame is a video frame with a 4:3 aspect ratio and the target object located in the central area of that target video frame.
[0148] In some embodiments, based on location information, target background range, and target object proportion, video frames are cropped with the target object as the center to obtain target video frames. The target object proportion refers to the percentage of the target object within the target video frame. That is, even with a fixed target background range, the target object proportion still needs to be considered. When the target object proportion is large, a smaller area needs to be cropped from the video frame according to the target background range to obtain the target video frame; conversely, when the target object proportion is small, a larger area needs to be cropped from the video frame according to the target background range to obtain the target video frame. For example, if the target background range is 4:3 and the target object proportion is 60%, then the target video frame is a video frame with a 4:3 aspect ratio, the target object located in the center of the target video frame, and the target object occupying 60% of the target video frame.
[0149] It should be noted that the cutting process is not visible to the user.
[0150] Step S306: Display the target video frame on the shooting interface.
[0151] In this embodiment of the disclosure, after capturing video frames, the video frames are processed using the above-described method to obtain target video frames, which are then displayed. That is, the processed target video frames are directly displayed to the user.
[0152] It should be noted that the processing in steps S304-S305 is for any one video frame captured. For multiple video frames captured, the above implementation method is used to obtain the corresponding target video frame.
[0153] Step S307: Determine the target video based on the target video frame processed from each of the multiple video frames captured.
[0154] See one example. Figure 4 The diagram shown illustrates the shooting process. Figure 4 The shooting interface shown in Figure a displays a preview screen. At this point, the user selects "Main Character Mode," and then... Figure 4 Select the target object in the preview screen displayed in the shooting interface shown in b. Figure 4 Object B in b is selected as the target object, and then in Figure 4 In the shooting interface shown in c, select the target background area ( Figure 4 (The thick border in c), finally, after the shooting begins, in Figure 4 The shooting interface shown in d displays the target video frame (i.e. the shooting screen). At this time, the shooting screen is centered on object B, and the background range is the target background range. Figure 4 In the shot shown in d, in addition to object B, object C is also included, but object C is not the focus of the shot.
[0155] This disclosure provides a new shooting mode, namely the protagonist mode. When shooting in protagonist mode, the user can select the target object in the preview screen as the protagonist during shooting. Then, during the shooting process, based on the position information of the target object and the target background range, the video frames captured are cropped with the target object as the center to obtain the processed target video frames. The target object is located in the central area of each target video frame in the target video, that is, the target object becomes the protagonist in the target video, thereby achieving the shooting effect desired by the user and improving the user experience.
[0156] Figure 5 This is a flowchart illustrating a photographing method according to an exemplary embodiment, performed by an electronic device. See also... Figure 5 The method includes the following steps:
[0157] Step S501: When the shooting mode is in protagonist mode, identify the target object in the preview screen.
[0158] The implementation method of step S501 is the same as that of steps S201-S203 described above, and will not be repeated here.
[0159] Step S502: Obtain the feature information of the target object.
[0160] The implementation method of step S502 is the same as that of step S302 described above, and will not be repeated here.
[0161] Step S503: In response to the detection of the shooting operation, based on the feature information of the target object, the target object in the captured video frame is identified, and the position information of the target object in the video frame is obtained.
[0162] The implementation method of step S503 is the same as that of step S304 described above, and will not be repeated here.
[0163] Step S504: Based on the location information, remove objects other than the target object and the shooting background from the video frame to obtain the target video frame.
[0164] In this embodiment of the disclosure, in order to highlight the target object, the position of the target object in the video frame is first determined based on the position information, and then other objects except the target object and the shooting background are eliminated to obtain the target video frame.
[0165] In some embodiments, when eliminating other objects, if an object occludes the target object, a portion of the target object will be missing after eliminating that object. Therefore, when the target object in a video frame is occluded, other objects in the video frame besides the target object and the subject being filmed are eliminated based on position information, resulting in an eliminated video frame. Then, based on the feature information of the target object, the target object in the eliminated video frame is completed, resulting in the target video frame. In other words, the feature information of the target object characterizes its appearance; that is, this feature information indicates the detailed state of the target object. Therefore, the target object can be completed based on the feature information to obtain the target video frame. By completing the target object, the target object in the target video frame can be ensured to be complete, thereby guaranteeing the image quality of the main subject.
[0166] It's important to note that during the shooting process, the screen displayed on the shooting interface is the live footage; that is, it shows the captured video frames, not the processed target video frames. After shooting, users can view the processed target video (target video frames) in their photo album.
[0167] Step S505: Obtain the shooting background information from the multiple video frames captured.
[0168] Objects in a video frame inevitably obscure the background. When the object is removed, the obscured background will be missing. To fill in the missing background, it's necessary to acquire the background information first. Furthermore, since the target video frame doesn't need to be displayed in real-time during shooting, background information from multiple video frames can be acquired after multiple frames have been captured, thus ensuring the background information represents the complete background as closely as possible. These multiple video frames can be all the captured video frames or a subset of them.
[0169] In some embodiments, starting from the first video frame captured, the first shooting background information in each video frame is acquired sequentially, and then multiple first shooting background information are merged to obtain the final shooting background information.
[0170] Step S506: If the shooting background missing from the target video frame appears in multiple video frames, fill the shooting background in the target video frame based on the shooting background information to obtain the filled target video frame.
[0171] The missing shooting background in the target video frame refers to the background at the location of the object that was eliminated in the target video frame.
[0172] If the missing shooting background in the target video frame appears in multiple video frames, it means that the shooting background information contains relevant information about the missing shooting background. Therefore, the shooting background in the target video frame can be filled in based on the shooting background information to obtain the filled video frame.
[0173] Step S507: If the missing shooting background in the target video frame has not appeared in multiple video frames, fill the shooting background in the target video frame based on the preset filling model to obtain the filled target video frame.
[0174] If the missing background of the target video frame appears in multiple video frames, it indicates that the background information does not contain relevant information about the missing portion, making it impossible to complete the background in the target video frame based on the missing background information. In this case, a preset filling model can be used to fill in the background in the target video frame, resulting in a filled target video frame. The preset filling model is used to predict the missing content based on the existing content in the image (video frame). For example, the preset filling model can be an AI (Artificial Intelligence) model.
[0175] Step S508: Determine the target video based on the target video frame processed from each of the multiple captured video frames.
[0176] In some embodiments, the object elimination process and the background filling process can be performed together or separately. That is, after eliminating other objects in a video frame, the missing background in the resulting target video frame can be filled in immediately; alternatively, after eliminating other objects in a video frame, the process can continue to eliminate other objects in the next video frame, and after all other objects in all video frames have been eliminated, the missing background in each resulting target video frame can be filled in sequentially. This disclosure does not limit this approach, as long as the final result is a target video containing only the target object and the background.
[0177] It should be noted that in this embodiment of the disclosure, the target object can be one or more. That is, when selecting the main character, one or more objects can be selected as the main character. Regardless of how many objects are selected as the main characters, the above-described implementation method can be used to process them in order to obtain a target video containing the target object and the shooting background.
[0178] Another point to note is that since the target video can only be viewed after shooting is completed, it means that the real-time requirement for video frame processing is not high. The above steps S504-S507 can be executed some time after shooting begins.
[0179] See one example. Figure 6 The diagram shown illustrates the shooting process. Figure 6 The shooting interface shown in Figure a displays a preview screen. At this point, the user selects "Main Character Mode," and then... Figure 6 Select the target object in the preview screen displayed in the shooting interface shown in b. Figure 6 Object B in step b is selected as the target object. After the shooting begins, Figure 6 The shooting interface shown in Figure c displays the real-time shooting footage. While the shooting footage is displayed, it can be processed in the background. After shooting, the result is as follows: Figure 6 The target video shown in d. Figure 6 The target video shown in d only includes object B and the shooting background.
[0180] Another point to note is that the above steps S501-S507 are a process of elimination. In another embodiment, when blurring other objects besides the target object and the shooting background, the above step S504 can be replaced by: blurring other objects besides the target object and the shooting background in the video frame based on the position information to obtain the target video frame. Since the blurring process does not cause the problem of missing shooting background, steps S505-S507 do not need to be executed.
[0181] This disclosure provides a new shooting mode, namely the protagonist mode. When shooting in protagonist mode, the user can select the target object in the preview screen as the protagonist during shooting. Then, during the shooting process, other objects besides the target object and the shooting background are removed from the captured video frame, and the missing shooting background is filled in to obtain the processed target video frame. This ensures that the target video does not include any content other than the target object and the shooting background, or that other objects besides the target object and the shooting background are blurred in the captured video, so that the target object and the shooting background remain clear, thereby achieving the shooting effect desired by the user and improving the user experience.
[0182] In some embodiments, in addition to shooting a target video with the target object as the main subject using the above-described methods during the shooting process, existing videos can also be edited to obtain a video with a specific object in the video as the main subject. The following is an example... Figure 7 The illustrated embodiments illustrate this.
[0183] Figure 7This is a flowchart illustrating a video editing process performed by an electronic device, according to an exemplary embodiment. See also... Figure 7 The method includes the following steps:
[0184] Step S701: Obtain the first video, which is a video captured by the current electronic device or a video obtained from another electronic device.
[0185] The first video can be the target video processed in the above embodiments.
[0186] Step S702: Determine the first target object in the first video.
[0187] In some embodiments, a first video is displayed in the editing interface, and an editing mode is displayed. When the editing mode is the protagonist mode, any object in the first video is selected as the first target object, which is the selected protagonist.
[0188] Step S703: Edit the first video based on the first target object to obtain the first target video; the first target object is located in the center area of each first target video frame in the first target video, and / or the first target video is a video obtained after eliminating or blurring other objects in the first video except for the first target object and the first shooting background.
[0189] In some embodiments, if the goal is to obtain a first target video where the first target object is located in the center region of each first target video frame, after selecting the first target object, the user also needs to select the target background range and the target object percentage. The subsequent editing process is then automatically executed by the electronic device. For example, after selecting the first target object, the target background range, and the target object percentage, the user clicks the start editing control, and the electronic device edits the first video based on the first target object, the target background range, and the target object percentage to obtain the first target video. The video editing process in this case is similar to steps S302-S305 and S307 above. The difference is that during the editing process, it is not necessary to obtain position information when a shooting operation is detected. Instead, after obtaining the feature information of the first target object, the first position information is directly obtained based on the feature information of the first target object. Furthermore, the video frames processed are not the captured video frames, but rather the video frames included in the first video.
[0190] In some embodiments, if the desired first target video is a video obtained by eliminating or blurring objects other than the first target object and the first shooting background in the first video, then after selecting the first target object, the subsequent editing process is automatically executed by the electronic device. For example, after the user selects the first target object, clicks the start editing control, and then the electronic device edits the first video based on the first target object to obtain the first target video. The video editing process in this case is similar to steps S502-S508 above, except that during the editing process, it is not necessary to obtain position information when the shooting operation is detected. Instead, after obtaining the feature information of the first target object, the first position information is directly obtained based on the feature information of the first target object. Furthermore, the processed video frames are not the captured video frames, but rather the video frames included in the first video.
[0191] The editing method provided in this embodiment allows a user to select a first target object in a first video as the main subject when editing a video. Then, during the video editing process, the first video is edited based on the first target object to obtain a first target video. The first target object is located in the central area of each first target video frame in the first target video. Alternatively, the first target video can be a video obtained by eliminating or blurring other objects in the first video except for the first target object and the first shooting background. In other words, the first target object becomes the main subject in the first target video, thereby achieving the shooting effect desired by the user and improving the user experience.
[0192] Figure 8 This is a block diagram illustrating a photographing device according to an exemplary embodiment, configured in an electronic device, see [link to relevant documentation]. Figure 8 The device includes:
[0193] The object determination module 801 is configured to determine the target object in the preview screen, and the target object is the selected protagonist;
[0194] The shooting module 802 is configured to, in response to detecting a shooting operation, capture a target video based on a target object; the target object is located in the center region of each target video frame in the target video, and / or the target video is a video obtained by removing or blurring other objects in the captured video besides the target object and the shooting background.
[0195] In some embodiments, the capturing module 802 is configured to:
[0196] In response to the detection of a shooting operation, the position information of the target object in the captured video frame is determined;
[0197] Based on location information, video frames are processed to obtain the target video frame after processing.
[0198] The target video is determined based on the target video frame processed from each of the multiple captured video frames.
[0199] In some embodiments, the capturing module 802 is configured to:
[0200] Based on the feature information of the target object, the target object in the video frame is identified, and the position information of the target object in the video frame is obtained. The feature information is used to characterize the appearance of the target object.
[0201] In some embodiments, the capturing module 802 is configured to:
[0202] Based on location information and target background range, video frames are cropped with the target object as the center to obtain target video frames. The target background range includes the background range of the target video frame, and the background range is used to characterize the aspect ratio of the target video frame.
[0203] In some embodiments, the capturing module 802 is configured to:
[0204] Based on location information, target background range, and target object proportion, video frames are cropped with the target object as the center to obtain target video frames. The target object proportion is the percentage of the target object in the target video frame.
[0205] In some embodiments, the apparatus further includes:
[0206] The background range display module is configured to display multiple preset background ranges in the shooting interface;
[0207] The background range selection module is configured to, in response to a selection operation on any preset background range, determine the selected preset background range as the target background range.
[0208] In some embodiments, the apparatus further includes:
[0209] The video frame display module is configured to display the target video frame on the shooting interface.
[0210] In some embodiments, the capturing module 802 is configured to:
[0211] Based on location information, objects other than the target object and the shooting background are removed from the video frame to obtain the target video frame; or...
[0212] Based on location information, objects other than the target object and the shooting background in the video frame are blurred to obtain the target video frame.
[0213] In some embodiments, the capturing module 802 is configured to:
[0214] When the target object in a video frame is occluded, other objects in the video frame besides the target object and the shooting background are eliminated based on the position information to obtain the eliminated video frame.
[0215] Based on the feature information of the target object, the target object in the eliminated video frame is completed to obtain the target video frame. The feature information is used to characterize the appearance of the target object.
[0216] In some embodiments, the apparatus further includes:
[0217] The background information acquisition module is configured to acquire the shooting background information from multiple video frames.
[0218] The device also includes:
[0219] The background filling module is configured to fill in the missing background in the target video frame based on the shooting background information when the shooting background has appeared in multiple video frames, thus obtaining a filled target video frame; or...
[0220] The background filling module is configured to fill the shooting background in the target video frame based on a preset filling model when the shooting background missing in the target video frame has not appeared in multiple video frames, thus obtaining the filled target video frame.
[0221] The missing shooting background in the target video frame refers to the background at the location of the object that was eliminated in the target video frame.
[0222] In some embodiments, the object determination module 801 is configured to:
[0223] In response to a selection operation on any object in the preview screen, the selected object is identified as the target object.
[0224] In some embodiments, the apparatus further includes:
[0225] The mode display module is configured to display the main character mode in the shooting interface;
[0226] The mode selection module is configured to respond to the selection of the main character mode and determine the shooting mode as the main character mode;
[0227] The object determination module 801 is configured to determine the target object in the preview screen when the shooting mode is the main character mode.
[0228] In some embodiments, the apparatus further includes:
[0229] The video acquisition module is configured to acquire a first video, which is either a video captured by the current electronic device or a video acquired from another electronic device.
[0230] The object determination module 801 is also configured to determine the first target object in the first video;
[0231] The video editing module is configured to edit a first video based on a first target object to obtain a first target video; the first target object is located in the center region of each first target video frame in the first target video, and / or the first target video is a video obtained by eliminating or blurring other objects in the first video except for the first target object and the first shooting background.
[0232] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0233] This disclosure also provides an electronic device, including: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to execute the shooting method described in the above embodiments.
[0234] Figure 9 This is a block diagram of an electronic device 900 according to an exemplary embodiment.
[0235] Reference Figure 9 The electronic device 900 may include one or more of the following components: a processing component 902, a memory 904, a power supply component 906, a multimedia component 908, an audio component 910, an input / output (I / O) interface 912, a sensor component 914, and a communication component 916.
[0236] Processing component 902 typically controls the overall operation of electronic device 900, such as operations associated with display, telephone calls, data communication, camera operation, and recording operations. Processing component 902 may include one or more processors 920 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 902 may include one or more modules to facilitate interaction between processing component 902 and other components. For example, processing component 902 may include a multimedia module to facilitate interaction between multimedia component 908 and processing component 902.
[0237] Memory 904 is configured to store various types of data to support the operation of electronic device 900. Examples of this data include instructions for any application or method operating on electronic device 900, contact data, phonebook data, messages, pictures, videos, etc. Memory 904 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0238] Power supply component 906 provides power to various components of electronic device 900. Power supply component 906 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 900.
[0239] Multimedia component 908 includes a screen that provides an output interface between the electronic device 900 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 908 includes a front-facing camera and / or a rear-facing camera. When the electronic device 900 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0240] Audio component 910 is configured to output and / or input audio signals. For example, audio component 910 includes a microphone (MIC) configured to receive external audio signals when electronic device 900 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 904 or transmitted via communication component 916. In some embodiments, audio component 910 also includes a speaker for outputting audio signals.
[0241] I / O interface 912 provides an interface between processing component 902 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.
[0242] Sensor assembly 914 includes one or more sensors for providing state assessments of various aspects of electronic device 900. For example, sensor assembly 914 can detect the on / off state of electronic device 900, the relative positioning of components such as the display and keypad of electronic device 900, changes in position of electronic device 900 or a component of electronic device 900, the presence or absence of user contact with electronic device 900, orientation or acceleration / deceleration of electronic device 900, and temperature changes of electronic device 900. Sensor assembly 914 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 914 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 914 may also include an accelerometer, gyroscope, magnetometer, pressure sensor, or temperature sensor.
[0243] Communication component 916 is configured to facilitate wired or wireless communication between electronic device 900 and other devices. Electronic device 900 can access wireless networks based on communication standards, such as WiFi, 2G, or 3G, or combinations thereof. In one exemplary embodiment, communication component 916 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 916 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0244] In an exemplary embodiment, the electronic device 900 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the methods described above.
[0245] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 904 including instructions, which can be executed by a processor 920 of an electronic device 900 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0246] This disclosure also provides a non-transitory computer-readable storage medium, wherein when the instructions in the storage medium are executed by the processor of an electronic device, the electronic device is able to perform the shooting method described in the above embodiments.
[0247] Other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of the invention are indicated by the following claims.
[0248] It should be understood that the present invention is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.
Claims
1. A shooting method, characterized in that, The method includes: Identify the target object in the preview screen, where the target object is the selected main character; In response to the detection of a shooting operation, a target video is captured based on the target object; the target object is located in the central region of each target video frame in the target video, and / or the target video is a video obtained by eliminating or blurring other objects in the captured video except for the target object and the shooting background.
2. The method according to claim 1, characterized in that, The step of capturing a target video based on the target object in response to detecting a shooting operation includes: In response to detecting the shooting operation, the position information of the target object in the captured video frame is determined; Based on the location information, the video frame is processed to obtain the target video frame after processing. The target video is determined based on the target video frame processed from each of the multiple captured video frames.
3. The method according to claim 2, characterized in that, Determining the position information of the target object in the captured video frame includes: Based on the feature information of the target object, the target object in the video frame is identified, and the position information of the target object in the video frame is obtained. The feature information is used to characterize the appearance of the target object.
4. The method according to claim 2, characterized in that, The step of processing the video frame based on the location information of the target object to obtain the processed target video frame includes: Based on the location information and the target background range, the video frame is cropped with the target object as the center to obtain the target video frame. The target background range includes the background range of the target video frame, and the background range is used to characterize the aspect ratio of the target video frame.
5. The method according to claim 4, characterized in that, The step of cropping the video frame based on the location information and the target background range, with the target object as the center, to obtain the target video frame includes: Based on the location information, the target background range, and the target object proportion, the video frame is cropped with the target object as the center to obtain the target video frame, where the target object proportion is the percentage of the target object in the target video frame.
6. The method according to claim 4, characterized in that, The method further includes: The shooting interface displays multiple preset background ranges; In response to the selection operation of any preset background range, the selected preset background range is determined as the target background range.
7. The method according to claim 4, characterized in that, After processing the video frame based on the location information to obtain the processed target video frame, the method further includes: The target video frame is displayed on the shooting interface.
8. The method according to claim 2, characterized in that, The step of processing the video frame based on the location information to obtain the processed target video frame includes: Based on the location information, objects other than the target object and the shooting background in the video frame are eliminated to obtain the target video frame; or... Based on the location information, other objects in the video frame besides the target object and the shooting background are blurred to obtain the target video frame.
9. The method according to claim 8, characterized in that, The step of eliminating objects other than the target object and the shooting background in the video frame based on the location information to obtain the target video frame includes: When the target object in the video frame is occluded, based on the position information, other objects in the video frame besides the target object and the shooting background are eliminated to obtain a video frame after elimination. Based on the feature information of the target object, the target object in the eliminated video frame is completed to obtain the target video frame, and the feature information is used to characterize the appearance of the target object.
10. The method according to claim 8, characterized in that, The method further includes: Obtain the shooting background information from multiple video frames captured; After eliminating objects other than the target object and the shooting background in the video frame based on the location information to obtain the target video frame, the method further includes: If the missing background in the target video frame appears in multiple video frames, the background in the target video frame is filled in based on the background information to obtain a filled target video frame; or... If the missing shooting background in the target video frame does not appear in multiple video frames, the shooting background in the target video frame is filled based on a preset filling model to obtain the filled target video frame. The missing shooting background in the target video frame refers to the background at the location of the object that was eliminated in the target video frame.
11. The method according to claim 1, characterized in that, Determining the target object in the preview screen includes: In response to a selection operation on any object in the preview screen, the selected object is determined as the target object.
12. The method according to claim 1, characterized in that, The method further includes: Display protagonist mode in the shooting interface; In response to the selection operation of the protagonist mode, the shooting mode is determined to be the protagonist mode; Determining the target object in the preview screen includes: When the shooting mode is the main character mode, the target object in the preview screen is determined.
13. The method according to any one of claims 1 to 12, characterized in that, The method further includes: Acquire a first video, which is a video captured by the current electronic device or a video acquired from another electronic device; Identify the first target object in the first video; The first video is edited based on the first target object to obtain a first target video; the first target object is located in the center region of each first target video frame in the first target video, and / or the first target video is a video obtained by eliminating or blurring other objects in the first video except for the first target object and the first shooting background.
14. A shooting device, characterized in that, The device includes: The object determination module is configured to determine the target object in the preview screen, wherein the target object is the selected main character; The shooting module is configured to, in response to detecting a shooting operation, capture a target video based on the target object; the target object is located in the central region of each target video frame in the target video, and / or the target video is a video obtained by eliminating or blurring other objects in the captured video besides the target object and the shooting background.
15. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to perform the method as described in any one of claims 1-13.
16. A non-transitory computer-readable storage medium, characterized in that, When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device is able to perform the method as described in any one of claims 1-13.