IP Library Granted Patent US 11,039,088
Granted Patent B2
US 11,039,088 · App. 16/798,018 · Granted Jun 15, 2021

Video processing method and apparatus based on augmented reality, and electronic device

Inventors: Feihu Yuan (Hangzhou, CN); Longfei Yu (Hangzhou, CN); Huan Liu (Hangzhou, CN)
Assignee: ADVANCED NEW TECHNOLOGIES CO., LTD.
H04N5/272G06T7/70G06T7/90H04N5/23218
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 11,039,088
App. No.
16/798,018
Granted
Jun 15, 2021
Kind
B2
Abstract

A method for video processing based on augmented reality comprises: acquiring an image; recognizing a target object in the image; obtaining a video file associated with the target object; recognizing a foreground portion and a background portion of a video frame in the video file; configuring alpha channel values for pixels corresponding to the foreground portion and pixels corresponding to the background portion of the video frame, to make the background portion of the video frame transparent; determining a position of the foreground portion of the video frame in the image; and synthesizing the video frame with the image based on the position of the foreground portion of the video frame in the image to obtain a synthesized video frame.

Claims (80)

1. A computer-implemented method for video processing, comprising:

receiving a merchant-related image;

acquiring an image;

recognizing a target object from the image by comparing the image with the merchant-related image, wherein the merchant-related image includes the target object;

obtaining a video file associated with the target object, wherein the video file has a specified background color and does not contain an alpha channel;

recognizing a foreground portion and a background portion of a video frame in the video file;

changing the background portion of the video frame to transparent by configuring alpha channel values for pixels corresponding to the foreground portion and pixels corresponding to the background portion of the video frame, wherein configuring the alpha channel values comprises:

determining values of distances each between a color vector of the specified background color of the video file and a color vector of each of the pixels corresponding to the foreground portion and each of the pixels corresponding to the background portion of the video frame,

modifying the values of the distances within a range, and

interpolating the modified values of the distances to obtain the alpha channel values for the pixels corresponding to the foreground portion and the pixels corresponding to the background portion of the video frame;

determining a position of the foreground portion of the video frame in the image based at least on changing the background portion of the video frame to transparent; and

synthesizing the video frame with the image based on the position of the foreground portion of the video frame in the image to obtain a synthesized video frame.

2. The method according to claim 1 , wherein

recognizing a foreground portion and a background portion of a video frame in the video file comprises:

calculating the color vectors of the pixels corresponding to the foreground portion and the pixels corresponding to the background portion of the video frame;

calculating the color vector of the specified background color; and

comparing the color vector of the specified background color with the color vectors of the pixels corresponding to the foreground portion and the pixels corresponding to the background portion of the video frame, to determine the foreground portion and the background portion of the video frame.

3. The method according to claim 2 , wherein modifying the values of the distances within a range comprises:

determining whether a value of a distance is outside the range; and

in response to determining that the value of the distance is outside the range, changing the value of the distance to be a boundary value of the range that is the closest to the value of the distance.

4. The method according to claim 2 , wherein recognizing a foreground portion and a background portion of a video frame in the video file further comprises: converting each of the pixels corresponding to the foreground portion and the pixels corresponding to the background portion of the video frame into a YUV color code format.

5. The method according to claim 1 , wherein recognizing a foreground portion and a background portion of a video frame in the video file comprises:

calculating a color vector of a first video frame in the video file by using a histogram to determine the background portion of the video frame.

6. The method according to claim 1 , further comprising:

acquiring a virtual component for the target object; and

determining a position of the virtual component in the image; and

wherein synthesizing the video frame with the image based on the position of the foreground portion of the video frame in the image to obtain a synthesized video frame comprises:

synthesizing the video frame and the virtual component with the image based on the position of the foreground portion of the video frame and the position of the virtual component in the image.

7. The method according to claim 1 , wherein comparing the image with the merchant-related image to recognize the target object in the image comprises:

extracting features of the merchant-related image and features of acquired image; and

comparing the features of the merchant-related image and the features of acquired image to determine whether the acquired image includes the merchant-related image.

8. An apparatus for video processing, comprising one or more processors and one or more non-transitory computer-readable memories coupled to the one or more processors and configured with instructions executable by the one or more processors to cause the apparatus to perform operations comprising:

receiving a merchant-related image;

acquiring an image;

recognizing a target object from the image by comparing the image with the merchant-related image, wherein the merchant-related image includes the target object;

obtaining a video file associated with the target object, wherein the video file has a specified background color and does not contain an alpha channel;

recognizing a foreground portion and a background portion of a video frame in the video file;

changing the background portion of the video frame to transparent by configuring alpha channel values for pixels corresponding to the foreground portion and pixels corresponding to the background portion of the video frame, wherein configuring the alpha channel values comprises:

determining values of distances each between a color vector of the specified background color of the video file and a color vector of each of the pixels corresponding to the foreground portion and each of the pixels corresponding to the background portion of the video frame,

