# US 2023/0274399 A1 · Motion-based pixel propagation for video inpainting

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2023/0274399 A1
- Document ID: US20230274399A1
- Status: Published application
- Kind: A1
- Application number: 18/142,304
- Filed: 2023-05-02
- Published: 2023-08-31
- Earliest claimed: 2020-11-02
- Assignees: Innopeak Technology, Inc.
- Applicants: Innopeak Technology, Inc.
- Inventors: Jenhao Hsiao; Zheng Zhang
- Web page: https://patentgrep.com/patent/US20230274399A1

## CPC

- G06T 5/77: Retouching; Inpainting; Scratch removal
- G06T 5/50: using two or more images, e.g. averaging or subtraction
- G06T 7/246: using feature-based methods, e.g. the tracking of corners or segments
- G06T 7/33: using feature-based methods
- G06T 7/73: using feature-based methods
- G06V 10/776: Validation; Performance evaluation
- G06V 20/46: {Extracting features or characteristics from the video content, e.g. video fingerprints, representative shots or key frames}
- G06T 2207/10016: Video; Image sequence
- G06T: IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06V: IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING

## Abstract

Techniques for pixel propagation and video inpainting are described. A video processing application selects, from a sequence of video frames, a reference video frame that includes replacement pixels corresponding to a mask of an undesired object. The video processing application aligns the reference video frame with the target video frame. The video processing application identifies, in the reference video frame, pixels corresponding to the mask. The video processing application uses the pixels from the reference video frame to replace pixels in the target video frame that correspond to the undesired object.

## Claims

### Claim 1

A method implemented by a computer system, the method comprising:
receiving a sequence of video frames and a set of masks, wherein the sequence of video frames comprises an initial video frame including an undesired object and the set of masks comprises an initial mask corresponding to the undesired object;
identifying from the sequence of video frames, a subset of video frames;
creating, using the set of masks, a combined mask corresponding to the undesired object;
selecting, from the sequence of video frames, a reference video frame that comprises replacement pixels corresponding to pixels in a target video frame that are associated with the combined mask by:
determining that an overlap between the combined mask in the reference video frame and the combined mask in the target video frame is less than a first threshold; and
determining that an optical flow metric of the combined mask in the reference video frame compared to the combined mask in the target video frame is less than a second threshold;
aligning the reference video frame with the target video frame; and
replacing, in the target video frame, pixels corresponding to the combined mask with pixels corresponding to the combined mask in the reference video frame.

### Claim 2 (depends on 1)

The method of claim 1, wherein receiving the set of masks comprises generating the set of masks by identifying, in each video frame of the sequence of video frames, a set of pixels that correlates with a set of pixels of the initial mask.

### Claim 3 (depends on 1)

The method of claim 1, wherein creating the combined mask comprises:
determining a subset of the set of masks for which a stability score is greater than a third threshold; and
forming, from the subset of the set of masks, the combined mask as a union of pixels corresponding to the undesired object in the subset of the set of masks.

### Claim 4 (depends on 1)

The method of claim 1, wherein determining the overlap comprises:
identifying, in the reference video frame, a first set of pixels that correspond to pixels in the combined mask;
locating, in the target video frame, a second set of pixels that corresponds to the first set of pixels; and
computing a stability score using the first set of pixels and the second set of pixels.

### Claim 5 (depends on 1)

The method of claim 1, further comprising outputting the target video frame to a display device.

### Claim 6 (depends on 1)

The method of claim 1, further comprising determining the optical flow metric by:
determining a difference between pixels that correspond to the combined mask in the reference video frame and pixels that correspond to the combined mask in the target video frame; and
computing the optical flow metric based on the difference.

### Claim 7 (depends on 1)

The method of claim 1, wherein aligning the reference video frame with the target video frame comprises:
a) determining a plurality of feature points in the target video frame and the reference video frame;
b) sampling a subset of the plurality of feature points to provide a validation feature set;
c) performing feature matching for the validation feature set;
d) calculating an overall matching score for the validation feature set;
iteratively performing b) through d) a predetermined number of times;
selecting the validation feature set having a highest overall matching score; and
computing a homography for the selected validation feature set.

### Claim 8 (depends on 7)

The method of claim 7, wherein sampling the subset of the plurality of feature points comprises performing a random sampling.

### Claim 9

