A rendering generation method and system for cultural and creative product animation

By obtaining the texture complexity of each pixel point in the cultural and creative product image and dividing the reference area, and obtaining the sampled pixel points based on factors such as ray reflection, and directly rendering, the problem that existing ray tracing methods are difficult to accurately and efficiently rendering the cultural and creative product images is solved, and a more efficient and accurate rendering effect is achieved.

CN119478149BActive Publication Date: 2025-03-14XIAN DONGWUTANG ANIMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510065308.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-16
Publication Date
2025-03-14
Estimated Expiration
2045-01-16

AI Technical Summary

Technical Problem

Existing ray tracing methods are difficult to accurately and efficiently render images of cultural and creative products, resulting in poor visual effects of cultural and creative products animations.

Method used

By obtaining the texture complexity of each pixel point in the cultural and creative product image, dividing the reference area, and obtaining the sampled pixel points based on factors such as light reflection, texture complexity and pixel point distribution, directly rendering the sampled pixel points, and then obtaining the rendering value of the unsampled pixel points.

Benefits of technology

It improves the accuracy and efficiency of rendering animations of cultural and creative products and enhances the display effect of cultural and creative products.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119478149B_ABST
    Figure CN119478149B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of animation rendering technology, and in particular to a rendering generation method and system for a cultural and creative product animation. The method obtains a cultural and creative product image; obtains the texture complexity according to the gradient value in a preset window of a pixel point in the cultural and creative product image, and divides the cultural and creative product image into reference areas; obtains sampling pixels according to the light reflection, texture complexity, and pixel distribution in the reference area, as well as the distance from the camera and the angle with the irradiated light; obtains the grayscale value and color channel value that need to be rendered for the unsampled pixel point based on the grayscale value and color channel value after rendering of the sampled pixel point, and then obtains a completely rendered cultural and creative product image. The present invention obtains the grayscale value and color channel value that need to be rendered for the remaining pixel points based on the grayscale value and color channel value of the partially rendered pixel points in each area of ​​the cultural and creative product image, effectively improving the accuracy and efficiency of the rendering of the cultural and creative product animation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of animation rendering technology, and in particular to a rendering generation method and system for a cultural and creative product animation. Background Art

[0002] Cultural and creative product animation refers to products with cultural creativity as the core, which use animation to express cultural elements, convey brand concepts, and shape a unique product image. It usually involves art, culture, history, regional characteristics and other content. Cultural and creative product animation fully combines modern animation technology with the creativity of traditional culture, and enhances the cultural value, appeal and fun of cultural and creative products through visual expression. In the process of cultural and creative product animation production, rendering the cultural and creative products in each frame of the animation is an indispensable and important step. This step involves converting the final synthesized image (background, characters, special effects, etc.) into a series of video frames that are played quickly to form an animation.

[0003] The existing method renders the cultural and creative product images that form the cultural and creative product animation by simulating the propagation of light in the scene to obtain the real light and shadow effects and colors, that is, rendering the cultural and creative product animation through ray tracing. However, in reality, the cultural and creative products themselves are relatively delicate and rich in colors and materials. It is difficult to render the cultural and creative product images through ray tracing, which makes it impossible to accurately and efficiently render the cultural and creative product images, affecting the visual effects of the cultural and creative product animation. Summary of the invention

[0004] In order to solve the technical problem that ray tracing cannot accurately and efficiently render cultural and creative product images, which affects the visual effects of cultural and creative product animations, the purpose of the present invention is to provide a rendering generation method and system for cultural and creative product animations. The technical solutions adopted are as follows:

[0005] In a first aspect, an embodiment of the present invention provides a method for rendering and generating a cultural and creative product animation, the method comprising the following steps:

[0006] Obtain images of cultural and creative products;

[0007] According to the distribution of the gradient value in the preset window of each pixel in the cultural and creative product image, the texture complexity of each pixel is obtained;

[0008] The cultural and creative product image is divided into regions based on the texture complexity to obtain reference regions; the sampling pixel points of each reference region are obtained according to the light reflection, texture complexity and pixel distribution in each reference region, as well as the distance between each reference region and the camera and the angle between each reference region and the irradiated light;

[0009] The sampled pixels are directly rendered, and based on the grayscale value and color channel value of each sampled pixel in each reference area after rendering, the grayscale value and color channel value that need to be rendered for each unsampled pixel are obtained, thereby obtaining a completely rendered cultural and creative product image.

[0010] Furthermore, the method for obtaining the texture complexity is:

[0011] For any pixel point in the cultural and creative product image, a preset window for the pixel point is constructed, and the product of the mean gradient value of all pixels in the preset window and the maximum gradient value is normalized as the texture complexity of the pixel point.

[0012] Furthermore, the method for obtaining the reference area is:

[0013] When the texture complexity is greater than or equal to the preset texture complexity threshold, the corresponding pixel is marked as a complex pixel;

[0014] When the texture complexity is less than the preset texture complexity threshold, the corresponding pixel is marked as a simple pixel;

[0015] The complex pixels and simple pixels are divided into regions using the connected domain labeling algorithm, and the obtained regions are used as reference regions.

[0016] Furthermore, the method for acquiring the sampling pixel points is:

[0017] For any reference area, the average value of the texture complexity of all pixels in the reference area is taken as the structural complexity index of the reference area;

[0018] Obtaining the environmental impact degree of the reference area according to the light reflection condition in the reference area, the distance between the reference area and the camera, and the angle between the reference area and the irradiated light;

[0019] The structural complexity index and environmental impact level of the reference area are added and normalized to obtain the sampling weight of the reference area;

[0020] The product of the number of all pixels in the reference area and the sampling weight is used as the sampling number of the reference area;

[0021] A sampling number of pixels are randomly selected from the reference area as the sampling pixels of the reference area.

[0022] Furthermore, the method for obtaining the degree of environmental impact is:

