WO2021254223A1 - Video processing method, apparatus and device, and storage medium - Google Patents

Video processing method, apparatus and device, and storage medium Download PDF

Info

Publication number
WO2021254223A1
WO2021254223A1 PCT/CN2021/099078 CN2021099078W WO2021254223A1 WO 2021254223 A1 WO2021254223 A1 WO 2021254223A1 CN 2021099078 W CN2021099078 W CN 2021099078W WO 2021254223 A1 WO2021254223 A1 WO 2021254223A1
Authority
WO
WIPO (PCT)
Prior art keywords
restored
video
video frame
target
area
Prior art date
Application number
PCT/CN2021/099078
Other languages
French (fr)
Chinese (zh)
Inventor
杨洪刚
舒娟媚
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2021254223A1 publication Critical patent/WO2021254223A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • H04N21/440245Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display the reformatting operation being performed only on part of the stream, e.g. a region of the image or a time segment
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/77Retouching; Inpainting; Scratch removal
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/472End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content
    • H04N21/47205End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content for manipulating displayed content, e.g. interacting with MPEG-4 objects, editing locally
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10016Video; Image sequence

Definitions

  • This application relates to the field of image processing technology, for example, to a video processing method, device, device, and storage medium.
  • the video editing functions supported by smartphones are relatively basic, such as video editing, filters, area cropping, adding subtitles (or watermarks), adding music, adding transition animations, etc., but cannot support some deep editing functions, such as removing videos Target audience, etc.
  • This application provides a video processing method, device, equipment, and storage medium to implement the function of removing target objects in the video during video editing.
  • a video processing method including:
  • Detect an object cutout instruction for the target video determine the target cutout object corresponding to the object cutout instruction; place the target cutout object in each original video of the multiple original video frames of the target video Cut out from the frame, obtain a plurality of to-be-restored video frames corresponding to the multiple original video frames; perform restoration processing on the cut-out area in each to-be-restored video frame to obtain the target video corresponding to the target video. Edit the video.
  • a video processing device including:
  • the target removal object determination module is configured to detect the object removal instruction for the target video, and determine the target removal object corresponding to the object removal instruction; the to-be-restored video frame acquisition module is set to remove the target The object is cut out from each of the multiple original video frames of the target video, and multiple to-be-restored video frames corresponding to the multiple original video frames are obtained; the video frame restoration module is set to Perform restoration processing on the cut-out area in each video frame to be restored to obtain an edited video corresponding to the target video.
  • An electronic device is also provided, and the electronic device includes:
  • One or more processors a memory, configured to store one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors realize the aforementioned video Approach.
  • a computer storage medium is also provided, on which a computer program is stored, and when the program is executed by a processor, the above-mentioned video processing method is realized.
  • FIG. 1 is a schematic flowchart of a video processing method provided by an embodiment of this application
  • FIG. 2 is an example diagram of a cut-out object template mask corresponding to an original video frame provided by an embodiment of the application
  • FIG. 3 is an example diagram of a regular pixel distribution provided by an embodiment of this application.
  • FIG. 5 is a schematic flowchart of another video processing method provided by an embodiment of this application.
  • FIG. 6 is an example diagram of a to-be-restored video frame provided by an embodiment of this application.
  • FIG. 7 is an example diagram of another to-be-restored video frame provided by an embodiment of the application.
  • FIG. 8 is an example diagram of another to-be-restored video frame provided by an embodiment of the application.
  • FIG. 9 is an example diagram of another to-be-restored video frame provided by an embodiment of the application.
  • FIG. 10 is a schematic diagram of system modules to which a video processing method according to an embodiment of the application is applicable;
  • FIG. 11 is a schematic structural diagram of a video processing device provided by an embodiment of this application.
  • FIG. 12 is a schematic structural diagram of an electronic device provided by an embodiment of this application.
  • module means, “component” or “unit” used to indicate elements is only for the description of the present application, and has no special meaning in itself. Therefore, “module”, “part” or “unit” can be used in a mixed manner.
  • FIG. 1 is a schematic flowchart of a video processing method provided by an embodiment of this application.
  • This method is suitable for the case of performing in-depth editing of the captured video in an electronic device (such as a mobile terminal, etc.), which may refer to removing some target objects from the video.
  • the method can be executed by the video processing device provided in the present application, and the video processing device can be implemented by software and/or hardware and integrated in an electronic device, such as a mobile terminal.
  • the video processing method provided by this embodiment includes:
  • S110 Detect an object removal instruction for the target video, and determine a target removal object corresponding to the object removal instruction.
  • the target video refers to the video to be edited.
  • decrypt the target video to obtain all the original video frames corresponding to the target video.
  • the user can select one or more of the original video frames for related editing operations as needed, such as adding animation, Add text or objects, or crop the original video frame, etc.
  • the object removal instruction refers to an instruction initiated in the edit page of the target video and used to instruct the removal of related objects in the target video.
  • the object removal instruction can be performed by, for example, the user's click action and movement
  • the action trigger can also be triggered by a user's sliding action, etc., which is not limited in this embodiment.
  • the target removal object corresponding to the object removal instruction is the object selected by the user through a set action and intended to be removed in the target video.
  • it can be a human body in the target video (such as a passerby who enters the video by mistake). ), objects (such as debris in the video), etc.
  • the trigger position of the object removal instruction in the original video frame is obtained, and the object is identified near the trigger position, and the object is recognized
  • the object of is the target removal object corresponding to the object removal instruction.
  • S110 includes:
  • the object cutout instruction for the target video is detected in the current display original video frame of the target video, and the object recognition is performed on the currently displayed original video frame; according to the object recognition result and the position information of the object cutout instruction in the currently displayed original video frame , To determine the target removal object corresponding to the object removal instruction.
  • the currently displayed original video frame is an original video frame displayed when an object removal instruction for the target video is detected. For example, it may be based on a pause operation triggered by the user during the playback of the original video frame of the target video. Positioned. If the object removal instruction is detected in the currently displayed original video frame, the object recognition is performed on the currently displayed original video frame.
  • OpenCV's artificial intelligence (AI) object recognition algorithm can be used to perform object recognition on the currently displayed original video frame. Recognize, and obtain one or more objects corresponding to the currently displayed original video frame. Label the recognized objects to obtain the location of the area corresponding to each object, and then save the location of the area of these objects.
  • the object identifier (ID), the object name, and the location of the object area can be stored correspondingly.
  • the position information of the object cut-out instruction in the currently displayed original video frame may refer to the position information triggered by the object cut-out instruction in the currently displayed original video frame, and the position information may refer to the object cut-out instruction in the currently displayed original video frame Coordinate location information in.
  • S120 Cut out the target cutout object in each original video frame of the target video, and obtain a to-be-restored video frame corresponding to each original video frame.
  • the video frame to be restored refers to the video frame corresponding to the original video frame obtained after the target keying object is cut out in an original video frame. There is a cut-out area in the video frame to be restored, and the cut-out area is the area where the target cut-out object is located in the original video frame.
  • a video frame that only includes the target keying object may be referred to as a keying object video frame.
  • the shape of the target cutout object is not necessarily the same in each original video frame, it is necessary to perform the cutout operation of the target cutout object with each original video frame as a unit.
  • an area to be cut out matching the target cut object is determined, and the area to be cut out is cut out in the corresponding original video frame to obtain the to-be-restored video frame correspondingly.
  • the to-be-restored video frame corresponding to the original video frame is still the original video frame.
  • S120 includes:
  • edge detection is first performed to obtain a cut-out object edge detection template corresponding to the target cut-out object, and a cut-out object template mask corresponding to the cut-out object edge detection template is generated.
  • edge detection operators such as Sobel operator, Laplacian operator, and Canny operator. These operators have different advantages and disadvantages. For example, Laplacian operators are sensitive to noise, and Sobel operators are not accurate. Too high but better for image processing with gradual gradation and more noise.
  • the Canny operator can detect weak and strong edges, and can also be controlled by setting a threshold. Therefore, an appropriate operator can be selected according to the actual situation of the cut-out target area of the video, which is not limited in this embodiment.
  • the pixel size of the cut-out object template mask is the same as the pixel size of the original video frame. As shown in Figure 2, in the cut-out object template mask, the pixel value in the area where the target cut-out object is located can be set to 1( It can also be set to 255), and the pixel value of the remaining area can be set to 0.
  • the original video frame and the cut-out target template mask may be bit-wise ANDed to obtain the cut-out target video frame; correspondingly,
  • the pixel value of the target pixel remains unchanged. If the target pixel in the original video frame is The target pixel is ANDed with the "0" in the template mask of the cutout target, and the pixel value of the target pixel becomes 0.
  • the cut-out target template mask is "inverted” by bit, the area with the original pixel value of "1” becomes “0", and the area with the original pixel value of "0” becomes "1".
  • edge detection is performed on the currently displayed original video frame to obtain the corresponding target cutout object Cut out the object edge detection template, and generate a cut out object template mask corresponding to the cut out object edge detection template for the original video frame currently displayed, and then the target cut out object can be displayed in the current display according to the cut out object template mask Cut out the original video frame, and obtain the to-be-restored video frame corresponding to the currently displayed original video frame.
  • the area that is successfully matched is the area to be cut out in the other original video frames (there is no need to perform object recognition on multiple other original video frames one by one to determine the area to be cut out that matches the target cutout object) , And then generate a cut-out object template mask for the other original video frames corresponding to the area to be cut out, and then cut out the target cut-out object in the other original video frames according to the cut-out object template mask to obtain To the to-be-restored video frame corresponding to the other original video frame.
  • Cut out the target cutout object in each original video frame of the target video which can be: cut out the target cutout object in the current display original video frame of the target video, and cut out the target cutout object in the target video. Cut out from the original video frames other than the original video currently displayed.
  • the cut out target video frame corresponding to the currently displayed original video frame may also be obtained; in response to The object movement event associated with the object cutout instruction moves the target cutout object in the currently displayed original video frame according to the cutout target video frame corresponding to the currently displayed original video frame and the to-be-restored video frame.
  • Cut-out target video frame refers to the video frame that only includes the target cut-out object; the cut-out target video frame corresponding to the currently displayed original video frame includes only the target cut-out target video frame corresponding to the currently displayed original video frame , That is, the edge area of the target to be cut out is determined according to the original video frame currently displayed.
  • the object removal instruction may be implemented through an object click event and an object movement event.
  • an object click event e.g., triggered by a user's finger touch operation
  • an object movement event e.g., triggered by a user's finger movement operation
  • the change of the trigger position of the object movement event is detected in real time, and the trigger position of the object movement event is used as the display position of the target cutout object, and the target cutout object is drawn at the display position (For example, it can be realized by superimposing the cut-out target video frame at the display position of the to-be-restored video frame, etc.), to achieve the effect of moving the target cut-out object in the original video currently displayed.
  • the timing refresh notification process is started. After the timing refresh event is detected, the display position of the target cutout object in the video frame to be restored is obtained according to the movement position function, and the target cutout is drawn at the display position Objects, until the end of the animation display, the target removed objects are no longer displayed in the to-be-restored video frame.
  • the target cutout object can also be moved to a set position in the target video editing interface, for example, a position similar to the recycle bin mark, so as to delete the target cutout object in the currently displayed video frame.
  • the target cutout object can also be deleted in the currently displayed video frame through the setting menu operation.
  • the target cutout instruction is a long-press operation, and the relevant key is popped up by long-pressing the target cutout object. Menu, click the delete button to realize the delete function.
  • S130 Perform restoration processing on the cut-out area in each video frame to be restored to obtain an edited video corresponding to the target video.
  • the edited video and the target video have the same number of video frames and the sequence of the video frames.
  • the difference between the edited video and the target video is that each video frame does not include the target keying object, and the area where the target keying object is located has been removed Performed a background restoration.
  • performing restoration processing on the cut-out area is to fill the cut-out area with pixels that match the target video background.
  • the embodiments of the present application after detecting the object removal instruction for the target video, first determine the target removal object that needs to be removed in the target video, and then place the target removal object in each original video. Cut out in the frame, and restore the cut out area to obtain the edited video corresponding to the target video, thereby realizing the function of removing the target object in the video during video editing.
  • performing restoration processing on the cut-out area in each video frame to be restored includes: restoring the cut-out area in each video frame to be restored according to the difference between multiple video frames to be restored.
  • the cutout area in multiple video frames to be restored is not necessarily the same.
  • the location, form, etc. are not necessarily the same. Therefore, it is possible to perform restoration processing on the cut-out areas in the multiple to-be-restored video frames by using the difference in the cut-out areas between the multiple to-be-restored video frames, so as to realize partial or complete deletion of the cut-out areas.
  • the video frame B to be restored can be restored according to the area on the right side of the video frame A to be restored.
  • the area on the right side of the screen of the to-be-restored video frame A can be divided into the area corresponding to the cut-out area in the to-be-restored video frame B, and the area on the left side of the screen of the to-be-restored video frame B can be combined with the key in the to-be-restored video frame A. Except for the area corresponding to the area, it is called the reducible difference area.
  • the restorable difference area is used to indicate an area in a to-be-restored video frame that can be restored to another to-be-restored video frame.
  • the restorable difference area is an area in the to-be-restored video frame A that can be restored to the to-be-restored video frame B.
  • the restorable difference area is an area in the video frame B to be restored that can be restored to the video frame A to be restored.
  • the corresponding cut-out area can be restored according to the restorable difference area.
  • the to-be-restored video frame A is for the to-be-restored video frame B has a restorable difference area, and then restores the cutout area of the to-be restored video frame B according to the restorable difference area in the to-be-restored video frame A; it can also be that the to-be-restored video frame B exists for the to-be-restored video frame A
  • the difference area can be restored, and then the cutout area of the to-be-restored video frame A can be restored according to the reducible-difference area in the to-be-restored video frame B;
  • the cut-out area is filled with pixels.
  • the distribution law of pixels around the cutout area can be determined by statistical methods. For example, the distribution law is that the change of pixels is stable, and the distribution law is that the change of pixels is homogeneous, and the pixel changes of the regular pattern are homogeneous. .
  • FIG. 3 is an example diagram of a regular pixel distribution provided by an embodiment of the application
  • FIG. 4 is an example diagram of an irregular pixel distribution provided by an embodiment of the application.
  • the local growth method can be used, that is, while maintaining consistency with the surrounding pixels, a texture is grown on a pixel or pixel area; in one example, the cut-out area
  • the paradigm method can also be used, that is, the known block closest to the missing block is searched and copied to the missing area.
  • the cut-out area in each video frame to be restored is restored; Remove the area, continue to fill the removed area according to the distribution of pixels around the removed area; again, continue to restore the removed area in each to-be-restored video frame based on the difference between multiple to-be-restored video frames deal with. If there are still uncompleted cutout areas in the to-be-restored video frames, repeat the above operation until the cut-out areas in each to-be-restored video frame have been completely restored.
  • the video processing method provided by this embodiment includes:
  • S220 Perform edge detection on each original video frame, and determine a cut-out object template mask corresponding to each original video frame.
  • S240 Perform restoration processing on the cut-out area in each video frame to be restored according to the difference between the multiple video frames to be restored.
  • performing restoration processing on the cut-out area in each to-be-restored video frame includes:
  • the first to-be-restored video frame and the second to-be-restored video frame are the two adjacent to-be-restored video frames.
  • the restored video frame can also be the next video frame to be restored.
  • the two adjacent video frames to be restored are compared in a positive order.
  • the first to-be restored video frame has a restorable difference area for the second to-be restored video frame
  • the second to be restored is compared according to the restorable difference area.
  • the cut-out area in the restored video frame is restored, and the second to-be-restored video frame is updated; for example, it can also compare two adjacent to-be-restored video frames in reverse order, and the first to-be-restored video frame is for the second to be restored
  • the cut-out area in the second to-be-restored video frame is restored according to the restorable-difference area, and the second to-be-restored video frame is updated.
  • first compare the two adjacent video frames to be restored in a positive order and then compare the two adjacent video frames to be restored in reverse order.
  • restoreable difference area in the video frame to be restored
  • restore the cutout area in the second to-be-restored video frame according to the restoreable difference area and update the second to-be-restored video frame; for example, it can be reversed in order first Two adjacent video frames to be restored before and after, and then two adjacent video frames to be restored are compared in a positive order.
  • the cut-out area in the second to-be-restored video frame is restored according to the restorable difference area, and the second to-be-restored video frame is updated.
  • the first to-be-restored video frame has a restorable difference area for the second to-be-restored video frame, according to the restorable difference
  • the area restores the cut-out area in the second to-be-restored video frame, and after updating the second to-be-restored video frame, it also includes:
  • Difference area if there is a reversible difference area between the two to-be-restored video frames to be compared, the “sequential positive and/or reverse-order comparison of two adjacent to-be-restored video frames is performed sequentially; In the case that the second to-be-restored video frame has a restorable difference area, restore the cutout area in the second to-be-restored video frame according to the restorable difference area, and update the second to-be-restored video frame" operation, if you compare If there is no reversible difference area between the two to-be-restored video frames, the loop process is exited.
  • the first two video frames to be restored of the target video are obtained in a positive sequence, that is, the first video frame to be restored and the second video frame to be restored, and the difference between the two to be restored video frames is compared. If the first to-be-restored video frame has a restorable difference area for the second to-be-restored video frame, restore the cutout area of the second to-be-restored video frame according to the restorable difference area, and update the second The video frame to be restored; if the second video frame to be restored has a restorable difference area for the first video frame to be restored, the cutout area of the first video frame to be restored is restored according to the restorable difference area, And update the first video frame to be restored.
  • next video frame to be restored After processing the first video frame to be restored and the second video frame to be restored, continue to obtain the next video frame to be restored for comparison, that is, compare the second video frame to be restored and the third video frame to be restored Whether there is a reversible difference area between frames. If there is no restorable difference area between the two video frames to be restored, the next video frame to be restored is directly obtained in the positive sequence for comparison, until the last video frame to be restored is processed in the positive sequence (that is, the Nth video to be restored) Frame, assuming that the target video has N video frames).
  • the Nth video frame to be restored has a restorable difference area for the N-1th video frame to be restored
  • the cutout area of the N-1th video frame to be restored is restored according to the restorable difference area
  • the next video frame to be restored is obtained in reverse order for comparison, that is, the N-1th video frame to be restored is compared with the N-th video frame to be restored. Whether there is a reversible difference area between the 2 video frames to be reverted. If there is no restorable difference area between the two video frames to be restored, the next video frame to be restored is directly obtained in reverse order for comparison, until the last video frame to be restored is processed in reverse order (that is, the first video frame to be restored) .
  • the above process is executed in a loop until it is determined that the restoration processing cannot be performed on any one of the to-be-restored video frames, that is, there is no restorable difference area between the two to-be-restored video frames to be compared.
  • the comparing whether there is a reducible difference area between two to-be-restored video frames it may first be calculated whether there is an overlap area between the two to-be-restored video frames.
  • the overlap area refers to the same area between the two to-be-restored video frames. Referring to the to-be-restored video frames shown in FIG. 6 and FIG. 7, the area marked by the box 60 on the left in FIG. The area identified by the box 70 is the overlap area between the to-be-restored video frames shown in FIG. 6 and FIG. 7. Since the video will move during shooting, the overlapped area can be used as a reference for restoration when restoring the video.
  • the overlap area determines whether there is a reducible difference area between the two.
  • the upper area in Figures 8 and 9 is the overlap area, and the lower area in Figures 8 and 9 can be used to cut out the area to restore, and the lower side in Figure 9 is used
  • the area identified by the box 90 is the reducible difference area for the to-be-restored video frame shown in FIG. 8, which can be restored to the lower area in FIG. 8.
  • performing restoration processing on the cut-out area in each to-be-restored video frame includes: dividing each to-be-restored video frame into frame blocks to obtain the respective corresponding to the multiple to-be-restored video frames According to the distribution of the multiple target frame blocks in multiple consecutive video frames to be restored, the cutout area in each video frame to be restored is restored.
  • Each video frame to be restored is divided into frame blocks, and the target frame block corresponding to each video frame to be restored can be obtained.
  • the distribution of the video frames to be restored can be used to obtain the motion trajectories of multiple target frame blocks in the video frame.
  • a target frame block corresponding to the cut-out area can be determined according to the motion trajectory of multiple target frame blocks in the video frame, and the cut-out area can be cut out according to the target frame block. The area is restored.
  • a block index is established for each target frame block and the movement track is recorded.
  • the block position information of each target frame block in each video frame is recorded, and the block position information of this target frame block is saved, so that when the cut-out area is restored, the block position information can be retrieved according to the block position information. Match the missing target frame block to realize the restoration processing of the cut-out area.
  • the cutout area is filled with pixels according to the distribution law of pixels around the cutout area.
  • the operating system of the electronic device is the android system
  • the object recognition algorithm is the AI object recognition algorithm of OpenCV
  • the target video is a video of people moving in a fixed scene (such as a park, a playground, etc.)
  • the target is removed. Is a character object
  • the obtained edited video is a fixed scene.
  • the video editing method provided by this embodiment can be packaged into the following four functional modules: an object recognition function module, an object edge detection function module, a cut-out area restoration function module, and an object removal animation generation functional module.
  • the object recognition function module is mainly set to complete the positioning function of the currently displayed video frame and the object recognition function for the currently displayed video frame.
  • the positioning function of the currently displayed video frame needs to be combined with the user's operation.
  • the user executes the operation of pausing the video playback.
  • the currently displayed video frame is located and the current displayed video can be defined
  • the frame is Current_Frame.
  • Bitmap Bitmap
  • the object recognition function interface to realize the object recognition of the current video display frame Current_Frame, and obtain the set of objects contained in the current video display frame Current_Frame.
  • the AI algorithm through the object recognition function interface recognizes the objects in the Bitmap according to the received Bitmap data, and labels multiple objects to determine multiple objects.
  • an object data can be defined as Identify_Object_Rect
  • the Identify_Object_Rect can include, for example, the object ID, the object name, and the location of the object area.
  • the multiple identified object information constitutes the object recognition result, which can be defined as Identify_Objects, that is, Identify_Objects is a collection containing one or more Identify_Object_Rect.
  • the processing flow of the object recognition function module may include:
  • the external positioning event is an event triggered by the user and used to select a video frame.
  • the object edge detection function module is mainly set to complete the determination of the target to be removed and the separation of the video frame to be restored and the video frame of the removed object.
  • the user selects the target to be removed in the currently displayed video frame.
  • detects the coordinate information triggered by the user in the currently displayed video frame Current_Frame such as detecting the coordinates of the user's finger touching the screen (Mx, My), in Identify_Objects, determine the target editing object Edit_Object corresponding to (Mx, My).
  • edge detection is performed on the current display video frame Current_Frame using an edge detection algorithm to obtain the cutout object edge detection template Edit_Template corresponding to the target cutout object Edit_Object.
  • edge detection is performed on the current display video frame Current_Frame using an edge detection algorithm to obtain the cutout object edge detection template Edit_Template corresponding to the target cutout object Edit_Object.
  • the area that is successfully matched is the corresponding The area of the object that needs to be cut out in other video frames. Separate each other corresponding video frame.
  • the separation method is the same as the Current_Frame method.
  • a Bitmap (which can be defined as Edit_Crop_Object) containing only the target cut object Edit_Object and a Bitmap (which does not contain the target cut object Edit_Object) can be defined as Edit_Save_Object).
  • a matching cutout object template mask Template_Mask for each video frame including Current_Frame and other video frames
  • the target cutout object can be set to 1 (or 255), and the pixel value of the remaining area can be set to 0.
  • the cut-out area restoration function module mainly completes the restoration function of the cut-out area in the video frame to be restored.
  • the restoration function can be realized by inter-frame restoration or frame block restoration, and can also be realized by inter-frame restoration and speculative restoration, or by frame block restoration and speculative restoration.
  • restoring between frames refers to restoring the cutout area in each video frame to be restored based on the difference between multiple video frames to be restored. Since the target cutout object may move in different video frames, the background behind the target cutout object can be revealed, and other video frames can be restored accordingly. Refer to Figure 8 and Figure 9, the bottom of Figure 9 The area marked by the box 90 on the side can be restored to the lower area in FIG. 8.
  • the processing flow of restoring between frames may include:
  • S22 If there is a restoreable difference area between the two to-be-restored video frames, perform corresponding restoration processing on the to-be-restored video frame according to the restoreable difference area, and update the restore times edit_count, and execute S23; if there is a difference between the two to-be-restored video frames If there is no reversible difference area, S23 is executed directly.
  • the initial value of the number of restores edit_count is zero.
  • the upper area in Figures 8 and 9 is the overlap area, and the lower area in Figures 8 and 9 can be used to cut out the area to restore, and the lower side in Figure 9 is used
  • the area identified by the box 90 is the reducible difference area for the to-be-restored video frame shown in FIG. 8, which can be restored to the lower area in FIG. 8.
  • the cut-out area of another video frame to be restored is restored.
  • Frame block restoration refers to dividing each video frame to be restored into frame blocks to obtain multiple target frame blocks corresponding to the multiple video frames to be restored; according to the respective corresponding to the multiple video frames to be restored For the matching between multiple target frame blocks, the cutout area in each video frame to be restored is restored.
  • Each video frame to be restored is divided into frame blocks, and the target frame block RectBlock corresponding to each video frame to be restored can be obtained.
  • a block index BlockIndex is established for each target frame block and the movement track is recorded .
  • the block position information BlockData of each target frame block RectBlock in each video frame is recorded, and the block position information BlockData of this target frame block is saved, so that when the cutout area is restored, the block data can be
  • the location information BlockData is used to match the missing target frame block RectBlock to realize the restoration processing of the cutout area.
  • Speculative restoration refers to the pixel filling of the cut-out area according to the distribution law of the pixels around the cut-out area.
  • the distribution law of pixels around the cutout area can be determined by statistical methods.
  • the distribution law is that the change of pixels is stable, and the distribution law is that the change of pixels is homogeneous.
  • the change of pixels in a regular pattern is uniform. Times. Fig. 3 shows a regular pixel distribution, and Fig. 4 shows an irregular pixel distribution.
  • a local growth method or a paradigm method is used to achieve speculative reduction.
  • the local growth method is to grow a texture on a pixel or pixel area while maintaining consistency with the surrounding pixels; the paradigm method is to search for the known block closest to the missing block and copy it to the missing area.
  • the processing flow of speculative restoration may include:
  • S33 Determine a corresponding repair method according to the pixel distribution law, for example, a local growth method or a paradigm method.
  • S34 Perform restoration processing on the cut-out area of the to-be-restored video frame according to the determined repair method.
  • S36 Perform inter-frame restoration processing on the video frames to be restored.
  • the object-moving-out animation generating function module mainly completes the function of generating an animation of the target-cut-out object moving out of the video editing area.
  • the moving speed of the target editing object Edit_Object can be calculated according to the position of the target cutting object in the currently displayed video frame and the animation duration, and the position of the target editing object Edit_Object can also be determined by defining the speed change curve.
  • the time period from the animation moment to the current moment, l represents the distance from the original position of the target to be cut out to the set boundary of the video frame.
  • the animation starts with the detection of the finger movement event ACTION_MOVE as the starting point.
  • the processing flow includes:
  • FIG. 11 is a schematic structural diagram of a video processing apparatus provided by an embodiment of the application.
  • the apparatus may be implemented by software and/or hardware and integrated into an electronic device, such as a mobile terminal.
  • the video processing device includes: a target removal object determination module 410, a to-be-restored video frame acquisition module 420, and a video frame restoration module 430.
  • the target removal object determination module 410 is configured to detect the object removal instruction for the target video, and determine the target removal object corresponding to the object removal instruction;
  • the to-be-restored video frame acquisition module 420 is configured to The target cutout object is cut out in each original video frame of the target video, and a video frame to be restored corresponding to each original video frame is obtained;
  • the video frame restoration module 430 is configured to The cut-out area in the video frame is restored to obtain an edited video corresponding to the target video.
  • the embodiments of the present application after detecting the object cutout instruction for the target video, first determine the target cutout object that needs to be removed from the target video, and then place the target cutout object in each original video. Cut out in the frame, and restore the cut out area to obtain the edited video corresponding to the target video, thereby realizing the function of removing the target object in the video during video editing.
  • the to-be-restored video frame acquisition module 420 is configured to perform edge detection on each original video frame, and determine the cutout object template mask corresponding to each original video frame; An object template mask, which cuts out the target cutout object in each corresponding original video frame, and obtains a to-be-restored video frame corresponding to each original video frame.
  • the video frame restoration module 430 is configured to perform restoration processing on the cutout area in each to-be-restored video frame according to the difference between a plurality of to-be-restored video frames.
  • the video frame restoring module 430 is configured to compare two adjacent video frames to be restored in positive and/or reverse order; in the first to-be-restored video frame, there is a restorable difference area for the second to-be-restored video frame In the case of, performing restoration processing on the cut-out area in the second to-be-restored video frame according to the restorable difference area, and update the second to-be-restored video frame.
  • the video frame restoration module 430 is further configured to perform restoration processing on the cutout area in each to-be-restored video frame according to the difference between a plurality of to-be-restored video frames, and then compare any two to-be-restored video frames. In the case that there is the restorable difference area between, continue to perform the operation of restoring the cutout area in each to be restored video frame according to the difference between the multiple to be restored video frames, until any of the comparisons There is no restorable difference area between the two video frames to be restored.
  • the video frame restoration module 430 is configured to divide each video frame to be restored into frame blocks to obtain multiple target frame blocks corresponding to the multiple video frames to be restored; The distribution of the blocks in a plurality of consecutive video frames to be restored is restored, and the cut-out area in each video frame to be restored is restored.
  • the video frame restoration module 430 is further configured to perform restoration processing on the cutout area in each to-be-restored video frame according to the difference between the different to-be-restored video frames, or, According to the distribution of multiple target frame blocks in a plurality of consecutive video frames to be restored, after performing restoration processing on the cutout area in each video frame to be restored, there are uncompleted video frames in the to-be restored video frames In the case of the restored cut-out area, pixel filling is performed on the cut-out area according to the distribution law of pixels around the cut-out area.
  • the to-be-restored video frame acquisition module 420 is configured to cut out the target cutout object in the current display original video frame of the target video; correspondingly, the above-mentioned device further includes: animation generation Module, configured to obtain the target video frame corresponding to the current display original video frame after the target cut-out object is cut out in the current display original video frame of the target video; In the object movement event associated with the object cutout instruction, the target cutout object is moved in the currently displayed original video frame according to the cutout target video frame corresponding to the currently displayed original video frame and the to-be-restored video frame.
  • the target removal object determination module 410 is configured to detect an object removal instruction for the target video in the currently displayed original video frame of the target video, and perform object recognition on the currently displayed original video frame ; According to the object recognition result and the position information corresponding to the object cutout instruction, determine the target cutout object in the currently displayed video frame with the object cutout instruction.
  • the above-mentioned video processing device can execute the video processing method provided by the embodiment of the present application, and has the functional modules and effects corresponding to the execution method.
  • the video processing method provided in the embodiment of this application please refer to the video processing method provided in the embodiment of this application.
  • FIG. 12 is a schematic structural diagram of an electronic device provided by an embodiment of the application.
  • the electronic device provided by the present application It includes: one or more processors 510 and a memory 520; the processor 510 of the electronic device may be one or more, and one processor 510 is taken as an example in FIG. 12; the memory 520 is configured to store one or more programs; The one or more programs are executed by the one or more processors 510, so that the one or more processors 510 implement the video processing method described in the embodiments of the present application.
  • the processor 510 and the memory 520 in the electronic device may be connected through a bus or in other ways.
  • the connection through a bus is taken as an example.
  • the memory 520 can be configured to store software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the video processing method described in the embodiments of the present application (for example, in the video processing device).
  • the memory 520 may include a program storage area and a data storage area, where the program storage area may store an operating system and an application program required by at least one function; the data storage area may store data created according to the use of the device, and the like.
  • the memory 520 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage devices.
  • the memory 520 may include a memory remotely provided with respect to the processor 510, and these remote memories may be connected to a communication node through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
  • the embodiments of the present application also provide a storage medium, the storage medium stores a computer program, and when the computer program is executed by a processor, the video processing method in the embodiments of the present application is implemented, and the video processing method includes:
  • Detect the object cutout instruction for the target video determine the target cutout object corresponding to the object cutout instruction; cut out the target cutout object in each original video frame of the target video, and obtain A to-be-restored video frame corresponding to each of the original video frames; performing restoration processing on the cut-out area in each to-be-restored video frame to obtain an edited video corresponding to the target video.
  • the computer executable instruction when executed by a computer processor, it can also be used to implement any of the video processing methods described in the embodiments of the present application.
  • this application can be implemented by software and necessary general-purpose hardware, or can be implemented by hardware.
  • the technical solution of this application can essentially be embodied in the form of a software product.
  • the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, a read-only memory (Read-Only Memory, ROM), and random access Random Access Memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including multiple instructions to make a communication device (which can be a personal computer, server, or network device, etc.) execute the embodiments described in this application Methods.
  • the multiple units and modules included are only divided according to the functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be realized; in addition, the multiple functional units
  • the names are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application.
  • the various embodiments of the present application can be implemented in hardware or dedicated circuits, software, logic or any combination thereof.
  • some aspects may be implemented in hardware, while other aspects may be implemented in firmware or software that may be executed by a controller, microprocessor, or other computing device, although the application is not limited thereto.
  • the embodiments of the present application may be implemented by executing computer program instructions by a data processor of a mobile device, for example, in a processor entity, or by hardware, or by a combination of software and hardware.
  • Computer program instructions can be assembly instructions, instruction set architecture (Instruction Set Architecture, ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or written in any combination of one or more programming languages Source code or object code.
  • the block diagram of any logic flow in the drawings of the present application may represent program steps, or may represent interconnected logic circuits, modules, and functions, or may represent a combination of program steps and logic circuits, modules, and functions.
  • the computer program can be stored on the memory.
  • the memory can be of any type suitable for the local technical environment and can be implemented using any suitable data storage technology, such as but not limited to read-only memory (ROM), random access memory (RAM), optical storage devices and systems (digital multi-function discs) (Digital Video Disc, DVD) or Compact Disk (CD)), etc.
  • Computer-readable media may include non-transitory storage media.
  • the data processor can be any type suitable for the local technical environment, such as but not limited to general-purpose computers, special-purpose computers, microprocessors, digital signal processors (Digital Signal Processing, DSP), application specific integrated circuits (ASICs) ), programmable logic devices (Field-Programmable Gate Array, FPGA), and processors based on multi-core processor architecture.
  • DSP Digital Signal Processing
  • ASICs application specific integrated circuits
  • FPGA Field-Programmable Gate Array
  • FPGA Field-Programmable Gate Array

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Human Computer Interaction (AREA)
  • Television Signal Processing For Recording (AREA)

