A method and system for dynamic rendering of an animation three-dimensional environment based on machine learning

By using machine learning-based methods and evidence maps of smoke engulfment and ink spikes, the connection and extension ends of slender entities are accurately located and corrected. This solves the problem of incorrect spatial attribution of slender entities in the rendering of 3D animation environments and improves the structural consistency and visual accuracy of the rendering results.

CN122391430APending Publication Date: 2026-07-14LIAONING YUANCHUANG ANIMATION TECHNOLOGY CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
LIAONING YUANCHUANG ANIMATION TECHNOLOGY CO LTD
Filing Date
2026-04-28
Publication Date
2026-07-14

AI Technical Summary

Technical Problem

Existing 3D environment rendering technology for animation struggles to accurately locate and correct the connection and extension ends of slender entities in complex occlusion environments, leading to errors in spatial attribution and affecting the structural consistency and visual accuracy of the rendering results.

Method used

A machine learning-based approach is used to characterize the degree of occlusion and protrusion of slender entities through smoke engulfment evidence maps and ink spike evidence maps. By combining line candidate region images and skeleton paths, the endpoints and paths of slender structures are determined, and pixel updates are performed to correct anomalous expression regions.

Benefits of technology

It improves the accuracy of distinguishing between the connecting ends and extended ends of slender entities in complex occlusion scenes, restores the spatial belonging expression of slender structures, and enhances the visual expression accuracy of animation frames.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122391430A_ABST
    Figure CN122391430A_ABST
Patent Text Reader

Abstract

The application discloses an animation three-dimensional environment dynamic rendering method and system based on machine learning, and relates to the technical field of image processing, and comprises the following steps: obtaining a smoke swallowing evidence map according to the smoke shielding degree corresponding to a target three-dimensional environment; determining linear structure response intensity according to a two-dimensional color image of the target three-dimensional environment, normalizing the linear structure response intensity, and converting the gray value to obtain a thorn spike evidence map; performing binaryzation processing on the thorn spike evidence map to obtain a line candidate region image, performing pixel assignment marking on a thorn skeleton map corresponding to the line candidate region image to obtain an endpoint marked image; determining a skeleton path according to the endpoint marked image, and performing classification marking assignment on pixel positions on the skeleton path according to the smoke swallowing evidence map to obtain a broken root thorn classification label map; and the application improves the spatial attribution expression accuracy of a final animation frame.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to a method and system for dynamic rendering of 3D animation environments based on machine learning. Background Technology

[0002] In the dynamic rendering of 3D environments in animation, especially in ruins and battle scenes, there are usually various visual elements such as broken reinforced concrete structures, exposed thin steel rebar ends, smoke and dust layers, and complex lighting interactions. These scenes often use line processing and layered light and shadow to create a visual effect with a 2D animation style. In this process, the boundaries of the solid structure are strengthened by outlining, while surface details are expressed through simplified processing. Dynamic effects such as smoke, sparks, and shock waves participate in the imaging in a semi-transparent overlay form, causing the occlusion relationship, attachment relationship, and depth layer in the real 3D space to be compressed and reconstructed in the 2D image. When a slender solid, such as an exposed steel rebar end, is located in a smoke-covered area and is simultaneously subjected to line enhancement processing, its root area is easily covered by smoke and dust and weakened in display, while the end far from the attachment position is highlighted by outlining, thus forming a visual expression in the image that is missing the root and protruding the end. This expression will be further superimposed and dynamically changed in consecutive frames, making the slender solid appear in the picture as a floating spike-like shape, destroying the original spatial connection relationship and structural expression.

[0003] In existing animation 3D environment rendering technologies, the distortion of attachment relationships caused by the combined effects of smoke and dust occlusion and line enhancement on slender entities is usually corrected only by a uniform outlining algorithm or occlusion processing based on depth information. These methods mainly focus on the stability of the overall outline or the correctness of the occlusion order, lacking targeted analysis of the local shape and spatial connection relationship of slender structures. As a result, even in complex occlusion environments, it is still impossible to effectively distinguish the connection end and extension end of the entity, making it difficult to accurately locate and correct abnormal expression areas. Ultimately, this leads to errors in the spatial belonging relationship of slender structures in the picture, affecting the structural consistency and visual expression accuracy of the rendering results. Summary of the Invention

[0004] The purpose of this invention is to address the shortcomings of existing technologies in accurately locating and correcting abnormal expression regions, and to propose a machine learning-based method and system for dynamic rendering of 3D animation environments.

[0005] To address the problems existing in the prior art, the present invention adopts the following technical solution: A machine learning-based method for dynamic rendering of 3D environments in animation, comprising: S1. Based on the degree of smoke and dust obstruction in the target's three-dimensional environment, obtain the smoke and dust engulfment evidence map; S2. Determine the linear structure response intensity based on the two-dimensional color image of the target three-dimensional environment, normalize the linear structure response intensity and convert the gray value to obtain the ink spike evidence image. S3. Binarize the ink spike evidence image to obtain the line candidate region image. Assign pixel values ​​to the ink spike skeleton image corresponding to the line candidate region image to obtain the endpoint marker image. S4. Determine the skeleton path based on the endpoint marker image, and classify and label the pixel positions on the skeleton path based on the smoke and dust engulfment evidence image to obtain the root puncture classification label image. S5. Based on the classification label map of broken roots and ink thorns, update the pixels of the basic animation rendering frame of the target 3D environment to obtain the final animation frame.

[0006] To address the aforementioned problems, this invention also provides a machine learning-based dynamic rendering system for 3D animation environments, the system comprising: The smoke and dust engulfment module generates a smoke and dust engulfment evidence map based on the degree of smoke and dust obstruction in the target's three-dimensional environment. The ink spike evidence module determines the linear structure response intensity based on the two-dimensional color image of the target's three-dimensional environment, normalizes the linear structure response intensity and converts its grayscale value to obtain the ink spike evidence image. The skeleton endpoint module performs binarization on the ink spike evidence image to obtain the line candidate region image, and assigns pixel values ​​to the ink spike skeleton image corresponding to the line candidate region image to obtain the endpoint marker image. The root break labeling module determines the skeleton path based on the endpoint marker image and assigns classification labels to the pixel positions on the skeleton path based on the smoke and dust engulfment evidence image, thus obtaining the root break ink spike classification label image. The rendering update module updates the pixels of the basic animation rendering frames of the target 3D environment based on the broken root ink spur classification label map to obtain the final animation frames.

[0007] Compared with the prior art, the beneficial effects of the present invention are: 1. This invention uses smoke and dust engulfment evidence maps to characterize the degree of occlusion of the root region of slender entities in the three-dimensional environment of the target by smoke and dust engulfment evidence maps, and uses ink spike evidence maps to characterize the prominence of slender and sharp linear structures. This allows the two factors of smoke and dust occlusion and line enhancement to be expressed in images, providing a clear data basis for subsequent localization of abnormal line regions.

[0008] 2. This invention transforms slender linear regions into skeletal structures that can identify endpoints and paths by using line candidate region images, ink spike skeleton diagrams, and endpoint marker images. Then, by combining endpoint engulfment intensity pairs and endpoint spike intensity pairs, the root endpoints and end endpoints are determined, which improves the accuracy of distinguishing between connecting ends and extension ends in complex occlusion scenarios.