[0023] For any reference area, obtain the light reflection coefficient of each pixel in the reference area, and use the average value of the light reflection coefficients of all pixels in the reference area as the light reflection degree of the reference area;

[0024] The result of negative correlation between the reference area and the shortest distance between the camera is used as the attention level of the reference area;

[0025] The light source is pointed in the direction of the centroid of the reference area as the irradiation light direction corresponding to the reference area;

[0026] The angle between the direction of the irradiation light and the plane where the reference area is located is used as the reference angle of the reference area;

[0027] The result of negatively correlating the difference between the reference angle and the specified angle is used as the light influence degree of the reference area;

[0028] The result of normalizing the product of the light reflection degree, the attention degree and the light impact degree of the reference area is used as the environmental impact degree of the reference area.

[0029] Furthermore, the method for obtaining the grayscale value and color channel value required to be rendered for each unsampled pixel is:

[0030] For any unsampled pixel and any sampled pixel in any reference area, the grayscale similarity and color similarity between the unsampled pixel and the sampled pixel are obtained according to the distance between the unsampled pixel and the sampled pixel, the difference between the grayscale value of the unsampled pixel and the grayscale value of the sampled pixel after rendering, and the difference between the color channel value of the unsampled pixel and the color channel value of the sampled pixel after rendering.

[0031] The sum of the grayscale similarity and the color similarity is used as the overall similarity between the unsampled pixel and the sampled pixel;

[0032] Based on the overall similarity, the target sampling pixel point that is most similar to the unsampled pixel point is selected;

[0033] The grayscale value and color channel value that need to be rendered for the unsampled pixel are obtained according to the grayscale similarity and color similarity between the unsampled pixel and the target sampled pixel, the grayscale value and color channel value of the unsampled pixel itself, and the grayscale value and color channel value after rendering of the target sampled pixel.

[0034] Furthermore, the grayscale similarity and color similarity are obtained by:

[0035] Obtaining the Euclidean distance between the unsampled pixel and the sampled pixel as a first distance;

[0036] Obtaining a difference between the grayscale value of the unsampled pixel and the grayscale value of the sampled pixel after rendering as a first difference;

[0037] Negatively correlating and normalizing the product of the first distance and the first difference, and using the result as the grayscale similarity between the unsampled pixel and the sampled pixel;

[0038] For any color channel, obtain the difference between the color channel value of the unsampled pixel itself and the color channel value of the sampled pixel after rendering, as the reference difference of the color channel;

[0039] The sum of the reference differences of all color channels is used as the overall color difference between the unsampled pixel and the sampled pixel;

[0040] A result of negatively correlating and normalizing the product of the first distance and the overall color difference is used as the color similarity between the unsampled pixel and the sampled pixel.

[0041] Furthermore, the method for acquiring the target sampling pixel point is:

[0042] The overall similarity between the unsampled pixel and each sampled pixel in the reference area is obtained, and the sampled pixel corresponding to the maximum overall similarity is used as the target sampled pixel.

[0043] Furthermore, the grayscale value and color channel value of the unsampled pixel point that needs to be rendered are obtained by:

[0044] The grayscale similarity between the unsampled pixel and the target sampled pixel is used as the first weight;

[0045] The color similarity between the unsampled pixel and the target sampled pixel is used as a second weight;

[0046] The product of the grayscale value of the target sampling pixel after rendering and the first weight is used as the first grayscale value;

[0047] The product of the grayscale value of the unsampled pixel and the negative correlation result of the first weight is used as the second grayscale value;

[0048] The sum of the first grayscale value and the second grayscale value is used as the grayscale value of the unsampled pixel point to be rendered;

[0049] For any color channel, the product of the color channel value after the target sampling pixel is rendered and the second weight is used as the first reference value of the color channel;

[0050] The product of the color channel value of the unsampled pixel point itself and the second weight negative correlation result is used as the second reference value of the color channel;

[0051] The sum of the first reference value and the second reference value of the color channel is used as the color channel value that needs to be rendered for the unsampled pixel.

[0052] In the second aspect, another embodiment of the present invention provides a rendering and generation system for cultural and creative product animations, the system comprising: a memory, a processor, and a computer program stored in the memory and running on the processor, and when the processor executes the computer program, the steps of any one of the above methods are implemented.

[0053] The present invention has the following beneficial effects:

[0054] The present invention first obtains the texture complexity of each pixel point according to the distribution of the gradient value in the preset window of each pixel point in the cultural and creative product image, accurately reflecting the structural complexity of the part where each pixel point is located; then, the cultural and creative product image is divided into regions based on the texture complexity to obtain reference regions, accurately determine the simple region and the structurally complex region in the cultural and creative product image, which is conducive to the subsequent accurate and efficient rendering of each reference region, and avoids interference between different reference regions; further, according to the light reflection, texture complexity and pixel distribution in each reference region, as well as the distance between each reference region and the camera, and the angle between each reference region and the irradiated light, the sampling pixel points of each reference region are obtained, and the pixel points that need to be directly rendered in each reference region are accurately determined, which is conducive to the subsequent accurate and efficient rendering of each reference region; then, based on the grayscale value and color channel value of each sampled pixel point after rendering in each reference region, the grayscale value and color channel value that need to be rendered for each unsampled pixel point are obtained, and the efficiency of rendering each reference region is improved while ensuring the accurate rendering of each reference region, so as to accurately obtain the completely rendered cultural and creative product image, and effectively improve the display effect of the cultural and creative product animation. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0056] Figure 1 A schematic flow chart of a method for rendering and generating a cultural and creative product animation provided by an embodiment of the present invention;

[0057] Figure 2 A flow chart of a method for acquiring sampling pixels provided by an embodiment of the present invention;

[0058] Figure 3 A flow chart of a method for obtaining grayscale values ​​and color channel values ​​of unsampled pixels that need to be rendered, provided by one embodiment of the present invention;

[0059] Figure 4 A structural diagram of a rendering generation system for a cultural and creative product animation provided by an embodiment of the present invention;