Abstract

Disclosed are a video processing method, apparatus and device, and a storage medium. The video processing method comprises: detecting an object removal instruction with respect to a target video, and determining a target removal object corresponding to the object removal instruction; removing the target removal object from each original video frame among multiple original video frames of the target video, and acquiring multiple video frames to be restored, respectively corresponding to the multiple original video frames; and restoring the removal zone of each video frame to be restored, and obtaining an edited video corresponding to the target video.

Description

视频处理方法、装置、设备和存储介质Video processing method, device, equipment and storage medium 技术领域Technical field
本申请涉及图像处理技术领域,例如涉及一种视频处理方法、装置、设备和存储介质。This application relates to the field of image processing technology, for example, to a video processing method, device, device, and storage medium.
背景技术Background technique
随着智能手机的普及,人们经常使用智能手机拍摄视频以记录生活的点点滴滴。而且,当人们对视频进行保存或分享之前,喜欢对原视频做一些后处理,以使视频达到更好的展示效果。智能手机支持的视频编辑功能比较基础,例如视频的剪辑、滤镜、区域裁剪、添加字幕(或水印)、添加音乐、增加转场动画等,但无法支持一些深度编辑功能,例如移除视频中目标对象等。With the popularity of smart phones, people often use smart phones to shoot videos to record every bit of life. Moreover, before people save or share the video, they like to do some post-processing on the original video to achieve a better display effect. The video editing functions supported by smartphones are relatively basic, such as video editing, filters, area cropping, adding subtitles (or watermarks), adding music, adding transition animations, etc., but cannot support some deep editing functions, such as removing videos Target audience, etc.
发明内容Summary of the invention
本申请提供了一种视频处理方法、装置、设备和存储介质,以实现在视频编辑中移除视频中目标对象的功能。This application provides a video processing method, device, equipment, and storage medium to implement the function of removing target objects in the video during video editing.
提供了一种视频处理方法,包括:A video processing method is provided, including:
检测到针对目标视频的对象抠除指令,确定与所述对象抠除指令对应的目标抠除对象;将所述目标抠除对象在所述目标视频的多个原始视频帧中的每个原始视频帧中抠除,获取到与所述多个原始视频帧分别对应的多个待还原视频帧;对每个待还原视频帧中的抠除区域进行还原处理,得到与所述目标视频对应的已编辑视频。Detect an object cutout instruction for the target video, determine the target cutout object corresponding to the object cutout instruction; place the target cutout object in each original video of the multiple original video frames of the target video Cut out from the frame, obtain a plurality of to-be-restored video frames corresponding to the multiple original video frames; perform restoration processing on the cut-out area in each to-be-restored video frame to obtain the target video corresponding to the target video. Edit the video.
还提供了一种视频处理装置,包括:A video processing device is also provided, including:
目标抠除对象确定模块,设置为检测到针对目标视频的对象抠除指令,确定与所述对象抠除指令对应的目标抠除对象;待还原视频帧获取模块,设置为将所述目标抠除对象在所述目标视频的多个原始视频帧中的每个原始视频帧中抠除,获取到与所述多个原始视频帧分别对应的多个待还原视频帧;视频帧还原模块,设置为对每个待还原视频帧中的抠除区域进行还原处理,得到与所述目标视频对应的已编辑视频。The target removal object determination module is configured to detect the object removal instruction for the target video, and determine the target removal object corresponding to the object removal instruction; the to-be-restored video frame acquisition module is set to remove the target The object is cut out from each of the multiple original video frames of the target video, and multiple to-be-restored video frames corresponding to the multiple original video frames are obtained; the video frame restoration module is set to Perform restoration processing on the cut-out area in each video frame to be restored to obtain an edited video corresponding to the target video.
还提供了一种电子设备,所述电子设备包括:An electronic device is also provided, and the electronic device includes:
一个或多个处理器;存储器,设置为存储一个或多个程序;当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现上述 的视频处理方法。One or more processors; a memory, configured to store one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors realize the aforementioned video Approach.
还提供了一种计算机存储介质,其上存储有计算机程序,该程序被处理器执行时实现上述的视频处理方法。A computer storage medium is also provided, on which a computer program is stored, and when the program is executed by a processor, the above-mentioned video processing method is realized.
附图说明Description of the drawings
图1为本申请实施例提供的一种视频处理方法的流程示意图;FIG. 1 is a schematic flowchart of a video processing method provided by an embodiment of this application;
图2为本申请实施例提供的一种与原始视频帧对应的抠除对象模板掩膜的示例图;FIG. 2 is an example diagram of a cut-out object template mask corresponding to an original video frame provided by an embodiment of the application; FIG.
图3为本申请实施例提供的一种有规律的像素分布示例图;FIG. 3 is an example diagram of a regular pixel distribution provided by an embodiment of this application;
图4为本申请实施例提供的一种无规律的像素分布示例图;4 is an example diagram of an irregular pixel distribution provided by an embodiment of the application;
图5为本申请实施例提供的另一种视频处理方法的流程示意图;FIG. 5 is a schematic flowchart of another video processing method provided by an embodiment of this application;
图6为本申请实施例提供的一种待还原视频帧的示例图;FIG. 6 is an example diagram of a to-be-restored video frame provided by an embodiment of this application;
图7为本申请实施例提供的另一种待还原视频帧的示例图;FIG. 7 is an example diagram of another to-be-restored video frame provided by an embodiment of the application;
图8为本申请实施例提供的另一种待还原视频帧的示例图;FIG. 8 is an example diagram of another to-be-restored video frame provided by an embodiment of the application;
图9为本申请实施例提供的另一种待还原视频帧的示例图;FIG. 9 is an example diagram of another to-be-restored video frame provided by an embodiment of the application;
图10为本申请实施例提供的一种视频处理方法所适用的系统模块示意图;FIG. 10 is a schematic diagram of system modules to which a video processing method according to an embodiment of the application is applicable;
图11为本申请实施例提供的一种视频处理装置的结构示意图;FIG. 11 is a schematic structural diagram of a video processing device provided by an embodiment of this application;
图12为本申请实施例提供的一种电子设备的结构示意图。FIG. 12 is a schematic structural diagram of an electronic device provided by an embodiment of this application.
具体实施方式detailed description
在后续的描述中,使用用于表示元件的诸如“模块”、“部件”或“单元”的后缀仅为了有利于本申请的说明,其本身没有特有的意义。因此,“模块”、“部件”或“单元”可以混合地使用。In the following description, the use of suffixes such as “module”, “component” or “unit” used to indicate elements is only for the description of the present application, and has no special meaning in itself. Therefore, "module", "part" or "unit" can be used in a mixed manner.
下文中将结合附图对本申请的实施例进行说明。Hereinafter, the embodiments of the present application will be described with reference to the accompanying drawings.
在一个示例性实施方式中,图1为本申请实施例提供的一种视频处理方法的流程示意图。该方法适用于在电子设备(例如移动终端等)中对拍摄视频进行深度编辑的情况,该情况可以是指将一些目标对象在视频中进行移除。该方法可以由本申请提供的视频处理装置执行,该视频处理装置可以由软件和/或硬件实现,并集成在电子设备中,如移动终端。In an exemplary embodiment, FIG. 1 is a schematic flowchart of a video processing method provided by an embodiment of this application. This method is suitable for the case of performing in-depth editing of the captured video in an electronic device (such as a mobile terminal, etc.), which may refer to removing some target objects from the video. The method can be executed by the video processing device provided in the present application, and the video processing device can be implemented by software and/or hardware and integrated in an electronic device, such as a mobile terminal.
如图1所示,本实施方式提供的视频处理方法,包括:As shown in Figure 1, the video processing method provided by this embodiment includes:
S110、检测到针对目标视频的对象抠除指令,确定与对象抠除指令对应的目标抠除对象。S110: Detect an object removal instruction for the target video, and determine a target removal object corresponding to the object removal instruction.
目标视频,指的是进行编辑的视频。可选的,将目标视频进行解密,获取到与目标视频对应的所有原始视频帧,用户可根据需要选择其中一个或多个原始视频帧进行相关的编辑操作,例如在原始视频帧中增加动画、增加文字或对象等,或者对原始视频帧进行裁剪等。The target video refers to the video to be edited. Optionally, decrypt the target video to obtain all the original video frames corresponding to the target video. The user can select one or more of the original video frames for related editing operations as needed, such as adding animation, Add text or objects, or crop the original video frame, etc.
对象抠除指令,指的是在对目标视频的编辑页面中发起的,用于指示将所述目标视频中的相关对象进行抠除的指令,对象抠除指令例如可以通过用户的点击动作及移动动作触发,也可以通过用户的滑动动作触发等,本实施例对此不做限定。The object removal instruction refers to an instruction initiated in the edit page of the target video and used to instruct the removal of related objects in the target video. The object removal instruction can be performed by, for example, the user's click action and movement The action trigger can also be triggered by a user's sliding action, etc., which is not limited in this embodiment.
与对象抠除指令对应的目标抠除对象,即为用户通过设定动作选择的、意在将其在目标视频中抠除的对象,例如可以是目标视频中人体(如视频中误入的路人)、物体(如视频中的杂物)等。The target removal object corresponding to the object removal instruction is the object selected by the user through a set action and intended to be removed in the target video. For example, it can be a human body in the target video (such as a passerby who enters the video by mistake). ), objects (such as debris in the video), etc.
在一示例中,当用户在其选择的一个原始视频帧中发起对象抠除指令时,获取该对象抠除指令在该原始视频帧中的触发位置,在该触发位置附近进行对象识别,识别出的对象即为与对象抠除指令对应的目标抠除对象。In an example, when the user initiates an object removal instruction in an original video frame selected by the user, the trigger position of the object removal instruction in the original video frame is obtained, and the object is identified near the trigger position, and the object is recognized The object of is the target removal object corresponding to the object removal instruction.
作为一种可选的实施方式,S110包括:As an optional implementation manner, S110 includes:
在目标视频的当前显示原始视频帧中检测到针对目标视频的对象抠除指令,对当前显示原始视频帧进行对象识别;根据对象识别结果以及对象抠除指令在当前显示原始视频帧中的位置信息,确定与对象抠除指令对应的目标抠除对象。The object cutout instruction for the target video is detected in the current display original video frame of the target video, and the object recognition is performed on the currently displayed original video frame; according to the object recognition result and the position information of the object cutout instruction in the currently displayed original video frame , To determine the target removal object corresponding to the object removal instruction.
在一示例中,当前显示原始视频帧为检测到针对目标视频的对象抠除指令时显示的一个原始视频帧,例如可以是在目标视频的原始视频帧的播放过程中,根据用户触发的暂停操作定位的。如果在当前显示原始视频帧中检测到对象抠除指令,则对当前显示原始视频帧进行对象识别,例如可以使用OpenCV的人工智能(Artificial Intelligence,AI)对象识别算法对当前显示原始视频帧进行对象识别,得到与当前显示原始视频帧对应的一个或多个对象。将识别出的对象进行标注,得到与每个对象对应的区域位置,进而保存这些对象的区域位置。在一示例中,在存储识别得到的对象信息时,可以将对象标识(Identifier,ID)、对象名称以及对象区域位置对应进行存储。In an example, the currently displayed original video frame is an original video frame displayed when an object removal instruction for the target video is detected. For example, it may be based on a pause operation triggered by the user during the playback of the original video frame of the target video. Positioned. If the object removal instruction is detected in the currently displayed original video frame, the object recognition is performed on the currently displayed original video frame. For example, OpenCV's artificial intelligence (AI) object recognition algorithm can be used to perform object recognition on the currently displayed original video frame. Recognize, and obtain one or more objects corresponding to the currently displayed original video frame. Label the recognized objects to obtain the location of the area corresponding to each object, and then save the location of the area of these objects. In an example, when storing the identified object information, the object identifier (ID), the object name, and the location of the object area can be stored correspondingly.
对象抠除指令在当前显示原始视频帧中的位置信息,可以指的是对象抠除指令在当前显示原始视频帧中触发的位置信息,位置信息可以是指对象抠除指令在当前显示原始视频帧中的坐标位置信息。在获取到对象抠除指令对应的位置信息之后,在存储的对象信息中查找与该位置信息匹配的对象,查找到的对 象即为与对象抠除指令对应的目标抠除对象。The position information of the object cut-out instruction in the currently displayed original video frame may refer to the position information triggered by the object cut-out instruction in the currently displayed original video frame, and the position information may refer to the object cut-out instruction in the currently displayed original video frame Coordinate location information in. After obtaining the location information corresponding to the object removal instruction, search for the object matching the location information in the stored object information, and the found object is the target removal object corresponding to the object removal instruction.
S120、将目标抠除对象在目标视频的每个原始视频帧中抠除,获取到与每个原始视频帧对应的待还原视频帧。S120: Cut out the target cutout object in each original video frame of the target video, and obtain a to-be-restored video frame corresponding to each original video frame.
待还原视频帧,指的是将目标抠除对象在一个原始视频帧中抠除后得到的与该原始视频帧对应的视频帧。在待还原视频帧中存在抠除区域,抠除区域即为目标抠除对象在原始视频帧中所位于的区域。相应的,可以将只包括目标抠除对象的视频帧称为抠除对象视频帧。The video frame to be restored refers to the video frame corresponding to the original video frame obtained after the target keying object is cut out in an original video frame. There is a cut-out area in the video frame to be restored, and the cut-out area is the area where the target cut-out object is located in the original video frame. Correspondingly, a video frame that only includes the target keying object may be referred to as a keying object video frame.
由于目标抠除对象在每一个原始视频帧中形态不一定相同,进而需要以每个原始视频帧为单位进行目标抠除对象的抠除操作。可选的,在每个原始视频帧中确定与目标抠除对象匹配的待抠除区域,并将待抠除区域在对应的原始视频帧中抠除,即可对应得到待还原视频帧。Since the shape of the target cutout object is not necessarily the same in each original video frame, it is necessary to perform the cutout operation of the target cutout object with each original video frame as a unit. Optionally, in each original video frame, an area to be cut out matching the target cut object is determined, and the area to be cut out is cut out in the corresponding original video frame to obtain the to-be-restored video frame correspondingly.
如果一个原始视频帧中不包含目标抠除对象,则与该原始视频帧对应的待还原视频帧依旧为该原始视频帧。If an original video frame does not contain the target cutout object, the to-be-restored video frame corresponding to the original video frame is still the original video frame.
在一种可选的实施方式中,S120包括:In an optional implementation manner, S120 includes:
对每个原始视频帧进行边缘检测,确定与每个原始视频帧对应的抠除对象模板掩膜;根据每个抠除对象模板掩膜,将目标抠除对象在对应的每个原始视频帧中抠除,获取到与每个原始视频帧对应的待还原视频帧。Perform edge detection on each original video frame, and determine the cutout object template mask corresponding to each original video frame; according to each cutout object template mask, put the target cutout object in each corresponding original video frame Cut out, and obtain the to-be-restored video frame corresponding to each original video frame.
针对每一个原始视频帧,首先进行边缘检测,得到与目标抠除对象对应的抠除对象边缘检测模板,并生成与抠除对象边缘检测模板对应的抠除对象模板掩膜。For each original video frame, edge detection is first performed to obtain a cut-out object edge detection template corresponding to the target cut-out object, and a cut-out object template mask corresponding to the cut-out object edge detection template is generated.
在进行边缘检测时,可以采用例如Sobel算子、Laplacian算子以及Canny算子之类的边缘检测算子,这些算子有不同的优缺点,如Laplacian算子对噪声敏感,Sobel算子精度不太高但是对灰度渐变和噪声较多的图像处理效果较好,Canny算子可以检测弱边缘和强边缘,也可以设置阈值进行控制。因此,可以根据视频的抠除对象区域的实际情况来选择合适的算子,本实施例对此不做限定。When performing edge detection, you can use edge detection operators such as Sobel operator, Laplacian operator, and Canny operator. These operators have different advantages and disadvantages. For example, Laplacian operators are sensitive to noise, and Sobel operators are not accurate. Too high but better for image processing with gradual gradation and more noise. The Canny operator can detect weak and strong edges, and can also be controlled by setting a threshold. Therefore, an appropriate operator can be selected according to the actual situation of the cut-out target area of the video, which is not limited in this embodiment.
抠除对象模板掩膜的像素与原始视频帧的像素大小是相同的,如图2所示,在抠除对象模板掩膜中,目标抠除对象所处区域中的像素值可以设置为1(也可以设置为255),其余区域的像素值可以设置为0。The pixel size of the cut-out object template mask is the same as the pixel size of the original video frame. As shown in Figure 2, in the cut-out object template mask, the pixel value in the area where the target cut-out object is located can be set to 1( It can also be set to 255), and the pixel value of the remaining area can be set to 0.
在一示例中,获取与原始视频帧对应的抠除对象视频帧时,可以将原始视频帧与抠除对象模板掩膜按位进行“与”操作,以得到抠除对象视频帧;相应的,获取与原始视频帧对应的待还原视频帧时,可以首先将抠除对象模板掩膜按位进行“取反”操作,然后将原始视频帧与“取反”操作后的抠除对象模板掩膜按位进行“与”操作,以得到待还原视频帧。In an example, when obtaining the cut-out target video frame corresponding to the original video frame, the original video frame and the cut-out target template mask may be bit-wise ANDed to obtain the cut-out target video frame; correspondingly, When obtaining the to-be-restored video frame corresponding to the original video frame, you can first perform the bitwise "inversion" operation on the cutout object template mask, and then combine the original video frame with the cutout object template mask after the "inversion" operation Perform bitwise AND operation to get the video frame to be restored.
在进行“与”操作时,若原始视频帧中的目标像素点与抠除对象模板掩膜中的“1”相“与”,则目标像素点的像素值不变,若原始视频帧中的目标像素点与抠除对象模板掩膜中的“0”相“与”,则目标像素点的像素值变成0。在将抠除对象模板掩膜按位进行“取反”操作时,原本像素值为“1”的区域变成“0”,原本像素值为“0”的区域变成“1”。During the "AND" operation, if the target pixel in the original video frame is "ANDed" with the "1" in the cutout template mask, the pixel value of the target pixel remains unchanged. If the target pixel in the original video frame is The target pixel is ANDed with the "0" in the template mask of the cutout target, and the pixel value of the target pixel becomes 0. When the cut-out target template mask is "inverted" by bit, the area with the original pixel value of "1" becomes "0", and the area with the original pixel value of "0" becomes "1".
在一示例中,针对当前显示原始视频帧而言,在对当前显示原始视频帧进行对象识别并确定目标抠除对象之后,对当前显示原始视频帧进行边缘检测,得到与目标抠除对象对应的抠除对象边缘检测模板,并生成与抠除对象边缘检测模板对应的针对当前显示原始视频帧的抠除对象模板掩膜,进而可以根据该抠除对象模板掩膜将目标抠除对象在当前显示原始视频帧中抠除,获取到与当前显示原始视频帧对应的待还原视频帧。In one example, for the currently displayed original video frame, after object recognition is performed on the currently displayed original video frame and the target cutout object is determined, edge detection is performed on the currently displayed original video frame to obtain the corresponding target cutout object Cut out the object edge detection template, and generate a cut out object template mask corresponding to the cut out object edge detection template for the original video frame currently displayed, and then the target cut out object can be displayed in the current display according to the cut out object template mask Cut out the original video frame, and obtain the to-be-restored video frame corresponding to the currently displayed original video frame.
针对除当前显示原始视频帧之外的任意一个其他原始视频帧,首先对该其他原始视频帧进行边缘检测,并根据由当前显示原始视频帧确定的抠除对象边缘检测模板对边缘检测检测结果进行匹配,匹配成功的区域即为该其他原始视频帧中的待抠除区域(此时无需对多个其他原始视频帧一一进行对象识别即可确定与目标抠除对象匹配的待抠除区域),然后生成与待抠除区域对应的针对该其他原始视频帧的抠除对象模板掩膜,进而可以根据该抠除对象模板掩膜将目标抠除对象在该其他原始视频帧中抠除,获取到与该其他原始视频帧对应的待还原视频帧。For any other original video frame except the currently displayed original video frame, first perform edge detection on the other original video frame, and perform edge detection detection results on the edge detection template based on the cutout object edge detection template determined by the currently displayed original video frame Match, the area that is successfully matched is the area to be cut out in the other original video frames (there is no need to perform object recognition on multiple other original video frames one by one to determine the area to be cut out that matches the target cutout object) , And then generate a cut-out object template mask for the other original video frames corresponding to the area to be cut out, and then cut out the target cut-out object in the other original video frames according to the cut-out object template mask to obtain To the to-be-restored video frame corresponding to the other original video frame.
将目标抠除对象在目标视频的每个原始视频帧中抠除,可以为:将目标抠除对象在目标视频的当前显示原始视频帧中抠除,以及将目标抠除对象在目标视频的除当前显示原视频之外的其他原始视频帧中抠除。Cut out the target cutout object in each original video frame of the target video, which can be: cut out the target cutout object in the current display original video frame of the target video, and cut out the target cutout object in the target video. Cut out from the original video frames other than the original video currently displayed.
在一种可选的实施方式中,在将目标抠除对象在目标视频的当前显示原始视频帧中抠除之后,还可以获取到与当前显示原始视频帧对应的抠除对象视频帧;响应于与对象抠除指令关联的对象移动事件,根据与当前显示原始视频帧对应的抠除对象视频帧以及待还原视频帧,将目标抠除对象在当前显示原始视频帧中移动。在一示例中,还可以生成按照对象抠除指令方向使目标抠除对象移出当前显示视频帧编辑界面的动画。In an optional implementation manner, after the target to be cut out is cut out in the currently displayed original video frame of the target video, the cut out target video frame corresponding to the currently displayed original video frame may also be obtained; in response to The object movement event associated with the object cutout instruction moves the target cutout object in the currently displayed original video frame according to the cutout target video frame corresponding to the currently displayed original video frame and the to-be-restored video frame. In an example, it is also possible to generate an animation that moves the target cutout object out of the currently displayed video frame editing interface according to the object cutout instruction direction.
抠除对象视频帧,指的是只包括目标抠除对象的视频帧;与当前显示原始视频帧对应的抠除对象视频帧,只包括与当前显示原始视频帧对应的目标抠除对象的视频帧,也即目标抠除对象的边缘区域是根据当前显示原始视频帧确定的。Cut-out target video frame refers to the video frame that only includes the target cut-out object; the cut-out target video frame corresponding to the currently displayed original video frame includes only the target cut-out target video frame corresponding to the currently displayed original video frame , That is, the edge area of the target to be cut out is determined according to the original video frame currently displayed.
在一示例中,对象抠除指令可以是通过对象点击事件和对象移动事件来实现。用户触发对象点击事件(例如通过用户手指触摸操作触发)之后,如果检 测到对象移动事件(例如通过用户手指移动操作触发),则开始执行在当前显示原始视频中移动目标抠除对象的操作。可选的,在检测到对象移动事件之后,实时检测对象移动事件触发位置的变化情况,并将对象移动事件的触发位置作为目标抠除对象的显示位置,在该显示位置处绘制目标抠除对象(例如可以通过在待还原视频帧的该显示位置处叠加抠除对象视频帧的方式实现等),实现在当前显示原始视频中移动目标抠除对象的效果。In an example, the object removal instruction may be implemented through an object click event and an object movement event. After the user triggers an object click event (e.g., triggered by a user's finger touch operation), if an object movement event (e.g., triggered by a user's finger movement operation) is detected, the operation of moving the target and removing the object in the currently displayed original video is started. Optionally, after the object movement event is detected, the change of the trigger position of the object movement event is detected in real time, and the trigger position of the object movement event is used as the display position of the target cutout object, and the target cutout object is drawn at the display position (For example, it can be realized by superimposing the cut-out target video frame at the display position of the to-be-restored video frame, etc.), to achieve the effect of moving the target cut-out object in the original video currently displayed.
在一示例中,还可以根据在当前显示原始视频中移动目标抠除对象的操作生成在当前显示原始视频中移动目标抠除对象的动画。In an example, it is also possible to generate an animation that moves the target and removes the object in the currently displayed original video according to the operation of moving the target to remove the object in the currently displayed original video.
可选的,预先设置一个移动位置函数,P(x,y)=f(t,l),其中,P(x,y)表示目标抠除对象在待还原视频帧中的显示位置,t表示开始生成动画时刻至当前时刻的时间段,l表示目标抠除对象原位置至视频帧设定边界的距离。在检测到对象移动事件之后,启动定时刷新通知流程,检测到定时刷新事件之后,根据移动位置函数得到目标抠除对象在待还原视频帧中的显示位置,并在该显示位置处绘制目标抠除对象,直至动画展示结束,目标抠除对象不再在待还原视频帧中显示。Optionally, preset a moving position function, P(x,y)=f(t,l), where P(x,y) represents the display position of the target to be cut out in the video frame to be restored, and t represents The time period from the moment when the animation is generated to the current moment, l represents the distance from the original position of the target to be cut out to the set boundary of the video frame. After the object movement event is detected, the timing refresh notification process is started. After the timing refresh event is detected, the display position of the target cutout object in the video frame to be restored is obtained according to the movement position function, and the target cutout is drawn at the display position Objects, until the end of the animation display, the target removed objects are no longer displayed in the to-be-restored video frame.
在另一种可选的实施方式中,还可以将目标抠除对象移动到目标视频编辑界面中的设置位置,例如类似回收站标识位置,以实现将目标抠除对象在当前显示视频帧中删除。In another optional implementation manner, the target cutout object can also be moved to a set position in the target video editing interface, for example, a position similar to the recycle bin mark, so as to delete the target cutout object in the currently displayed video frame. .
在又一种可选的实施方式中,也可以通过设定菜单操作将目标抠除对象在当前显示视频帧中删除,例如对象抠除指令为长按操作,通过长按目标抠除对象弹出相关菜单,点击删除按键实现删除功能。In yet another optional implementation manner, the target cutout object can also be deleted in the currently displayed video frame through the setting menu operation. For example, the target cutout instruction is a long-press operation, and the relevant key is popped up by long-pressing the target cutout object. Menu, click the delete button to realize the delete function.
S130、对每个待还原视频帧中的抠除区域进行还原处理,得到与目标视频对应的已编辑视频。S130: Perform restoration processing on the cut-out area in each video frame to be restored to obtain an edited video corresponding to the target video.
已编辑视频与目标视频的视频帧数量及视频帧顺序均一致,已编辑视频与目标视频的区别只在于每个视频帧中不包括目标抠除对象,并且已经对目标抠除对象所位于的区域进行了背景还原。The edited video and the target video have the same number of video frames and the sequence of the video frames. The difference between the edited video and the target video is that each video frame does not include the target keying object, and the area where the target keying object is located has been removed Performed a background restoration.
在得到多个待还原视频帧之后,对每个待还原视频帧中的抠除区域进行还原处理,得到与多个待还原视频帧对应的多个已还原视频帧,将多个已还原视频帧顺序排列保存即可得到已编辑视频。其中,对抠除区域进行还原处理,即为给抠除区域填充与目标视频背景匹配的像素。After obtaining multiple to-be-restored video frames, perform restoration processing on the cutout area in each to-be-restored video frame to obtain multiple restored video frames corresponding to the multiple to-be-restored video frames, and combine the multiple restored video frames Arrange and save in order to get the edited video. Among them, performing restoration processing on the cut-out area is to fill the cut-out area with pixels that match the target video background.
本申请实施例提供的技术方案中,在检测到针对目标视频的对象抠除指令之后,首先确定需要在目标视频中抠除的目标抠除对象,然后将该目标抠除对象在每个原始视频帧中抠除,并对抠除区域进行还原处理,得到与目标视频对 应的已编辑视频,以此实现了在视频编辑中移除视频中目标对象的功能。In the technical solution provided by the embodiments of the present application, after detecting the object removal instruction for the target video, first determine the target removal object that needs to be removed in the target video, and then place the target removal object in each original video. Cut out in the frame, and restore the cut out area to obtain the edited video corresponding to the target video, thereby realizing the function of removing the target object in the video during video editing.
在一个示例性实施方式中,本实施方式在上述实施方式的基础上进行说明。其中,对每个待还原视频帧中的抠除区域进行还原处理,包括:根据多个待还原视频帧之间的差异,对每个待还原视频帧中的抠除区域进行还原处理。In an exemplary embodiment, this embodiment is described on the basis of the above-mentioned embodiment. Wherein, performing restoration processing on the cut-out area in each video frame to be restored includes: restoring the cut-out area in each video frame to be restored according to the difference between multiple video frames to be restored.
由于目标抠除对象在不同的原始视频帧的位置、形态等都不一定相同,进而将目标抠除对象在每个原始视频帧中抠除之后,多个待还原视频帧中的抠除区域的位置、形态等也不一定相同。因此,可以利用多个待还原视频帧之间抠除区域的差异对多个待还原视频帧中的抠除区域进行还原处理,以实现对抠除区域的部分清除或者全部清除。Since the position and shape of the target cutout object in different original video frames are not necessarily the same, after the target cutout object is cut out in each original video frame, the cutout area in multiple video frames to be restored is not necessarily the same. The location, form, etc. are not necessarily the same. Therefore, it is possible to perform restoration processing on the cut-out areas in the multiple to-be-restored video frames by using the difference in the cut-out areas between the multiple to-be-restored video frames, so as to realize partial or complete deletion of the cut-out areas.
例如,待还原视频帧A中的抠除区域在画面左侧,待还原视频帧B中的抠除区域在画面右侧,则可以根据待还原视频帧A的画面右侧区域对待还原视频帧B中的抠除区域进行还原处理,根据待还原视频帧B的画面左侧区域对待还原视频帧A中的抠除区域进行还原处理。For example, if the cut-out area in the video frame A to be restored is on the left side of the screen, and the cut-out area in the video frame B to be restored is on the right side of the screen, then the video frame B to be restored can be restored according to the area on the right side of the video frame A to be restored. Perform restoration processing on the cut-out area in the video frame B to be restored, and restore the cut-out area in the video frame A to be restored according to the area on the left side of the video frame B to be restored.
可以将待还原视频帧A的画面右侧区域中与待还原视频帧B中的抠除区域对应的区域,以及将待还原视频帧B的画面左侧区域中与待还原视频帧A中的抠除区域对应的区域,均称之为可还原差异区域。The area on the right side of the screen of the to-be-restored video frame A can be divided into the area corresponding to the cut-out area in the to-be-restored video frame B, and the area on the left side of the screen of the to-be-restored video frame B can be combined with the key in the to-be-restored video frame A. Except for the area corresponding to the area, it is called the reducible difference area.
可还原差异区域用于表示一个待还原视频帧中能够还原至另一个待还原视频帧中的区域,例如可还原差异区域为待还原视频帧A中能够还原至待还原视频帧B中的区域,又例如可还原差异区域为待还原视频帧B中能够还原至待还原视频帧A中的区域。The restorable difference area is used to indicate an area in a to-be-restored video frame that can be restored to another to-be-restored video frame. For example, the restorable difference area is an area in the to-be-restored video frame A that can be restored to the to-be-restored video frame B. For another example, the restorable difference area is an area in the video frame B to be restored that can be restored to the video frame A to be restored.
如果任意两个待还原视频帧之间存在可还原差异区域,则可以根据该可还原差异区域对相应的抠除区域进行还原处理。两个待还原视频帧之间存在可还原差异区域,以两个待还原视频帧分别为待还原视频帧A和待还原视频帧B为例,可以是,待还原视频帧A针对待还原视频帧B存在可还原差异区域,进而可以根据待还原视频帧A中的可还原差异区域对待还原视频帧B的抠除区域进行还原处理;也可以是,待还原视频帧B针对待还原视频帧A存在可还原差异区域,进而可以根据待还原视频帧B中的可还原差异区域对待还原视频帧A的抠除区域进行还原处理;还可以是,待还原视频帧A针对待还原视频帧B存在可还原差异区域,待还原视频帧B针对待还原视频帧A也存在可还原差异区域,进而对待还原视频帧A以及待还原视频帧B的抠除区域都可以进行还原处理。If there is a restorable difference area between any two video frames to be restored, the corresponding cut-out area can be restored according to the restorable difference area. There is a restoreable difference area between the two to-be-restored video frames. Taking the two to-be-restored video frames as the to-be-restored video frame A and the to-be-restored video frame B as an example, it may be that the to-be-restored video frame A is for the to-be-restored video frame B has a restorable difference area, and then restores the cutout area of the to-be restored video frame B according to the restorable difference area in the to-be-restored video frame A; it can also be that the to-be-restored video frame B exists for the to-be-restored video frame A The difference area can be restored, and then the cutout area of the to-be-restored video frame A can be restored according to the reducible-difference area in the to-be-restored video frame B; it can also be that the to-be-restored video frame A has a restoreable area for the to-be-restored video frame B In the difference area, the video frame B to be restored also has a difference area that can be restored for the video frame A to be restored, and the cutout areas of the video frame A to be restored and the video frame B to be restored can be restored.
作为一种可选的实施方式,在根据多个待还原视频帧之间的差异,对每个待还原视频帧中的抠除区域进行还原处理之后,如果在待还原视频帧中存在未 完成还原的抠除区域,则根据抠除区域周围像素的分布规律,对抠除区域进行像素填充。As an optional implementation manner, after performing the restoration processing on the cut-out area in each video frame to be restored based on the difference between multiple video frames to be restored, if there is an uncompleted restoration in the video frame to be restored According to the distribution rule of pixels around the cut-out area, the cut-out area is filled with pixels.
抠除区域周围像素的分布规律可以通过统计的方法确定,例如分布规律为像素的变化是平稳的,又例如分布规律为像素的变化是齐次的,其中,规则图案的像素变化是齐次的。图3为本申请实施例提供的一种有规律的像素分布示例图,图4本申请实施例提供的一种无规律的像素分布示例图。The distribution law of pixels around the cutout area can be determined by statistical methods. For example, the distribution law is that the change of pixels is stable, and the distribution law is that the change of pixels is homogeneous, and the pixel changes of the regular pattern are homogeneous. . FIG. 3 is an example diagram of a regular pixel distribution provided by an embodiment of the application, and FIG. 4 is an example diagram of an irregular pixel distribution provided by an embodiment of the application.
在一示例中,对抠除区域进行像素填充时,可以采用局部生长法,即在与周围像素保持一致性的同时,在一个像素或像素区域上生长纹理;在一示例中,对抠除区域进行像素填充时,还可以采用范例法,即搜索与缺失区块最相近的已知区块,并复制到缺失区域中。In one example, when pixel-filling the cut-out area, the local growth method can be used, that is, while maintaining consistency with the surrounding pixels, a texture is grown on a pixel or pixel area; in one example, the cut-out area When performing pixel filling, the paradigm method can also be used, that is, the known block closest to the missing block is searched and copied to the missing area.
在一示例中,首先,根据多个待还原视频帧之间的差异,对每个待还原视频帧中的抠除区域进行还原处理;其次,如果在待还原视频帧中存在未完成还原的抠除区域,继续根据抠除区域周围像素的分布规律对抠除区域进行像素填充;再次,继续根据多个待还原视频帧之间的差异,对每个待还原视频帧中的抠除区域进行还原处理。如果在待还原视频帧中依旧存在未完成还原的抠除区域,则重复上述操作,直至每个待还原视频帧中的抠除区域已被完全还原。In an example, first, according to the difference between multiple video frames to be restored, the cut-out area in each video frame to be restored is restored; Remove the area, continue to fill the removed area according to the distribution of pixels around the removed area; again, continue to restore the removed area in each to-be-restored video frame based on the difference between multiple to-be-restored video frames deal with. If there are still uncompleted cutout areas in the to-be-restored video frames, repeat the above operation until the cut-out areas in each to-be-restored video frame have been completely restored.
如图5所示,本实施方式提供的视频处理方法,包括:As shown in FIG. 5, the video processing method provided by this embodiment includes:
S210、检测到针对目标视频的对象抠除指令,确定与对象抠除指令对应的目标抠除对象。S210. Detect an object removal instruction for the target video, and determine a target removal object corresponding to the object removal instruction.
S220、对每个原始视频帧进行边缘检测,确定与每个原始视频帧对应的抠除对象模板掩膜。S220: Perform edge detection on each original video frame, and determine a cut-out object template mask corresponding to each original video frame.
S230、根据每个抠除对象模板掩膜,将目标抠除对象在原始视频帧中抠除,获取到与每个原始视频帧对应的待还原视频帧。S230: Cut out the target cutout object in the original video frame according to each cutout object template mask, and obtain a to-be-restored video frame corresponding to each original video frame.
S240、根据多个待还原视频帧之间的差异,对每个待还原视频帧中的抠除区域进行还原处理。S240: Perform restoration processing on the cut-out area in each video frame to be restored according to the difference between the multiple video frames to be restored.
作为一种可选的实施方式,根据多个待还原视频帧之间的差异,对每个待还原视频帧中的抠除区域进行还原处理,包括:As an optional implementation manner, according to the difference between a plurality of to-be-restored video frames, performing restoration processing on the cut-out area in each to-be-restored video frame includes:
依次正序和/或逆序比较前后相邻两个待还原视频帧;在第一待还原视频帧针对第二待还原视频帧存在可还原差异区域的情况下,根据可还原差异区域对第二待还原视频帧中的抠除区域进行还原处理,并更新第二待还原视频帧。其中,第一待还原视频帧和第二待还原视频帧即为前后相邻的两个待还原视频帧,第一待还原视频帧可以是前后相邻两个待还原视频帧中的前一个待还原视频帧,也可以是后一个待还原视频帧。Compare the two adjacent video frames to be restored in the forward and/or reverse order; in the case that the first to-be-restored video frame has a restorable difference area for the second to-be-restored video frame, compare the second to be restored Restore the cut-out area in the restored video frame for restoration processing, and update the second to-be-restored video frame. Among them, the first to-be-restored video frame and the second to-be-restored video frame are the two adjacent to-be-restored video frames. The restored video frame can also be the next video frame to be restored.
例如可以是,依次正序比较前后相邻两个待还原视频帧,在第一待还原视频帧针对第二待还原视频帧存在可还原差异区域的情况下,根据可还原差异区域对第二待还原视频帧中的抠除区域进行还原处理,并更新第二待还原视频帧;例如也可以是依次逆序比较前后相邻两个待还原视频帧,在第一待还原视频帧针对第二待还原视频帧存在可还原差异区域的情况下,根据可还原差异区域对第二待还原视频帧中的抠除区域进行还原处理,并更新第二待还原视频帧。For example, the two adjacent video frames to be restored are compared in a positive order. In the case that the first to-be restored video frame has a restorable difference area for the second to-be restored video frame, the second to be restored is compared according to the restorable difference area. The cut-out area in the restored video frame is restored, and the second to-be-restored video frame is updated; for example, it can also compare two adjacent to-be-restored video frames in reverse order, and the first to-be-restored video frame is for the second to be restored In the case that the video frame has a restorable difference area, the cut-out area in the second to-be-restored video frame is restored according to the restorable-difference area, and the second to-be-restored video frame is updated.
例如还可以是,先依次正序比较前后相邻两个待还原视频帧,再依次逆序比较前后相邻两个待还原视频帧,在比较的过程中,当第一待还原视频帧针对第二待还原视频帧存在可还原差异区域时,根据可还原差异区域对第二待还原视频帧中的抠除区域进行还原处理,并更新第二待还原视频帧;例如也可以是,先依次逆序比较前后相邻两个待还原视频帧,再依次正序比较前后相邻两个待还原视频帧,在比较的过程中,当第一待还原视频帧针对第二待还原视频帧存在可还原差异区域时,根据可还原差异区域对第二待还原视频帧中的抠除区域进行还原处理,并更新第二待还原视频帧。For example, it is also possible to first compare the two adjacent video frames to be restored in a positive order, and then compare the two adjacent video frames to be restored in reverse order. When there is a restoreable difference area in the video frame to be restored, restore the cutout area in the second to-be-restored video frame according to the restoreable difference area, and update the second to-be-restored video frame; for example, it can be reversed in order first Two adjacent video frames to be restored before and after, and then two adjacent video frames to be restored are compared in a positive order. During the comparison process, when the first to be restored video frame has a restoreable difference area for the second to be restored video frame At this time, the cut-out area in the second to-be-restored video frame is restored according to the restorable difference area, and the second to-be-restored video frame is updated.
在根据多个待还原视频帧之间的差异,对每个待还原视频帧中的抠除区域进行还原处理之后,还包括:After performing the restoration process on the cut-out area in each video frame to be restored based on the difference between the multiple video frames to be restored, it also includes:
在比较的任意两个待还原视频帧之间存在可还原差异区域的情况下,继续执行根据多个待还原视频帧之间的差异,对每个待还原视频帧中的抠除区域进行还原处理的操作,直至比较的任意两个待还原视频帧之间不存在可还原差异区域。In the case that there is a difference area between any two video frames to be restored that can be restored, continue to perform restoration processing on the cutout area in each video frame to be restored based on the difference between multiple video frames to be restored Until there is no reversible difference area between any two video frames to be reverted.
也即,在依次正序和/或逆序比较前后相邻两个待还原视频帧,并在第一待还原视频帧针对第二待还原视频帧存在可还原差异区域的情况下,根据可还原差异区域对第二待还原视频帧中的抠除区域进行还原处理,及更新第二待还原视频帧之后,还包括:That is, in order to compare two adjacent video frames to be restored in the forward and/or reverse order, and in the case that the first to-be-restored video frame has a restorable difference area for the second to-be-restored video frame, according to the restorable difference The area restores the cut-out area in the second to-be-restored video frame, and after updating the second to-be-restored video frame, it also includes:
在比较的任意两个待还原视频帧之间存在可还原差异区域的情况下,继续执行“依次正序和/或逆序比较前后相邻两个待还原视频帧;在第一待还原视频帧针对第二待还原视频帧存在可还原差异区域的情况下,根据可还原差异区域对第二待还原视频帧中的抠除区域进行还原处理,并更新第二待还原视频帧”的操作,如此循环,直至比较的任意两个待还原视频帧之间不存在可还原差异区域,也即直至确定无法对任意一个待还原视频帧进行还原处理。In the case that there is a difference area between any two video frames to be restored to be restored, continue to perform "Sequentially compare the two adjacent video frames to be restored in the forward and/or reverse order; in the first video frame to be restored, In the case that the second to-be-restored video frame has a restorable difference area, restore the cutout area in the second to-be-restored video frame according to the restorable difference area, and update the second to-be-restored video frame" operation, and so on , Until there is no restorable difference area between any two to-be-restored video frames that are compared, that is, until it is determined that any of the to-be-restored video frames cannot be restored.
可选的,在执行完“依次正序和/或逆序比较前后相邻两个待还原视频帧;在第一待还原视频帧针对第二待还原视频帧存在可还原差异区域的情况下,根据可还原差异区域对第二待还原视频帧中的抠除区域进行还原处理,并更新第二待还原视频帧”的操作之后,判断进行比较的两个待还原视频帧之间是否不 存在可还原差异区域,若比较的两个待还原视频帧之间存在可还原差异区域,则循环执行“依次正序和/或逆序比较前后相邻两个待还原视频帧;在第一待还原视频帧针对第二待还原视频帧存在可还原差异区域的情况下,根据可还原差异区域对第二待还原视频帧中的抠除区域进行还原处理,并更新第二待还原视频帧”的操作,若比较的两个待还原视频帧之间均不存在可还原差异区域,则退出循环流程。Optionally, after performing "Sequentially compare two adjacent video frames to be restored in the forward and/or reverse order; in the case that the first to-be-restored video frame has a restorable difference area with respect to the second to-be-restored video frame, according to Recoverable difference area: After the operation of "recovering the cut-out area in the second to-be-reverted video frame, and update the second to-be-reverted video frame", determine whether there is no recoverable between the two to-be-reverted video frames to be compared. Difference area, if there is a reversible difference area between the two to-be-restored video frames to be compared, the “sequential positive and/or reverse-order comparison of two adjacent to-be-restored video frames is performed sequentially; In the case that the second to-be-restored video frame has a restorable difference area, restore the cutout area in the second to-be-restored video frame according to the restorable difference area, and update the second to-be-restored video frame" operation, if you compare If there is no reversible difference area between the two to-be-restored video frames, the loop process is exited.
以先依次正序比较,再依次逆序比较前后相邻两个待还原视频帧为例,进行说明:Take the first comparison in positive order, and then the comparison in reverse order of two adjacent video frames to be restored as an example to illustrate:
依次正序比较前后两个待还原视频帧;在第一待还原视频帧针对第二待还原视频帧存在可还原差异区域的情况下,根据所述可还原差异区域对第二待还原视频帧中的抠除区域进行还原处理,并更新第二待还原视频帧;在第二待还原视频帧针对第一待还原视频帧存在可还原差异区域的情况下,根据所述可还原差异区域对第一待还原视频帧中的抠除区域进行还原处理,并更新第一待还原视频帧;依次逆序比较前后两个待还原视频帧;在第二待还原视频帧针对第一待还原视频帧存在可还原差异区域的情况下,根据所述可还原差异区域对第一待还原视频帧中的抠除区域进行还原处理,并更新第一待还原视频帧;在第一待还原视频帧针对第二待还原视频帧存在可还原差异区域的情况下,根据所述可还原差异区域对第二待还原视频帧中的抠除区域进行还原处理,并更新第二待还原视频帧;在比较的任意两个所述待还原视频帧之间存在所述可还原差异区域的情况下,重复上述流程,直至比较的任意两个所述待还原视频帧之间均不存在所述可还原差异区域。Compare the two to-be-restored video frames before and after in positive order; in the case that the first to-be-restored video frame has a restorable difference area for the second to-be-restored video frame, compare the second to-be-restored video frame according to the restorable difference area Perform restoration processing on the cut-out area of, and update the second to-be-restored video frame; in the case that the second to-be-restored video frame has a restorable difference area for the first to-be-restored video frame, the first to be restored difference area is compared to the first The cut-out area in the video frame to be restored is restored, and the first video frame to be restored is updated; the two video frames to be restored before and after are compared in reverse order; the second video frame to be restored exists for the first to be restored video frame that can be restored In the case of a difference area, restore the cutout area in the first to-be-restored video frame according to the reversible difference area, and update the first to-be-restored video frame; the first to-be-restored video frame is for the second to be restored In the case that the video frame has a restorable difference area, restore the cut-out area in the second to-be-restored video frame according to the restorable difference area, and update the second to-be-restored video frame; in any two comparisons In the case where there is the reducible difference area between the video frames to be restored, the above process is repeated until the reducible difference area does not exist between any two of the compared video frames to be restored.
首先,正序获取目标视频的前两个待还原视频帧,即第1个待还原视频帧和第2个待还原视频帧,比较这两个待还原视频帧之间是否存在可还原差异区域。若第1个待还原视频帧针对第2个待还原视频帧存在可还原差异区域,则根据该可还原差异区域对第2个待还原视频帧的抠除区域进行还原处理,并更新第2个待还原视频帧;若第2个待还原视频帧针对第1个待还原视频帧存在可还原差异区域,则根据该可还原差异区域对第1个待还原视频帧的抠除区域进行还原处理,并更新第1个待还原视频帧。在处理完成第1个待还原视频帧和第2个待还原视频帧之后,继续正序获取下一个待还原视频帧进行比较,也即比较第2个待还原视频帧和第3个待还原视频帧之间是否存在可还原差异区域。若比较两个待还原视频帧之间不存在可还原差异区域,则直接正序获取下一个待还原视频帧进行比较,直至正序处理完最后一个待还原视频帧(即第N个待还原视频帧,假设目标视频共有N个视频帧)。First, the first two video frames to be restored of the target video are obtained in a positive sequence, that is, the first video frame to be restored and the second video frame to be restored, and the difference between the two to be restored video frames is compared. If the first to-be-restored video frame has a restorable difference area for the second to-be-restored video frame, restore the cutout area of the second to-be-restored video frame according to the restorable difference area, and update the second The video frame to be restored; if the second video frame to be restored has a restorable difference area for the first video frame to be restored, the cutout area of the first video frame to be restored is restored according to the restorable difference area, And update the first video frame to be restored. After processing the first video frame to be restored and the second video frame to be restored, continue to obtain the next video frame to be restored for comparison, that is, compare the second video frame to be restored and the third video frame to be restored Whether there is a reversible difference area between frames. If there is no restorable difference area between the two video frames to be restored, the next video frame to be restored is directly obtained in the positive sequence for comparison, until the last video frame to be restored is processed in the positive sequence (that is, the Nth video to be restored) Frame, assuming that the target video has N video frames).
然后,逆序获取目标视频的最后两个待还原视频帧,即第N个待还原视频 帧和第N-1个待还原视频帧,比较这两个待还原视频帧之间是否存在可还原差异区域。若第N个待还原视频帧针对第N-1个待还原视频帧存在可还原差异区域,则根据该可还原差异区域对第N-1个待还原视频帧的抠除区域进行还原处理,并更新第N-1个待还原视频帧;若第N-1个待还原视频帧针对第N个待还原视频帧存在可还原差异区域,则根据该可还原差异区域对第N个待还原视频帧的抠除区域进行还原处理,并更新第N个待还原视频帧。在处理完成第N个待还原视频帧和第N-1个待还原视频帧之后,继续逆序获取下一个待还原视频帧进行比较,也即比较第N-1个待还原视频帧和第N-2个待还原视频帧之间是否存在可还原差异区域。若比较两个待还原视频帧之间不存在可还原差异区域,则直接逆序获取下一个待还原视频帧进行比较,直至逆序处理完最后一个待还原视频帧(即第1个待还原视频帧)。Then, obtain the last two video frames to be restored of the target video in reverse order, that is, the Nth video frame to be restored and the N-1th video frame to be restored, and compare whether there is a restoreable difference area between the two to be restored video frames . If the Nth video frame to be restored has a restorable difference area for the N-1th video frame to be restored, the cutout area of the N-1th video frame to be restored is restored according to the restorable difference area, and Update the N-1th to-be-restored video frame; if the N-1th to-be-restored video frame has a restorable difference area for the Nth to-be-restored video frame, then the Nth to-be-restored video frame is based on the restorable difference area Perform restoration processing on the cut-out area of, and update the Nth to-be-restored video frame. After the Nth video frame to be restored and the N-1th video frame to be restored are processed, the next video frame to be restored is obtained in reverse order for comparison, that is, the N-1th video frame to be restored is compared with the N-th video frame to be restored. Whether there is a reversible difference area between the 2 video frames to be reverted. If there is no restorable difference area between the two video frames to be restored, the next video frame to be restored is directly obtained in reverse order for comparison, until the last video frame to be restored is processed in reverse order (that is, the first video frame to be restored) .
循环执行上述流程,直至确定无法对任意一个待还原视频帧进行还原处理,也即进行比较的两个待还原视频帧之间不存在可还原差异区域。The above process is executed in a loop until it is determined that the restoration processing cannot be performed on any one of the to-be-restored video frames, that is, there is no restorable difference area between the two to-be-restored video frames to be compared.
在一示例中,可以对一次循环处理(包括正序和逆序)中的还原处理次数进行记录,并在下一次循环处理开始前对还原次数进行清零处理。当一次循环处理结束时,如还原处理次数为零,则退出循环,如果还原处理次数大于零,则进入下一次循环处理。In an example, it is possible to record the number of reduction processes in one cycle process (including the positive sequence and the reverse sequence), and to clear the number of reduction processes before the start of the next cycle process. When one cycle of processing ends, if the number of reduction processing times is zero, the cycle is exited, and if the number of reduction processing times is greater than zero, the next cycle processing is entered.
在一种示例中,比较两个待还原视频帧之间是否存在可还原差异区域时,可以首先计算两个待还原视频帧之间是否存在重合区域。In an example, when comparing whether there is a reducible difference area between two to-be-restored video frames, it may first be calculated whether there is an overlap area between the two to-be-restored video frames.
如果二者之间不存在重合区域,则确定二者之间不存在可还原差异区域。其中,重合区域指的是两个待还原视频帧之间一致的区域,参照图6和图7所示的待还原视频帧,图6中左侧用方框60标识的区域与图7右侧用方框70标识的区域即为图6和图7所示的待还原视频帧之间的重合区域。由于视频拍摄过程中会移动,故在进行视频还原时,可以将重合区域作为还原参考。If there is no overlapping area between the two, it is determined that there is no reducible difference area between the two. Among them, the overlap area refers to the same area between the two to-be-restored video frames. Referring to the to-be-restored video frames shown in FIG. 6 and FIG. 7, the area marked by the box 60 on the left in FIG. The area identified by the box 70 is the overlap area between the to-be-restored video frames shown in FIG. 6 and FIG. 7. Since the video will move during shooting, the overlapped area can be used as a reference for restoration when restoring the video.
如果二者之间存在重合区域,则参考重合区域确定二者之间是否存在可还原差异区域。参照图8和图9所示的待还原视频帧,图8和图9中上侧区域即为重合区域,进而图8和图9下侧区域可用于抠除区域还原,图9中下侧用方框90标识的区域即为针对图8所示的待还原视频帧的可还原差异区域,可以还原至图8中的下侧区域。在二者之间存在重合区域的情况下,如果一个待还原视频帧中没有抠除区域,则可以根据该待还原视频帧中与另一个待还原视频帧的抠除区域对应的区域,直接对另一个待还原视频帧的抠除区域进行还原。If there is an overlap area between the two, refer to the overlap area to determine whether there is a reducible difference area between the two. Referring to the to-be-restored video frames shown in Figures 8 and 9, the upper area in Figures 8 and 9 is the overlap area, and the lower area in Figures 8 and 9 can be used to cut out the area to restore, and the lower side in Figure 9 is used The area identified by the box 90 is the reducible difference area for the to-be-restored video frame shown in FIG. 8, which can be restored to the lower area in FIG. 8. In the case of overlapping areas between the two, if there is no cutout area in a to-be-restored video frame, you can directly check the area in the to-be-restored video frame that corresponds to the cut-out area of the other to-be-restored video frame. The cut-out area of another video frame to be restored is restored.
S250、在待还原视频帧中存在未完成还原的抠除区域的情况下,根据抠除区域周围像素的分布规律,对抠除区域进行像素填充,得到与每个待还原视频帧对应的已还原视频帧。S250. In the case that there is a cutout area in the to-be-restored video frame that has not been restored, fill the cutout area with pixels according to the distribution law of pixels around the cut-out area to obtain a restored area corresponding to each to-be-restored video frame Video frame.
可选的,在根据抠除区域周围像素的分布规律,对抠除区域进行像素填充之后,还可以对每个已还原视频帧中原有的抠除区域边缘进行图像平滑性处理,以提升处理后的视频质量。Optionally, after filling the cutout area according to the distribution of pixels around the cutout area, you can also perform image smoothness processing on the original cutout area edge in each restored video frame to improve the post-processing Video quality.
S260、将多个已还原视频帧顺序存储,得到与目标视频对应的已编辑视频。S260. Store multiple restored video frames sequentially to obtain an edited video corresponding to the target video.
在另一个示例性实施方式中,对每个待还原视频帧中的抠除区域进行还原处理,包括:将每个待还原视频帧进行帧区块划分,得到与多个待还原视频帧分别对应的多个目标帧区块;根据多个目标帧区块在连续多个待还原视频帧中的分布情况,对每个待还原视频帧中的抠除区域进行还原处理。In another exemplary embodiment, performing restoration processing on the cut-out area in each to-be-restored video frame includes: dividing each to-be-restored video frame into frame blocks to obtain the respective corresponding to the multiple to-be-restored video frames According to the distribution of the multiple target frame blocks in multiple consecutive video frames to be restored, the cutout area in each video frame to be restored is restored.
每个待还原视频帧进行帧区块划分,可以得到与每个待还原视频帧对应的目标帧区块,根据多个待还原视频帧的排列顺序,以及多个目标帧区块在连续多个待还原视频帧中的分布情况,即可得到多个目标帧区块在视频帧中的运动轨迹。进而,在对抠除区域进行还原处理时,可以根据多个目标帧区块在视频帧中的运动轨迹确定与抠除区域对应的一个目标帧区块,并根据该目标帧区块对抠除区域进行还原处理。Each video frame to be restored is divided into frame blocks, and the target frame block corresponding to each video frame to be restored can be obtained. The distribution of the video frames to be restored can be used to obtain the motion trajectories of multiple target frame blocks in the video frame. Furthermore, when the cut-out area is restored, a target frame block corresponding to the cut-out area can be determined according to the motion trajectory of multiple target frame blocks in the video frame, and the cut-out area can be cut out according to the target frame block. The area is restored.
可选的,为每个目标帧区块建立块索引并进行运动轨迹的记录。其中,记录每个目标帧区块在每个视频帧中的块位置信息,并保存这个目标帧区块的块位置信息,以使在对抠除区域进行还原处理时,可以根据块位置信息去匹配缺失的目标帧区块,以实现对抠除区域的还原处理。Optionally, a block index is established for each target frame block and the movement track is recorded. Among them, the block position information of each target frame block in each video frame is recorded, and the block position information of this target frame block is saved, so that when the cut-out area is restored, the block position information can be retrieved according to the block position information. Match the missing target frame block to realize the restoration processing of the cut-out area.
作为一种可选的实施方式,在根据多个目标帧区块在连续多个所述待还原视频帧中的分布情况,对每个待还原视频帧中的抠除区域进行还原处理之后,在待还原视频帧中存在未完成还原的抠除区域的情况下,根据抠除区域周围像素的分布规律,对抠除区域进行像素填充。As an optional implementation manner, after performing restoration processing on the cut-out area in each to-be-restored video frame according to the distribution of multiple target frame blocks in the plurality of consecutive to-be-restored video frames, When there is a cutout area that has not been restored in the video frame to be restored, the cutout area is filled with pixels according to the distribution law of pixels around the cutout area.
在上述技术方案中,对每个待还原视频帧进行多次背景还原,提高了视频帧还原的准确性,也保证了视频帧的还原效果。In the above technical solution, multiple background restorations are performed on each video frame to be restored, which improves the accuracy of the restoration of the video frame and also guarantees the restoration effect of the video frame.
在一个示例性实施方式中,电子设备的操作系统为android系统,对象识别算法为OpenCV的AI对象识别算法,目标视频为固定场景(如公园、操场等)中人物运动的视频,目标抠除对象为人物对象,得到的已编辑视频为固定场景。In an exemplary embodiment, the operating system of the electronic device is the android system, the object recognition algorithm is the AI object recognition algorithm of OpenCV, the target video is a video of people moving in a fixed scene (such as a park, a playground, etc.), and the target is removed. Is a character object, and the obtained edited video is a fixed scene.
可选的,如图10所示,将本实施方式提供的视频编辑方法可以包装成如下四个功能模块:对象识别功能模块、对象边缘检测功能模块、抠除区域还原功能模块以及移出对象动画生成功能模块。Optionally, as shown in FIG. 10, the video editing method provided by this embodiment can be packaged into the following four functional modules: an object recognition function module, an object edge detection function module, a cut-out area restoration function module, and an object removal animation generation functional module.
在一示例中,对象识别功能模块主要设置为完成对当前显示视频帧的定位功能以及针对当前显示视频帧的对象识别功能。In an example, the object recognition function module is mainly set to complete the positioning function of the currently displayed video frame and the object recognition function for the currently displayed video frame.
对当前显示视频帧的定位功能需要结合用户的操作。在视频编辑界面中,用户发现目标视频界面中存在想要移除的对象时执行暂停视频播放的操作,当监测到目标视频被暂停播放时,对当前显示视频帧进行定位,可以定义当前显示视频帧为Current_Frame。可选的,将当前显示视频帧保存为位图(Bitmap)类型数据,并传递给对象识别功能接口,以实现对当前视频显示帧Current_Frame的对象识别,得到当前视频显示帧Current_Frame包含的对象集合。The positioning function of the currently displayed video frame needs to be combined with the user's operation. In the video editing interface, when the user finds that there is an object to be removed in the target video interface, the user executes the operation of pausing the video playback. When the target video is monitored to be paused, the currently displayed video frame is located and the current displayed video can be defined The frame is Current_Frame. Optionally, save the currently displayed video frame as bitmap (Bitmap) type data and pass it to the object recognition function interface to realize the object recognition of the current video display frame Current_Frame, and obtain the set of objects contained in the current video display frame Current_Frame.
可选的,在实现对当前显示视频帧的对象识别功能时,通过对象识别功能接口的AI算法根据接收的Bitmap数据,识别出Bitmap中的对象,并将多个对象进行标注,确定出多个对象区域,可以定义一个对象数据为Identify_Object_Rect,Identify_Object_Rect中例如可以包含:对象ID、对象名称、对象区域位置。识别到的多个对象信息构成对象识别结果,可以定义对象识别结果为Identify_Objects,也即Identify_Objects是包含一个或多个Identify_Object_Rect的集合。Optionally, when implementing the object recognition function of the currently displayed video frame, the AI algorithm through the object recognition function interface recognizes the objects in the Bitmap according to the received Bitmap data, and labels multiple objects to determine multiple objects. For the object area, an object data can be defined as Identify_Object_Rect, and the Identify_Object_Rect can include, for example, the object ID, the object name, and the location of the object area. The multiple identified object information constitutes the object recognition result, which can be defined as Identify_Objects, that is, Identify_Objects is a collection containing one or more Identify_Object_Rect.
在一示例中,对象识别功能模块的处理流程可以包括:In an example, the processing flow of the object recognition function module may include:
S11、启动视频浏览播放,检测针对目标视频的外部定位事件。其中,外部定位事件为用户触发的、用于选择一个视频帧的事件。S11. Start video browsing and playback, and detect an external positioning event for the target video. Among them, the external positioning event is an event triggered by the user and used to select a video frame.
S12、收到外部定位事件,暂停播放,确定当前显示视频帧Current_Frame。S12. When an external positioning event is received, the playback is paused, and the current display video frame Current_Frame is determined.
S13、将当前显示视频帧Current_Frame保存为Bitmap数据。S13. Save the currently displayed video frame Current_Frame as Bitmap data.
S14、将Bitmap数据传递到对象识别功能接口,通过AI算法进行对象识别。S14. Pass the Bitmap data to the object recognition function interface, and perform object recognition through the AI algorithm.
S15、获取与当前显示视频帧对应的对象识别结果,包括对象名称和对象区域位置。S15. Obtain an object recognition result corresponding to the currently displayed video frame, including the object name and the position of the object area.
S16、保存对象识别结果。S16. Save the object recognition result.
在一示例中,对象边缘检测功能模块主要设置为完成目标抠除对象的确定以及待还原视频帧和抠除对象视频帧的分离。In an example, the object edge detection function module is mainly set to complete the determination of the target to be removed and the separation of the video frame to be restored and the video frame of the removed object.
可选的,用户在当前显示视频帧中选择需要移除的目标抠除对象,可选的,检测用户在当前显示视频帧Current_Frame中触发的坐标信息,例如检测用户手指触摸屏幕的坐标(Mx,My),在Identify_Objects中确定与(Mx,My)对应的目标抠除对象Edit_Object。Optionally, the user selects the target to be removed in the currently displayed video frame. Optionally, detects the coordinate information triggered by the user in the currently displayed video frame Current_Frame, such as detecting the coordinates of the user's finger touching the screen (Mx, My), in Identify_Objects, determine the target editing object Edit_Object corresponding to (Mx, My).
可选的,在确定目标抠除对象之后,使用边缘检测算法对当前显示视频帧Current_Frame进行边缘检测,得到与目标抠除对象Edit_Object对应的抠除对象边缘检测模板Edit_Template。并对当前显示视频帧Current_Frame进行分离,分离出一个只包含目标抠除对象Edit_Object的Bitmap(可以定义为 Edit_Crop_Object)和一个不包含目标抠除对象Edit_Object的Bitmap(可以定义为Edit_Save_Object)。Optionally, after determining the target cutout object, edge detection is performed on the current display video frame Current_Frame using an edge detection algorithm to obtain the cutout object edge detection template Edit_Template corresponding to the target cutout object Edit_Object. Separate the currently displayed video frame Current_Frame, and separate a Bitmap (which can be defined as Edit_Crop_Object) that only contains the target cutout object Edit_Object, and a Bitmap (which can be defined as Edit_Save_Object) that does not contain the target cutout object Edit_Object.
定位到除当前显示视频帧Current_Frame之外的其他视频帧,分别对每一个其他视频帧进行边缘检测,并使用抠除对象边缘检测模板Edit_Template对每个边缘检测结果进行匹配,匹配成功的区域就是对应的其他视频帧中需要抠除的对象区域。并对相应的每个其他视频帧进行分离,分离方法与Current_Frame的方法一致,对应得到一个只包含目标抠除对象Edit_Object的Bitmap(可以定义为Edit_Crop_Object)和一个不包含目标抠除对象Edit_Object的Bitmap(可以定义为Edit_Save_Object)。Locate other video frames except the currently displayed video frame Current_Frame, perform edge detection on each other video frame, and use the cut-out object edge detection template Edit_Template to match each edge detection result. The area that is successfully matched is the corresponding The area of the object that needs to be cut out in other video frames. Separate each other corresponding video frame. The separation method is the same as the Current_Frame method. Correspondingly, a Bitmap (which can be defined as Edit_Crop_Object) containing only the target cut object Edit_Object and a Bitmap (which does not contain the target cut object Edit_Object) Can be defined as Edit_Save_Object).
可选的,为每个视频帧(包括Current_Frame和其他视频帧)分别定义一个匹配的抠除对象模板掩膜Template_Mask,如图2所示,在抠除对象模板掩膜Template_Mask中,目标抠除对象所处区域中的像素值可以设置为1(或255),其余区域的像素值可以设置为0。Optionally, define a matching cutout object template mask Template_Mask for each video frame (including Current_Frame and other video frames), as shown in Figure 2, in the cutout template mask Template_Mask, the target cutout object The pixel value in the area can be set to 1 (or 255), and the pixel value of the remaining area can be set to 0.
相应的,抠除对象视频帧CropRect=Template_Mask&Edit_Frame;待还原视频帧SaveRect=!Template_Mask&Edit_Frame;其中,“&”代表对应位置的数据进行相乘,Edit_Frame中目标像素点的值,如果与Template_Mask的“0”相乘,则变成0,如果与Template_Mask的“1”相乘,则值不变;“!”代表对Template_Mask进行取反操作,目标抠除对象所处区域中的像素值变为0,其余区域的像素值变为1。Correspondingly, cut out the target video frame CropRect=Template_Mask&Edit_Frame; the to-be-restored video frame SaveRect=! Template_Mask&Edit_Frame; where "&" represents the data of the corresponding position to be multiplied, the value of the target pixel in Edit_Frame, if it is multiplied by the "0" of Template_Mask, it becomes 0, and if it is multiplied by the "1" of Template_Mask, then The value remains unchanged; "!" represents the inverse operation of Template_Mask, the pixel value in the area where the target cutout object is located becomes 0, and the pixel value of the remaining areas becomes 1.
在一示例中,抠除区域还原功能模块主要完成待还原视频帧中抠除区域的还原功能。其中,还原功能可以通过帧间还原或帧区块还原来实现,还可以通过帧间还原以及推测还原来实现,或者通过帧区块还原以及推测还原来实现。其中,帧间还原,指的是根据多个待还原视频帧之间的差异,对每个待还原视频帧中的抠除区域进行还原处理。由于目标抠除对象在不同视频帧中可能存在移动现象,这样目标抠除对象后面的背景就可以显现出来,即可对其他视频帧进行相应的还原,参照图8和图9,图9中下侧用方框90标识的区域即可还原至图8中的下侧区域。In an example, the cut-out area restoration function module mainly completes the restoration function of the cut-out area in the video frame to be restored. Among them, the restoration function can be realized by inter-frame restoration or frame block restoration, and can also be realized by inter-frame restoration and speculative restoration, or by frame block restoration and speculative restoration. Among them, restoring between frames refers to restoring the cutout area in each video frame to be restored based on the difference between multiple video frames to be restored. Since the target cutout object may move in different video frames, the background behind the target cutout object can be revealed, and other video frames can be restored accordingly. Refer to Figure 8 and Figure 9, the bottom of Figure 9 The area marked by the box 90 on the side can be restored to the lower area in FIG. 8.
在一示例中,帧间还原的处理流程可以包括:In an example, the processing flow of restoring between frames may include:
S21、正序获取目标视频的前两个待还原视频帧SaveRect进行对比,也即对比Edit_Save_Object。S21: Obtain the first two to-be-restored video frames SaveRect of the target video in a positive sequence for comparison, that is, compare Edit_Save_Object.
S22、如果两个待还原视频帧之间存在可还原差异区域,则根据可还原差异区域对待还原视频帧进行相应还原处理,并更新还原次数edit_count,执行S23;如果两个待还原视频帧之间不存在可还原差异区域,则直接执行S23。S22. If there is a restoreable difference area between the two to-be-restored video frames, perform corresponding restoration processing on the to-be-restored video frame according to the restoreable difference area, and update the restore times edit_count, and execute S23; if there is a difference between the two to-be-restored video frames If there is no reversible difference area, S23 is executed directly.
可选的,还原次数edit_count的初始值为零。Optionally, the initial value of the number of restores edit_count is zero.
S23、获取目标视频的下一个待还原视频帧SaveRect,与前一个待还原视频帧SaveRect进行对比,执行S22,直到处理完目标视频的最后一个待还原视频帧。S23. Obtain the next video frame SaveRect to be restored of the target video, compare it with the previous video frame SaveRect to be restored, and execute S22 until the last video frame to be restored of the target video is processed.
S24、逆序获取目标视频的前两个待还原视频帧SaveRect进行对比,执行S22,当处理完成目标视频的最后一个待还原视频帧时,执行S25。S24. Obtain the first two to-be-restored video frames of the target video in reverse order, SaveRect, and perform S22, and when the processing of the last to-be-restored video frame of the target video is completed, perform S25.
S25、判断edit_count是否大于0,如果edit_count大于0,则初始化edit_count,并返回执行S21,如果edit_count等于0,则退出帧间还原处理流程。S25: Determine whether edit_count is greater than 0, if edit_count is greater than 0, initialize edit_count, and return to execute S21, and if edit_count is equal to 0, exit the inter-frame restoration processing flow.
在比较两个待还原视频帧之间是否存在可还原差异区域时,可以首先计算两个待还原视频帧之间是否存在重合区域。参照图6和图7所示的待还原视频帧,图6中左侧用方框60标识的区域与图7右侧用方框70标识的区域即为图6和图7所示的待还原视频帧之间的重合区域。如果二者之间不存在重合区域,则确定二者之间不存在可还原差异区域;如果二者之间存在重合区域,则参考重合区域确定二者之间是否存在可还原差异区域。参照图8和图9所示的待还原视频帧,图8和图9中上侧区域即为重合区域,进而图8和图9下侧区域可用于抠除区域还原,图9中下侧用方框90标识的区域即为针对图8所示的待还原视频帧的可还原差异区域,可以还原至图8中的下侧区域。在二者之间存在重合区域的情况下,如果一个待还原视频帧中没有抠除区域,则可以根据该待还原视频帧中与另一个待还原视频帧的抠除区域对应的区域,直接对另一个待还原视频帧的抠除区域进行还原。When comparing whether there is a reducible difference area between two video frames to be restored, it can first calculate whether there is an overlapping area between the two video frames to be restored. Referring to the to-be-restored video frames shown in FIGS. 6 and 7, the area marked by the box 60 on the left side of FIG. 6 and the area marked by the box 70 on the right side of FIG. The overlap area between video frames. If there is no overlapping area between the two, then it is determined that there is no reducible difference area between the two; if there is an overlapping area between the two, then refer to the overlapping area to determine whether there is a reducible difference area between the two. Referring to the to-be-restored video frames shown in Figures 8 and 9, the upper area in Figures 8 and 9 is the overlap area, and the lower area in Figures 8 and 9 can be used to cut out the area to restore, and the lower side in Figure 9 is used The area identified by the box 90 is the reducible difference area for the to-be-restored video frame shown in FIG. 8, which can be restored to the lower area in FIG. 8. In the case of overlapping areas between the two, if there is no cutout area in a to-be-restored video frame, you can directly check the area in the to-be-restored video frame that corresponds to the cut-out area of the other to-be-restored video frame. The cut-out area of another video frame to be restored is restored.
帧区块还原,指的是将每个待还原视频帧进行帧区块划分,得到与多个待还原视频帧分别对应的多个目标帧区块;根据与多个待还原视频帧分别对应的多个目标帧区块之间的匹配情况,对每个待还原视频帧中的抠除区域进行还原处理。Frame block restoration refers to dividing each video frame to be restored into frame blocks to obtain multiple target frame blocks corresponding to the multiple video frames to be restored; according to the respective corresponding to the multiple video frames to be restored For the matching between multiple target frame blocks, the cutout area in each video frame to be restored is restored.
每个待还原视频帧进行帧区块划分,可以得到与每个待还原视频帧对应的目标帧区块RectBlock,可选的,为每个目标帧区块建立块索引BlockIndex并进行运动轨迹的记录。其中,记录每个目标帧区块RectBlock在每个视频帧中的块位置信息BlockData,并保存这个目标帧区块的块位置信息BlockData,以使在对抠除区域进行还原处理时,可以根据块位置信息BlockData去匹配缺失的目标帧区块RectBlock,以实现对抠除区域的还原处理。Each video frame to be restored is divided into frame blocks, and the target frame block RectBlock corresponding to each video frame to be restored can be obtained. Optionally, a block index BlockIndex is established for each target frame block and the movement track is recorded . Among them, the block position information BlockData of each target frame block RectBlock in each video frame is recorded, and the block position information BlockData of this target frame block is saved, so that when the cutout area is restored, the block data can be The location information BlockData is used to match the missing target frame block RectBlock to realize the restoration processing of the cutout area.
可选的,在对多个待还原视频帧进行帧间还原或者帧区块还原处理之后,如果在待还原视频帧中存在未完成还原的抠除区域,则继续对待还原视频帧进行推测还原处理。Optionally, after performing inter-frame restoration or frame block restoration processing on multiple to-be-restored video frames, if there is a cutout area in the to-be-restored video frame that has not been restored, continue speculative restoration of the to-be-restored video frame .
推测还原,指的是根据抠除区域周围像素的分布规律,对抠除区域进行像素填充。其中,抠除区域周围像素的分布规律可以通过统计的方法确定,例如分布规律为像素的变化是平稳的,又例如分布规律为像素的变化是齐次的,其中,规则图案的像素变化是齐次的。图3示出了一种有规律的像素分布,图4示出了一种无规律的像素分布。Speculative restoration refers to the pixel filling of the cut-out area according to the distribution law of the pixels around the cut-out area. Among them, the distribution law of pixels around the cutout area can be determined by statistical methods. For example, the distribution law is that the change of pixels is stable, and the distribution law is that the change of pixels is homogeneous. Among them, the change of pixels in a regular pattern is uniform. Times. Fig. 3 shows a regular pixel distribution, and Fig. 4 shows an irregular pixel distribution.
可选的,采用局部生长法或范例法来实现推测还原。局部生长法,即在与周围像素保持一致性的同时,在一个像素或像素区域上生长纹理;范例法,即搜索与缺失区块最相近的已知区块,并复制到缺失区域中。Optionally, a local growth method or a paradigm method is used to achieve speculative reduction. The local growth method is to grow a texture on a pixel or pixel area while maintaining consistency with the surrounding pixels; the paradigm method is to search for the known block closest to the missing block and copy it to the missing area.
在一示例中,推测还原的处理流程可以包括:In an example, the processing flow of speculative restoration may include:
S31、顺序获取一个待还原视频帧,确定其抠除区域Lack_Rect。S31. Obtain a video frame to be restored in sequence, and determine its cut-out area Lack_Rect.
S32、分析抠除区域Lack_Rect周围的像素分布规律。S32. Analyze the pixel distribution law around the Lack_Rect of the cut-out area.
S33、根据像素分布规律确定对应的修补方法,例如是局部生长法或者范例法。S33: Determine a corresponding repair method according to the pixel distribution law, for example, a local growth method or a paradigm method.
S34、根据确定的修补方法对该待还原视频帧的抠除区域进行还原处理。S34: Perform restoration processing on the cut-out area of the to-be-restored video frame according to the determined repair method.
S35、返回执行S31,直至完成对其他待还原视频帧的推测还原处理。S35. Return to S31 until the speculative restoration processing of other video frames to be restored is completed.
S36、对这些待还原视频帧进行帧间还原处理。S36: Perform inter-frame restoration processing on the video frames to be restored.
S37、检测多个待还原视频帧中是否还存在抠除区域,若多个待还原视频帧中还存在抠除区域,则执行S31,若多个待还原视频帧中不存在抠除区域,退出还原流程。S37. Detect whether there is a cutout area in the multiple to-be-restored video frames, if there is a cut-out area in the multiple to-be-restored video frames, execute S31, if there is no cutout area in the multiple to-be-restored video frames, exit Restore process.
在一示例中,移出对象动画生成功能模块主要完成生成目标抠除对象移出视频编辑区域动画的功能。其中,可以根据目标抠除对象在当前显示视频帧中的位置以及动画时长计算目标抠除对象Edit_Object的移动速度,也可以通过定义速度变化曲线来确定目标抠除对象Edit_Object移动到的位置。In an example, the object-moving-out animation generating function module mainly completes the function of generating an animation of the target-cut-out object moving out of the video editing area. Wherein, the moving speed of the target editing object Edit_Object can be calculated according to the position of the target cutting object in the currently displayed video frame and the animation duration, and the position of the target editing object Edit_Object can also be determined by defining the speed change curve.
可选的,一个移动位置函数,P(x,y)=f(t,l),其中,P(x,y)表示目标抠除对象在待还原视频帧中的显示位置,t表示开始生成动画时刻至当前时刻的时间段,l表示目标抠除对象原位置至视频帧设定边界的距离。Optionally, a moving position function, P(x,y)=f(t,l), where P(x,y) represents the display position of the target to be removed in the video frame to be restored, and t represents the start of generation The time period from the animation moment to the current moment, l represents the distance from the original position of the target to be cut out to the set boundary of the video frame.
在一示例中,用户手指触摸屏幕后,以检测到手指移动事件ACTION_MOVE为开始点启动动画,处理流程包括:In one example, after the user's finger touches the screen, the animation starts with the detection of the finger movement event ACTION_MOVE as the starting point. The processing flow includes:
S41、检测到手指移动事件ACTION_MOVE事件,启动动画。S41. The ACTION_MOVE event of the finger movement event is detected, and the animation is started.
S42、启动定时刷新通知流程。S42. Start the regular refresh notification process.
S43、检测到定时刷新事件,根据移动位置函数P(x,y)=f(t,l),得到目标抠除 对象在待还原视频帧中的显示位置。S43. Detect a timing refresh event, and obtain the display position of the target cutout object in the to-be-restored video frame according to the moving position function P(x,y)=f(t,l).
S44、在P(x,y)处绘制目标抠除对象。S44. Draw the target cutout object at P(x, y).
S45、判断动画是否结束,若动画未结束,执行S43,若动画结束,退出生成动画流程。S45: Determine whether the animation is over, if the animation is not over, execute S43, if the animation is over, exit the animation generating process.
在一个示例性实施方式中,图11为本申请实施例提供的一种视频处理装置的结构示意图,该装置可以由软件和/或硬件实现,并集成电子设备中,如移动终端。如图11所示,视频处理装置包括:目标抠除对象确定模块410、待还原视频帧获取模块420以及视频帧还原模块430。其中,目标抠除对象确定模块410,设置为检测到针对目标视频的对象抠除指令,确定与所述对象抠除指令对应的目标抠除对象;待还原视频帧获取模块420,设置为将所述目标抠除对象在所述目标视频的每个原始视频帧中抠除,获取到与所述每个原始视频帧对应的待还原视频帧;视频帧还原模块430,设置为对每个待还原视频帧中的抠除区域进行还原处理,得到与所述目标视频对应的已编辑视频。In an exemplary embodiment, FIG. 11 is a schematic structural diagram of a video processing apparatus provided by an embodiment of the application. The apparatus may be implemented by software and/or hardware and integrated into an electronic device, such as a mobile terminal. As shown in FIG. 11, the video processing device includes: a target removal object determination module 410, a to-be-restored video frame acquisition module 420, and a video frame restoration module 430. Wherein, the target removal object determination module 410 is configured to detect the object removal instruction for the target video, and determine the target removal object corresponding to the object removal instruction; the to-be-restored video frame acquisition module 420 is configured to The target cutout object is cut out in each original video frame of the target video, and a video frame to be restored corresponding to each original video frame is obtained; the video frame restoration module 430 is configured to The cut-out area in the video frame is restored to obtain an edited video corresponding to the target video.
本申请实施例提供的技术方案中,在检测到针对目标视频的对象抠除指令之后,首先确定需要在目标视频中移除的目标抠除对象,然后将该目标抠除对象在每个原始视频帧中抠除,并对抠除区域进行还原处理,得到与目标视频对应的已编辑视频,以此实现了在视频编辑中移除视频中目标对象的功能。In the technical solution provided by the embodiments of the present application, after detecting the object cutout instruction for the target video, first determine the target cutout object that needs to be removed from the target video, and then place the target cutout object in each original video. Cut out in the frame, and restore the cut out area to obtain the edited video corresponding to the target video, thereby realizing the function of removing the target object in the video during video editing.
在一示例中,待还原视频帧获取模块420,设置为对所述每个原始视频帧进行边缘检测,确定与所述每个原始视频帧对应的抠除对象模板掩膜;根据每个抠除对象模板掩膜,将所述目标抠除对象在对应的所述每个原始视频帧中抠除,获取到与所述每个原始视频帧对应的待还原视频帧。In one example, the to-be-restored video frame acquisition module 420 is configured to perform edge detection on each original video frame, and determine the cutout object template mask corresponding to each original video frame; An object template mask, which cuts out the target cutout object in each corresponding original video frame, and obtains a to-be-restored video frame corresponding to each original video frame.
在一示例中,视频帧还原模块430,设置为根据多个待还原视频帧之间的差异,对每个待还原视频帧中的抠除区域进行还原处理。In an example, the video frame restoration module 430 is configured to perform restoration processing on the cutout area in each to-be-restored video frame according to the difference between a plurality of to-be-restored video frames.
在一实施方式中,视频帧还原模块430,设置为依次正序和/或逆序比较相邻两个待还原视频帧;在第一待还原视频帧针对第二待还原视频帧存在可还原差异区域的情况下,根据所述可还原差异区域对所述第二待还原视频帧中的抠除区域进行还原处理,并更新所述第二待还原视频帧。In one embodiment, the video frame restoring module 430 is configured to compare two adjacent video frames to be restored in positive and/or reverse order; in the first to-be-restored video frame, there is a restorable difference area for the second to-be-restored video frame In the case of, performing restoration processing on the cut-out area in the second to-be-restored video frame according to the restorable difference area, and update the second to-be-restored video frame.
视频帧还原模块430,还设置为在根据多个待还原视频帧之间的差异,对每个待还原视频帧中的抠除区域进行还原处理之后,在比较的任意两个待还原视频帧之间存在所述可还原差异区域的情况下,继续执行所述根据多个待还原视频帧之间的差异,对每个待还原视频帧中的抠除区域进行还原处理的操作,直至比较的任意两个所述待还原视频帧之间不存在所述可还原差异区域。The video frame restoration module 430 is further configured to perform restoration processing on the cutout area in each to-be-restored video frame according to the difference between a plurality of to-be-restored video frames, and then compare any two to-be-restored video frames. In the case that there is the restorable difference area between, continue to perform the operation of restoring the cutout area in each to be restored video frame according to the difference between the multiple to be restored video frames, until any of the comparisons There is no restorable difference area between the two video frames to be restored.
在另一示例中,视频帧还原模块430,设置为将每个待还原视频帧进行帧区块划分,得到与多个待还原视频帧分别对应的多个目标帧区块;根据多个目标帧区块在连续多个所述待还原视频帧中的分布情况,对每个待还原视频帧中的抠除区域进行还原处理。In another example, the video frame restoration module 430 is configured to divide each video frame to be restored into frame blocks to obtain multiple target frame blocks corresponding to the multiple video frames to be restored; The distribution of the blocks in a plurality of consecutive video frames to be restored is restored, and the cut-out area in each video frame to be restored is restored.
在又一示例中,视频帧还原模块430,还设置为在根据不同的所述待还原视频帧之间的差异,对每个待还原视频帧中的抠除区域进行还原处理之后,或者,在根据多个目标帧区块在连续多个所述待还原视频帧中的分布情况,对每个待还原视频帧中的抠除区域进行还原处理之后,在所述待还原视频帧中存在未完成还原的抠除区域的情况下,根据所述抠除区域周围像素的分布规律,对所述抠除区域进行像素填充。In another example, the video frame restoration module 430 is further configured to perform restoration processing on the cutout area in each to-be-restored video frame according to the difference between the different to-be-restored video frames, or, According to the distribution of multiple target frame blocks in a plurality of consecutive video frames to be restored, after performing restoration processing on the cutout area in each video frame to be restored, there are uncompleted video frames in the to-be restored video frames In the case of the restored cut-out area, pixel filling is performed on the cut-out area according to the distribution law of pixels around the cut-out area.
在一可选实施方式中,待还原视频帧获取模块420,设置为将所述目标抠除对象在所述目标视频的当前显示原始视频帧中抠除;相应的,上述装置还包括:动画生成模块,设置为在将所述目标抠除对象在所述目标视频的当前显示原始视频帧中抠除之后,获取到与所述当前显示原始视频帧对应的抠除对象视频帧;响应于与所述对象抠除指令关联的对象移动事件,根据与所述当前显示原始视频帧对应的抠除对象视频帧以及待还原视频帧,将所述目标抠除对象在所述当前显示原始视频帧中移动。In an optional implementation manner, the to-be-restored video frame acquisition module 420 is configured to cut out the target cutout object in the current display original video frame of the target video; correspondingly, the above-mentioned device further includes: animation generation Module, configured to obtain the target video frame corresponding to the current display original video frame after the target cut-out object is cut out in the current display original video frame of the target video; In the object movement event associated with the object cutout instruction, the target cutout object is moved in the currently displayed original video frame according to the cutout target video frame corresponding to the currently displayed original video frame and the to-be-restored video frame.
在一实施方式中,目标抠除对象确定模块410,设置为在所述目标视频的当前显示原始视频帧中检测到针对目标视频的对象抠除指令,对所述当前显示原始视频帧进行对象识别;根据对象识别结果以及所述对象抠除指令对应的位置信息,确定与所述对象抠除指令在所述当前显示视频帧中的目标抠除对象。In one embodiment, the target removal object determination module 410 is configured to detect an object removal instruction for the target video in the currently displayed original video frame of the target video, and perform object recognition on the currently displayed original video frame ; According to the object recognition result and the position information corresponding to the object cutout instruction, determine the target cutout object in the currently displayed video frame with the object cutout instruction.
上述视频处理装置可执行本申请实施例所提供的视频处理方法,具备执行方法相应的功能模块和效果。未在本实施例中详尽描述的技术细节,可参见本申请实施例所提供的视频处理方法。The above-mentioned video processing device can execute the video processing method provided by the embodiment of the present application, and has the functional modules and effects corresponding to the execution method. For technical details that are not described in detail in this embodiment, please refer to the video processing method provided in the embodiment of this application.
在一个示例性实施方式中,本申请实施例还提供了一种电子设备,图12为本申请实施例提供的一种电子设备的结构示意图,如图12所示,本申请提供的电子设备,包括:一个或多个处理器510和存储器520;该电子设备的处理器510可以是一个或多个,图12中以一个处理器510为例;存储器520设置为存储一个或多个程序;所述一个或多个程序被所述一个或多个处理器510执行,使得所述一个或多个处理器510实现如本申请实施例中所述的视频处理方法。In an exemplary embodiment, an embodiment of the present application further provides an electronic device. FIG. 12 is a schematic structural diagram of an electronic device provided by an embodiment of the application. As shown in FIG. 12, the electronic device provided by the present application, It includes: one or more processors 510 and a memory 520; the processor 510 of the electronic device may be one or more, and one processor 510 is taken as an example in FIG. 12; the memory 520 is configured to store one or more programs; The one or more programs are executed by the one or more processors 510, so that the one or more processors 510 implement the video processing method described in the embodiments of the present application.
电子设备中的处理器510、存储器520可以通过总线或其他方式连接,图12中以通过总线连接为例。The processor 510 and the memory 520 in the electronic device may be connected through a bus or in other ways. In FIG. 12, the connection through a bus is taken as an example.
存储器520作为一种计算机可读存储介质,可设置为存储软件程序、计算机可执行程序以及模块,如本申请实施例所述的视频处理方法对应的程序指令/模块(例如,视频处理装置中的目标抠除对象确定模块410、待还原视频帧获取模块420以及视频帧还原模块430)。存储器520可包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序;存储数据区可存储根据设备的使用所创建的数据等。此外,存储器520可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他非易失性固态存储器件。在一些实例中,存储器520可包括相对于处理器510远程设置的存储器,这些远程存储器可以通过网络连接至通信节点。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory 520, as a computer-readable storage medium, can be configured to store software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the video processing method described in the embodiments of the present application (for example, in the video processing device). The target removal object determination module 410, the to-be-restored video frame acquisition module 420, and the video frame restoration module 430). The memory 520 may include a program storage area and a data storage area, where the program storage area may store an operating system and an application program required by at least one function; the data storage area may store data created according to the use of the device, and the like. In addition, the memory 520 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage devices. In some examples, the memory 520 may include a memory remotely provided with respect to the processor 510, and these remote memories may be connected to a communication node through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
本申请实施例还提供一种存储介质,所述存储介质存储有计算机程序,所述计算机程序被处理器执行时实现本申请实施例中视频处理方法,该视频处理方法包括:The embodiments of the present application also provide a storage medium, the storage medium stores a computer program, and when the computer program is executed by a processor, the video processing method in the embodiments of the present application is implemented, and the video processing method includes:
检测到针对目标视频的对象抠除指令,确定与所述对象抠除指令对应的目标抠除对象;将所述目标抠除对象在所述目标视频的每个原始视频帧中抠除,获取到与所述每个原始视频帧对应的待还原视频帧;对每个待还原视频帧中的抠除区域进行还原处理,得到与所述目标视频对应的已编辑视频。Detect the object cutout instruction for the target video, determine the target cutout object corresponding to the object cutout instruction; cut out the target cutout object in each original video frame of the target video, and obtain A to-be-restored video frame corresponding to each of the original video frames; performing restoration processing on the cut-out area in each to-be-restored video frame to obtain an edited video corresponding to the target video.
可选的,该计算机可执行指令在由计算机处理器执行时还可以用于实现本申请实施例中任一所述的视频处理方法。Optionally, when the computer executable instruction is executed by a computer processor, it can also be used to implement any of the video processing methods described in the embodiments of the present application.
通过以上关于实施方式的描述,本申请可借助软件及必需的通用硬件来实现,也可以通过硬件实现。本申请的技术方案本质上可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如计算机的软盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、闪存(FLASH)、硬盘或光盘等,包括多个指令用以使得一台通信设备(可以是个人计算机,服务器,或者网络设备等)执行本申请实施例所述的方法。Through the above description of the implementation manners, this application can be implemented by software and necessary general-purpose hardware, or can be implemented by hardware. The technical solution of this application can essentially be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, a read-only memory (Read-Only Memory, ROM), and random access Random Access Memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including multiple instructions to make a communication device (which can be a personal computer, server, or network device, etc.) execute the embodiments described in this application Methods.
上述视频处理装置的实施例中,所包括的多个单元和模块只是按照功能逻辑进行划分的,但并不局限于上述的划分,只要能够实现相应的功能即可;另外,多个功能单元的名称也只是为了便于相互区分,并不用于限制本申请的保护范围。In the above embodiment of the video processing device, the multiple units and modules included are only divided according to the functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be realized; in addition, the multiple functional units The names are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application.
一般来说,本申请的多种实施例可以在硬件或专用电路、软件、逻辑或其任何组合中实现。例如,一些方面可以被实现在硬件中,而其它方面可以被实现在可以被控制器、微处理器或其它计算装置执行的固件或软件中,尽管本申请不限于此。Generally speaking, the various embodiments of the present application can be implemented in hardware or dedicated circuits, software, logic or any combination thereof. For example, some aspects may be implemented in hardware, while other aspects may be implemented in firmware or software that may be executed by a controller, microprocessor, or other computing device, although the application is not limited thereto.
本申请的实施例可以通过移动装置的数据处理器执行计算机程序指令来实现,例如在处理器实体中,或者通过硬件,或者通过软件和硬件的组合。计算机程序指令可以是汇编指令、指令集架构(Instruction Set Architecture,ISA)指令、机器指令、机器相关指令、微代码、固件指令、状态设置数据、或者以一种或多种编程语言的任意组合编写的源代码或目标代码。The embodiments of the present application may be implemented by executing computer program instructions by a data processor of a mobile device, for example, in a processor entity, or by hardware, or by a combination of software and hardware. Computer program instructions can be assembly instructions, instruction set architecture (Instruction Set Architecture, ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or written in any combination of one or more programming languages Source code or object code.
本申请附图中的任何逻辑流程的框图可以表示程序步骤,或者可以表示相互连接的逻辑电路、模块和功能,或者可以表示程序步骤与逻辑电路、模块和功能的组合。计算机程序可以存储在存储器上。存储器可以具有任何适合于本地技术环境的类型并且可以使用任何适合的数据存储技术实现,例如但不限于只读存储器(ROM)、随机访问存储器(RAM)、光存储器装置和系统(数码多功能光碟(Digital Video Disc,DVD)或光盘(Compact Disk,CD))等。计算机可读介质可以包括非瞬时性存储介质。数据处理器可以是任何适合于本地技术环境的类型,例如但不限于通用计算机、专用计算机、微处理器、数字信号处理器(Digital Signal Processing,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程逻辑器件(Field-Programmable Gate Array,FPGA)以及基于多核处理器架构的处理器。The block diagram of any logic flow in the drawings of the present application may represent program steps, or may represent interconnected logic circuits, modules, and functions, or may represent a combination of program steps and logic circuits, modules, and functions. The computer program can be stored on the memory. The memory can be of any type suitable for the local technical environment and can be implemented using any suitable data storage technology, such as but not limited to read-only memory (ROM), random access memory (RAM), optical storage devices and systems (digital multi-function discs) (Digital Video Disc, DVD) or Compact Disk (CD)), etc. Computer-readable media may include non-transitory storage media. The data processor can be any type suitable for the local technical environment, such as but not limited to general-purpose computers, special-purpose computers, microprocessors, digital signal processors (Digital Signal Processing, DSP), application specific integrated circuits (ASICs) ), programmable logic devices (Field-Programmable Gate Array, FPGA), and processors based on multi-core processor architecture.

