Search

CN-122023611-A - Eye animation display method and device based on image rendering

CN122023611ACN 122023611 ACN122023611 ACN 122023611ACN-122023611-A

Abstract

The application belongs to the technical field of image generation and discloses an eye animation display method and device based on image rendering, wherein the method comprises the steps of conducting layered rendering on a preset eye white image, an iris image, a pupil image and a highlight image to obtain an initial eye image; the method comprises the steps of obtaining a preset animation frame number, calculating the vertical pixel distance of an initial eye image, obtaining the number of stepping pixels of each frame in the preset animation frame number according to the vertical pixel distance and a sine function, rendering eyelid images on the initial eye image according to the number of the stepping pixels to obtain a plurality of eye image frames, combining the eye image frames to obtain a blink animation video and playing the blink animation video in a preset period. The application can realize low-delay display of eye animation and reduce hardware cost.

Inventors

  • LI TIANCHENG

Assignees

  • 广州安凯微电子股份有限公司

Dates

Publication Date
20260512
Application Date
20260106

Claims (10)

  1. 1. An eye animation display method based on image rendering, which is characterized by comprising the following steps: layering and rendering a preset eye white image, an iris image, a pupil image and a highlight image to obtain an initial eye image; obtaining a preset animation frame number, and calculating the vertical pixel distance of the initial eye image; Obtaining the stepping pixel number of each frame in the preset animation frame number according to the vertical pixel distance and the sine function; Rendering an eyelid image on the initial eye image according to the number of the stepping pixels to obtain a plurality of eye image frames; And combining the eye image frames to obtain a blink animation video and playing the blink animation video in a preset period.
  2. 2. The method for displaying an eye animation based on image rendering according to claim 1, wherein the step pixel number per frame in the preset animation frame number is obtained according to the vertical pixel distance and the sine function, comprising: average segmentation is carried out on the preset animation frame number to obtain a closed-eye frame number and an open-eye frame number; the vertical pixel distance and the open eye frame number are mapped into a half positive period of the sine function belonging to a decreasing function, so that the number of stepping pixels corresponding to each frame in the open eye frame number is obtained.
  3. 3. The image rendering-based eye animation display method of claim 1, further comprising: responding to an emotion instruction, and acquiring the eyelid displacement pixel number and the emotion display frame number corresponding to the emotion instruction; obtaining the stepping pixel number of each frame in the emotion display frame number according to the eyelid displacement pixel number; Rendering eyelid images on the initial eye image according to the number of the stepping pixels to obtain a plurality of emotion image frames; and combining the emotion image frames to obtain emotion eye animation video and playing the emotion eye animation video for a single time.
  4. 4. The image rendering-based eye animation display method of claim 3, further comprising: Before playing the emotion eye animation video, judging whether any eye animation video is played or not; if yes, after the currently played eye animation video is finished, playing the emotion eye animation video.
  5. 5. The image rendering-based eye animation display method of claim 1, further comprising: Responding to a voice signal, positioning according to the voice signal, and determining the eyeball target position; Acquiring a combined rendering area of the iris image, the pupil image and the highlight image in the initial eye image; taking the central position of the combined rendering area as the current eyeball position; determining the number of eyeball displacement pixels according to the eyeball target position and the eyeball current position; acquiring eyeball displacement images corresponding to each frame in a preset animation frame number based on the eyeball displacement pixel number; Rendering eyelid images on eyeball displacement images of corresponding frames according to the stepping pixel number to obtain a plurality of displacement image frames; And combining each displacement image frame to obtain a blink and eyeball movement combined animation video and play the video once.
  6. 6. The method for displaying an eye animation based on image rendering according to claim 5, wherein the obtaining an eye displacement image corresponding to each frame in a preset animation frame number based on the number of eye displacement pixels comprises: calculating the slow motion progress of each frame in the preset animation frame number according to the slow motion function; Obtaining the eyeball displacement of each frame according to the eyeball displacement pixel quantity and the slow motion progress of each frame; And layering and rendering the iris image, the pupil image and the highlight image on the eye white image according to the eye displacement, so as to obtain an eye displacement image of a frame corresponding to the eye displacement.
  7. 7. The image rendering-based eye animation display method of claim 6, further comprising: acquiring a 3D model file of the special-shaped screen and a receiving card point array coordinate file; Constructing a virtual screen according to the 3D model file, and determining a main viewpoint of the virtual screen; performing UV expansion on the virtual screen to obtain a plurality of UV blocks; traversing the center point of the blink animation video in a preset range taking the main viewpoint as the center, and calculating the coverage area of the eye area of the blink animation video in each UV block when each setting; taking the position of the central point when the coverage area of the eye area is maximum as a target mapping point; and playing the blink animation video on the special-shaped screen based on the received card lattice coordinate file and the target mapping point.
  8. 8. An eye animation display device based on image rendering, comprising: the initial rendering module is used for conducting layered rendering on a preset eye white image, an iris image, a pupil image and a highlight image to obtain an initial eye image; the acquisition module is used for acquiring a preset animation frame number and calculating the vertical pixel distance of the initial eye image; The step calculation module is used for obtaining the step pixel number of each frame in the preset animation frame number according to the vertical pixel distance and the sine function; the eyelid rendering module is used for rendering eyelid images on the initial eye images according to the number of the stepping pixels to obtain a plurality of eye image frames; And the playing module is used for combining the eye image frames to obtain the blink animation video and playing the blink animation video in a preset period.
  9. 9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the image rendering based eye animation display method according to any of claims 1 to 7 when the computer program is executed by the processor.
  10. 10. A computer-readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the image rendering-based eye animation display method according to any of claims 1 to 7.