[0060] Figure 5 A schematic diagram of a computer device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0061] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the rendering generation method and system of a cultural and creative product animation proposed by the present invention, its specific implementation method, structure, features and effects, in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.

[0062] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.

[0063] The following is a detailed description of a method and system for rendering and generating animation of a cultural and creative product provided by the present invention in conjunction with the accompanying drawings.

[0064] Embodiment 1:

[0065] The present invention proposes a method for rendering and generating cultural and creative product animations. Figure 1 , which shows a schematic flow chart of a rendering generation method of a cultural and creative product animation provided by an embodiment of the present invention, the method comprising the following steps:

[0066] Step S1: Acquire images of cultural and creative products.

[0067] Before rendering the cultural and creative product animation, it is necessary to first determine the final effect of the cultural and creative product animation rendering, that is, the output format, resolution, and rendering quality, etc.; then sort all the frame images that constitute the cultural and creative product animation in order to ensure the flow of the cultural and creative product animation; at the same time, check the cultural and creative product model in each frame image to determine the integrity of the cultural and creative product and whether the material is set correctly, accurately determine the material of each part of the cultural and creative product, so that the cultural and creative product animation display effect is more realistic; further determine the light source position and camera position, where the light source and camera have only one fixed position in this embodiment, which is not limited here; finally determine the rendering engine and adjust the relevant parameters of the rendering engine. At this point, the work preparation before rendering the cultural and creative product animation is completed.

[0068] When rendering the animation of cultural and creative products, the focus is on rendering the cultural and creative products, and the difficulty of rendering is also concentrated on the cultural and creative products. In order to improve the efficiency of rendering the animation of cultural and creative products, this embodiment uses a semantic segmentation network to separate the cultural and creative products from the background in each frame of the animation video, and obtain the cultural and creative product image in each frame. Among them, the semantic segmentation network of this embodiment uses a U-net neural network, and the input is an image containing cultural and creative products in each frame; the output is a cultural and creative product image with only cultural and creative products; the U-net neural network is trained and labeled in the following way: the area of ​​the cultural and creative product is marked as 1, and other areas are marked as 0; the loss function of the U-net neural network is a cross entropy loss function. Among them, the U-net neural network is a well-known technology and will not be described in detail here. At this point, all cultural and creative product images in the cultural and creative product animation are obtained.

[0069] In order to clearly illustrate the process of rendering a cultural and creative product image, this embodiment takes any cultural and creative product image as an example for analysis. It should be noted that the cultural and creative product images that appear subsequently are all the selected cultural and creative product image.

[0070] Step S2: Obtain the texture complexity of each pixel point in the cultural and creative product image according to the distribution of the gradient value within a preset window of each pixel point.

[0071] In actual situations, due to the structure and color of the cultural and creative products themselves, the structure or texture complexity of different parts of the cultural and creative products is different. The more complex the structure, the more detailed the rendering is needed to ensure the effect of the cultural and creative product animation. In order to accurately analyze the complex structural areas in the cultural and creative product image so as to better render the cultural and creative product animation, this embodiment first grayscales the cultural and creative product image, and then analyzes the texture complexity of each pixel point according to the gray value changes of each pixel point and its surrounding pixels in the grayscaled cultural and creative product image. Among them, grayscale is a well-known technology and will not be described in detail. Therefore, this embodiment obtains the texture complexity of each pixel point according to the distribution of the gradient value in the preset window of each pixel point in the cultural and creative product image. Among them, the greater the texture complexity, the more likely the area where the corresponding pixel point is located is a complex structural area of ​​the cultural and creative product.

[0072] Preferably, in a method that can be implemented in this embodiment, the method for obtaining the texture complexity is: for any pixel point in the cultural and creative product image, a preset window of the pixel point is constructed. In this embodiment, a preset window is constructed with the pixel point as the center. A window of size is used as the preset window of the pixel point. The implementer can set the position and size of the preset window of the pixel point according to the actual situation, which is not limited here. The gradient value of each pixel point in the preset window of the pixel point is obtained by the Canny edge detection algorithm. When the gradient values ​​of the pixels in the preset window of the pixel point are larger, it means that the texture of the part where the pixel point is located is more complex; at the same time, when the maximum gradient value in the preset window of the pixel point is larger, it indirectly indicates that the part where the pixel point is located is more likely to be a complex structural part of the cultural and creative product; and then this embodiment normalizes the product of the mean of the gradient values ​​of all pixels in the preset window and the maximum gradient value as the texture complexity of the pixel point. Among them, the Canny edge detection algorithm is a well-known technology and will not be repeated. It should be noted that if the pixel point is a boundary pixel point in the cultural and creative product image, when the preset window of the pixel point exceeds the cultural and creative product image, only the part of the preset window in the cultural and creative product image is analyzed to obtain the texture complexity of the pixel point.

[0073] The calculation formula of texture complexity is: ; In the formula, is the texture complexity of the i-th pixel; is the mean of the gradient values ​​of all pixels in the preset window of the i-th pixel; is the maximum gradient value in the preset window of the i-th pixel; norm is the normalization function.

[0074] At this point, the texture complexity of each pixel in the cultural and creative product image is obtained.

[0075] Step S3: Divide the cultural and creative product image into regions based on texture complexity to obtain reference regions; obtain sampling pixel points of each reference region according to the light reflection conditions, texture complexity and pixel distribution in each reference region, as well as the distance between each reference region and the camera, and the angle between each reference region and the irradiated light.

[0076] In actual situations, the simple parts of cultural and creative products are easy to render, while the parts with complex structures are more difficult to render. In order to improve the efficiency and accuracy of rendering, this embodiment first divides the cultural and creative product image into regions based on the complexity of the texture to obtain reference regions, and then analyzes each reference region independently. The greater the texture complexity in a reference region, the more texture details or structural changes the reference region has. In order to accurately render the reference region, the more pixels that need to be directly rendered in the reference region should be more to avoid the loss of details of the cultural and creative product; the smaller the texture complexity in the reference region, the simpler the reference region. In order to improve the efficiency of rendering, the fewer pixels that need to be directly rendered in the reference region should be.