Claims (12)

  1. 一种视频处理方法,包括:A video processing method, including:
    检测到针对目标视频的对象抠除指令,确定与所述对象抠除指令对应的目标抠除对象;Detecting an object removal instruction for the target video, and determining a target removal object corresponding to the object removal instruction;
    将所述目标抠除对象在所述目标视频的多个原始视频帧中的每个原始视频帧中抠除,获取到与所述多个原始视频帧分别对应的多个待还原视频帧;Cut out the target cutout object in each original video frame of the multiple original video frames of the target video, and obtain multiple to-be-restored video frames corresponding to the multiple original video frames respectively;
    对每个待还原视频帧中的抠除区域进行还原处理,得到与所述目标视频对应的已编辑视频。Perform restoration processing on the cut-out area in each video frame to be restored to obtain an edited video corresponding to the target video.
  2. 根据权利要求1所述的方法,其中,所述将所述目标抠除对象在所述目标视频的多个原始视频帧中的每个原始视频帧中抠除,获取到与所述多个原始视频帧分别对应的多个待还原视频帧,包括:2. The method according to claim 1, wherein said removing the target object in each original video frame of a plurality of original video frames of the target video, and obtaining the same as the original Multiple video frames to be restored corresponding to the video frames, including:
    对每个原始视频帧进行边缘检测,确定与所述每个原始视频帧对应的抠除对象模板掩膜;Performing edge detection on each original video frame, and determining a cut-out object template mask corresponding to each original video frame;
    根据所述抠除对象模板掩膜,将所述目标抠除对象在所述每个原始视频帧中抠除,获取到与所述每个原始视频帧对应的待还原视频帧。According to the cut-out object template mask, cut out the target cut-out object in each original video frame, and obtain a to-be-restored video frame corresponding to each original video frame.
  3. 根据权利要求1所述的方法,其中,所述对每个待还原视频帧中的抠除区域进行还原处理,包括:The method according to claim 1, wherein said performing restoration processing on the cut-out area in each video frame to be restored comprises:
    根据所述多个待还原视频帧之间的差异,对每个待还原视频帧中的抠除区域进行还原处理。According to the difference between the multiple video frames to be restored, restoration processing is performed on the cut-out area in each video frame to be restored.
  4. 根据权利要求3所述的方法,其中,所述根据所述多个待还原视频帧之间的差异,对每个待还原视频帧中的抠除区域进行还原处理,包括:The method according to claim 3, wherein said performing restoration processing on the cut-out area in each to-be-restored video frame according to the difference between said plurality of to-be-restored video frames comprises:
    依次通过以下方式中的至少之一比较相邻两个待还原视频帧:正序,逆序;In turn, compare two adjacent video frames to be restored by at least one of the following methods: positive sequence, reverse sequence;
    在所述相邻两个待还原视频帧中的第一待还原视频帧针对第二待还原视频帧存在可还原差异区域的情况下,根据所述可还原差异区域对所述第二待还原视频帧中的抠除区域进行还原处理,并更新所述第二待还原视频帧。In the case that the first to-be-restored video frame of the two adjacent to-be-restored video frames has a restorable difference area for the second to-be-restored video frame, the second to-be-restored video frame is compared according to the restorable difference area. The cut-out area in the frame is restored, and the second video frame to be restored is updated.
  5. 根据权利要求4所述的方法,在所述根据所述多个待还原视频帧之间的差异,对每个待还原视频帧中的抠除区域进行还原处理之后,还包括:The method according to claim 4, after the restoration process is performed on the cutout area in each to-be-restored video frame according to the difference between the plurality of to-be-restored video frames, the method further comprises:
    在比较的两个待还原视频帧之间存在所述可还原差异区域的情况下,继续执行所述根据所述多个待还原视频帧之间的差异,对每个待还原视频帧中的抠除区域进行还原处理的操作,直至比较的每两个待还原视频帧之间不存在所述可还原差异区域。In the case that there is the restoreable difference area between the two to-be-restored video frames to be compared, continue to execute the keying in each of the to-be-restored video frames according to the difference between the plurality of to-be-restored video frames. The operation of restoring the deleted area is performed until the restorable difference area does not exist between every two video frames to be restored that are compared.
  6. 根据权利要求1所述的方法,其中,所述对每个待还原视频帧中的抠除 区域进行还原处理,包括:The method according to claim 1, wherein the performing restoration processing on the cut-out area in each video frame to be restored includes:
    将每个待还原视频帧进行帧区块划分,得到与所述多个待还原视频帧分别对应的多个目标帧区块;Dividing each video frame to be restored into frame blocks to obtain multiple target frame blocks respectively corresponding to the multiple video frames to be restored;
    根据所述多个目标帧区块在连续所述多个待还原视频帧中的分布情况,对每个待还原视频帧中的抠除区域进行还原处理。According to the distribution of the multiple target frame blocks in the consecutive multiple to-be-restored video frames, performing restoration processing on the cutout area in each to-be-restored video frame.
  7. 根据权利要求3或6所述的方法,在所述对每个待还原视频帧中的抠除区域进行还原处理之后,还包括:The method according to claim 3 or 6, after the restoration process is performed on the cut-out area in each video frame to be restored, the method further comprises:
    在所述每个待还原视频帧中存在未完成还原的抠除区域的情况下,根据所述未完成还原的抠除区域周围像素的分布规律,对所述未完成还原的抠除区域进行像素填充。In the case where there is a cutout area that has not been restored in each video frame to be restored, pixel the cutout area that has not been restored is pixelated according to the distribution law of pixels around the cutout area that has not been restored. filling.
  8. 根据权利要求1所述的方法,其中,所述将所述目标抠除对象在所述目标视频的多个原始视频帧中的每个原始视频帧中抠除,包括:The method according to claim 1, wherein said removing the target to be removed from each original video frame of a plurality of original video frames of the target video comprises:
    将所述目标抠除对象在所述目标视频的当前显示原始视频帧中抠除;Cut out the target cutout object in the current display original video frame of the target video;
    在所述将所述目标抠除对象在所述目标视频的当前显示原始视频帧中抠除之后,还包括:After the removing the target to be removed from the currently displayed original video frame of the target video, the method further includes:
    获取到与所述当前显示原始视频帧对应的抠除对象视频帧;Acquiring a cutout target video frame corresponding to the currently displayed original video frame;
    响应于与所述对象抠除指令关联的对象移动事件,根据与所述当前显示原始视频帧对应的抠除对象视频帧以及待还原视频帧,将所述目标抠除对象在所述当前显示原始视频帧中移动。In response to the object movement event associated with the object cutout instruction, according to the cutout target video frame corresponding to the currently displayed original video frame and the to-be-restored video frame, the target cutout object is displayed in the currently displayed original video frame. Move in the video frame.
  9. 根据权利要求1所述的方法,其中,所述检测到针对目标视频的对象抠除指令,确定与所述对象抠除指令对应的目标抠除对象,包括:The method according to claim 1, wherein the detecting the object removal instruction for the target video and determining the target removal object corresponding to the object removal instruction comprises:
    在所述目标视频的当前显示原始视频帧中检测到针对所述目标视频的对象抠除指令,对所述当前显示原始视频帧进行对象识别;Detecting an object removal instruction for the target video in the currently displayed original video frame of the target video, and performing object recognition on the currently displayed original video frame;
    根据对象识别结果以及所述对象抠除指令在所述当前显示视频帧中的位置信息,确定与所述对象抠除指令对应的目标抠除对象。According to the object recognition result and the position information of the object removal instruction in the currently displayed video frame, a target removal object corresponding to the object removal instruction is determined.
  10. 一种视频处理装置,包括:A video processing device includes:
    目标抠除对象确定模块,设置为检测到针对目标视频的对象抠除指令,确定与所述对象抠除指令对应的目标抠除对象;The target removal object determination module is configured to detect an object removal instruction for the target video, and determine the target removal object corresponding to the object removal instruction;
    待还原视频帧获取模块,设置为将所述目标抠除对象在所述目标视频的多个原始视频帧中的每个原始视频帧中抠除,获取到与所述多个原始视频帧分别对应的多个待还原视频帧;The to-be-restored video frame acquisition module is configured to cut out the target cutout object in each of the multiple original video frames of the target video, and obtain the respective corresponding to the multiple original video frames Multiple video frames to be restored;
    视频帧还原模块,设置为对每个待还原视频帧中的抠除区域进行还原处理,得到与所述目标视频对应的已编辑视频。The video frame restoration module is configured to restore the cut-out area in each video frame to be restored to obtain the edited video corresponding to the target video.
  11. 一种电子设备,包括:An electronic device including:
    至少一个处理器;At least one processor;
    存储器,设置为存储至少一个程序;Memory, set to store at least one program;
    当所述至少一个程序被所述至少一个处理器执行,使得所述至少一个处理器实现如权利要求1-9中任一项所述的视频处理方法。When the at least one program is executed by the at least one processor, the at least one processor implements the video processing method according to any one of claims 1-9.
  12. 一种存储介质,存储有计算机程序,所述计算机程序被处理器执行时实现权利要求1-9中任一项所述的视频处理方法。A storage medium storing a computer program that, when executed by a processor, implements the video processing method according to any one of claims 1-9.
