Dynamic display method, device and equipment of two-dimensional image and storage medium

CN116630143BActive Publication Date: 2026-09-11SHENZHEN SHANJIAN INTELLIGENT SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310556195.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-16
Publication Date
2026-09-11
Estimated Expiration
2043-05-16

AI Technical Summary

Technical Problem

[0004]本发明的主要目的在于解决当前二维图像转换为三维动态化图像的变化扩展灵活性较低的技术问题

Benefits of technology

[0039] In this embodiment of the invention, a video cone effect and a cave terrain effect are generated by performing linear mapping processing based on the image center on each pixel. These effects can be generated cyclically over time and can be expanded and modified, solving the technical problem of low flexibility in the transformation of current two-dimensional images into three-dimensional dynamic images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116630143B_ABST
    Figure CN116630143B_ABST
Patent Text Reader

Abstract

This invention relates to the field of special effects processing, and discloses a method, apparatus, device, and storage medium for dynamic display of two-dimensional images. The method includes: reading the coordinates of a target pixel in a two-dimensional image according to the screen pixel coordinate system; normalizing the target pixel coordinates based on the total number of vertical and horizontal pixels on the display screen to obtain normalized pixel coordinates; performing angle calculations on the normalized pixel coordinates to obtain a transformation angle; obtaining the mapped horizontal coordinates corresponding to the target pixel coordinates by substituting the transformation angle and the total number of vertical pixels according to the horizontal mapping formula; performing pixel mapping processing on the normalized pixel coordinates and the total number of vertical pixels according to the vertical mapping formula to obtain the mapped vertical coordinates corresponding to the target pixel coordinates; and performing three-dimensional processing on the two-dimensional image based on the mapped vertical and horizontal coordinates to generate a three-dimensional dynamic image. This invention solves the problem of low flexibility in expanding current dynamic effects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of special effects processing, and more particularly to a method, apparatus, device, and storage medium for the dynamic display of two-dimensional images. Background Technology

[0002] Whether it's video or game, stunning visuals are indispensable, and even the most beautiful visuals rely on images. Sometimes it's necessary to construct a virtual environment, which can be used for videos or game scenes. Some can use pre-made images from the internet for direct overlay, but current processing methods often don't allow for customization and can only rely on the source material itself.

[0003] While current technologies exist for creating terrain images from computer noise, they require a high level of technical expertise from users and are difficult to animate, limiting their widespread use. To address the limited flexibility in converting 2D images into 3D animated images, a new technology is needed. Summary of the Invention

[0004] The main objective of this invention is to solve the technical problem of low flexibility in converting two-dimensional images into three-dimensional dynamic images.

[0005] The first aspect of this invention provides a method for dynamically displaying a two-dimensional image, comprising the steps of:

[0006] Read the target pixel coordinates of the two-dimensional image according to the preset screen pixel coordinate system;

[0007] Based on the total number of vertical and horizontal pixels of the preset display screen, the coordinates of the target pixel are normalized to obtain pixel normalized coordinates.

[0008] The normalized coordinates of the pixels are processed by angle calculation to obtain the transformed angle;

[0009] Based on the preset horizontal mapping formula, by substituting the transformation angle and the total number of vertical pixels, the mapped horizontal coordinates corresponding to the target pixel coordinates are obtained.

[0010] According to the preset vertical mapping formula, pixel mapping processing is performed on the normalized coordinates of the pixels and the total number of vertical pixels to obtain the mapped vertical coordinates corresponding to the coordinates of the target pixel.

[0011] Based on the mapped ordinate and the mapped abscissa, the two-dimensional image is processed to generate a three-dimensional dynamic image.

[0012] Optionally, in a first implementation of the first aspect of the present invention, the step of normalizing the coordinates of the target pixel point based on the total number of vertical pixels and the total number of horizontal pixels of the preset display screen to obtain the pixel normalized coordinates includes:

[0013] The target pixel coordinates are normalized according to a preset normalization formula to obtain normalized pixel coordinates. The normalization formula includes:

[0014] Px = (row - 0.5 * width) / height, Py = (clo - 0.5 * height) / height, where Px is the x-coordinate of the pixel normalized coordinates, Py is the y-coordinate of the pixel normalized coordinates, row is the x-coordinate of the target pixel coordinates, clo is the y-coordinate of the target pixel coordinates, width is the total number of vertical pixels, and height is the total number of horizontal pixels.