[0077] Taking into account the different materials of different parts of cultural and creative products, in order to make cultural and creative products more realistic in animated videos, this embodiment analyzes the light reflection situation in each reference area through the material of the cultural and creative product area corresponding to each reference area. The more significant the light reflection situation in a reference area is, the more light reflection effects need to be considered when rendering the reference area. In order to ensure the rendering effect of the reference area, the reference area should have more pixels that need to be directly rendered.

[0078] At the same time, considering that the closer a reference area is to the camera, the more attention the cultural and creative product area corresponding to the reference area receives, in order to make the cultural and creative product area corresponding to the reference area appear more realistic in the animation and improve the visual display effect, the reference area should be rendered more delicately, which indirectly means that the reference area should have more pixels that need to be directly rendered.

[0079] On the other hand, when the area of ​​a reference area illuminated by a light source is larger, the area of ​​the reference area that is clearly displayed is larger, which indirectly reflects that the reference area needs more attention, and thus the reference area should have more pixels that need to be directly rendered. In actual situations, the area of ​​a reference area illuminated by a light source can be reflected by the angle between the illumination light of the light source and the reference area. When the illumination light is more perpendicular to the plane where the reference area is located, the area of ​​the reference area illuminated by the light source is larger, which indirectly reflects that the reference area is more strongly affected by the illumination.

[0080] It is known that the pixels that need to be directly rendered in each reference area must belong to the corresponding reference area. In order to determine the pixels that need to be directly rendered in each reference area, this embodiment obtains the sampled pixels of each reference area according to the light reflection, texture complexity and pixel distribution in each reference area, the distance between each reference area and the camera, and the angle between each reference area and the irradiated light. The sampled pixels are the pixels that are directly rendered by the rendering engine after a lot of calculations.

[0081] Preferably, in a method that can be implemented in this embodiment, the method for obtaining the reference area is: in order to accurately divide the structurally complex area and the simple area in the cultural and creative product image, it is known that the greater the texture complexity, the more complex the location of the corresponding pixel point, and then this embodiment sets the preset texture complexity threshold as 0.5. The implementer can set the size of the preset texture complexity threshold according to the actual situation, and it is not limited here. When the texture complexity is greater than or equal to the preset texture complexity threshold, the corresponding pixel point is marked as a complex pixel point; when the texture complexity is less than the preset texture complexity threshold, the corresponding pixel point is marked as a simple pixel point; then the complex pixel point and the simple pixel point are divided into regions by the connected domain marking algorithm, and the obtained regions are all used as reference regions. At this point, each simple area and each complex area in the cultural and creative product image are determined, so that the cultural and creative product image can be accurately and efficiently rendered later. Among them, the connected domain marking algorithm is a well-known technology and will not be repeated.

[0082] Preferably, in a method that can be implemented in this embodiment, the method for obtaining the sampling pixel point can be found in Figure 2 , which shows a flow chart of a method for obtaining sampling pixels provided in this embodiment, the method comprising the following steps:

[0083] Step S201: For any reference region, the average value of the texture complexity of all pixels in the reference region is used as the structural complexity index of the reference region.

[0084] The larger the structural complexity index is, the more complex the cultural and creative product area corresponding to the corresponding reference area is. In order to improve the visual effect, the corresponding reference area needs to be rendered more delicately, which indirectly means that more pixels need to be directly rendered in the corresponding reference area.

[0085] Step S202: Obtain the environmental impact degree of the reference area according to the light reflection condition in the reference area, the distance between the reference area and the camera, and the angle between the reference area and the irradiated light.

[0086] It is known that the light reflection in a certain reference area, the distance between the reference area and the camera, and the angle between the reference area and the irradiated light will affect the rendering of the cultural and creative product area corresponding to the reference area. In order to make a unified analysis, this embodiment obtains the degree of environmental impact of the reference area based on the light reflection in the reference area, the distance between the reference area and the camera, and the angle between the reference area and the irradiated light. When the degree of environmental impact is greater, the light reflection in the reference area is more significant, and at the same time, the greater the attention it receives and the greater the degree of influence of light. In order to ensure the rendering effect of the cultural and creative product area corresponding to the reference area, the more detailed the reference area needs to be rendered, which indirectly indicates that more pixels need to be directly rendered in the reference area.

[0087] Preferably, in a method that can be implemented in this embodiment, the method for obtaining the degree of environmental impact is: for any reference area, obtain the light reflection coefficient of each pixel in the reference area, and take the average of the light reflection coefficients of all pixels in the reference area as the light reflection degree of the reference area. The greater the light reflection degree, the more detailed the reference area needs to be rendered; it is known that the materials of each part of the cultural and creative product are already known, so the light reflection coefficient of each pixel in the reference area can be directly obtained. Among them, the method for obtaining the light reflection coefficient is a well-known technology and will not be repeated. It is known that when the distance between the reference area and the camera is shorter, it means that the cultural and creative product area corresponding to the reference area needs to be paid more attention. Then, in this embodiment, the result of negative correlation between the reference area and the shortest distance of the camera is taken as the degree of attention of the reference area. Among them, the method for obtaining the shortest distance is a well-known technology and will not be repeated. The direction of the light source pointing to the centroid of the reference area is taken as the irradiation light direction corresponding to the reference area; among them, the method for obtaining the centroid is a well-known technology and will not be repeated. The angle between the direction of the irradiated light and the plane where the reference area is located is obtained as the reference angle of the reference area; when the reference angle approaches 90°, the reference area is more affected by the attention, and the reference area needs to be rendered more finely; then the result of the negative correlation between the absolute value of the difference between the reference angle and the specified angle is used as the degree of light influence on the reference area; in this embodiment, the specified angle is set to 90°. It is known that the greater the degree of light reflection, the greater the degree of attention and the greater the degree of light influence, the more finely the reference area needs to be rendered, and then in this embodiment, the product of the degree of light reflection, the degree of attention and the degree of light influence of the reference area is normalized as the result of the environmental influence degree of the reference area.