[0009] 3. This invention determines the risk pixel region, root pixel region, and end pixel region based on the classification label map of broken ink spikes, and performs line assignment rewriting, environment blending, and end detail preservation processing respectively, so that the slender structure that was mistakenly expressed as floating spikes in the basic animation rendering frame is restored to the visual form of being attached to the surface of ruins, thereby improving the accuracy of spatial assignment expression in the final animation frame. Attached Figure Description

[0010] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings: Figure 1 This is a flowchart illustrating a machine learning-based method for dynamically rendering anime 3D environments, as provided in an embodiment of the present invention. Figure 2 This is a functional module diagram of a machine learning-based animation 3D environment dynamic rendering system provided in one embodiment of the present invention. Detailed Implementation

[0011] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.

[0012] This embodiment provides a machine learning-based method for dynamically rendering 3D environments in animation. (See also...) Figure 1 Specifically, including: S1. Based on the degree of smoke and dust obstruction in the target's three-dimensional environment, obtain the smoke and dust engulfment evidence map; In an embodiment of the present invention, a smoke engulfment evidence map is obtained based on the degree of smoke obstruction corresponding to the target three-dimensional environment, including: Obtain a two-dimensional color image of the target three-dimensional environment; The target 3D environment refers to a 3D scene space that includes broken reinforced concrete, exposed thin steel bar ends, smoke and dust, and lighting effects; the 2D color image refers to a planar color image formed after the target 3D environment is captured by a camera imaging device or output by a rendering camera.

[0013] Specifically, the target 3D environment is rendered frame by frame using a virtual rendering camera. During the rendering process, the complete red, green and blue channel color information is preserved. The output is a 2D planar color image with the same resolution as the final animation rendering output. The pixel coordinates of the image are based on the upper left corner as the origin, with the horizontal axis as the x-axis and the vertical axis as the y-axis. Each pixel corresponds to the projection of a specific spatial position in the target 3D environment onto the imaging plane. The pixel value range of each color channel is 0 to 255.

[0014] The degree of smoke and dust obstruction is determined based on the color distribution relationship of each pixel in the two-dimensional color image and combined with machine learning. The degree of smoke and dust obstruction refers to the strength of the obstruction and scattering effect of smoke and dust particles on the path of light propagation in space. This strength reflects the proportion of light from the surface of an object in the environment that is absorbed or deflected by smoke and dust as it propagates to the imaging position, thus manifesting as the degree of reduction in the visibility of the object's surface.

[0015] Specifically, 2D color images covering various ruin battle scenes, lighting conditions, smoke concentrations, occluded backgrounds, camera angles, and camera distances are collected. Each image corresponds to a pure smoke layer image rendered separately in the 3D rendering pipeline. The alpha channel value of each pixel in the pure smoke layer image is used as the actual smoke occlusion level for that pixel. The 2D color images are then compared with the corresponding actual smoke occlusion levels. Figure 1 The original dataset is composed of pairs, and the original dataset is randomly divided into training set, validation set and test set. The training set is used for updating model parameters, the validation set is used to monitor the model's generalization ability, and the test set is used to finally evaluate the model performance. An image regression model employing an encoder-decoder structure is proposed. The encoder consists of multiple convolutional layers and downsampling layers. Each convolutional layer uses a sliding window calculation with convolutional kernels of different sizes to process the input 2D color image layer by layer, extracting color distribution information at different scales. The downsampling layer compresses the output of the convolutional layer to reduce computation and expand the receptive field. The decoder consists of multiple deconvolutional layers and upsampling layers. The deconvolutional layer restores the encoded result output by the encoder layer by layer, and the upsampling layer restores the output of the deconvolutional layer to the same resolution as the input image. Skip connections are set between corresponding layers of the encoder and decoder to directly pass the color distribution information at different scales extracted by the encoder to the corresponding layer of the decoder, supplementing the image detail information. The input of the model is a three-channel 2D color image, and the output is a single-channel smoke and dust occlusion prediction map. During training, mean squared error is used as the loss function. The square of the difference between the predicted smoke occlusion level and the actual smoke occlusion level for each pixel is calculated. The average of the squared values ​​of all pixels in the entire image is then used to obtain the total loss. An adaptive moment estimation optimizer is used to update the model's weight parameters, and a cosine annealing learning rate scheduler is used to dynamically adjust the learning rate. The validation loss is calculated using a validation set after a fixed number of training rounds, and the model weights with the lowest validation loss are saved. Training stops when the validation loss no longer decreases after several consecutive rounds, resulting in a trained smoke occlusion prediction model. The two-dimensional color image corresponding to the target 3D environment to be processed is input into the trained smoke occlusion prediction model. The model automatically processes the color distribution information of each pixel in the image layer by layer and outputs a prediction result image with the same resolution as the input image. The value of each pixel in the prediction result image is the smoke occlusion level corresponding to that pixel, with a value range from 0 to 1. The larger the value, the higher the smoke occlusion level at that pixel location, and the smaller the value, the lower the smoke occlusion level at that pixel location.

[0016] Based on the degree of smoke and dust obstruction, grayscale mapping is performed on each pixel in the two-dimensional color image to obtain an evidence image of smoke and dust engulfment.

[0017] The smoke and dust engulfment evidence map refers to the spatial distribution of the degree of smoke and dust obstruction at various locations in space. This result reflects the differences in the degree of light propagation obstruction at different locations in the form of an image, and is used to characterize the spatial state of physical structures being covered or revealed in a smoke and dust environment.

[0018] Specifically, the process iterates through each pixel in the 2D color image, sequentially obtaining the smoke occlusion level value corresponding to each pixel. It then calculates the smoke occlusion level values ​​for all pixels in the current frame, determining the global minimum and maximum values. The difference between the global maximum and minimum values ​​is calculated. For each pixel's smoke occlusion level value, the global minimum value is subtracted to obtain the relative occlusion level. The relative occlusion level is then divided by the difference between the global maximum and minimum values ​​to obtain the normalized occlusion level. The normalized occlusion level is multiplied by 255 to obtain the corresponding grayscale value for that pixel. A single-channel image with the same width and height as the 2D color image is created. The grayscale value calculated for each pixel is written into the corresponding coordinate position in the single-channel image. Finally, a smoke engulfment evidence image is generated. In this image, the grayscale value of each pixel is positively correlated with the smoke occlusion level corresponding to that pixel; a larger grayscale value indicates a higher degree of smoke occlusion at that pixel location, and a smaller grayscale value indicates a lower degree of smoke occlusion at that pixel location.

[0019] S2. Determine the linear structure response intensity based on the two-dimensional color image of the target three-dimensional environment, normalize the linear structure response intensity and convert the gray value to obtain the ink spike evidence image. In embodiments of the present invention, determining the linear structural response intensity includes: A luminance image is obtained by performing a luminance conversion on a two-dimensional color image. Brightness conversion refers to the process of converting the color values ​​of each pixel in a two-dimensional color image into pixel values ​​used to represent the degree of brightness; a brightness image refers to an image obtained by converting a two-dimensional color image and used to represent the degree of brightness of each pixel.

[0020] Specifically, the process iterates through all pixels of the two-dimensional color image, sequentially reading the red, green, and blue channel values ​​of each pixel. The red channel value is multiplied by a first weighting coefficient, the green channel value by a second weighting coefficient, and the blue channel value by a third weighting coefficient. These three weighting coefficients are determined based on the human eye's sensitivity to different wavelengths of visible light. The three weighted calculation results are then added together to obtain the brightness value corresponding to the pixel. A single-channel image with the same width and height as the two-dimensional color image is created. The brightness value calculated for each pixel is written into the corresponding coordinate position in the single-channel image to form a brightness image.