PCT/CN2021/099078 2020-06-19 2021-06-09 Video processing method, apparatus and device, and storage medium WO2021254223A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010568166.9A CN112118483A (en) 2020-06-19 2020-06-19 Video processing method, device, equipment and storage medium
CN202010568166.9 2020-06-19

Publications (1)

Publication Number Publication Date
WO2021254223A1 true WO2021254223A1 (en) 2021-12-23

Family

ID=73799043

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/099078 WO2021254223A1 (en) 2020-06-19 2021-06-09 Video processing method, apparatus and device, and storage medium

Country Status (2)

Country Link
CN (1) CN112118483A (en)
WO (1) WO2021254223A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112118483A (en) * 2020-06-19 2020-12-22 中兴通讯股份有限公司 Video processing method, device, equipment and storage medium
CN112884664B (en) * 2021-01-22 2024-03-29 北京达佳互联信息技术有限公司 Image processing method, device, electronic equipment and storage medium
CN113518187B (en) * 2021-07-13 2024-01-09 北京达佳互联信息技术有限公司 Video editing method and device
CN116017049A (en) * 2022-12-28 2023-04-25 北京百度网讯科技有限公司 Video processing method and device and electronic equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105376462A (en) * 2015-11-10 2016-03-02 清华大学深圳研究生院 Content supplement drafting method for pollution area in video
US20160171669A1 (en) * 2014-12-11 2016-06-16 Sony Corporation Using depth for recovering missing information in an image
CN105827952A (en) * 2016-02-01 2016-08-03 维沃移动通信有限公司 Photographing method for removing specified object and mobile terminal
WO2017209468A1 (en) * 2016-06-03 2017-12-07 (주)지니트 Chroma-key synthesizing system and method for providing three dimensional stereoscopic effects
CN110913267A (en) * 2019-11-29 2020-03-24 上海赛连信息科技有限公司 Image processing method, device, system, interface, medium and computing equipment
CN112118483A (en) * 2020-06-19 2020-12-22 中兴通讯股份有限公司 Video processing method, device, equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160171669A1 (en) * 2014-12-11 2016-06-16 Sony Corporation Using depth for recovering missing information in an image
CN105376462A (en) * 2015-11-10 2016-03-02 清华大学深圳研究生院 Content supplement drafting method for pollution area in video
CN105827952A (en) * 2016-02-01 2016-08-03 维沃移动通信有限公司 Photographing method for removing specified object and mobile terminal
WO2017209468A1 (en) * 2016-06-03 2017-12-07 (주)지니트 Chroma-key synthesizing system and method for providing three dimensional stereoscopic effects
CN110913267A (en) * 2019-11-29 2020-03-24 上海赛连信息科技有限公司 Image processing method, device, system, interface, medium and computing equipment
CN112118483A (en) * 2020-06-19 2020-12-22 中兴通讯股份有限公司 Video processing method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN112118483A (en) 2020-12-22