[0088] The calculation formula for the degree of environmental impact is: ; In the formula, is the environmental impact level of the e-th reference area; is the light reflection degree of the e-th reference area; is the shortest distance between the e-th reference area and the camera; is the attention level of the e-th reference area; is the reference angle of the e-th reference area; is the absolute value function; is the first preset constant, greater than 0; is the light influence degree of the e-th reference area; norm is the normalization function.

[0089] This embodiment will Set to 0.1 to avoid the denominator being 0. The implementer can set it according to the actual situation. The size of is not limited here. It should be noted that The obtained result, in this embodiment, defaults to no unit.

[0090] Step S203: The structural complexity index and the environmental impact degree of the reference area are added and normalized to obtain a result which is used as the sampling weight of the reference area.

[0091] It is known that when the structural complexity index and environmental impact degree of a certain reference area are both larger, it means that the structure of the cultural and creative product area corresponding to the reference area is more complex, and the reference area needs to be rendered more delicately, which indirectly means that the reference area needs to directly render more pixels. Therefore, this embodiment adds the structural complexity index and environmental impact degree of the reference area and normalizes the result as the sampling weight of the reference area. Among them, the larger the sampling weight, the more pixels the reference area needs to directly render. It should be noted that this embodiment normalizes the addition result of the structural complexity index and the environmental impact degree through the norm normalization function.

[0092] Step S204: The product of the number of all pixels in the reference area and the sampling weight is used as the number of samples in the reference area.

[0093] For any reference area, in order to determine the number of pixels that need to be rendered in the reference area so as to accurately render the cultural and creative product area corresponding to the reference area while improving the rendering efficiency, this embodiment first obtains the number of all pixels in the reference area, and then takes the product of the number of all pixels in the reference area and the sampling weight as the sampling number of the reference area to determine the number of pixels that need to be rendered in the reference area.

[0094] Step S205: randomly selecting a sampling number of pixels from the reference area as sampling pixels of the reference area.

[0095] At this point, the sampling pixels in each reference area are determined.

[0096] Step S4: directly render the sampled pixels, and based on the grayscale value and color channel value of each sampled pixel in each reference area after rendering, obtain the grayscale value and color channel value that need to be rendered for each unsampled pixel, and then obtain a completely rendered cultural and creative product image.

[0097] Specifically, after the sampling pixels of each reference area are determined, it is beneficial for the rendering engine to directly render each sampling pixel in combination with the position of each sampling pixel, the material of the corresponding cultural and creative product part, and the lighting conditions, and obtain the grayscale value and color channel value of each sampling pixel after rendering. Among them, the color channel includes three color channels of R, G, and B. In order to improve the efficiency of rendering the cultural and creative product animation, this embodiment obtains the grayscale value and color channel value that needs to be rendered for each unsampled pixel based on the grayscale value and color channel value after rendering of each sampling pixel in each reference area. It does not require a large amount of calculations through the rendering engine, which improves the rendering efficiency of the unsampled pixels, and finally accurately and efficiently obtains the complete rendered cultural and creative product image, and improves the display effect of the cultural and creative product animation.

[0098] Preferably, in a method that can be implemented in this embodiment, the method for obtaining the grayscale value and color channel value required to be rendered for each unsampled pixel point can be found in Figure 3 , which shows a flow chart of a method for obtaining the grayscale value and color channel value of an unsampled pixel point to be rendered provided by this embodiment, the method comprising the following steps:

[0099] Step S301: For any unsampled pixel and any sampled pixel in any reference area, the grayscale similarity and color similarity between the unsampled pixel and the sampled pixel are obtained according to the distance between the unsampled pixel and the sampled pixel, the difference between the grayscale value of the unsampled pixel itself and the grayscale value of the sampled pixel after rendering, and the difference between the color channel value of the unsampled pixel itself and the color channel value of the sampled pixel after rendering.

[0100] For any unsampled pixel and any sampled pixel in any reference area, when the distance between the unsampled pixel and the sampled pixel is closer, and the grayscale value of the unsampled pixel itself is more similar to the grayscale value of the sampled pixel after rendering, it means that the grayscale values ​​of the unsampled pixel and the sampled pixel are more similar; at the same time, on the basis that the distance between the unsampled pixel and the sampled pixel is close, if the color channel value of the unsampled pixel itself is more equal to the color channel value of the sampled pixel after rendering, it means that the color of the unsampled pixel and the sampled pixel are more similar; and then, according to the distance between the unsampled pixel and the sampled pixel, the difference between the grayscale value of the unsampled pixel itself and the grayscale value of the sampled pixel after rendering, and the difference between the color channel value of the unsampled pixel itself and the color channel value of the sampled pixel after rendering, the grayscale similarity and color similarity between the unsampled pixel and the sampled pixel are obtained in this embodiment.

[0101] Preferably, in a method that can be implemented in this embodiment, the method for obtaining the grayscale similarity is: obtaining the Euclidean distance between the unsampled pixel and the sampled pixel as the first distance; wherein, the method for obtaining the Euclidean distance is a well-known technique and will not be described in detail. Obtain the absolute value of the difference between the grayscale value of the unsampled pixel itself and the grayscale value of the sampled pixel after rendering as the first difference; when the first distance and the first difference are both smaller, it means that the grayscale of the unsampled pixel is more similar to that of the sampled pixel, and then this embodiment negatively correlates and normalizes the product of the first distance and the first difference as the grayscale similarity between the unsampled pixel and the sampled pixel.