[0021] The edge intensity of each pixel in the brightness image is determined based on the brightness changes of each pixel in the horizontal and vertical directions. A pixel is the smallest image unit in a luminance image that records brightness and darkness information; the horizontal direction refers to the direction in which pixels are arranged horizontally in a luminance image; the vertical direction refers to the direction in which pixels are arranged vertically in a luminance image; brightness variation refers to the change in brightness between adjacent pixels or neighboring pixels; edge intensity refers to the degree of abrupt change in brightness and darkness around a pixel.

[0022] Specifically, the process iterates through all pixels in the brightness image. For each non-boundary pixel, the brightness value of the current pixel is subtracted from the brightness value of its right-hand neighbor in the horizontal direction to obtain the horizontal brightness difference. The brightness value of the current pixel is subtracted from the brightness value of its upper-lower neighbor in the vertical direction to obtain the vertical brightness difference. For pixels at the image boundary, the missing brightness values ​​of adjacent pixels are supplemented by boundary copying before calculating the horizontal and vertical brightness differences. The horizontal brightness difference is squared to obtain the horizontal brightness change, and the vertical brightness difference is squared to obtain the vertical brightness change. The horizontal and vertical brightness changes are added together to obtain the total brightness change. The square root of the total brightness change is taken to obtain the edge intensity corresponding to the pixel. The edge intensity is used to represent the degree of brightness change in the area surrounding the pixel.

[0023] Gradient direction statistics are performed on the brightness image to obtain the edge direction distribution; Gradient direction statistics refer to the process of summarizing the distribution of pixel brightness change directions in a brightness image; edge direction distribution refers to the distribution of edge direction in different directions in a brightness image.

[0024] Specifically, the entire pixel of the brightness image is traversed. For each pixel, its horizontal and vertical brightness differences are obtained. The gradient direction angle corresponding to the pixel is calculated based on the arctangent function. The gradient direction angle ranges from 0 to 360 degrees. The angle range of 0 to 360 degrees is evenly divided into multiple continuous angle intervals, with each angle interval having the same span. For pixels at the image boundary, the missing brightness values ​​of adjacent pixels are supplemented by boundary copying before calculating the horizontal, vertical, and gradient direction angles. The number of pixels contained in each angle interval and the sum of the edge intensities of the corresponding pixels are counted to obtain the edge direction distribution. The edge direction distribution contains the pixel count information and the sum of edge intensities corresponding to each angle interval.

[0025] The linear structural response intensity is determined based on the edge strength and edge direction distribution.

[0026] Linear structure response intensity refers to the degree of influence of the surface of an object in space on the imaging light signal when it is continuously extended along a certain direction. This degree reflects the ability of light to form a continuous change along a specific direction after being reflected or blocked on the surface of the object. When there is a slender structure with a consistent direction on the surface of the object, its reflection and blocking of incident light have continuity and stability in that direction, which is manifested as a change in brightness along that direction in the imaging result. This intensity is used to characterize whether there is a slender solid structure with a consistent direction at the corresponding position in the image.

[0027] Specifically, the process iterates through all pixels of the brightness image to obtain its horizontal and vertical resolutions. The arithmetic mean of these resolutions is calculated, and this mean is multiplied by 0.01 to obtain a baseline value for the neighborhood side length. This baseline value is then rounded up to the nearest odd number. If the rounded odd number is less than 3, the neighborhood side length is set to 3. A square neighborhood region with the calculated side length is constructed centered on each pixel. For pixels at image boundaries, a mirror-fill method is used to fill in missing pixel data within the neighborhood region; that is, positions exceeding the image boundary are filled with pixel data from symmetrical positions within the image. The distribution of this neighborhood region is statistically analyzed based on the edge direction. The sum of edge intensity corresponding to each angle interval within the domain is used to select the angle interval with the largest sum of edge intensity as the main direction interval of the neighborhood. The sum of edge intensity of all pixels in the neighborhood whose gradient direction angle belongs to the main direction interval is calculated. This sum of edge intensity is divided by the sum of edge intensity of all pixels in the neighborhood to obtain the orientation consistency coefficient of the pixel. If the sum of edge intensity of all pixels in the neighborhood is 0, the orientation consistency coefficient is set to 0. The orientation consistency coefficient is multiplied by the edge intensity of the pixel to obtain the linear structure response intensity of the pixel. The higher the linear structure response intensity, the more likely there is a slender solid structure with consistent orientation at the pixel position.

[0028] In an embodiment of the present invention, obtaining the ink spike evidence image includes: The linear structural response intensity is normalized on the whole graph to obtain the normalized linear structural response intensity; Full-image normalization refers to the process of adjusting the values ​​at different locations within the same image range to a uniform value range; the normalized linear structure response intensity refers to the linear structure response intensity after adjustment to a uniform value range.

[0029] Specifically, the process iterates through all linear structure response intensity (LSI) values ​​corresponding to the luminance image, records the LSI at each pixel location, calculates the global maximum and global minimum values, and then calculates the difference between the global maximum and global minimum. If the difference is 0, the normalized LSI for all pixels is set to 0. If the difference is not 0, the relative LSI for each pixel is obtained by subtracting the global minimum value, and then by dividing the relative LSI by the difference between the global maximum and global minimum. This yields the normalized LSI for that pixel. A single-channel image with the same width and height as the luminance image is created, and the normalized LSI calculated for each pixel is written to the corresponding coordinate position to obtain the normalized LSI map.

[0030] The gray-scale mapping relationship is determined based on the normalized linear structural response intensity. Gray-scale mapping refers to the rules for converting the numerical values ​​corresponding to the response intensity of a linear structure into corresponding gray-scale values.

[0031] Specifically, a linear correspondence rule is established between the normalized linear structural response intensity and the grayscale value. The input range of this rule is 0 to 1, and the output range is the standard numerical range of 0 to 255 for a single-channel grayscale image. For the normalized linear structural response intensity of each pixel, it is multiplied by 255 to obtain the corresponding grayscale value of that pixel. A single-channel image with the same width and height as the normalized linear structural response intensity map is created. The grayscale value calculated for each pixel is written to the corresponding coordinate position to obtain the ink spike evidence map. The grayscale value of each pixel in the ink spike evidence map is positively correlated with the linear structural response intensity corresponding to that pixel. The larger the grayscale value, the higher the linear structural response intensity at that pixel position, and the smaller the grayscale value, the lower the linear structural response intensity at that pixel position.

[0032] Based on the grayscale mapping relationship, the grayscale value of the normalized linear structural response intensity is converted to obtain the ink spike evidence map.

[0033] Grayscale conversion refers to the process of converting numerical representations into image brightness and darkness representations; ink spike evidence image refers to an image in grayscale form that represents the degree to which ink spike-like linear structures are present at various locations; ink spike evidence image refers to a grayscale image used to represent the degree to which slender, sharp linear structures are present at various locations in an image. This image reflects the concentrated reflection or occlusion of light by slender entities in space during the imaging process. When the edge of an object has a slender extension and forms a prominent pointed shape locally, its effect on incident light in that area presents a continuous and consistent change in direction, thus appearing as a bright and dark transition with obvious sharp shapes in the imaging result. This image is used to distinguish between ordinary texture changes and slender structures with clear directionality and pointed shapes by expressing the strength of this spatial structure effect.