Similar Documents

Publication Publication Date Title
WO2021254223A1 (en) Video processing method, apparatus and device, and storage medium
US11317028B2 (en) Capture and display device
US11438510B2 (en) System and method for editing video contents automatically technical field
CN111954055B (en) Video special effect display method and device, electronic equipment and storage medium
CN111193961B (en) Video editing apparatus and method
CN104903934A (en) Rendering augmented reality based on foreground object
CN111163267B (en) Panoramic video editing method, device, equipment and storage medium
KR101484844B1 (en) Apparatus and method for privacy masking tool that provides real-time video
WO2022002151A1 (en) Implementation method and apparatus for behavior analysis of moving target, and electronic device
CN112419132B (en) Video watermark detection method, device, electronic equipment and storage medium
CN111669495B (en) Photographing method, photographing device and electronic equipment
WO2022222835A1 (en) Video processing method, video processing apparatus and electronic device
WO2024153191A1 (en) Video generation method and apparatus, electronic device, and medium
CN113722541A (en) Video fingerprint generation method and device, electronic equipment and storage medium
JPWO2015178234A1 (en) Image search system, search screen display method
CN115756275A (en) Screen capture method, screen capture device, electronic equipment and readable storage medium
JP6866210B2 (en) Image processing equipment, image processing methods and programs
CN114125297B (en) Video shooting method, device, electronic equipment and storage medium
US9898828B2 (en) Methods and systems for determining frames and photo composition within multiple frames
CN106202130A (en) A kind of method and device of shot segmentation
KR20160016746A (en) Determining start and end points of a video clip based on a single click
JP2008020944A (en) Image processing method, program, and device
CN112887611A (en) Image processing method, device, equipment and storage medium
CN112672033A (en) Image processing method and device, storage medium and electronic device
JP6704797B2 (en) Image retrieval device, control method thereof, and program

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21826946

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 03/05/2023)

122 Ep: pct application non-entry in european phase

Ref document number: 21826946

Country of ref document: EP

Kind code of ref document: A1