[0015] Optionally, in a second implementation of the first aspect of the present invention, the step of performing angle calculations on the normalized pixel coordinates to obtain the transformed angle includes:

[0016] According to a preset conversion formula, the normalized coordinates of the pixels are processed by angle calculation to obtain the conversion angle, wherein the conversion formula includes:

[0017] Angle1=arctan(Py / Px),Angle2=(Angle1-π / 2)+(1-step(0,Angle1-π / 2))

[0018] *2π, where Px is the x-coordinate of the pixel normalized coordinates, Py is the y-coordinate of the pixel normalized coordinates, arctan() is the arctangent function, Angle1 is the median angle, Angle2 is the transformed angle, and step() is the comparison function.

[0019] Optionally, in a third implementation of the first aspect of the present invention, the lateral mapping formula includes:

[0020] X = width * Angle2 / 2π, where X is the mapped horizontal coordinate of the target pixel, width is the total number of vertical pixels, and Angle2 is the transformation angle.

[0021] Optionally, in a fourth implementation of the first aspect of the present invention, the vertical mapping formula includes:

[0022]

[0023] Where Y is the mapped ordinate of the labeled pixel coordinates, height is the total number of pixels in the vertical direction, Px is the abscissa of the pixel normalized coordinates, Py is the ordinate of the pixel normalized coordinates, and k is the display constant.

[0024] Optionally, in a fifth implementation of the first aspect of the present invention, the vertical mapping formula further includes:

[0025]

[0026] Where Y is the mapped ordinate of the labeled pixel coordinates, height is the total number of pixels in the vertical direction, Px is the x-coordinate of the pixel normalized coordinates, Py is the y-coordinate of the pixel normalized coordinates, k is the display constant, v is the preset movement speed, time is the preset timer value, and fract() is a function that takes the decimal part of the value.

[0027] Optionally, in a sixth implementation of the first aspect of the present invention, the step of performing three-dimensional processing on the two-dimensional image based on the mapped ordinate and the mapped abscissa to generate a three-dimensional dynamic image includes:

[0028] Read the RGB channel values ​​of the target pixel coordinates;

[0029] Based on a preset mapping correction formula, the pixels corresponding to the mapped vertical coordinate and the mapped horizontal coordinate are modified in RGB to generate the pixels of a three-dimensional dynamic image.

[0030] A second aspect of the present invention provides a dynamic display device for two-dimensional images, the dynamic display device for two-dimensional images comprising:

[0031] The reading module is used to read the coordinates of the target pixel points of a two-dimensional image according to a preset screen pixel coordinate system;

[0032] The normalization module is used to normalize the coordinates of the target pixel point based on the total number of vertical pixels and the total number of horizontal pixels of the preset display screen, so as to obtain the pixel normalized coordinates.

[0033] An angle calculation module is used to perform angle calculations on the normalized coordinates of the pixels to obtain the transformed angle.

[0034] The horizontal mapping module is used to obtain the mapped horizontal coordinates corresponding to the target pixel coordinates by substituting the transformation angle and the total number of vertical pixels into a preset horizontal mapping formula.

[0035] The vertical mapping module is used to perform pixel mapping processing on the normalized coordinates of the pixels and the total number of vertical pixels according to a preset vertical mapping formula, so as to obtain the mapped vertical coordinates corresponding to the coordinates of the target pixel.

[0036] The 3D conversion module is used to perform 3D conversion processing on the 2D image based on the mapped vertical coordinate and the mapped horizontal coordinate to generate a 3D dynamic image.

[0037] A third aspect of the present invention provides a dynamic display device for a two-dimensional image, comprising: a memory and at least one processor, wherein the memory stores instructions, and the memory and the at least one processor are interconnected via a circuit; the at least one processor invokes the instructions in the memory to cause the dynamic display device for the two-dimensional image to execute the above-described dynamic display method for the two-dimensional image.

[0038] A fourth aspect of the present invention provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the above-described method for dynamically displaying two-dimensional images.