[0034] It should be noted that ink spikes refer to the sharp, linear representations formed in an image by the linearization of slender solid structures. These spikes typically appear as narrow, dark lines with a clear directionality, with one or both ends having a converging tip shape. They reflect the concentrated occlusion or reflection of light by the edge of the solid or the slender structure during the imaging process, thus forming a prominent, sharp visual shape in the image.

[0035] A slender, sharp linear structure refers to a solid shape that extends continuously in a certain direction in space and whose lateral dimension is significantly smaller than its longitudinal extension length. Geometrically, this structure presents a narrow and long shape with converging tips at one or both ends. When light is applied to the surface of this structure, the changes in reflection or occlusion are continuous along the extension direction, but change rapidly in the lateral direction, thus forming a fine, clear, and linear light and shadow representation with a sharp transition in the imaging result.

[0036] Specifically, the normalized linear structure response (LSR) image is traversed from left to right and top to bottom. The normalized LSR value corresponding to each pixel's coordinates is read sequentially. For pixels with values ​​less than 0, their corresponding grayscale value is set to 0; for pixels with values ​​greater than 1, their corresponding grayscale value is set to 255; for pixels with values ​​between 0 and 1, their normalized LSR value is multiplied by 255 to obtain their corresponding grayscale value. A single-channel grayscale image with identical horizontal and vertical resolution to the normalized LSR image is created. Each pixel... The grayscale values ​​obtained from pixel calculations are written into the corresponding coordinate positions in a single-channel grayscale image to obtain the ink spike evidence image. The grayscale value of each pixel in the ink spike evidence image is positively correlated with the significance of the thin, sharp linear structure at that position. The larger the grayscale value, the more likely there is an entity that extends continuously in a single direction and whose lateral dimension is significantly smaller than its longitudinal extension length. The smaller the grayscale value, the more likely the position is a normal texture or a uniform area. This image reflects the concentrated reflection or occlusion of light by thin entities in space during the imaging process through the difference in grayscale brightness, and can distinguish between ordinary texture changes and thin structures with clear directionality and sharp point shape.

[0037] S3. Binarize the ink spike evidence image to obtain the line candidate region image. Assign pixel values ​​to the ink spike skeleton image corresponding to the line candidate region image to obtain the endpoint marker image. In an embodiment of the present invention, obtaining a line candidate region image includes: Calculate the average grayscale value of the entire image of the ink spike evidence map; Specifically, the entire pixel of the ink spike evidence image is traversed from left to right and top to bottom. The gray value corresponding to the coordinate position of each pixel is read in turn. All the read gray values ​​are accumulated to obtain the total gray value of the entire image. The horizontal and vertical resolutions of the ink spike evidence image are obtained. The horizontal resolution and vertical resolution are multiplied to obtain the total number of pixels in the entire image. The total gray value of the entire image is divided by the total number of pixels in the entire image to obtain the average gray value of the ink spike evidence image.

[0038] Based on the grayscale values ​​of each pixel in the ink spike evidence image and the average grayscale value of the entire image, grayscale comparison and marking are performed on each pixel in the ink spike evidence image to obtain line retention markings; The average grayscale value of the entire image refers to the average grayscale value of all pixels in the ink spike evidence image; a pixel refers to the smallest image unit used to record grayscale information in the ink spike evidence image; grayscale value refers to the brightness value corresponding to a pixel; grayscale comparison mark refers to the pixel mark formed based on the relationship between the pixel grayscale value and the average grayscale value of the entire image; line retention mark refers to the mark used to indicate whether the corresponding pixel belongs to the line area that needs to be retained.

[0039] Specifically, the entire pixel of the ink spike evidence image is traversed again from left to right and top to bottom. The gray value of each pixel is compared with the calculated average gray value of the entire image. If the gray value of a pixel is greater than or equal to the average gray value of the entire image, the line preservation flag corresponding to that pixel is set to 1. If the gray value of a pixel is less than the average gray value of the entire image, the line preservation flag corresponding to that pixel is set to 0. A single-channel marker image with the same horizontal and vertical resolution as the ink spike evidence image is created. The line preservation flag corresponding to each pixel is written into the corresponding coordinate position in the single-channel marker image to obtain the complete line preservation marker image.

[0040] Based on the preserved markings of the lines, the ink spike evidence image is binarized to obtain the candidate region image of the lines.

[0041] Binarization refers to the process of converting pixels in an image into two types of values; line candidate region image refers to an image that expresses the possible locations of slender entities in space in the imaging result. This image is used to describe the light and dark distribution areas formed by a structure that extends continuously along a certain direction and has a small width on the surface of an object under the action of light. These areas correspond to the parts of the object that continuously block or reflect incident light, thus appearing as slender and directional regional distributions in the image, used to characterize the location range of slender structures that may correspond to them in actual space.

[0042] Specifically, the entire pixel of the ink spike evidence image is traversed from left to right and top to bottom. The line preservation marker corresponding to the coordinate position of each pixel is read sequentially. If the line preservation marker is 1, the gray value of the pixel after binarization is set to 255. If the line preservation marker is 0, the gray value of the pixel after binarization is set to 0. A single-channel binary image with the same horizontal and vertical resolution as the ink spike evidence image is created. The gray value of each pixel after binarization is written into the corresponding coordinate position in the single-channel binary image to obtain the line candidate region image. The region composed of pixels with a gray value of 255 in the line candidate region image is the candidate region for possible slender solid structures. The region composed of pixels with a gray value of 0 is the background region. This image expresses the possible location of slender solids in space in the imaging result. It describes the light and dark distribution area formed by a structure that extends continuously along a certain direction and has a small width on the surface of an object under the action of light. It is used to characterize the location range of slender structures that may correspond to them in actual space, and provides a basis for the subsequent generation of ink spike skeleton image and endpoint marker image.

[0043] In an embodiment of the present invention, obtaining an endpoint marker image includes: The candidate region image of the lines is thinned to obtain the ink spike skeleton image; Thinning refers to the image processing process of shrinking a wide linear region into a centerline shape; ink skeleton map refers to an image representing the central extension path of a thin linear region.

[0044] Specifically, the entire pixel region of the candidate image is traversed from left to right and from top to bottom. Pixels with a grayscale value of 255 are labeled as foreground pixels, and pixels with a grayscale value of 0 are labeled as background pixels. An iterative thinning method is used to process the foreground pixel region. Each iteration consists of two consecutive processing stages. In the first stage, all foreground pixels are traversed. If a pixel is a boundary pixel and the number of foreground pixels in its eight-neighborhood is greater than or equal to 2 and less than or equal to 6, and the pixels above, to the right, and below the pixel are not simultaneously foreground pixels, and the pixels to the right, below, and to the left of the pixel are not simultaneously foreground pixels, then the pixel is labeled as a foreground pixel. In the first stage, all pixels marked as to be deleted in the first stage are traversed. If the three neighboring pixels above, to the left, and below a pixel are not simultaneously foreground pixels, or the three neighboring pixels above, to the right, and to the left are not simultaneously foreground pixels, then the gray value of the pixel is set to 0. The above two-stage iterative process is repeated until no pixels are deleted in two consecutive iterations. A single-channel image with the same horizontal and vertical resolution as the line candidate region image is created. The pixels with a gray value of 255 remaining after processing are written as skeleton pixels at the corresponding coordinate positions to obtain the ink burr skeleton image.