Description

Eye animation display method and device based on image rendering Technical Field The application relates to the technical field of image generation, in particular to an eye animation display method and device based on image rendering. Background Toys currently on the market carrying AI usually have electronic screens through which different eye animations are displayed to simulate emotion or attitude for interaction with a user, and the generation of these eye animations in the prior art mainly relies on prerecorded video playback, i.e. playing prerecorded eye animations in a loop through an LCD/OLED screen. However, the manner of prerecording video requires a software and hardware decoder and memory overhead, thereby increasing the hardware cost of the AI toy, and secondly, prerecording video can only express preset emotion, and instant response to external input (such as voice and touch) cannot be realized. Disclosure of Invention The application provides an eye animation display method and device based on image rendering, which can realize low-delay eye animation display, reduce hardware cost and are more suitable for battery-powered toys. In a first aspect, an embodiment of the present application provides an eye animation display method based on image rendering, including: layering and rendering a preset eye white image, an iris image, a pupil image and a highlight image to obtain an initial eye image; acquiring a preset animation frame number, and calculating the vertical pixel distance of an initial eye image; Obtaining the number of stepping pixels of each frame in the preset animation frame number according to the vertical pixel distance and the sine function; rendering eyelid images on the initial eye images according to the number of each stepping pixel to obtain a plurality of eye image frames; and combining the eye image frames to obtain the blink animation video and playing the blink animation video in a preset period. Further, the obtaining the number of step pixels of each frame in the preset animation frame number according to the vertical pixel distance and the sine function includes: average segmentation is carried out on the preset animation frame number to obtain a closed-eye frame number and an open-eye frame number; the method comprises the steps of mapping the vertical pixel distance and the eye-closing frame number into a half positive period of the sine function belonging to the increasing function to obtain the number of stepping pixels corresponding to each frame in the eye-closing frame number, and mapping the vertical pixel distance and the eye-opening frame number into a half positive period of the sine function belonging to the decreasing function to obtain the number of stepping pixels corresponding to each frame in the eye-opening frame number. Further, the method further comprises: Responding to the emotion instruction, and acquiring the eyelid displacement pixel number and the emotion display frame number corresponding to the emotion instruction; obtaining the stepping pixel number of each frame in the emotion display frame number according to the eyelid displacement pixel number; Rendering eyelid images on the initial eye images according to the number of each stepping pixel to obtain a plurality of emotion image frames; And combining the emotion image frames to obtain emotion eye animation video and playing the emotion eye animation video for a single time. Further, the method further comprises: before playing emotion eye animation videos, judging whether any eye animation video is played or not; If yes, after the currently played eye animation video is finished, the emotion eye animation video is played. Further, the method further comprises: Responding to the voice signal, positioning according to the voice signal, and determining the eyeball target position; Acquiring a combined rendering area of an iris image, a pupil image and a highlight image in an initial eye image; taking the central position of the combined rendering area as the current eyeball position; determining the number of eyeball displacement pixels according to the eyeball target position and the current eyeball position; Acquiring eyeball displacement images corresponding to each frame in a preset animation frame number based on the quantity of eyeball displacement pixels; rendering eyelid images on eyeball displacement images of corresponding frames according to the number of the stepping pixels to obtain a plurality of displacement image frames; and combining each displacement image frame to obtain a blink and eyeball movement combined animation video and playing the combined animation video for a single time. Further, the obtaining the eyeball displacement image corresponding to each frame in the preset animation frame number based on the eyeball displacement pixel number includes: calculating the slow motion progress of each frame in the preset animation frame number according to the slow motion