[0039] In this embodiment of the invention, a video cone effect and a cave terrain effect are generated by performing linear mapping processing based on the image center on each pixel. These effects can be generated cyclically over time and can be expanded and modified, solving the technical problem of low flexibility in the transformation of current two-dimensional images into three-dimensional dynamic images. Attached Figure Description

[0040] Figure 1 This is a schematic diagram of an embodiment of the dynamic display method for two-dimensional images in this invention.

[0041] Figure 2 This is a schematic diagram of an embodiment of the three-dimensional dynamic image in the present invention;

[0042] Figure 3 This is a schematic diagram of one embodiment of the dynamic display device for two-dimensional images in this invention;

[0043] Figure 4 This is a schematic diagram of another embodiment of the dynamic display device for two-dimensional images in this invention;

[0044] Figure 5 This is a schematic diagram of one embodiment of a dynamic display device for two-dimensional images in this invention. Detailed Implementation

[0045] This invention provides a method, apparatus, device, and storage medium for dynamically displaying two-dimensional images.

[0046] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” or “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0047] For ease of understanding, the specific process of the embodiments of the present invention is described below. Please refer to [link / reference]. Figure 1 One embodiment of the dynamic display method for two-dimensional images in this invention includes:

[0048] 101. Based on the preset screen pixel coordinate system, read the coordinates of the target pixel in the two-dimensional image;

[0049] In this embodiment, we need to prepare an image first, because different images can produce different effects. Therefore, it is specifically noted that this invention mainly describes the method, but is not limited to this example. First, a cone-shaped structure is constructed using mathematical knowledge. By mapping the positions on the structure to each point of the prepared image, and using the prepared image as the color source for the processed image, the cone-shaped process can be completed. Then, adjustments and color processing are performed based on the effect.

[0050] Conicalizing the original image is essentially a process of migrating its pixels to a cone-shaped structure. Think of caves in games or images—the principle of perspective—where objects appear smaller in the distance and larger in the distance. For simplicity, we'll consider a circular cave shape for this study. Based on this principle, if we take the image center as the furthest point, pixels expand outwards in concentric circles, with the radius of each circle increasing until the center has zero radius. This visual effect creates a cone-shaped structure. We can establish a screen pixel coordinate system, where the pixel coordinates on the display screen are (row, clo). (row, clo) represents the target pixel coordinates of the 2D image. Based on the characteristics of a cone, to map the original image onto the side of the cone, the circles formed by the pixels on the screen correspond one-to-one with each circle on the cone.

[0051] 102. Based on the total number of vertical pixels and the total number of horizontal pixels of the preset display screen, the coordinates of the target pixel are normalized to obtain the pixel normalized coordinates;

[0052] In this embodiment, for ease of processing, we need to normalize the pixel coordinates. Let the width and height of the image displayed on the screen be width and height, respectively. Then, the normalized vector p of the pixel coordinates on the screen relative to the screen center is:

[0053] px = (row - 0.5 * width) / width

[0054] py = (clo - 0.5 * height) / width

[0055] Since the image width and height are uncertain, the width is used as the subdivision for normalization. This is simply to keep both values ​​around 1, and is not a standard normalization.

[0056] Specifically, the following steps can be performed on 102:

[0057] 1021. According to a preset normalization formula, the coordinates of the target pixel are normalized to obtain normalized pixel coordinates, wherein the normalization formula includes:

[0058] Px = (row - 0.5 * width) / height, Py = (clo - 0.5 * height) / height, where Px is the x-coordinate of the pixel normalized coordinates, Py is the y-coordinate of the pixel normalized coordinates, row is the x-coordinate of the target pixel coordinates, clo is the y-coordinate of the target pixel coordinates, width is the total number of vertical pixels, and height is the total number of horizontal pixels.

[0059] 103. Perform angle calculations on the normalized coordinates of the pixels to obtain the transformed angle;

[0060] In this embodiment, based on the characteristics of a circle, the angle (angle) of the set pixel coordinates on a circle centered at the screen center can be calculated as follows:

[0061] angle = arctan(py / px);

[0062] Where arctan is the arctangent function.

[0063] Since its range is (-π / 2.0, π / 2.0), while the total angle of the actual circle is 2.0*π, and the coordinates of the image to be mapped have no negative values, it is necessary to transform the angle and convert its range to (0, π / 2.0), where π is the value of pi. The absolute value of the angle is then processed to obtain the transformed angle.