[0045] Calculate the number of adjacent skeleton pixels of a skeleton pixel in the ink skeleton image; Skeleton pixels refer to pixels in the ink skeleton map that belong to the central extension path; the number of adjacent skeleton pixels refers to the number of skeleton pixels around a skeleton pixel that are connected to that skeleton pixel and also belong to the central extension path.

[0046] Specifically, the entire pixel of the ink skeleton image is traversed from left to right and from top to bottom. For each skeleton pixel with a gray value of 255, the gray values ​​of the pixels at its eight adjacent positions (above, above, to the right, below, to the right, below, to the left, to the left, and above to the left) are checked in turn. The number of pixels with a gray value of 255 is counted, and this number is the number of adjacent skeleton pixels corresponding to that skeleton pixel. A single-channel numerical image with the same horizontal and vertical resolution as the ink skeleton image is created. The number of adjacent skeleton pixels corresponding to each skeleton pixel is written to the corresponding coordinate position, and the values ​​corresponding to non-skeleton pixels are set to 0, thus obtaining a complete image of the number of adjacent skeleton pixels.

[0047] Determine the set of endpoint skeleton pixels based on the number of adjacent skeleton pixels; The endpoint skeleton pixel set refers to the skeleton pixel set located at the end of the central extension path and whose number of connected skeleton pixels satisfies the end shape.

[0048] Specifically, the entire image of the adjacent skeleton pixel count is traversed in the order from left to right and from top to bottom. For each pixel position, the value of the adjacent skeleton pixel corresponding to that position is read. If the value is equal to 1, the horizontal and vertical coordinate information of the pixel is added to the endpoint skeleton pixel set. If the value is not equal to 1, no operation is performed. The number of adjacent skeleton pixels corresponding to non-skeleton pixels is 0 and they do not participate in the endpoint skeleton pixel judgment process. Finally, the endpoint skeleton pixel set containing the coordinate information of the end pixels of all the center extension paths is obtained.

[0049] Based on the set of endpoint skeleton pixels, pixel values ​​are assigned to the ink spike skeleton image to obtain the endpoint marked image.

[0050] Pixel assignment marking refers to the process of writing mark values ​​to the corresponding positions according to the category of the pixel; endpoint mark image refers to the image used to represent the position of the end of the central extension path in the ink skeleton diagram.

[0051] Specifically, a single-channel marker image with the exact same horizontal and vertical resolution as the ink skeleton image is created. The initial grayscale value of all pixels in the marker image is set to 0. All pixel coordinate information in the endpoint skeleton pixel set is traversed, and the grayscale value of the pixels at the corresponding horizontal and vertical coordinate positions in the marker image is set to 255. Finally, the endpoint marker image is obtained. The pixel position with a grayscale value of 255 in the endpoint marker image corresponds to the end position of the central extension path in the ink skeleton image, and the pixel position with a grayscale value of 0 corresponds to the skeleton pixel or background pixel that is not an endpoint.

[0052] S4. Determine the skeleton path based on the endpoint marker image, and classify and label the pixel positions on the skeleton path based on the smoke and dust engulfment evidence image to obtain the root puncture classification label image. In an embodiment of the present invention, determining the skeleton path based on the endpoint marker image includes: Connected component segmentation is performed on the ink spine skeleton graph to obtain the connected components of the ink spine skeleton; Connected component segmentation refers to the process of dividing interconnected skeleton pixels in an image into the same pixel region; ink skeleton connected component refers to a single centrally extending path region composed of interconnected skeleton pixels in an ink skeleton image.

[0053] Specifically, traversing all pixels of the ink skeleton image from left to right and top to bottom, a single-channel access marker image with identical horizontal and vertical resolutions is created. The initial values ​​of all pixels in the access marker image are set to 0. For each skeleton pixel with a grayscale value of 255 and a corresponding value of 0 in the access marker image, it is used as the seed pixel for the current connected component. An eight-connected region growing method is used for region expansion. The eight adjacent pixels of the seed pixel are checked sequentially. If an adjacent pixel has a grayscale value of 255 and a corresponding value of 0 in the access marker image, that adjacent pixel is added to the current connected component, and the corresponding value in the access marker image is updated. The value of the corresponding position is set to 1. The above region expansion process is repeated until no new pixels can be added to the current connected region. The current connected region is stored as an independent ink spike skeleton connected region. The remaining pixels are traversed until all skeleton pixels have been visited and assigned to the corresponding connected regions. Each ink spike skeleton connected region contains the horizontal and vertical coordinate information of all skeleton pixels in the connected region, as well as the total number of skeleton pixels contained in the connected region. All ink spike skeleton connected regions are independent of each other and there are no overlapping pixels. Each ink spike skeleton connected region corresponds to a complete central extension path region in the ink spike skeleton diagram, which can accurately represent the central direction and position range of a single slender and sharp linear structure.

[0054] Based on the endpoint-marked image, determine the endpoint pixel pairs of the connected domain of the ink spike skeleton; Specifically, all ink spike skeleton connected components are traversed in the order of storage index. For each ink spike skeleton connected component, the horizontal and vertical coordinate information of all skeleton pixels in the connected component is read in sequence. Based on the coordinate information of each skeleton pixel, the gray values ​​of the corresponding horizontal and vertical coordinate positions in the endpoint marker image are read. The number of endpoint pixels with a gray value of 255 in the ink spike skeleton connected component is counted. Two endpoint pixels in the ink spike skeleton connected component are combined into an endpoint pixel pair. Each ink spike skeleton connected component corresponds to a unique endpoint pixel pair. The two pixels in the endpoint pixel pair are located at the two ends of the central extension path corresponding to the ink spike skeleton connected component.

[0055] Determine the skeleton path between endpoint pixel pairs.

[0056] An endpoint pixel pair refers to two endpoint pixels located at both ends of the central extension path in the same ink skeleton connected domain; a skeleton path refers to the central extension path between endpoint pixel pairs composed of continuous skeleton pixels.

[0057] Specifically, for each endpoint pixel pair corresponding to a connected component of the ink spine skeleton, a single-channel path access marker image with the same horizontal and vertical resolution as the ink spine skeleton image is created. The initial values ​​of all pixels in the path access marker image are set to 0. The first endpoint pixel in the endpoint pixel pair is taken as the path start point and the second endpoint pixel as the path end point. The path start point is added to the skeleton path and the value at the corresponding position in the path access marker image is set to 1. Starting from the path start point, the pixels at the eight adjacent positions of the current pixel are checked in turn. If the grayscale value of the adjacent pixel is 255 and the value at the corresponding position in the path access marker image is 0, then the adjacent pixel is added to the skeleton path and the value at the corresponding position in the path access marker image is set to 1. The adjacent pixel is taken as the new current pixel and the adjacent pixel check continues. The above process is repeated until the current pixel is the path end point, resulting in a skeleton path composed of continuous skeleton pixels between endpoint pixel pairs. The skeleton path contains the coordinate information of all skeleton pixels on the central extension path.