modifying the values of the distances within a range, and

interpolating the modified values of the distances to obtain the alpha channel values for the pixels corresponding to the foreground portion and the pixels corresponding to the background portion of the video frame;

determining a position of the foreground portion of the video frame in the image based at least on changing the background portion of the video frame to transparent; and

synthesizing the video frame with the image based on the position of the foreground portion of the video frame in the image to obtain a synthesized video frame.

9. The apparatus according to claim 8 , wherein

recognizing a foreground portion and a background portion of a video frame in the video file comprises:

calculating the color vectors of the pixels corresponding to the foreground portion and the pixels corresponding to the background portion of the video frame;

calculating the color vector of the specified background color; and

comparing the color vector of the specified background color with the color vectors of the pixels corresponding to the foreground portion and the pixels corresponding to the background portion of the video frame, to determine the foreground portion and the background portion of the video frame.

10. The apparatus according to claim 9 , wherein modifying the values of the distances within a range comprises:

determining whether a value of a distance is outside the range; and

in response to determining that the value of the distance is outside the range, changing the value of the distance to be a boundary value of the range that is the closest to the value of the distance.

11. The apparatus according to claim 9 , wherein recognizing a foreground portion and a background portion of a video frame in the video file further comprises:

converting each of the pixels corresponding to the foreground portion and the pixels corresponding to the background portion of the video frame into a YUV color code format.

12. The apparatus according to claim 8 , wherein recognizing a foreground portion and a background portion of a video frame in the video file comprises:

calculating a color vector of a first video frame in the video file by using a histogram to determine the background portion of the video frame.

13. The apparatus according to claim 8 , the operations further comprise:

acquiring a virtual component for the target object; and

determining a position of the virtual component in the image; and

wherein synthesizing the video frame with the image based on the position of the foreground portion of the video frame in the image to obtain a synthesized video frame comprises:

synthesizing the video frame and the virtual component with the image based on the position of the foreground portion of the video frame and the position of the virtual component in the image.

14. The apparatus according to claim 8 , wherein comparing the image with the merchant-related image to recognize the target object in the image comprises:

extracting features of the merchant-related image and features of acquired image; and

comparing the features of the merchant-related image and the features of acquired image to determine whether the acquired image includes the merchant-related image.

15. A non-transitory computer-readable storage medium configured with instructions executable by one or more processors to cause the one or more processors to perform operations comprising:

receiving a merchant-related image;

acquiring an image;

recognizing a target object from the image by comparing the image with the merchant-related image, wherein the merchant-related image includes the target object;

obtaining a video file associated with the target object, wherein the video file has a specified background color and does not contain an alpha channel;

recognizing a foreground portion and a background portion of a video frame in the video file;

changing the background portion of the video frame to transparent by configuring alpha channel values for pixels corresponding to the foreground portion and pixels corresponding to the background portion of the video frame, wherein configuring the alpha channel values comprises:

determining values of distances each between a color vector of the specified background color of the video file and a color vector of each of the pixels corresponding to the foreground portion and each of the pixels corresponding to the background portion of the video frame,

modifying the values of the distances within a range, and

interpolating the modified values of the distances to obtain the alpha channel values for the pixels corresponding to the foreground portion and the pixels corresponding to the background portion of the video frame;

determining a position of the foreground portion of the video frame in the image based at least on changing the background portion of the video frame to transparent; and

synthesizing the video frame with the image based on the position of the foreground portion of the video frame in the image to obtain a synthesized video frame.

16. The non-transitory computer-readable storage medium according to claim 15 , wherein

recognizing a foreground portion and a background portion of a video frame in the video file comprises:

calculating the color vectors of the pixels corresponding to the foreground portion and the pixels corresponding to the background portion of the video frame;

calculating the color vector of the specified background color; and

comparing the color vector of the specified background color with the color vectors of the pixels corresponding to the foreground portion and the pixels corresponding to the background portion of the video frame, to determine the foreground portion and the background portion of the video frame.

Assignments (3)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 16, 2020
From: ADVANTAGEOUS NEW TECHNOLOGIES CO., LTD.
To: ADVANCED NEW TECHNOLOGIES CO., LTD.
Reel/Frame 053796/0281 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 3, 2020
From: ALIBABA GROUP HOLDING LIMITED
To: ADVANTAGEOUS NEW TECHNOLOGIES CO., LTD.
Reel/Frame 053702/0392 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Apr 17, 2020
From: YUAN, FEIHU; YU, LONGFEI; LIU, HUAN
To: ALIBABA GROUP HOLDING LIMITED
Reel/Frame 052536/0758 →
Priority Claims (1)
CN 201711129714.2 · Nov 15, 2017 · national
Continuity (2)
Continuation PCTCN2018105774 · Sep 14, 2018
Related Publication 20200213532A1 · Jul 2, 2020