[0064] Specifically, the following steps can be performed on 103:

[0065] 1031. According to a preset conversion formula, the normalized coordinates of the pixels are processed by angle calculation to obtain the conversion angle, wherein the conversion formula includes:

[0066] Angle1=arctan(Py / Px),Angle2=(Angle1-π / 2)+(1-step(0,Angle1-π / 2))

[0067] *2π, where Px is the x-coordinate of the pixel normalized coordinates, Py is the y-coordinate of the pixel normalized coordinates, arctan() is the arctangent function, Angle1 is the median angle, Angle2 is the transformed angle, and step() is the comparison function.

[0068] In step 1031, step is a function in the computer that compares two values ​​and returns 0 or 1. For example, t = step(a, b) means: if b > a, t = 1, otherwise t = 0.

[0069] 104. According to the preset horizontal mapping formula, by substituting the transformation angle and the total number of vertical pixels, the mapped horizontal coordinates corresponding to the target pixel coordinates are obtained;

[0070] In this embodiment, the mapped abscissa corresponding to the target pixel coordinate is generated based on the horizontal mapping formula of the mapping relationship between the point on the circle and the x-direction coordinate of the original image.

[0071] Specifically, the "lateral mapping formula" includes the following:

[0072] X = width * Angle2 / 2π, where X is the mapped horizontal coordinate of the target pixel, width is the total number of vertical pixels, and Angle2 is the transformation angle.

[0073] 105. According to the preset vertical mapping formula, perform pixel mapping processing on the normalized coordinates of the pixels and the total number of vertical pixels to obtain the mapped vertical coordinates corresponding to the coordinates of the target pixel.

[0074] In this embodiment, the lateral surface length of the cone is mapped to the entire y-axis coordinate of the original image. The lateral surface length of the cone can be calculated first, which is the distance Len between the pixel on the screen and the center. Len can be calculated as follows:

[0075]

[0076] Therefore, mapping the pixels in the y-direction of the original image to this length is:

[0077] y = height / Len

[0078] Generally, mapping the entire Y-axis for display makes the pixels appear cramped and the effect is not very good. Therefore, it is usually mapped proportionally, for example, mapping half the length of the original image. This makes the displayed pixels appear larger and the image visually clearer. Therefore, a constant ratio can be set; let's say it's k. Further evolution of the above formula yields:

[0079] y = k * height / Len

[0080] y is the mapped ordinate of the target pixel, and height is the total number of pixels in the horizontal direction.

[0081] Preferably, the vertical mapping formula includes:

[0082]

[0083] Where Y is the mapped ordinate of the labeled pixel coordinates, height is the total number of pixels in the vertical direction, Px is the abscissa of the pixel normalized coordinates, Py is the ordinate of the pixel normalized coordinates, and k is the display constant.

[0084] Preferably, the vertical mapping formula further includes:

[0085]

[0086] Where Y is the mapped ordinate of the labeled pixel coordinates, height is the total number of pixels in the vertical direction, Px is the x-coordinate of the pixel normalized coordinates, Py is the y-coordinate of the pixel normalized coordinates, k is the display constant, v is the preset movement speed, time is the preset timer value, and fract() is a function that takes the decimal part of the value.

[0087] Ordinary mapping is static and doesn't involve infinite loops. An infinite loop, on the other hand, is a dynamic process where the image changes continuously over time. This is where the time parameter comes in. The time parameter starts at 0 and gradually increases over time, measured in seconds. Based on the mapping relationship in the y-direction, if we offset the y-axis, we can observe the original image moving along a cone-shaped path, essentially moving from far to near on the screen. Assuming the time parameter is 'time' and the rate of pixel movement in the original image is 'v', and for ease of calculation, we set the unit to the proportion of original image pixels per second, then the y-mapping can be written as:

[0088]

[0089] Where Y is the mapped ordinate of the labeled pixel coordinates, height is the total number of pixels in the vertical direction, Px is the x-coordinate of the pixel normalized coordinates, Py is the y-coordinate of the pixel normalized coordinates, k is the display constant, v is the preset movement speed, time is the preset timer value, and fract() is a function that takes the decimal part of the value.