[0058] In an embodiment of the present invention, a classification label map of broken ink thorns is obtained, including: Based on the endpoint pixel pairs, the endpoint pixel values ​​are read from the smoke engulfment evidence map to obtain the endpoint engulfment intensity pairs; Specifically, the endpoint pixel pairs corresponding to all connected components of the ink spike skeleton are traversed according to the storage index order. For each endpoint pixel pair, the x-coordinate and y-coordinate information of the first endpoint pixel in the endpoint pixel pair are read in sequence, and the gray values ​​of the corresponding x-coordinate and y-coordinate positions in the smoke engulfment evidence image are read. Then, the x-coordinate and y-coordinate information of the second endpoint pixel in the endpoint pixel pair are read, and the gray values ​​of the corresponding x-coordinate and y-coordinate positions in the smoke engulfment evidence image are read. The two gray values ​​read in sequence are combined into a set of data according to the order of the endpoint pixel pair. This set of data is the endpoint engulfment intensity pair corresponding to the endpoint pixel pair. Each endpoint pixel pair corresponds to a unique set of endpoint engulfment intensity pairs. The order of gray values ​​in the endpoint engulfment intensity pair is consistent with the order of endpoint pixels in the corresponding endpoint pixel pair.

[0059] Based on the endpoint pixel pairs, the endpoint pixel values ​​of the ink spike evidence image are read to obtain the endpoint spike intensity pairs. Endpoint engulfment intensity pair refers to the grayscale value combination of the corresponding position of the endpoint pixel pair in the smoke engulfment evidence image; endpoint spike intensity pair refers to the grayscale value combination of the corresponding position of the endpoint pixel pair in the ink spike evidence image.

[0060] Specifically, the endpoint pixel pairs corresponding to all connected components of the ink spike skeleton are traversed according to the storage index order. For each endpoint pixel pair, the x-coordinate and y-coordinate information of the first endpoint pixel in the endpoint pixel pair are read in sequence, and the gray values ​​of the corresponding x-coordinate and y-coordinate positions in the ink spike evidence image are read. Then, the x-coordinate and y-coordinate information of the second endpoint pixel in the endpoint pixel pair are read, and the gray values ​​of the corresponding x-coordinate and y-coordinate positions in the ink spike evidence image are read. The two gray values ​​read in sequence are combined into a set of data according to the order of the endpoint pixel pair. This set of data is the endpoint spike intensity pair corresponding to the endpoint pixel pair. Each endpoint pixel pair corresponds to a unique set of endpoint spike intensity pairs. The arrangement order of the gray values ​​in the endpoint spike intensity pair is consistent with the arrangement order of the endpoint pixels in the corresponding endpoint pixel pair.

[0061] The root endpoint and the end endpoint are determined based on the endpoint submersion strength pair and the endpoint spike strength pair; The root endpoint refers to the pixel at the location where the corresponding entity structure is attached to the environment and is more affected by occlusion; the end endpoint refers to the pixel at the location where the corresponding entity structure is far from the attachment location and appears prominent in the image.

[0062] Specifically, according to the storage index order, all endpoint swallowing intensity pairs and endpoint spike intensity pairs corresponding to the ink spike skeleton connected domains are traversed. For each endpoint pixel pair, the first gray value and the second gray value in the endpoint swallowing intensity pair are extracted in sequence, and the first gray value and the second gray value in the endpoint spike intensity pair are extracted at the same time. The endpoint pixel with the larger gray value in the endpoint swallowing intensity pair and the smaller gray value in the corresponding endpoint spike intensity pair is determined as the root endpoint, and the endpoint pixel with the smaller gray value in the endpoint swallowing intensity pair and the larger gray value in the corresponding endpoint spike intensity pair is determined as the end endpoint. Each ink spike skeleton connected domain corresponds to a unique set of root endpoints and end endpoints. The root endpoint corresponds to the end pixel where the entity structure is attached to the environment and is more strongly affected by occlusion, and the end endpoint corresponds to the other end pixel where the entity structure is far from the attachment position and appears prominent in the image.

[0063] Based on the root endpoint and the end endpoint, the pixel positions on the skeleton path are classified, labeled, and assigned values ​​to obtain the classification label map of broken root ink spikes.

[0064] Classification label assignment refers to the process of writing label values ​​to the corresponding positions according to the category of the pixel; the severed ink spur classification label image refers to an image used to represent the attachment relationship and extension state of slender entities in space. This image distinguishes the extension path of the entity at each position, reflecting the part of the entity that is connected to the environmental structure at one end and is affected by occlusion, as well as the part that extends outward and presents a protruding shape at the other end, thereby expressing the connection position and extension direction of the entity in space, and reflecting the differences in occlusion and exposure at different positions during the light propagation process.

[0065] Specifically, a single-channel labeled image with the exact same horizontal and vertical resolution as the ink spike skeleton map is created. The initial grayscale value of all pixels in the labeled image is set to 0. The skeleton paths corresponding to all connected components of the ink spike skeleton are traversed in the order of storage index. For each skeleton path, the grayscale value of the pixel on the path that is exactly the same as the coordinate of the root endpoint is set to 1, the grayscale value of the pixel on the path that is exactly the same as the coordinate of the end endpoint is set to 2, and the grayscale value of all other skeleton pixels on the path is set to 3. Finally, the severed root ink spike classification label map is obtained. Different grayscale values ​​in the severed root ink spike classification label map represent different parts of the attachment relationship and extension state of the slender entity in space. They reflect the part of the entity that is connected to the environmental structure at one end and is affected by occlusion, as well as the part that extends outward and presents a protruding shape at the other end. This expresses the connection position and extension direction of the entity in space and reflects the differences in occlusion and exposure at different positions during light propagation.

[0066] S5. Based on the classification label map of broken roots and ink thorns, update the pixels of the basic animation rendering frame of the target 3D environment to obtain the final animation frame.

[0067] In an embodiment of the present invention, obtaining the final animation frame includes: The target 3D environment is rendered in an anime-style format to obtain basic anime rendering frames. Anime stylized rendering refers to the rendering process that transforms the materials, lighting, shadows, and contours of a target 3D environment into elements that conform to the visual style of anime. A basic anime rendering frame refers to the current frame image obtained after the target 3D environment has undergone anime stylized rendering.

[0068] Specifically, the process reads the geometric model data, material attribute data, light source parameter data, and camera parameter data of the target 3D environment. It converts the physical materials in the target 3D environment into anime-style flat-painted materials, sets the number of color layers and color transition thresholds for the flat-painted materials, calculates the diffuse reflection light intensity of each light source on the model surface, quantizes the diffuse reflection light intensity, converts continuous light intensity values ​​into discrete light levels, generates anime-style hard shadows, sets the edge hardness and shadow color of the hard shadows, extracts the contour lines of objects in the scene based on the model's normal and depth information, sets the width and color of the contour lines, and combines and renders the processed materials, lighting, shadows, and contour lines to output the current frame image that conforms to the anime visual style. This image is the basic anime rendering frame.

[0069] Based on the broken ink spike classification label map, identify the risk pixel areas of broken ink spikes in the basic animation rendering frames; The risk pixel area of ​​broken roots and ink spikes refers to the pixel range in the basic animation rendering frame that corresponds to the abnormal expression of the attachment relationship of slender entities.

[0070] Specifically, the horizontal and vertical resolutions of the broken ink spike classification label image are obtained, along with the horizontal and vertical resolutions of the base animation rendering frame. If the two resolutions are inconsistent, the broken ink spike classification label image is scaled to the exact same resolution as the base animation rendering frame. All pixels of the broken ink spike classification label image are traversed from left to right and from top to bottom, and the grayscale value of each pixel is read sequentially. If the grayscale value of a pixel is not 0, the pixel at the corresponding horizontal and vertical coordinate positions in the base animation rendering frame is marked as a broken ink spike risk pixel. The continuous or discrete region composed of all marked broken ink spike risk pixels is the broken ink spike risk pixel region. The broken ink spike risk pixel region corresponds to the pixel range in the base animation rendering frame where the attachment relationship of slender entities is abnormally expressed.