[0102] Among them, the calculation formula for grayscale similarity is: ; In the formula, is the grayscale similarity between the ath unsampled pixel and the bth sampled pixel in the eth reference area; is the first distance between the ath unsampled pixel and the bth sampled pixel in the eth reference area; is the gray value of the ath unsampled pixel in the eth reference area; is the gray value of the bth sampled pixel in the eth reference area after rendering; is the first difference; is the absolute value function; exp is the exponential function with a natural constant as the base.

[0103] Preferably, in a manner that can be implemented in this embodiment, the method for obtaining the color similarity is: for any color channel, obtaining the absolute value of the difference between the color channel value of the unsampled pixel itself and the color channel value after the sampled pixel is rendered, as the reference difference of the color channel; adding the reference differences of all color channels as the overall color difference between the unsampled pixel and the sampled pixel; when the first distance and the overall color difference are both smaller, it means that the colors of the unsampled pixel and the sampled pixel are more similar, and then this embodiment negatively correlates and normalizes the product of the first distance and the overall color difference as the color similarity between the unsampled pixel and the sampled pixel.

[0104] The calculation formula for color similarity is: ; In the formula, is the color similarity between the ath unsampled pixel and the bth sampled pixel in the eth reference area; is the first distance between the ath unsampled pixel and the bth sampled pixel in the eth reference area; is the nth color channel value of the ath unsampled pixel in the eth reference area; The nth color channel value after rendering of the bth sampled pixel in the eth reference area; is the reference difference of the nth color channel; is the overall color difference between the ath unsampled pixel and the bth sampled pixel in the eth reference area; is the absolute value function; exp is the exponential function with a natural constant as the base.

[0105] Step S302: taking the sum of the grayscale similarity and the color similarity as the overall similarity between the unsampled pixel and the sampled pixel.

[0106] When the grayscale similarity and color similarity between the unsampled pixel and the sampled pixel are both greater, it means that the unsampled pixel is more similar to the sampled pixel, and then this embodiment uses the sum of the grayscale similarity and the color similarity as the overall similarity between the unsampled pixel and the sampled pixel. The greater the overall similarity, the more the unsampled pixel can be adjusted and rendered according to the grayscale value and color channel value of the sampled pixel after rendering.

[0107] Step S303: Filter out the target sampled pixel point that is most similar to the unsampled pixel point based on the overall similarity.

[0108] In order to accurately render the unsampled similar point, and then obtain the overall similarity between the unsampled pixel and each sampled pixel in the reference area, it is known that the greater the overall similarity, the more accurate the grayscale value and color channel value of the unsampled pixel that need to be rendered obtained based on the grayscale value and color channel value of the corresponding sampled pixel after rendering. In this embodiment, the sampled pixel corresponding to the greatest overall similarity is used as the target sampled pixel, that is, the sampled pixel most similar to the unsampled pixel. It should be noted that if there are multiple sampled pixel corresponding to the greatest overall similarity, any one of them is selected as the target sampled pixel.

[0109] Step S304: Obtain the grayscale value and color channel value that need to be rendered for the unsampled pixel based on the grayscale similarity and color similarity between the unsampled pixel and the target sampled pixel, the grayscale value and color channel value of the unsampled pixel itself, and the grayscale value and color channel value of the target sampled pixel after rendering.

[0110] In order to obtain the grayscale value and color channel value that the unsampled pixel needs to be rendered, the present embodiment first uses the grayscale similarity between the unsampled pixel and the target sampled pixel as the first weight; and uses the color similarity between the unsampled pixel and the target sampled pixel as the second weight; when the first weight is larger, when obtaining the grayscale value that the unsampled pixel needs to be rendered, the grayscale value of the target sampled pixel after rendering participates more, and the grayscale value of the unsampled pixel itself has fewer reference components; the same is true for the second weight;

[0111] Then, the product of the grayscale value of the target sampled pixel after rendering and the first weight is used as the first grayscale value; the product of the grayscale value of the unsampled pixel itself and the negative correlation result of the first weight is used as the second grayscale value; in this embodiment, the subtraction result of the constant 1 and the first weight is used as the negative correlation result of the first weight. Finally, the addition result of the first grayscale value and the second grayscale value is used as the grayscale value that the unsampled pixel needs to be rendered;

[0112] For any color channel, the product of the color channel value after the target sampled pixel is rendered and the second weight is used as the first reference value of the color channel; the product of the color channel value of the unsampled pixel itself and the negative correlation result of the second weight is used as the second reference value of the color channel; in this embodiment, the subtraction result of the constant 1 and the second weight is used as the second weight negative correlation result. Finally, the addition result of the first reference value and the second reference value of the color channel is used as the color channel value that the unsampled pixel needs to render.

[0113] At this point, the grayscale value and each color channel value that need to be rendered for each unsampled pixel are obtained. By using the above method to obtain the grayscale value and each color channel value that need to be rendered for the unsampled pixel, a large area of ​​simple areas in the cultural and creative product image can be directly rendered quickly, and the rendering speed of complex areas in the cultural and creative product image can be improved without affecting too many details. Ensure that the efficiency of rendering the cultural and creative product image is improved while accurately rendering the cultural and creative product image.

[0114] After the rendering of all cultural and creative product images is completed, other scenes and characters in the animation are further rendered according to existing methods, and the rendering results are imported into the post-production software to form a preliminary animation effect; then the cultural and creative product animation that has been initially rendered is further color corrected, audio inserted, and special effects added to enhance the artistic sense and visual impact of the work and make it more attractive. At the same time, the switching between video frames is smoothed and optimized to ensure that the animation is smooth and natural; finally, the final version of the cultural and creative product animation is output. It should be noted that after the final rendering and output, it is very necessary to conduct multiple tests and reviews to ensure that the cultural and creative product animation effect meets expectations.