[0090] As time increases, y will continue to grow, eventually exceeding the height of the original image. This exceeds the allowed range, and there is no corresponding mapping relationship. Therefore, the range of y needs to be controlled within (0, height) to allow for infinite mapping. This is where the fract() function comes in. fract is a function in computers that rounds a number to its decimal part. For example, fract(2.31) = 0.31, and its range is always (0, 1). Therefore, the coordinates of the y-axis of the original image can be permanently controlled within (0, height).

[0091] 106. Based on the mapped vertical coordinate and the mapped horizontal coordinate, perform three-dimensional processing on the two-dimensional image to generate a three-dimensional dynamic image.

[0092] In this embodiment, a three-dimensional image is dynamically generated from the original two-dimensional image based on the pre-calculated mapped ordinate and abscissa. The display effect can be referenced. Figure 2 A schematic diagram of a three-dimensional dynamic image.

[0093] Specifically, the following steps can be performed on 106:

[0094] 1061. Read the RGB channel values ​​of the target pixel coordinates;

[0095] 1062. Based on a preset mapping correction formula, the pixels corresponding to the mapped vertical coordinate and the mapped horizontal coordinate are modified in RGB to generate the pixels of the three-dimensional dynamic image.

[0096] In embodiments 1061-1062, simple rendering results in the light being the same for both near and far objects, appearing unrealistic. Therefore, light is introduced here to further process the image. Observing real-world situations, we find that the deeper into a pipe or cave, the darker the light becomes. Therefore, we can reduce the light intensity based on the distance from the image pixel to the center on the screen. We assume that the color value of the original image is 'a' times the color of normal light. This multiple 'a' is mainly introduced to adjust the effect; 'a' is generally around 1.0. Then, the color after complete darkening is 0, and nothing can be seen. Therefore, light reduction is the process of transitioning from normal color to 0. Assuming the pixel color value of the 3D dynamic image to be displayed on the current screen is (r, g, b), and the pixel color value of the target pixel coordinates is (pr, pg, pb), based on the previously calculated distance values, then:

[0097] r = a * pr * Len

[0098] g = a * pg * Len

[0099] b = a * pb * Len

[0100] After the light and color are corrected, the image pixel mapping is completed.

[0101] In this embodiment of the invention, a video cone effect and a cave terrain effect are generated by performing linear mapping processing based on the image center on each pixel. These effects can be generated cyclically over time and can be expanded and modified, solving the technical problem of low flexibility in the transformation of current two-dimensional images into three-dimensional dynamic images.

[0102] The above describes the dynamic display method of two-dimensional images in the embodiments of the present invention. The following describes the dynamic display device of two-dimensional images in the embodiments of the present invention. Please refer to [link / reference]. Figure 3 One embodiment of the dynamic display device for two-dimensional images in this invention includes:

[0103] The reading module 301 is used to read the coordinates of the target pixel point of the two-dimensional image according to the preset screen pixel coordinate system;

[0104] The normalization module 302 is used to normalize the coordinates of the target pixel point based on the total number of vertical pixels and the total number of horizontal pixels of the preset display screen to obtain pixel normalized coordinates.

[0105] Angle calculation module 303 is used to perform angle calculation processing on the normalized coordinates of the pixels to obtain the transformed angle;

[0106] The horizontal mapping module 304 is used to obtain the mapped horizontal coordinates corresponding to the target pixel coordinates by substituting the transformation angle and the total number of vertical pixels into a preset horizontal mapping formula.

[0107] The vertical mapping module 305 is used to perform pixel mapping processing on the normalized coordinates of the pixels and the total number of vertical pixels according to a preset vertical mapping formula, so as to obtain the mapped vertical coordinates corresponding to the coordinates of the target pixel.

[0108] The 3D conversion module 306 is used to perform 3D conversion processing on the 2D image based on the mapped vertical coordinate and the mapped horizontal coordinate to generate a 3D dynamic image.

[0109] In this embodiment of the invention, a video cone effect and a cave terrain effect are generated by performing linear mapping processing based on the image center on each pixel. These effects can be generated cyclically over time and can be expanded and modified, solving the technical problem of low flexibility in the transformation of current two-dimensional images into three-dimensional dynamic images.