[0071] The line pixels in the risk pixel region of broken ink burrs are rewritten to obtain the risk-corrected line image. Line pixels refer to the pixels in the basic animation rendering frame used to express entity boundaries, cracks, shadow edges, or slender structures; line attribution rewriting refers to the process of adjusting line pixels from independent spike shapes to lines connected to the surface of ruins; risk-corrected line images refer to the images formed after attribution adjustment of line pixels in the risk pixel area of ​​broken roots and ink spikes.

[0072] Specifically, the coordinate information of the risk pixel region of the broken root ink spike is read, and all pixels in the base animation rendering frame located in this region are traversed. Line pixels belonging to entity boundaries, cracks, shadow edges, or slender structures are extracted. Taking the root pixel region as the connection starting point, the position, direction, and connection relationship of the line pixels are adjusted to form a continuous connection effect with the lines of the surrounding ruin structure. The line pixels with independent spike shapes are modified into lines connected to the surface of the ruins. The adjusted line pixels are written into a blank image with the same resolution as the base animation rendering frame. The background pixels are set to the original background color of the base animation rendering frame to obtain the risk-corrected line image. The risk-corrected line image only contains the line pixels that have been adjusted in terms of their affiliation.

[0073] Based on the classification label map of broken ink burrs, the root pixel region and the end pixel region in the basic animation rendering frame are determined; The root pixel region refers to the pixel range at the connection point between the slender entity and the ruin structure in the basic animation rendering frame; the end pixel region refers to the pixel range at the end of the slender entity that extends away from the connection point and outwards in the basic animation rendering frame.

[0074] Specifically, the horizontal and vertical resolutions of the broken root ink spike classification label image are obtained, as well as the horizontal and vertical resolutions of the base animation rendering frame. The broken root ink spike classification label image and the base animation rendering frame are aligned pixel-wise. All pixels of the broken root ink spike classification label image are traversed in a left-to-right, top-to-bottom order. For pixels with a grayscale value of 1 in the broken root ink spike classification label image, the corresponding coordinate position in the base animation rendering frame is marked as the root pixel. The area formed by all marked root pixels is the root pixel area. For pixels with a grayscale value of 2 in the broken root ink spike classification label image, the corresponding coordinate position in the base animation rendering frame is marked as the end pixel. The area formed by all marked end pixels is the end pixel area. The root pixel area corresponds to the pixel range at the connection position between the slender entity and the ruin structure in the base animation rendering frame, and the end pixel area corresponds to the pixel range at the end of the slender entity that extends away from the connection position and outwards in the base animation rendering frame.

[0075] The pixels in the root pixel region are subjected to environment blending processing to obtain the root-corrected image; Environment blending refers to the process of adjusting the target region pixels to be consistent with their surrounding environment in terms of illumination intensity, color distribution, and spatial continuity; root correction image refers to the image formed after environment blending is performed on the root pixel region.

[0076] Specifically, using the boundary of the root pixel region as a reference, a blending reference region is formed by expanding outward in the base animation rendering frame. All pixels within the blending reference region are traversed, and the illumination intensity value, color channel value, and transition relationship with adjacent pixels of each pixel are calculated. The calculated average illumination intensity, average color value, and transition continuity data are used as environmental reference parameters. Each pixel within the root pixel region is traversed, and the illumination intensity, color value, and transition relationship with adjacent pixels of that pixel are adjusted according to the environmental reference parameters to make it consistent with the surrounding environment. An image with the exact same resolution as the base animation rendering frame is created, and the adjusted root pixel is written to the corresponding coordinate position. The remaining pixels retain the original pixel values ​​of the base animation rendering frame, resulting in the root correction image.

[0077] End detail preservation processing is performed on the pixels in the end pixel region to obtain the end-corrected image; End detail preservation processing refers to the process of maintaining the brightness variations and boundary sharpness of the end without weakening the extended shape of the end; end correction image refers to the image formed after performing detail preservation processing on the end pixel area.

[0078] Specifically, the process iterates through all pixels within the end pixel region, calculates the local brightness gradient and boundary gradient value for each pixel, identifies contour pixels, highlight pixels, and shadow pixels within the end pixel region, records the coordinates and pixel values ​​of these key pixels, iterates through the non-key pixels within the end pixel region, adjusts the illumination intensity and color values ​​of the non-key pixels so that they do not affect the brightness variation and boundary sharpness of the end, creates an image with the exact same resolution as the base animation rendering frame, writes the key pixels to their corresponding coordinates while retaining their original pixel values, writes the adjusted non-key pixels to their corresponding coordinates, and retains the original pixel values ​​of the base animation rendering frame for the remaining pixels, thus obtaining the end-corrected image.

[0079] Based on the risk-corrected line image, root correction image, and end correction image, the base animation rendering frame is updated pixel by pixel to obtain the final animation frame.

[0080] Pixel update refers to the process of replacing or adjusting the pixel values ​​at corresponding positions in the original image according to the processing results of different regions; the final animation frame refers to the image used for display after completing the pixel update of each region.

[0081] Specifically, a temporary image with identical horizontal and vertical resolutions to the base animation rendering frame is created. All pixel values ​​from the base animation rendering frame are copied to the temporary image according to their coordinate correspondence. The entire pixel set of the risk correction line image is traversed from left to right and top to bottom, reading the horizontal and vertical coordinates and pixel value of each pixel sequentially. If a pixel value differs from the pixel value at the same coordinate position in the temporary image, the pixel value at that coordinate position in the temporary image is replaced with the pixel value from the risk correction line image. This process is repeated, traversing the entire pixel set of the root correction image from left to right and top to bottom, and reading the values ​​sequentially. For each pixel, its x-coordinate, y-coordinate, and pixel value are processed. If the pixel value differs from the pixel value at the same coordinate position in the temporary image, the pixel value at that coordinate position in the temporary image is replaced with the pixel value of the root correction image. Then, all pixels in the end correction image are traversed in order from left to right and from top to bottom. The x-coordinate, y-coordinate, and pixel value of each pixel are read sequentially. If the pixel value differs from the pixel value at the same coordinate position in the temporary image, the pixel value at that coordinate position in the temporary image is replaced with the pixel value of the end correction image. After all pixel values ​​have been replaced and adjusted, the temporary image is output as the final animation frame.

[0082] It should be noted that during the rendering of 3D environments in animation, due to the combined effects of smoke and dust obscuring the lines, the exposed ends of thin steel bars can easily appear as discontinuous lines with no roots and protruding ends. This can cause them to be misjudged in the image as independent, suspended spikes rather than solid extensions attached to the concrete surface. This can disrupt the spatial connection and visual semantics between entities in the ruins structure. Therefore, it is necessary to update the pixels of the basic animation rendering frames. By adjusting the line assignments and shading of relevant pixel areas, the slender structures can be re-represented in the image as connected to the environment, thus obtaining the final animation frames that conform to the actual spatial relationships.

[0083] like Figure 2 The diagram shown is a functional module diagram of a machine learning-based animation 3D environment dynamic rendering system provided in an embodiment of the present invention.

