Method, apparatus and electronic device for processing image
Abstract
The application discloses a method, an apparatus and an electronic device for processing an image. The method includes: acquiring an image with a first rendering style and an image with a second rendering style; generating at least one first intermediate gradient image based on the image with the first rendering style and the image with the second rendering style; wherein the at least one first intermediate gradient image comprises an image in a gradient process from the image with the first rendering style to the image with the second rendering style; and generating a first gradient video based on the image with the first rendering style, the at least one first intermediate gradient image, and the image with the second rendering style.
Claims
exact text as granted — not AI-modifiedWe claim:
1 . A method for processing an image, comprising:
acquiring an image with a first rendering style and an image with a second rendering style; generating at least one first intermediate gradient image based on the image with the first rendering style and the image with the second rendering style; wherein the at least one first intermediate gradient image comprises an image in a gradient process from the image with the first rendering style to the image with the second rendering style; and generating a first gradient video based on the image with the first rendering style, the at least one first intermediate gradient image, and the image with the second rendering style.
2 . The method according to claim 1 , wherein said acquiring the image with the second rendering style comprises:
acquiring first color information of each pixel in the image with the first rendering style; searching for second color information corresponding to the first color information of each pixel in a relationship table of color transformation for transforming the first rendering style into the second rendering style; and generating the image with the second rendering style based on the second color information corresponding to the first color information of each pixel.
3 . The method according to claim 2 , said generating the image with the second rendering style comprises:
generating a blank image of same resolution as the image with the first rendering style; determining a location of each pixel in the blank image based on a location of each pixel in the image with the first rendering style; and generating the image with the second rendering style by filling respective locations of the pixels in the blank image with the second color information corresponding to the first color information of the pixels.
4 . The method according to claim 2 , further comprises: determining the relationship table of color transformation for transforming the first rendering style into the second rendering style;
said determining the relationship table of color transformation comprises: searching for the relationship table of color transformation corresponding to the first rendering style and the second rendering style in a correspondence among an original rendering style, a target rendering style, and a relationship table of color transformation, with the first rendering style as the original rendering style and the second rendering style as the target rendering style.
5 . The method according to claim 1 , wherein said acquiring the image with the second rendering style comprises:
acquiring a preset image with the second rendering style; generating a reference image; performing at least one round of optimal iteration on the reference image through an iterative optimization algorithm, based on the image with the first rendering style and the preset image with the second rendering style; and determining a reference image on which the optimal iteration has been performed as the image with the second rendering style, in response to a difference between a rendering style of the reference image and the second rendering style being less than a first threshold and a difference between image content of the reference image and image content of the image with the first rendering style being less than a second threshold.
6 . The method according to claim 1 , wherein said generating the at least one first intermediate gradient image comprises:
for each same location in the image with the first rendering style and the image with the second rendering style, acquiring first color information of a pixel in the location in the image with the first rendering style and second color information of a pixel in the location in the image with the second rendering style, and determining at least one piece of target color information of a pixel in the location based on the first color information, the second color information, a first rendering style coefficient, and a second rendering style coefficient; generating at least one candidate image based on the at least one piece of target color information of a pixel in each location; and determining the at least one first intermediate gradient image based on the at least one candidate image.
7 . The method according to claim 6 , wherein said determining the at least one first intermediate gradient image comprises:
determining the at least one candidate image as the at least one first intermediate gradient image; or, determining the at least one first intermediate gradient image by acquiring a local processing manner based on the first rendering style and the second rendering style and processing the at least one candidate image based on the local processing manner.
8 . The method according to claim 7 , wherein said acquiring the local processing manner comprises:
searching for the local processing manner corresponding to the first rendering style and the second rendering style in a correspondence among an original rendering style, a target rendering style, and a local processing manner, with the first rendering style as the original rendering style and the second rendering style as the target rendering style.
9 . The method according to claim 1 , further comprising:
acquiring an image with a third rendering style based on the image with the second rendering style; generating at least one second intermediate gradient image based on the image with the second rendering style and the image with the third rendering style; wherein the at least one second intermediate gradient image comprises an image in a gradient process from the image with the second rendering style to the image with the third rendering style; generating a second gradient video based on the image with the second rendering style, the at least one second intermediate gradient image, and the image with the third rendering style; and generating a third gradient video by combining the first gradient video and the second gradient video.
10 . An electronic device, comprising:
a processor; and a memory configured to store an instruction executed by the processor; wherein in response to the instruction being executed, the processor is configured to:
acquire an image with a first rendering style and an image with a second rendering style;
generate at least one first intermediate gradient image based on the image with the first rendering style and the image with the second rendering style; wherein the at least one first intermediate gradient image comprises an image in a gradient process from the image with the first rendering style to the image with the second rendering style; and
generate a first gradient video based on the image with the first rendering style, the at least one first intermediate gradient image, and the image with the second rendering style.
11 . The electronic device according to claim 10 , wherein the processor is configured to:
acquire first color information of each pixel in the image with the first rendering style; search for second color information corresponding to the first color information of each pixel in a relationship table of color transformation for transforming the first rendering style into the second rendering style; and generate the image with the second rendering style based on the second color information corresponding to the first color information of each pixel.
12 . The electronic device according to claim 11 , wherein the processor is configured to:
generate a blank image of same resolution as the image with the first rendering style; determine a location of each pixel in the blank image based on a location of each pixel in the image with the first rendering style; and generate the image with the second rendering style by filling respective locations of the pixels in the blank image with the second color information corresponding to the first color information of the pixels.
13 . The electronic device according to claim 11 , wherein the processor is configured to:
determine the relationship table of color transformation for transforming the first rendering style into the second rendering style; wherein the processor is further configured to: search for the relationship table of color transformation corresponding to the first rendering style and the second rendering style in a correspondence among an original rendering style, a target rendering style, and a relationship table of color transformation, with the first rendering style as the original rendering style and the second rendering style as the target rendering style.
14 . The electronic device according to claim 10 , wherein the processor is configured to:
acquire a preset image with the second rendering style; generate a reference image; perform at least one round of optimal iteration on the reference image through an iterative optimization algorithm, based on the image with the first rendering style and the preset image with the second rendering style; and determine a reference image on which the optimal iteration has been performed as the image with the second rendering style, in response to a difference between a rendering style of the reference image and the second rendering style being less than a first threshold and a difference between image content of the reference image and image content of the image with the first rendering style being less than a second threshold.
15 . The electronic device according to claim 10 , wherein the processor is configured to:
for each same location in the image with the first rendering style and the image with the second rendering style, acquire first color information of a pixel in the location in the image with the first rendering style and second color information of a pixel in the location in the image with the second rendering style, and determine at least one piece of target color information of a pixel in the location based on the first color information, the second color information, a first rendering style coefficient, and a second rendering style coefficient; generate at least one candidate image based on the at least one piece of target color information of a pixel in each location; and determine the at least one first intermediate gradient image based on the at least one candidate image.
16 . The electronic device according to claim 15 , wherein the processor is configured to:
determine the at least one candidate image as the at least one first intermediate gradient image; or, determine the at least one first intermediate gradient image by acquiring a local processing manner based on the first rendering style and the second rendering style and processing the at least one candidate image based on the local processing manner.
17 . The electronic device according to claim 16 , wherein the processor is configured to:
search for the local processing manner corresponding to the first rendering style and the second rendering style in a correspondence among an original rendering style, a target rendering style, and a local processing manner, with the first rendering style as the original rendering style and the second rendering style as the target rendering style.
18 . The electronic device according to claim 10 , wherein the processor is configured to:
acquire an image with a third rendering style based on the image with the second rendering style; generate at least one second intermediate gradient image based on the image with the second rendering style and the image with the third rendering style; wherein the at least one second intermediate gradient image comprises an image in a gradient process from the image with the second rendering style to the image with the third rendering style; generate a second gradient video based on the image with the second rendering style, the at least one second intermediate gradient image, and the image with the third rendering style; and generate a third gradient video by combining the first gradient video and the second gradient video.
19 . A non-temporary computer readable storage medium, wherein in response to an instruction in the storage medium being executed by a processor of an electronic device, the electronic device is enabled to:
acquire an image with a first rendering style and an image with a second rendering style; generate at least one first intermediate gradient image based on the image with the first rendering style and the image with the second rendering style; wherein the at least one first intermediate gradient image comprises an image in a gradient process from the image with the first rendering style to the image with the second rendering style; and generate a first gradient video based on the image with the first rendering style, the at least one first intermediate gradient image, and the image with the second rendering style.Join the waitlist — get patent alerts
Track US2021343070A1 — get alerts on status changes and closely related new filings.
We store only your email — no account needed. See our privacy policy.