[0110] Please see Figure 4 Another embodiment of the dynamic display device for two-dimensional images in this invention includes:

[0111] The reading module 301 is used to read the coordinates of the target pixel point of the two-dimensional image according to the preset screen pixel coordinate system;

[0112] The normalization module 302 is used to normalize the coordinates of the target pixel point based on the total number of vertical pixels and the total number of horizontal pixels of the preset display screen to obtain pixel normalized coordinates.

[0113] Angle calculation module 303 is used to perform angle calculation processing on the normalized coordinates of the pixels to obtain the transformed angle;

[0114] The horizontal mapping module 304 is used to obtain the mapped horizontal coordinates corresponding to the target pixel coordinates by substituting the transformation angle and the total number of vertical pixels into a preset horizontal mapping formula.

[0115] The vertical mapping module 305 is used to perform pixel mapping processing on the normalized coordinates of the pixels and the total number of vertical pixels according to a preset vertical mapping formula, so as to obtain the mapped vertical coordinates corresponding to the coordinates of the target pixel.

[0116] The 3D conversion module 306 is used to perform 3D conversion processing on the 2D image based on the mapped vertical coordinate and the mapped horizontal coordinate to generate a 3D dynamic image.

[0117] Specifically, the normalization module 302 is used for:

[0118] The target pixel coordinates are normalized according to a preset normalization formula to obtain normalized pixel coordinates. The normalization formula includes:

[0119] Px = (row - 0.5 * width) / height, Py = (clo - 0.5 * height) / height, where Px is the x-coordinate of the pixel normalized coordinates, Py is the y-coordinate of the pixel normalized coordinates, row is the x-coordinate of the target pixel coordinates, clo is the y-coordinate of the target pixel coordinates, width is the total number of vertical pixels, and height is the total number of horizontal pixels.

[0120] The angle calculation module 303 includes:

[0121] Formula calculation unit 3031 is used to perform angle calculation processing on the normalized coordinates of the pixels according to a preset conversion formula to obtain the conversion angle, wherein the conversion formula includes:

[0122] Angle1=arctan(Py / Px),Angle2=(Angle1-π / 2)+(1-step(0,Angle1-π / 2))

[0123] *2π, where Px is the x-coordinate of the pixel normalized coordinates, Py is the y-coordinate of the pixel normalized coordinates, arctan() is the arctangent function, Angle1 is the median angle, Angle2 is the transformed angle, and step() is the comparison function.

[0124] The lateral mapping formula includes:

[0125] X = width * Angle2 / 2π, where X is the mapped horizontal coordinate of the target pixel, width is the total number of vertical pixels, and Angle2 is the transformation angle.

[0126] The vertical mapping formula includes:

[0127]

[0128] Where Y is the mapped ordinate of the labeled pixel coordinates, height is the total number of pixels in the vertical direction, Px is the abscissa of the pixel normalized coordinates, Py is the ordinate of the pixel normalized coordinates, and k is the display constant.

[0129] The vertical mapping formula further includes:

[0130]

[0131] Where Y is the mapped ordinate of the labeled pixel coordinates, height is the total number of pixels in the vertical direction, Px is the x-coordinate of the pixel normalized coordinates, Py is the y-coordinate of the pixel normalized coordinates, k is the display constant, v is the preset movement speed, time is the preset timer value, and fract() is a function that takes the decimal part of the value.

[0132] Specifically, the three-dimensional module 306 is used for:

[0133] Read the RGB channel values ​​of the target pixel coordinates;

[0134] Based on a preset mapping correction formula, the pixels corresponding to the mapped vertical coordinate and the mapped horizontal coordinate are modified in RGB to generate the pixels of a three-dimensional dynamic image.

[0135] In this embodiment of the invention, a video cone effect and a cave terrain effect are generated by performing linear mapping processing based on the image center on each pixel. These effects can be generated cyclically over time and can be expanded and modified, solving the technical problem of low flexibility in the transformation of current two-dimensional images into three-dimensional dynamic images.

[0136] above Figure 3 and Figure 4 The dynamic display device for two-dimensional images in the embodiments of the present invention will be described in detail from the perspective of modular functional entities. The dynamic display device for two-dimensional images in the embodiments of the present invention will be described in detail from the perspective of hardware processing.