[0115] In summary, the present embodiment obtains a cultural and creative product image; obtains the texture complexity according to the gradient value within the preset window of the pixel point in the cultural and creative product image to divide the cultural and creative product image into reference areas; obtains the sampling pixel points according to the light reflection, texture complexity and pixel point distribution in the reference area, as well as the distance from the camera and the angle with the irradiated light; obtains the grayscale value and color channel value that the unsampled pixel points need to be rendered based on the grayscale value and color channel value after rendering of the sampling pixel points, and then obtains the complete rendered cultural and creative product image. The present invention obtains the grayscale value and color channel value that the remaining pixel points need to be rendered based on the grayscale value and color channel value of the partially rendered pixel points in each area of ​​the cultural and creative product image, which effectively improves the accuracy and efficiency of the animation rendering of the cultural and creative product.

[0116] Embodiment 2:

[0117] The present invention also proposes a rendering generation system for cultural and creative product animations, see Figure 4 , which shows a structural diagram of a rendering generation system for a cultural and creative product animation provided by an embodiment of the present invention, the system comprising: an image acquisition module 10, a texture complexity acquisition module 20, a sampling pixel point acquisition module 30 and a complete rendering cultural and creative product image acquisition module 40.

[0118] The image acquisition module 10 is used to acquire images of cultural and creative products.

[0119] The texture complexity acquisition module 20 is used to obtain the texture complexity of each pixel in the cultural and creative product image according to the distribution of the gradient value within a preset window of each pixel.

[0120] The sampling pixel point acquisition module 30 is used to divide the cultural and creative product image into regions based on the complexity of the texture to obtain reference areas; the sampling pixel points of each reference area are obtained according to the light reflection conditions, texture complexity and pixel distribution conditions in each reference area, as well as the distance between each reference area and the camera, and the angle between each reference area and the irradiated light.

[0121] The complete rendered cultural and creative product image acquisition module 40 is used to directly render the sampled pixel points, and based on the grayscale value and color channel value of each sampled pixel point after rendering in each reference area, obtain the grayscale value and color channel value that need to be rendered for each unsampled pixel point, so as to obtain a complete rendered cultural and creative product image.

[0122] It should be noted that: the system provided in the above embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the computer device is divided into different functional modules to complete all or part of the functions described above. In addition, the rendering generation system of a cultural and creative product animation provided in the above embodiment and the rendering generation method embodiment of a cultural and creative product animation belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0123] Embodiment 3:

[0124] The present invention also proposes a rendering and generating device for a cultural and creative product animation, the device comprising a memory and a processor, wherein the memory stores an executable program code, and the processor is used to call and execute the executable program code to execute a rendering and generating method for a cultural and creative product animation provided in an embodiment of the present application. The device can be a chip, a component or a module, and the chip can include a connected processor and a memory; wherein the memory is used to store instructions, and when the processor calls and executes the instructions, the chip can execute a rendering and generating method for a cultural and creative product animation provided in the above embodiment.

[0125] In addition, the present application embodiment also protects a computer device, see Figure 5 The computer device includes a memory 401, a processor 402, and a computer program 403 stored in the memory 401 and running on the processor 402, wherein when the processor 402 executes the computer program 403, the computer device can execute any one of the rendering and generation methods of the cultural and creative product animation introduced above.

[0126] Embodiment 4:

[0127] The present invention also provides a computer-readable storage medium, which stores computer program code. When the computer program code runs on a computer, the computer executes the above-mentioned related method steps to implement a rendering and generation method for a cultural and creative product animation provided in the above-mentioned embodiment.

[0128] Embodiment 5:

[0129] The present invention also provides a computer program product. When the computer program product runs on a computer, it enables the computer to execute the above-mentioned related steps to implement a rendering and generation method of a cultural and creative product animation provided in the above-mentioned embodiment.

[0130] Among them, the device, computer-readable storage medium, computer program product or chip provided in this embodiment is used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, and will not be repeated here.

[0131] It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0132] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.

Claims

1. A rendering generation method for a cultural and creative product animation, characterized in that: The method comprises the following steps: Obtain images of cultural and creative products; According to the distribution of the gradient value in the preset window of each pixel in the cultural and creative product image, the texture complexity of each pixel is obtained; The cultural and creative product image is divided into regions based on the texture complexity to obtain reference regions; the sampling pixel points of each reference region are obtained according to the light reflection, texture complexity and pixel distribution in each reference region, as well as the distance between each reference region and the camera and the angle between each reference region and the irradiated light; Directly render the sampled pixels, and based on the grayscale value and color channel value of each sampled pixel in each reference area after rendering, obtain the grayscale value and color channel value that each unsampled pixel needs to render, and then obtain a completely rendered cultural and creative product image; The method for obtaining the sampling pixel points is: For any reference area, the average value of the texture complexity of all pixels in the reference area is taken as the structural complexity index of the reference area; Obtaining the environmental impact degree of the reference area according to the light reflection condition in the reference area, the distance between the reference area and the camera, and the angle between the reference area and the irradiated light; The structural complexity index and environmental impact level of the reference area are added and normalized to obtain the sampling weight of the reference area; The product of the number of all pixels in the reference area and the sampling weight is used as the sampling number of the reference area; Randomly select a sampling number of pixels from the reference area as sampling pixels of the reference area; The method for obtaining the degree of environmental impact is: For any reference area, obtain the light reflection coefficient of each pixel in the reference area, and use the average value of the light reflection coefficients of all pixels in the reference area as the light reflection degree of the reference area; The result of negative correlation between the reference area and the shortest distance between the camera is used as the attention level of the reference area; The light source is pointed in the direction of the centroid of the reference area as the irradiation light direction corresponding to the reference area; The angle between the direction of the irradiation light and the plane where the reference area is located is used as the reference angle of the reference area; The result of negatively correlating the difference between the reference angle and the specified angle is used as the light influence degree of the reference area; The result of normalizing the product of the light reflection degree, the attention degree and the light impact degree of the reference area is used as the environmental impact degree of the reference area; The calculation formula for the degree of environmental impact is: ; In the formula, is the environmental impact level of the e-th reference area; is the light reflection degree of the e-th reference area; is the shortest distance between the e-th reference area and the camera; is the attention level of the e-th reference area; is the reference angle of the e-th reference area; is the absolute value function; is the first preset constant, greater than 0; is the light influence degree of the e-th reference area; norm is the normalization function.