A computer system, including:
one or more processors; and
one or more non-transitory computer-storage media storing instructions that, upon execution on by the one or more processors, cause the computer system to perform operations including:
receiving a sequence of video frames and a set of masks, wherein the sequence of video frames comprises an initial video frame including an undesired object and the set of masks comprises an initial mask corresponding to the undesired object;
identifying from the sequence of video frames, a subset of video frames;
creating, using the set of masks, a combined mask corresponding to the undesired object;
selecting, from the sequence of video frames, a reference video frame that comprises replacement pixels corresponding to pixels in a target video frame that are associated with the combined mask by:
determining that an overlap between the combined mask in the reference video frame and the combined mask in the target video frame is less than a first threshold; and
determining that an optical flow metric of the combined mask in the reference video frame compared to the combined mask in the target video frame is less than a second threshold;
aligning the reference video frame with the target video frame; and
replacing, in the target video frame, pixels corresponding to the combined mask with pixels corresponding to the combined mask in the reference video frame.

### Claim 10 (depends on 9)

The computer system of claim 9, wherein receiving the set of masks comprises generating the set of masks by identifying, in each video frame of the sequence of video frames, a set of pixels that correlates with a set of pixels of the initial mask.

### Claim 11 (depends on 9)

The computer system of claim 9, wherein creating the combined mask comprises:
determining a subset of the set of masks for which a stability score is greater than a third threshold; and
forming, from the subset of the set of masks, the combined mask as a union of pixels corresponding to the undesired object in the subset of the set of masks.

### Claim 12 (depends on 9)

The computer system of claim 9, wherein the operations further comprise determining an optical flow metric by:
determining a difference between pixels that correspond to the combined mask in the reference video frame and pixels that correspond to the combined mask in the target video frame; and
computing the optical flow metric based on the difference.

### Claim 13 (depends on 9)

The computer system of claim 9, wherein aligning the reference video frame with the target video frame comprises:
a) determining a plurality of feature points in the target video frame and the reference video frame;
b) sampling a subset of the plurality of feature points to provide a validation feature set;
c) performing feature matching for the validation feature set; d) calculating an overall matching score for the validation feature set;
iteratively performing b) through d) a predetermined number of times;
selecting the validation feature set having a highest overall matching score; and
computing a homography for the selected validation feature set.

### Claim 14 (depends on 9)

The computer system of claim 9, wherein sampling the subset of the plurality of feature points comprises performing a random sampling.

### Claim 15

One or more non-transitory computer-storage media storing instructions that, upon execution on a computer system, cause the computer system to perform operations including:
receiving a sequence of video frames and a set of masks, wherein the sequence of video frames comprises an initial video frame including an undesired object and the set of masks comprises an initial mask corresponding to the undesired object;
identifying from the sequence of video frames, a subset of video frames;
creating, using the set of masks, a combined mask corresponding to the undesired object;
selecting, from the sequence of video frames, a reference video frame that comprises replacement pixels corresponding to pixels in a target video frame that are associated with the combined mask by:
determining that an overlap between the combined mask in the reference video frame and the combined mask in the target video frame is less than a first threshold; and
determining that an optical flow metric of the combined mask in the reference video frame compared to the combined mask in the target video frame is less than a second threshold;
aligning the reference video frame with the target video frame; and
replacing, in the target video frame, pixels corresponding to the combined mask with pixels corresponding to the combined mask in the reference video frame.

### Claim 16 (depends on 15)

The non-transitory computer-storage media of claim 15, wherein receiving the set of masks comprises generating the set of masks by identifying, in each video frame of the sequence of video frames, a set of pixels that correlates with a set of pixels of the initial mask.

### Claim 17 (depends on 15)

The non-transitory computer-storage media of claim 15, wherein creating the combined mask comprises:
determining a subset of the set of masks for which a stability score is greater than a third threshold; and
forming, from the subset of the set of masks, the combined mask as a union of pixels corresponding to the undesired object in the subset of the set of masks.

### Claim 18 (depends on 15)

The non-transitory computer-storage media of claim 15, wherein the operations further comprise determining the optical flow metric by:
determining a difference between pixels that correspond to the combined mask in the reference video frame and pixels that correspond to the combined mask in the target video frame; and
computing the optical flow metric based on the difference.

### Claim 19 (depends on 15)

The non-transitory computer-storage media of claim 15, wherein aligning the reference video frame with the target video frame comprises:
a) determining a plurality of feature points in the target video frame and the reference video frame;
b) sampling a subset of the plurality of feature points to provide a validation feature set;
c) performing feature matching for the validation feature set;
d) calculating an overall matching score for the validation feature set;
iteratively performing b) through d) a predetermined number of times;
selecting the validation feature set having a highest overall matching score; and
computing a homography for the selected validation feature set.

### Claim 20 (depends on 19)

The non-transitory computer-storage media of claim 19, wherein sampling the subset of the plurality of feature points comprises performing a random sampling.