[0137] Figure 5 This is a schematic diagram of the structure of a dynamic display device for two-dimensional images provided in an embodiment of the present invention. The dynamic display device 500 can vary significantly due to different configurations or performance characteristics. It may include one or more central processing units (CPUs) 510 (e.g., one or more processors) and a memory 520, and one or more storage media 530 (e.g., one or more mass storage devices) for storing application programs 533 or data 532. The memory 520 and storage media 530 can be temporary or persistent storage. The program stored in the storage media 530 may include one or more modules (not shown in the diagram), each module including a series of instruction operations on the dynamic display device 500. Furthermore, the processor 510 may be configured to communicate with the storage media 530 and execute the series of instruction operations in the storage media 530 on the dynamic display device 500.

[0138] The dynamic display device 500 based on two-dimensional images may also include one or more power supplies 540, one or more wired or wireless network interfaces 550, one or more input / output interfaces 560, and / or one or more operating systems 531, such as Windows Server, Mac OS X, Unix, Linux, Free BSD, etc. Those skilled in the art will understand that... Figure 5 The illustrated structure of a dynamic display device for two-dimensional images does not constitute a limitation on dynamic display devices based on two-dimensional images. It may include more or fewer components than illustrated, or combine certain components, or have different component arrangements.

[0139] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium, wherein the computer-readable storage medium stores instructions that, when the instructions are executed on a computer, cause the computer to perform the steps of the dynamic display method of the two-dimensional image.

[0140] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system, device, or unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0141] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0142] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for dynamically displaying a two-dimensional image, characterized in that, Including the following steps: Read the target pixel coordinates of the two-dimensional image according to the preset screen pixel coordinate system; Based on the total number of vertical and horizontal pixels of the preset display screen, the coordinates of the target pixel are normalized to obtain pixel normalized coordinates. The normalized coordinates of the pixels are processed by angle calculation to obtain the transformed angle; Based on the preset horizontal mapping formula, by substituting the transformation angle and the total number of vertical pixels, the mapped horizontal coordinates corresponding to the target pixel coordinates are obtained. According to the preset vertical mapping formula, pixel mapping processing is performed on the normalized coordinates of the pixels and the total number of vertical pixels to obtain the mapped vertical coordinates corresponding to the coordinates of the target pixel. Based on the mapped vertical coordinate and the mapped horizontal coordinate, the two-dimensional image is processed to generate a three-dimensional dynamic image; The step of normalizing the target pixel coordinates based on the total number of vertical and horizontal pixels of the preset display screen to obtain normalized pixel coordinates includes: The target pixel coordinates are normalized according to a preset normalization formula to obtain normalized pixel coordinates. The normalization formula includes: Px = (row - 0.5 * width) / height, Py = (clo - 0.5 * height) / height, where Px is the x-coordinate of the pixel normalized coordinates, Py is the y-coordinate of the pixel normalized coordinates, row is the x-coordinate of the target pixel coordinates, clo is the y-coordinate of the target pixel coordinates, width is the total number of horizontal pixels, and height is the total number of vertical pixels. The step of performing angle calculations on the normalized pixel coordinates to obtain the transformed angle includes: According to a preset conversion formula, the normalized coordinates of the pixels are processed by angle calculation to obtain the conversion angle, wherein the conversion formula includes: Angle1 = arctan(Py / Px), Angle2 = (Angle1 - π / 2) + (1 - step(0, Angle1 - π / 2)) * 2π, where Px is the x-coordinate of the pixel normalized coordinates, Py is the y-coordinate of the pixel normalized coordinates, arctan() is the arctangent function, Angle1 is the median angle, Angle2 is the transformed angle, and step() is the comparison function; The lateral mapping formula includes: X = width * Angle2 / 2π, where X is the mapped x-coordinate of the target pixel, width is the total number of pixels in the horizontal direction, and Angle2 is the transformation angle; The vertical mapping formula further includes: , Where Y is the mapped ordinate of the marked pixel coordinates, height is the total number of vertical pixels, Px is the abscissa of the pixel normalized coordinates, Py is the ordinate of the pixel normalized coordinates, k is the display constant, v is the preset moving speed, time is the preset timer value, and fract() is a function to take the decimal part of the value. The step of performing three-dimensional processing on the two-dimensional image based on the mapped ordinate and the mapped abscissa to generate a three-dimensional dynamic image includes: Read the RGB channel values ​​of the target pixel coordinates; Based on a preset mapping correction formula, the pixels corresponding to the mapped vertical coordinate and the mapped horizontal coordinate are modified in RGB to generate the pixels of a three-dimensional dynamic image.