[0084] In this embodiment, the functions of each module / unit are as follows: The smoke and dust engulfment module generates a smoke and dust engulfment evidence map based on the degree of smoke and dust obstruction in the target's three-dimensional environment. The ink spike evidence module determines the linear structure response intensity based on the two-dimensional color image of the target's three-dimensional environment, normalizes the linear structure response intensity and converts its grayscale value to obtain the ink spike evidence image. The skeleton endpoint module performs binarization on the ink spike evidence image to obtain the line candidate region image, and assigns pixel values ​​to the ink spike skeleton image corresponding to the line candidate region image to obtain the endpoint marker image. The root break labeling module determines the skeleton path based on the endpoint marker image and assigns classification labels to the pixel positions on the skeleton path based on the smoke and dust engulfment evidence image, thus obtaining the root break ink spike classification label image. The rendering update module updates the pixels of the basic animation rendering frames of the target 3D environment based on the broken root ink spur classification label map to obtain the final animation frames.

[0085] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. A machine learning-based method for dynamic rendering of 3D animation environments, characterized in that, Includes the following steps: S1. Based on the degree of smoke and dust obstruction in the target's three-dimensional environment, obtain the smoke and dust engulfment evidence map; S2. Determine the linear structure response intensity based on the two-dimensional color image of the target three-dimensional environment, normalize the linear structure response intensity and convert the gray value to obtain the ink spike evidence image. S3. Binarize the ink spike evidence image to obtain the line candidate region image. Assign pixel values ​​to the ink spike skeleton image corresponding to the line candidate region image to obtain the endpoint marker image. S4. Determine the skeleton path based on the endpoint marker image, and classify and label the pixel positions on the skeleton path based on the smoke and dust engulfment evidence image to obtain the root puncture classification label image. S5. Based on the classification label map of broken roots and ink thorns, update the pixels of the basic animation rendering frame of the target 3D environment to obtain the final animation frame.

2. The method for dynamic rendering of anime 3D environments based on machine learning according to claim 1, characterized in that, Based on the degree of smoke and dust obstruction corresponding to the target's three-dimensional environment, an evidence map of smoke and dust engulfment is obtained, including: Obtain a two-dimensional color image of the target three-dimensional environment; The degree of smoke and dust obstruction is determined based on the color distribution relationship of each pixel in the two-dimensional color image; Based on the degree of smoke and dust obstruction, grayscale mapping is performed on each pixel in the two-dimensional color image to obtain an evidence image of smoke and dust engulfment.

3. The method for dynamic rendering of anime 3D environments based on machine learning according to claim 1, characterized in that, Determining the intensity of linear structural response includes: A luminance image is obtained by performing a luminance conversion on a two-dimensional color image. The edge intensity of each pixel in the brightness image is determined based on the brightness changes of each pixel in the horizontal and vertical directions. Gradient direction statistics are performed on the brightness image to obtain the edge direction distribution; The linear structural response intensity is determined based on the edge strength and edge direction distribution.

4. The method for dynamic rendering of anime 3D environments based on machine learning according to claim 1, characterized in that, The evidence obtained includes images of ink spikes, including: The linear structural response intensity is normalized on the whole graph to obtain the normalized linear structural response intensity; The gray-scale mapping relationship is determined based on the normalized linear structural response intensity. Based on the grayscale mapping relationship, the grayscale value of the normalized linear structural response intensity is converted to obtain the ink spike evidence map.

5. The method for dynamic rendering of anime 3D environments based on machine learning according to claim 1, characterized in that, Obtain the line candidate region image, including: Calculate the average grayscale value of the entire image of the ink spike evidence map; Based on the grayscale values ​​of each pixel in the ink spike evidence image and the average grayscale value of the entire image, grayscale comparison and marking are performed on each pixel in the ink spike evidence image to obtain line retention markings; Based on the preserved markings of the lines, the ink spike evidence image is binarized to obtain the candidate region image of the lines.

6. The method for dynamic rendering of anime 3D environments based on machine learning according to claim 1, characterized in that, Obtain the endpoint marker image, including: The candidate region image of the lines is thinned to obtain the ink spike skeleton image; Calculate the number of adjacent skeleton pixels of a skeleton pixel in the ink skeleton image; Determine the set of endpoint skeleton pixels based on the number of adjacent skeleton pixels; Based on the set of endpoint skeleton pixels, pixel values ​​are assigned to the ink spike skeleton image to obtain the endpoint marked image.

7. The method for dynamic rendering of anime 3D environments based on machine learning according to claim 1, characterized in that, Determine the skeleton path based on the endpoint marker image, including: Connected component segmentation is performed on the ink spine skeleton graph to obtain the connected components of the ink spine skeleton; Based on the endpoint-marked image, determine the endpoint pixel pairs of the connected domain of the ink spike skeleton; Determine the skeleton path between endpoint pixel pairs.

8. The method for dynamic rendering of anime 3D environments based on machine learning according to claim 1, characterized in that, The resulting classification label image for severed ink thorns includes: Based on the endpoint pixel pairs, the endpoint pixel values ​​are read from the smoke engulfment evidence map to obtain the endpoint engulfment intensity pairs; Based on the endpoint pixel pairs, the endpoint pixel values ​​of the ink spike evidence image are read to obtain the endpoint spike intensity pairs. The root endpoint and the end endpoint are determined based on the endpoint submersion strength pair and the endpoint spike strength pair; Based on the root endpoint and the end endpoint, the pixel positions on the skeleton path are classified, labeled, and assigned values ​​to obtain the classification label map of broken root ink spikes.

9. The method for dynamic rendering of anime 3D environments based on machine learning according to claim 1, characterized in that, The final animation frames are obtained, including: The target 3D environment is rendered in an anime-style format to obtain basic anime rendering frames. Based on the broken ink spike classification label map, identify the risk pixel areas of broken ink spikes in the basic animation rendering frames; The line pixels in the risk pixel region of broken ink burrs are rewritten to obtain the risk-corrected line image. Based on the classification label map of broken ink burrs, the root pixel region and the end pixel region in the basic animation rendering frame are determined; The pixels in the root pixel region are subjected to environment blending processing to obtain the root-corrected image; End detail preservation processing is performed on the pixels in the end pixel region to obtain the end-corrected image; Based on the risk-corrected line image, root correction image, and end correction image, the base animation rendering frame is updated pixel by pixel to obtain the final animation frame.

10. A system for applying the machine learning-based animation 3D environment dynamic rendering method described in any one of claims 1-9, characterized in that, The system includes: The smoke and dust engulfment module generates a smoke and dust engulfment evidence map based on the degree of smoke and dust obstruction in the target's three-dimensional environment. The ink spike evidence module determines the linear structure response intensity based on the two-dimensional color image of the target's three-dimensional environment, normalizes the linear structure response intensity and converts its grayscale value to obtain the ink spike evidence image. The skeleton endpoint module performs binarization on the ink spike evidence image to obtain the line candidate region image, and assigns pixel values ​​to the ink spike skeleton image corresponding to the line candidate region image to obtain the endpoint marker image. The root break labeling module determines the skeleton path based on the endpoint marker image and assigns classification labels to the pixel positions on the skeleton path based on the smoke and dust engulfment evidence image, thus obtaining the root break ink spike classification label image. The rendering update module updates the pixels of the basic animation rendering frames of the target 3D environment based on the broken root ink spur classification label map to obtain the final animation frames.