2. The method for rendering and generating a cultural and creative product animation according to claim 1, characterized in that: The method for obtaining the texture complexity is: For any pixel point in the cultural and creative product image, a preset window of the pixel point is constructed, and the product of the mean value of the gradient values ​​of all the pixels in the preset window and the maximum gradient value is normalized as the texture complexity of the pixel point; The calculation formula for texture complexity is: ; In the formula, is the texture complexity of the i-th pixel; is the mean of the gradient values ​​of all pixels in the preset window of the i-th pixel; is the maximum gradient value in the preset window of the i-th pixel; norm is the normalization function.

3. The method for rendering and generating a cultural and creative product animation according to claim 1, characterized in that: The method for obtaining the reference area is: When the texture complexity is greater than or equal to the preset texture complexity threshold, the corresponding pixel is marked as a complex pixel; When the texture complexity is less than the preset texture complexity threshold, the corresponding pixel is marked as a simple pixel; The complex pixels and simple pixels are divided into regions using the connected domain labeling algorithm, and the obtained regions are used as reference regions.

4. The method for rendering and generating a cultural and creative product animation according to claim 1, characterized in that: The method for obtaining the grayscale value and color channel value required to be rendered for each unsampled pixel is: For any unsampled pixel and any sampled pixel in any reference area, the grayscale similarity and color similarity between the unsampled pixel and the sampled pixel are obtained according to the distance between the unsampled pixel and the sampled pixel, the difference between the grayscale value of the unsampled pixel and the grayscale value of the sampled pixel after rendering, and the difference between the color channel value of the unsampled pixel and the color channel value of the sampled pixel after rendering. The sum of the grayscale similarity and the color similarity is used as the overall similarity between the unsampled pixel and the sampled pixel; Based on the overall similarity, the target sampling pixel point that is most similar to the unsampled pixel point is selected; The grayscale value and color channel value that need to be rendered for the unsampled pixel are obtained according to the grayscale similarity and color similarity between the unsampled pixel and the target sampled pixel, the grayscale value and color channel value of the unsampled pixel itself, and the grayscale value and color channel value after rendering of the target sampled pixel.

5. The method for rendering and generating a cultural and creative product animation according to claim 4, characterized in that: The method for obtaining the grayscale similarity and color similarity is: Obtaining the Euclidean distance between the unsampled pixel and the sampled pixel as a first distance; Obtaining a difference between the grayscale value of the unsampled pixel and the grayscale value of the sampled pixel after rendering as a first difference; Negatively correlating and normalizing the product of the first distance and the first difference, and using the result as the grayscale similarity between the unsampled pixel and the sampled pixel; For any color channel, obtain the difference between the color channel value of the unsampled pixel itself and the color channel value of the sampled pixel after rendering, as the reference difference of the color channel; The sum of the reference differences of all color channels is used as the overall color difference between the unsampled pixel and the sampled pixel; Negatively correlate and normalize the product of the first distance and the overall color difference, and use the result as the color similarity between the unsampled pixel and the sampled pixel; Among them, the calculation formula for grayscale similarity is: ; In the formula, is the grayscale similarity between the ath unsampled pixel and the bth sampled pixel in the eth reference area; is the first distance between the ath unsampled pixel and the bth sampled pixel in the eth reference area; is the gray value of the ath unsampled pixel in the eth reference area; is the gray value of the bth sampled pixel in the eth reference area after rendering; is the first difference; is the absolute value function; exp is the exponential function with a natural constant as the base; The calculation formula for color similarity is: ; In the formula, is the color similarity between the ath unsampled pixel and the bth sampled pixel in the eth reference area; is the first distance between the ath unsampled pixel and the bth sampled pixel in the eth reference area; is the nth color channel value of the ath unsampled pixel in the eth reference area; The nth color channel value after rendering of the bth sampled pixel in the eth reference area; is the reference difference of the nth color channel; is the overall color difference between the ath unsampled pixel and the bth sampled pixel in the eth reference area; is the absolute value function; exp is the exponential function with a natural constant as the base.

6. The method for rendering and generating a cultural and creative product animation according to claim 4, characterized in that: The method for obtaining the target sampling pixel point is: The overall similarity between the unsampled pixel and each sampled pixel in the reference area is obtained, and the sampled pixel corresponding to the maximum overall similarity is used as the target sampled pixel.

7. The method for rendering and generating a cultural and creative product animation according to claim 4, characterized in that: The method for obtaining the grayscale value and color channel value that the unsampled pixel needs to render is: The grayscale similarity between the unsampled pixel and the target sampled pixel is used as the first weight; The color similarity between the unsampled pixel and the target sampled pixel is used as a second weight; The product of the grayscale value of the target sampling pixel after rendering and the first weight is used as the first grayscale value; The product of the grayscale value of the unsampled pixel and the negative correlation result of the first weight is used as the second grayscale value; The sum of the first grayscale value and the second grayscale value is used as the grayscale value of the unsampled pixel point to be rendered; For any color channel, the product of the color channel value after the target sampling pixel is rendered and the second weight is used as the first reference value of the color channel; The product of the color channel value of the unsampled pixel point itself and the second weight negative correlation result is used as the second reference value of the color channel; The sum of the first reference value and the second reference value of the color channel is used as the color channel value that needs to be rendered for the unsampled pixel.

8. A rendering generation system for a cultural and creative product animation, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When executing the computer program, the processor implements the steps of a method for rendering and generating a cultural and creative product animation as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Image rendering method and device, equipment and medium

    CN114119853A

  • AR-based cultural and creative product display method and display equipment

    CN115063566A