2. A dynamic display device for two-dimensional images, characterized in that, The dynamic display device for the two-dimensional image includes: The reading module is used to read the coordinates of the target pixel points of a two-dimensional image according to a preset screen pixel coordinate system; The normalization module is used to normalize the coordinates of the target pixel point based on the total number of vertical pixels and the total number of horizontal pixels of the preset display screen, so as to obtain the pixel normalized coordinates. An angle calculation module is used to perform angle calculations on the normalized coordinates of the pixels to obtain the transformed angle. The horizontal mapping module is used to obtain the mapped horizontal coordinates corresponding to the target pixel coordinates by substituting the transformation angle and the total number of vertical pixels into a preset horizontal mapping formula. The vertical mapping module is used to perform pixel mapping processing on the normalized coordinates of the pixels and the total number of vertical pixels according to a preset vertical mapping formula, so as to obtain the mapped vertical coordinates corresponding to the coordinates of the target pixel. A 3D conversion module is used to perform 3D conversion processing on the 2D image based on the mapped vertical coordinate and the mapped horizontal coordinate to generate a 3D dynamic image; Specifically, the normalization module is used for: The target pixel coordinates are normalized according to a preset normalization formula to obtain normalized pixel coordinates. The normalization formula includes: Px = (row - 0.5 * width) / height, Py = (clo - 0.5 * height) / height, where Px is the x-coordinate of the pixel normalized coordinates, Py is the y-coordinate of the pixel normalized coordinates, row is the x-coordinate of the target pixel coordinates, clo is the y-coordinate of the target pixel coordinates, width is the total number of horizontal pixels, and height is the total number of vertical pixels. Specifically, the angle calculation module is used for: According to a preset conversion formula, the normalized coordinates of the pixels are processed by angle calculation to obtain the conversion angle, wherein the conversion formula includes: Angle1 = arctan(Py / Px), Angle2 = (Angle1 - π / 2) + (1 - step(0, Angle1 - π / 2)) * 2π, where Px is the x-coordinate of the pixel normalized coordinates, Py is the y-coordinate of the pixel normalized coordinates, arctan() is the arctangent function, Angle1 is the median angle, Angle2 is the transformed angle, and step() is the comparison function; The lateral mapping formula includes: X = width * Angle2 / 2π, where X is the mapped x-coordinate of the target pixel, width is the total number of pixels in the horizontal direction, and Angle2 is the transformation angle; The vertical mapping formula further includes: , Where Y is the mapped ordinate of the marked pixel coordinates, height is the total number of vertical pixels, Px is the abscissa of the pixel normalized coordinates, Py is the ordinate of the pixel normalized coordinates, k is the display constant, v is the preset moving speed, time is the preset timer value, and fract() is a function to take the decimal part of the value. Specifically, the three-dimensional module is used for: Read the RGB channel values ​​of the target pixel coordinates; Based on a preset mapping correction formula, the pixels corresponding to the mapped vertical coordinate and the mapped horizontal coordinate are modified in RGB to generate the pixels of a three-dimensional dynamic image.

3. A dynamic display device for two-dimensional images, characterized in that, The dynamic display device for the two-dimensional image includes: a memory and at least one processor, wherein the memory stores instructions, and the memory and the at least one processor are interconnected via a circuit; The at least one processor invokes the instructions in the memory to cause the dynamic display device of the two-dimensional image to execute the dynamic display method of the two-dimensional image as described in claim 1.

4. A computer-readable storage medium storing a computer program thereon, characterized in that, When the computer program is executed by the processor, it implements the dynamic display method of the two-dimensional image as described in claim 1.

Citation Information

Patent Citations

  • Image processing method and apparatus, computer apparatus, and readable storage medium

    CN108833877A

  • Image spheroidization method and related equipment

    CN115936975A