WO2023029892A1 - 视频处理方法、装置、设备及存储介质 - Google Patents

视频处理方法、装置、设备及存储介质 Download PDF

Info

Publication number
WO2023029892A1
WO2023029892A1 PCT/CN2022/110796 CN2022110796W WO2023029892A1 WO 2023029892 A1 WO2023029892 A1 WO 2023029892A1 CN 2022110796 W CN2022110796 W CN 2022110796W WO 2023029892 A1 WO2023029892 A1 WO 2023029892A1
Authority
WO
WIPO (PCT)
Prior art keywords
pixel position
texture
texture image
brightness
coordinates
Prior art date
Application number
PCT/CN2022/110796
Other languages
English (en)
French (fr)
Inventor
吴金远
Original Assignee
北京字跳网络技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京字跳网络技术有限公司 filed Critical 北京字跳网络技术有限公司
Publication of WO2023029892A1 publication Critical patent/WO2023029892A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/04Texture mapping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/222Studio circuitry; Studio devices; Studio equipment
    • H04N5/262Studio circuits, e.g. for mixing, switching-over, change of character of image, other special effects ; Cameras specially adapted for the electronic generation of special effects
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N9/00Details of colour television systems
    • H04N9/64Circuits for processing colour signals
    • H04N9/74Circuits for processing colour signals for obtaining special effects

Definitions

  • Embodiments of the present disclosure relate to the technical field of video processing, and in particular, to a video processing method, device, device, and storage medium.
  • the video application provided by the related technology can shoot a video of a real scene, and share the video of the real scene on a video consumption platform for consumers to watch.
  • the sharing of real scenes can no longer meet the growing needs of users. Therefore, how to add texture effects with specific effects in video scenes to improve the interest of videos is a technical problem that needs to be solved urgently. .
  • embodiments of the present disclosure provide a video processing method, device, device, and storage medium.
  • the first aspect of the embodiments of the present disclosure provides a video processing method, the method comprising:
  • mapping relationship between the pixel position obtained in advance and the initial brightness and the brightness change rate determine that the target pixel position on the first texture image corresponds to the target brightness at the current moment
  • the second texture image is mapped onto the video image to obtain a target video image.
  • a second aspect of an embodiment of the present disclosure provides a video processing device, the device comprising:
  • An acquisition module configured to acquire the three-dimensional reconstruction data of the current video image and the first texture image corresponding to the current moment
  • a determining module configured to determine that the target pixel position on the first texture image corresponds to the target brightness at the current moment according to the pre-obtained mapping relationship between the pixel position and the initial brightness and the brightness change rate;
  • a brightness adjustment module configured to adjust the brightness of the target pixel position on the first texture image to the target brightness to obtain a second texture image
  • the texture mapping module is configured to map the second texture image onto the video image based on the 3D reconstruction data to obtain the target video image.
  • the third aspect of the embodiments of the present disclosure provides an electronic device, the electronic device includes a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the above-mentioned first aspect can be realized video processing method.
  • a fourth aspect of the embodiments of the present disclosure provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the video processing method in the above-mentioned first aspect can be realized.
  • a fifth aspect of the embodiments of the present disclosure provides a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, where the computer program includes a program for executing the video processing method of the above-mentioned first aspect code.
  • the first texture image after acquiring the 3D reconstruction data of the video image and the first texture image corresponding to the current moment, the first texture image can be determined according to the mapping relationship between the pre-obtained pixel position and the initial brightness and the brightness change rate
  • the target pixel position on corresponds to the target brightness at the current moment, and the brightness of the target pixel position on the first texture image is adjusted to the target brightness to obtain the second texture image.
  • the scheme provided by the embodiments of the present disclosure can make the same pixel position on the video image present different textures and brightness at different times, and make different pixel positions on the video image present different textures and brightness at the same time, and then on the video image A flowing and flickering texture effect is achieved, which improves the interest of the video.
  • FIG. 1 is a schematic flowchart of a video processing method provided by an embodiment of the present disclosure
  • Fig. 2a is a schematic diagram of a reference texture image provided by an embodiment of the present disclosure
  • Fig. 2b is a schematic diagram of a preset template provided by an embodiment of the present disclosure
  • Fig. 2c is a schematic diagram of a noise texture image provided by an embodiment of the present disclosure.
  • FIG. 3 is a schematic flowchart of another video processing method provided by an embodiment of the present disclosure.
  • FIG. 4 is a schematic structural diagram of a video processing device provided by an embodiment of the present disclosure.
  • Fig. 5 is a schematic structural diagram of an electronic device in an embodiment of the present disclosure.
  • a video application may shoot a video of a real scene, and share the video of the real scene on a video consumption platform for consumers to watch.
  • an embodiment of the present disclosure provides a video processing method, which can add a texture with a flowing and flickering effect to a video image.
  • Fig. 1 shows a schematic flowchart of a video processing method provided by an embodiment of the present disclosure.
  • the video processing method may include the following steps S110-S140.
  • the shooting device before obtaining the three-dimensional reconstruction data and the first texture image of the video image, can be used to obtain the scene that needs to be added with a specific effect from different angles, obtain the scene video of the scene, and send the scene video to the electronic device, After acquiring the scene video, the electronic device performs scene reconstruction based on the video images in the scene video to obtain 3D reconstruction data of the video images in the scene video.
  • the above-mentioned photographing device may include devices such as a three-dimensional scanner, a camera, a laser, and a depth camera, which are not limited herein.
  • the video image may include a game video image, a virtual reality image, an audio-visual video image, etc., which is not limited here.
  • the first texture image may be an initial material image for adding a specific effect to the video image, and the texture of each pixel position and the brightness of each pixel position are defined in the first texture image.
  • the first texture images corresponding to different moments may be different, and the first texture images in the embodiments of the present disclosure may be generated in real time or preset.
  • the first texture image may be a text image, a landscape image, a building image or other types of images, which is not limited here.
  • the pixel position referred to in the embodiments of the present disclosure can be understood as a coordinate area, and can also be understood as a coordinate point.
  • the embodiments of the present disclosure pre-set the initial brightness and brightness change rate of each pixel position, wherein the initial brightness corresponding to different pixel positions may be the same or different, and the brightness change rates corresponding to different pixel positions may be the same or different.
  • the target pixel position referred to in the embodiments of the present disclosure may be understood as a pixel point position where brightness value changes are required. There may be one or more target pixel positions in the embodiments of the present disclosure.
  • the target brightness of the target pixel position can be understood as the brightness value of the target pixel position, which is obtained by changing from the initial brightness at the initial moment to the current moment at a preset brightness change rate.
  • S120 may include the following S1-S3:
  • the brightness of each pixel position may be configured to change periodically within a preset range (such as a range from 0 to 1, but not limited to a range from 0 to 1).
  • the time parameter at the current moment may be understood as a time change amount at the current moment in the current change period.
  • the calculation formula of the target brightness may be:
  • Z is the target brightness of the target pixel position
  • x is the abscissa of the target pixel position
  • y is the ordinate of the target pixel position
  • t is the time parameter at the current moment
  • v is the brightness change rate of the target pixel position
  • a is the target
  • f xy (*) is the calculation function of the target brightness.
  • a and v may be preset values.
  • the initial brightness and brightness change rate of the target pixel position can be obtained, and the time parameter at the current moment and the brightness change rate of the target pixel position Multiplying to get the brightness variation of the target pixel position corresponding to the current moment, and then based on the brightness variation of the target pixel position corresponding to the current moment and the initial brightness of the target pixel position, it can be accurately determined that the target pixel position corresponds to the current target brightness.
  • the electronic device After the electronic device determines that the target pixel position on the first texture image corresponds to the target brightness at the current moment, it can adjust the brightness of the target pixel position to the target brightness, so as to change the brightness value of the pixel point at the target pixel position, so that The target pixel position corresponds to different brightness values at different times.
  • the 3D reconstruction data includes data of a 3D mesh constituting the 3D model of the scene, and the data of the 3D mesh includes vertex coordinates and normal directions.
  • the 3D grid can be understood as the basic unit that composes the 3D model of the scene.
  • the vertex coordinates and the normal direction of the three-dimensional mesh may be obtained by extracting from the three-dimensional reconstruction data of the scene through a vertex shader.
  • texture mapping may be understood as a process of mapping textures on a texture image to a three-dimensional model of a scene.
  • the sampling coordinates may be first determined based on the vertex coordinates and the normal direction in the data of the three-dimensional grid; then the preset second texture image may be sampled based on the sampling coordinates ; and based on the relationship between the sampling coordinates and the vertices, map the sampled second texture image onto the video image to obtain the target video image.
  • the sampling coordinates are determined based on the three-dimensional coordinates and the normal direction of the grid, after the texture image is sampled based on the sampling coordinates, the sampled texture image can be obtained based on the relationship between the sampling coordinates and the grid.
  • the second texture image is mapped onto the video image, so that the acquired texture image is mapped to the 3D scene of the video.
  • the first The target pixel position on the texture image corresponds to the target brightness at the current moment
  • the brightness of the target pixel position on the first texture image is adjusted to the target brightness to obtain the second texture image
  • the second texture image is mapped to the video image , to get the target video image.
  • the scheme provided by the embodiments of the present disclosure can make the same pixel position on the video image present different textures and brightness at different times, and make different pixel positions on the video image present different textures and brightness at the same time, and then on the video image A flowing and flickering texture effect is achieved, which improves the interest of the video.
  • the texture on the pre-obtained reference texture image may be randomly sampled to at least part of the pixel positions of the preset template, so as to obtain the first texture image corresponding to the current moment.
  • the pre-obtained reference texture image may be the texture image to be sampled.
  • the preset template may be a sampling template obtained by dividing pixels in the screen of the electronic device into a plurality of uniform blocks in advance.
  • the size of each pixel position in the preset template may be a fixed size, so that when the texture data in the reference texture image is sampled to the pixel position of the preset template, deformation of the texture data in the pixel position of the preset template is avoided.
  • randomly sampling the texture on the pre-obtained reference texture image to at least part of the pixel positions of the preset template may include the following S10-S14:
  • the random coordinate may be a randomly generated coordinate.
  • S14 may include: using random coordinates as sampling coordinates, so as to sample the texture at the position corresponding to the random coordinates in the reference texture image to the preset template.
  • the electronic device acquires the reference texture image, the pre-obtained noise texture image, and the preset template, for any pixel position in at least some of the pixel positions of the preset template, randomly select a pixel from the pre-obtained noise texture image
  • the pixel position is used as the sampling position, and the random coordinates of the sampling position are determined, and the random coordinates are used as the sampling coordinates, so that the texture at the position corresponding to the random coordinates in the reference texture image is sampled on the preset template until all sampling is completed, and the obtained Corresponding to the first texture image at the current moment.
  • Fig. 2a shows a schematic diagram of a reference texture image provided by an embodiment of the present disclosure
  • Fig. 2b shows a schematic diagram of a preset template provided by an embodiment of the present disclosure
  • Fig. 2c shows a schematic diagram of a preset template provided by an embodiment of the present disclosure
  • the reference texture image shown in Fig. 2a may be a text image.
  • Each small square of the preset template shown in FIG. 2b is a pixel position.
  • Each sampling position in the noise texture image shown in Fig. 2c corresponds to one or more random coordinates.
  • the texture corresponding to pixel position 1 is A4
  • the texture corresponding to pixel position 2 is A4.
  • the texture is A3.
  • a pixel position is randomly selected from the noise texture image as the sampling position, and the random coordinates of the sampling position are determined.
  • the random coordinates are used as the sampling coordinates, and the pixel position corresponding to the random coordinates in the reference texture image is Texture A1 is sampled to pixel position 1, so that the texture at pixel position 1 is adjusted from A4 to A1, and texture A2 at the position corresponding to random coordinates in the reference texture image is sampled to pixel position 2, so that the texture at pixel position 2 is changed from A3 Adjust to A2 to get the first texture image corresponding to the current moment.
  • the noise texture image can be introduced, the random coordinates corresponding to the sampling position can be extracted from the noise texture image, and based on the random coordinates, the texture on the pre-obtained reference texture image can be randomly sampled to the preset template
  • the first texture image corresponding to the current moment is obtained at least some of the pixel positions, and the texture information of the collected first texture image can be continuously changed in a continuous period of time, so as to present the effect of dynamic texture changes.
  • randomly sampling the texture on the pre-obtained reference texture image to at least part of the pixel positions of the preset template may include the following S20-S24:
  • the offset coordinates may be the coordinates obtained after coordinate offset processing is performed on the initial coordinates corresponding to the pixel positions, wherein, the offset processing may be, for example, superimposing the initial coordinates with the time parameters corresponding to the current moment, but is not limited to The initial coordinates and the time parameters corresponding to the current moment are superimposed.
  • any pixel position on the preset template The coordinates are subjected to coordinate offset processing, and according to the initial coordinates of any pixel position, the offset coordinates corresponding to any pixel position are obtained, and then, the position corresponding to the offset coordinates is used as the sampling position in the preset noise texture image to determine the sampling position.
  • the random coordinates corresponding to the position further, the random coordinates are used as the sampling coordinates, so as to sample the texture at the position corresponding to the random coordinates in the reference texture image to any pixel position, and obtain the first texture image corresponding to the current moment.
  • a time parameter can be introduced, and for any pixel position in at least part of the pixel positions of the preset template, coordinate offset processing is performed on the coordinates of any pixel position on the preset template to obtain The offset coordinates corresponding to any pixel position, and introduce the noise texture image, based on the offset position and the noise texture image, obtain the first texture image corresponding to the current moment, and in the continuous time period, the collected first texture image
  • the texture information of the texture can be continuously changed to present the effect of dynamic texture changes.
  • randomly sampling the texture on the pre-obtained reference texture image to at least some pixel positions of the preset template may include the following S30-S32:
  • the electronic device acquires the reference texture image and the preset template, for any pixel position in at least part of the pixel positions of the preset template, coordinate offset processing is performed on the coordinates of any pixel position on the preset template, And according to the initial coordinates of any pixel position, the offset coordinate corresponding to any pixel position is obtained, and then, the offset coordinate is used as the sampling coordinate to sample the texture at the position corresponding to the offset coordinate in the reference texture image to any At the pixel position, the first texture image corresponding to the current moment is obtained.
  • the second texture image is obtained by adjusting the brightness of the first texture image obtained in the above manner, and the second texture image is mapped to the 3D scene, so that the 3D scene can present the brightness change effect and the texture change effect Synthesized dynamic change effects, such as the effect of character rain generated by texture flickering effect and flowing effect, can improve the interest of the video.
  • the vertex coordinate information and normal direction information of the 3D mesh in the 3D reconstruction data of the video image may be processed to obtain the 3D coordinates and normal direction of the segments in the 3D mesh, And according to the three-dimensional coordinates and the normal direction of the segment, the second texture image is sampled, and the sampled texture is further mapped to the segment to obtain the target video image.
  • Fig. 3 shows a schematic flowchart of another video processing method provided by an embodiment of the present disclosure.
  • the video processing method may include the following steps S310-S370.
  • S310-S330 are similar to S110-S130, and will not be repeated here.
  • S340 Perform differential processing on the 3D mesh in the 3D reconstruction data to obtain the fragments in the 3D mesh and the offset positions of the fragments in the 3D mesh.
  • the difference processing may be based on the vertices of the three-dimensional grid, and the interpolation function is used to discretize the three-dimensional grid according to the preset step size, so that the three-dimensional grid is discretized into one or more segments .
  • a segment refers to the smallest unit obtained by dividing the three-dimensional grid in equal proportions.
  • the offset position of the segment relative to the vertex of the three-dimensional grid can be determined according to the step size of the segment relative to the vertex of the three-dimensional grid and the position of the vertex.
  • the electronic device extracts the 3D coordinates and vertex normal directions of the vertices of the 3D mesh from the 3D reconstruction data
  • the extracted 3D coordinates and vertex normal directions of the vertices of the 3D mesh can be input into the fragment shader, and the fragment shader
  • the three-dimensional mesh can be discretized according to the preset step size, so that the three-dimensional mesh can be discretized into one or more segments, and the three-dimensional mesh can be obtained The fragments in and their offset positions in the 3D grid.
  • S350 may include: for each segment, calculating the coordinates of each segment according to the 3D coordinates of the vertices of the 3D grid and the offset position of each segment in the 3D grid, and according to the coordinates of the segment, Constructs the normals of the fragments, taking the normal direction of the 3D mesh as the normal direction of each fragment.
  • the fragment shader can be used to use the coordinates corresponding to the offset positions of each fragment in the 3D grid as the fragment.
  • the coordinates of the fragments are used to construct the normals of the fragments according to the coordinates of the fragments, and the normal direction of the 3D grid is used as the normal direction of each fragment.
  • the fragment shader is used to perform differential processing on the 3D mesh to obtain the fragments in the 3D mesh and the offset positions of the fragments in the 3D mesh, and then Based on the offset position, and the vertex coordinates and normal direction of the 3D mesh, the coordinates and normal direction of the fragment are accurately determined.
  • S360 may include the following S11-S15:
  • the sampling coordinates are formed; or, When the distance between the normal line and the first coordinate axis and the second coordinate axis is the closest, it can be based on the components of the three-dimensional coordinates on the second and third coordinate axes, or the components of the three-dimensional coordinates on the first and third coordinate axes Components that make up the sampling coordinates.
  • the shortest distance between the normal line and the first coordinate axis and the second coordinate axis means that the distance between the normal line and the first coordinate axis and the second coordinate axis is the same, and is smaller than the distance between the normal line and the third coordinate axis.
  • S11 may include the following S111-S115:
  • the distance between the target normal and the coordinate axis is inversely proportional to the component of the target normal on the coordinate axis.
  • S11 may include the following S211-S213:
  • the preset three-dimensional coordinate system may be the three-dimensional coordinate system where the three-dimensional mesh model to which the segment belongs is located.
  • the angle between the normal of the fragment and the straight line where the three coordinate axes are located can be used to represent the closeness between the normal and the three coordinate axes.
  • the distance relationship between the target normal and the three coordinate axes can be determined according to the three-dimensional coordinates of the fragment and the normalized components of the target normal on the three coordinate axes , or, according to the angle between the normal of the fragment and the coordinate axes, determine the distance relationship between the target normal and the three coordinate axes, so that the sampling coordinates can be determined later according to the distance relationship.
  • the components of the three-dimensional coordinates on the second and third coordinate axes of the three coordinate axes can be understood as the components of the three-dimensional coordinates on the second and third coordinate axes of the three coordinate axes coordinates on the axes.
  • the components of the three-dimensional coordinates on the second and third coordinate axes can be understood as the coordinates of the three-dimensional coordinates on the second and third coordinate axes of the three coordinate axes
  • the three-dimensional coordinates on the first coordinate axis The components on the axis and the third coordinate axis can be understood as the coordinates of the three-dimensional coordinates on the first coordinate axis and the third coordinate axis among the three coordinate axes.
  • the electronic device may, based on the sampling coordinates, sample the texture information of the pixels at the positions corresponding to the sampling coordinates on the texture image to obtain corresponding textures.
  • texture mapping may be understood as a process of mapping textures on a texture image to a three-dimensional model of a scene.
  • S370 may include S3701:
  • the sampling coordinates are determined based on the 3D coordinates and the normal direction of the fragment, after the texture image is sampled based on the sampling coordinates, according to the distance between the normal and the coordinate axes in the preset 3D coordinate system, according to the distance between the normal and the coordinate axes in the preset 3D coordinate system.
  • the resulting texture image is then mapped to the 3D scene of the video.
  • the texture information sampled in the second texture image may be mapped to the video image by using a three-way mapping (Tri-planar Mapping) method or a common mapping method, so that the second texture image is mapped to the 3D model of the scene.
  • Tri-planar Mapping Tri-planar Mapping
  • the embodiment of the present disclosure since the embodiment of the present disclosure considers the 3D coordinates and normal direction of the fragment when determining the sampling coordinates, after the texture image acquired based on the sampling coordinates is mapped to the 3D scene of the video, It can fit with the three-dimensional scene of the video and present a natural and realistic effect, thereby improving the interest of the video.
  • FIG. 4 is a schematic structural diagram of a video processing device provided by an embodiment of the present disclosure.
  • the processing device may be understood as the above-mentioned electronic device or some functional modules in the above-mentioned electronic device.
  • the video processing apparatus 400 may include: an acquisition module 410 , a determination module 420 , a brightness adjustment module 430 and a texture mapping module 440 .
  • the obtaining module 410 is used to obtain the three-dimensional reconstruction data of the current video image and the first texture image corresponding to the current moment;
  • the determining module 420 is configured to determine that the target pixel position on the first texture image corresponds to the target brightness at the current moment according to the mapping relationship between the pixel position obtained in advance and the initial brightness and the brightness change rate;
  • a brightness adjustment module 430 configured to adjust the brightness of the target pixel position on the first texture image to the target brightness to obtain a second texture image
  • the texture mapping module 440 is configured to map the second texture image onto the video image based on the 3D reconstruction data to obtain a target video image.
  • the determining module 420 includes:
  • the acquisition sub-module is used to obtain the initial brightness and the brightness change rate of the target pixel position according to the pre-obtained mapping relationship between the pixel position and the initial brightness and the brightness change rate;
  • the first determining submodule is used to determine the amount of brightness change at the target pixel position corresponding to the current moment based on the time parameter at the current moment and the rate of change in brightness at the target pixel position;
  • the second determination sub-module is used to determine that the target pixel position corresponds to the target brightness at the current moment based on the target pixel position corresponding to the brightness change at the current moment and the initial brightness at the target pixel position.
  • the obtaining module 410 includes:
  • the random sampling sub-module is used to randomly sample the texture on the pre-obtained reference texture image to at least part of the pixel positions of the preset template for the current moment, so as to obtain the first texture image corresponding to the current moment.
  • the random sampling submodule includes:
  • the selection subunit is used to randomly select a pixel position from a pre-obtained noise texture image as a target pixel position for any pixel position in at least some of the pixel positions, and the noise texture image includes random coordinate information corresponding to the target pixel position ;
  • An extraction subunit is used to extract random coordinates corresponding to the target pixel position from the noise texture image
  • the first sampling subunit samples the texture corresponding to the random coordinates in the reference texture image to any pixel position.
  • the random sampling submodule includes:
  • the processing subunit is configured to perform coordinate offset processing on the coordinates of any pixel position on the preset template for any pixel position in at least some of the pixel positions, to obtain the offset coordinates corresponding to any pixel position;
  • the obtaining subunit is used to obtain random coordinates corresponding to the target pixel position from the preset noise texture image based on the offset coordinates, and the position coordinates of the target pixel position in the noise texture image match the offset coordinates;
  • the second sampling subunit is used to collect the texture corresponding to the random coordinates in the reference texture image to any pixel position.
  • the 3D reconstruction data includes vertex coordinate information and normal direction information of the 3D mesh
  • the texture mapping module 440 includes:
  • the differential processing module is used to perform differential processing on the three-dimensional grid to obtain the segment in the three-dimensional grid and the offset position of the segment in the three-dimensional grid;
  • the third determining module is used to determine the coordinates and the normal direction of the fragment based on the offset position, and the vertex coordinates and the normal direction of the three-dimensional grid;
  • An image sampling module configured to sample the second texture image based on the coordinates and the normal direction of the fragment
  • the texture mapping submodule is used to map the sampled texture to the fragment.
  • the texture mapping submodule is used for:
  • the sampled texture is mapped onto the fragment along the direction of the first coordinate axis.
  • the device provided in this embodiment is capable of executing the method in any of the above-mentioned embodiments in FIG. 1-FIG. 3 , and its execution mode and beneficial effect are similar, and details are not repeated here.
  • An embodiment of the present disclosure also provides an electronic device, the electronic device includes a processor and a memory, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the above-mentioned FIG. 1, Fig. 3, and the method of any embodiment in Fig. 2a-Fig. 2c.
  • FIG. 5 is a schematic structural diagram of a terminal device in an embodiment of the present disclosure.
  • the electronic device 500 in the embodiment of the present disclosure may include, but is not limited to, mobile phones, notebook computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Tablet Computers), PMPs (Portable Multimedia Players), vehicle-mounted terminals ( Mobile terminals such as car navigation terminals) and stationary terminals such as digital TVs, desktop computers and the like.
  • the terminal device shown in FIG. 5 is only an example, and should not limit the functions and scope of use of this embodiment of the present disclosure.
  • an electronic device 500 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 501, which may be randomly accessed according to a program stored in a read-only memory (ROM) 502 or loaded from a storage device 508.
  • ROM read-only memory
  • RAM random access memory
  • various appropriate actions and processes are executed by programs in the memory (RAM) 503 .
  • RAM random access memory
  • various programs and data necessary for the operation of the electronic device 500 are also stored.
  • the processing device 501, ROM 502, and RAM 503 are connected to each other through a bus 504.
  • An input/output (I/O) interface 505 is also connected to the bus 504 .
  • the following devices can be connected to the I/O interface 505: input devices 506 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; including, for example, a liquid crystal display (LCD), speaker, vibration an output device 507 such as a computer; a storage device 508 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 509.
  • the communication means 509 may allow the electronic device 500 to perform wireless or wired communication with other devices to exchange data. While FIG. 5 shows electronic device 500 having various means, it is to be understood that implementing or having all of the means shown is not a requirement. More or fewer means may alternatively be implemented or provided.
  • embodiments of the present disclosure include a computer program product including a computer program carried on a non-transitory computer readable medium, the computer program including program codes for executing the method shown in the flowchart.
  • the computer program may be downloaded and installed from a network via communication means 509, or from storage means 508, or from ROM 502.
  • the processing device 501 When the computer program is executed by the processing device 501, the above-mentioned functions defined in the methods of the embodiments of the present disclosure are performed.
  • the above-mentioned computer-readable medium in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two.
  • a computer readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave carrying computer-readable program code therein. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • a computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can transmit, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device .
  • Program code embodied on a computer readable medium may be transmitted by any appropriate medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
  • the client and the server can communicate using any currently known or future network protocols such as HTTP (HyperText Transfer Protocol, Hypertext Transfer Protocol), and can communicate with digital data in any form or medium
  • HTTP HyperText Transfer Protocol
  • the communication eg, communication network
  • Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), internetworks (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network of.
  • the above-mentioned computer-readable medium may be included in the above-mentioned terminal device, or may exist independently without being assembled into the terminal device.
  • the computer-readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device: acquires the three-dimensional reconstruction data of the video image and the first texture image corresponding to the current moment;
  • mapping relationship between the pixel position obtained in advance and the initial brightness and the brightness change rate determine that the target pixel position on the first texture image corresponds to the target brightness at the current moment
  • the second texture image is mapped onto the video image to obtain a target video image.
  • Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, or combinations thereof, including but not limited to object-oriented programming languages—such as Java, Smalltalk, C++, and Includes conventional procedural programming languages - such as the "C" language or similar programming languages.
  • the program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server.
  • the remote computer can be connected to the user computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (such as through an Internet service provider). Internet connection).
  • LAN local area network
  • WAN wide area network
  • Internet service provider such as AT&T, MCI, Sprint, EarthLink, MSN, GTE, etc.
  • each block in a flowchart or block diagram may represent a module, program segment, or portion of code that contains one or more logical functions for implementing specified executable instructions.
  • the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved.
  • each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations can be implemented by a dedicated hardware-based system that performs the specified functions or operations , or may be implemented by a combination of dedicated hardware and computer instructions.
  • the units involved in the embodiments described in the present disclosure may be implemented by software or by hardware. Wherein, the name of a unit does not constitute a limitation of the unit itself under certain circumstances.
  • FPGAs Field Programmable Gate Arrays
  • ASICs Application Specific Integrated Circuits
  • ASSPs Application Specific Standard Products
  • SOCs System on Chips
  • CPLD Complex Programmable Logical device
  • a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device.
  • a machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium.
  • a machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing.
  • machine-readable storage media would include one or more wire-based electrical connections, portable computer discs, hard drives, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, compact disk read only memory (CD-ROM), optical storage, magnetic storage, or any suitable combination of the foregoing.
  • RAM random access memory
  • ROM read only memory
  • EPROM or flash memory erasable programmable read only memory
  • CD-ROM compact disk read only memory
  • magnetic storage or any suitable combination of the foregoing.
  • An embodiment of the present disclosure also provides a computer-readable storage medium, where a computer program is stored in the storage medium, and when the computer program is executed by a processor, the above-mentioned FIG. 1 , FIG. 3 , and FIG. 2a-2c can be realized.
  • the execution mode and beneficial effects of the method in any one of the embodiments are similar, and will not be repeated here.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computer Graphics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Geometry (AREA)
  • Software Systems (AREA)
  • Image Generation (AREA)

Abstract

本公开实施例涉及一种视频处理方法、装置、设备及存储介质。该方法包括:获取视频图像的三维重建数据和对应于当前时刻的第一纹理图像,根据预先得到的像素位置与初始亮度以及亮度变化速率之间的映射关系,确定第一纹理图像上的目标像素位置对应于当前时刻的目标亮度,将第一纹理图像上的目标像素位置的亮度调整成目标亮度,得到第二纹理图像,基于三维重建数据,将第二纹理图像映射到视频图像上,得到目标视频图像。由此,可以使得视频图像上的同一像素位置在不同时刻呈现出不同纹理和亮度,并使得视频图像上不同像素位置在同一时刻呈现出不同纹理和亮度,进而在视频图像上实现了一种流动闪烁的纹理效果,提高了视频的趣味性。

Description

视频处理方法、装置、设备及存储介质
本申请要求于2021年08月31日提交中国专利局、申请号为202111016296.2、申请名称为“视频处理方法、装置、设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本公开实施例涉及视频处理技术领域,尤其涉及一种视频处理方法、装置、设备及存储介质。
背景技术
相关技术提供的视频应用可以拍摄现实场景的视频,并将现实场景的视频分享到视频消费平台上供消费者进行观看。但是随着视频应用的发展,现实场景的分享,已经无法满足日益增长的用户需求,因此,如何在视频场景中添加特定效果的纹理效果,提高视频的趣味性,是当前亟需解决的技术问题。
发明内容
为了解决上述技术问题或者至少部分地解决上述技术问题,本公开实施例提供了一种视频处理方法、装置、设备及存储介质。
本公开实施例的第一方面提供了一种视频处理方法,该方法包括:
获取视频图像的三维重建数据和对应于当前时刻的第一纹理图像;
根据预先得到的像素位置与初始亮度以及亮度变化速率之间的映射关系,确定第一纹理图像上的目标像素位置对应于当前时刻的目标亮度;
将第一纹理图像上的目标像素位置的亮度调整成目标亮度,得到第二纹理图像;
基于三维重建数据,将第二纹理图像映射到视频图像上,得到目标视频图像。
本公开实施例的第二方面提供了一种视频处理装置,该装置包括:
获取模块,用于获取当前视频图像的三维重建数据和对应于当前时刻的第一纹理图像;
确定模块,用于根据预先得到的像素位置与初始亮度以及亮度变化速率之间的映射关系,确定第一纹理图像上的目标像素位置对应于当前时刻的目标亮度;
亮度调整模块,用于将第一纹理图像上的目标像素位置的亮度调整成目标亮度,得到第二纹理图像;
纹理映射模块,用于基于三维重建数据,将第二纹理图像映射到视频图像上,得到目标视频图像。
本公开实施例的第三方面提供了一种电子设备,该电子设备包括存储器和处理器,其中,存储器中存储有计算机程序,当该计算机程序被处理器执行时,可以实现如上述第一方面的视频处理方法。
本公开实施例的第四方面提供了一种计算机可读存储介质,该存储介质中存储有计算机程序,当该计算机程序被处理器执行时,可以实现如上述第一方面的视频处理方法。
本公开实施例的第五方面提供了一种计算机程序产品,其包括承载在非暂态计算机可读介质上的计算机程序,该计算机程序包含用于执行如上述第一方面的视频处理方法的程序代码。
本公开实施例提供的技术方案与现有技术相比具有如下优点:
本公开实施例,在获取视频图像的三维重建数据和对应于当前时刻的第一纹理图像之后,能够根据预先得到的像素位置与初始亮度以及亮度变化速率之间的映射关系,确定第一纹理图像上的目标像素位置对应于当前时刻的目标亮度,并将第一纹理图像上的目标像素位置的亮度调整成目标亮度,得到第二纹理图像,通过将第二纹理图像映射到视频图像上,得到目标视频图像。本公开实施例提供的方案,可以使得视频图像上的同一像素位置在不同时刻呈现出不同纹理和亮度,并使得视频图像上不同像素位置在同一时刻呈现出不同纹理和亮度,进而在视频图像上实现了一种流动闪烁的纹理效果,提高了视频的趣味性。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。
为了更清楚地说明本公开实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是本公开实施例提供的一种视频处理方法的流程示意图;
图2a是本公开实施例提供的一种参考纹理图像的示意图;
图2b是本公开实施例提供的一种预设模板的示意图;
图2c是本公开实施例提供的一种噪声纹理图像的示意图;
图3是本公开实施例提供的另一种视频处理方法的流程示意图;
图4是本公开实施例提供的一种视频处理装置的结构示意图;
图5是本公开实施例中的一种电子设备的结构示意图。
具体实施方式
为了能够更清楚地理解本公开的上述目的、特征和优点,下面将对本公开的方案进行进一步描述。需要说明的是,在不冲突的情况下,本公开的实施例及实施例中的特征可以相互组合。
在下面的描述中阐述了很多具体细节以便于充分理解本公开,但本公开还可以采用其他不同于在此描述的方式来实施;显然,说明书中的实施例只是本公开的一部分实施例,而不是全部的实施例。
在相关技术中,视频应用可以拍摄现实场景的视频,并将现实场景的视频分享到视频消费平台上供消费者进行观看。
随着视频应用的发展,现实场景的分享,已经无法满足日益增长的用户需求,用户希望在视频场景中添加特定效果的纹理效果,以提高视频的趣味性,进而满足日益增长的用户需求。
为了满足用户需求,本公开实施例提供了一种视频处理方法,该方法可以在视频图像上添加具有流动闪烁效果的纹理。
下面结合示例性实施例对本公开实施例提供的视频处理方法进行说明。
图1示出了本公开实施例提供的一种视频处理方法的流程示意图。
在本公开一些实施例中,图1所示的视频处理方法可以由电子设备执行。其中,电子设备可以包括移动电话、平板电脑、台式计算机、笔记本电脑、车载终端、可穿戴设备、一体机、智能家居设备等具有视频处理功能的设备,也可以包括虚拟机或者模拟器模拟的设备。
如图1所示,该视频处理方法可以包括如下S110-S140。
S110、获取视频图像的三维重建数据和对应于当前时刻的第一纹理图像。
具体的,在获取视频图像的三维重建数据和第一纹理图像之前,可以利用拍摄设备分别从不同的角度获取需要添加特定效果的场景,得到该场景的场景视频,将场景视频发送至电子设备,电子设备获取到场景视频之后,基于场景视频中的视频图像进行场景重建,得到场景视频中视频图像的三维重建数据。
在一种可能的实施方式中,上述拍摄设备可以包括三维扫描仪、摄像头、激光器、深度相机等设备,在此不做限定。
在一种可能的实施方式中,视频图像可以包括游戏视频图像、虚拟现实图像、影音视频图像等,在此不做限制。
在本公开实施例中,第一纹理图像可以是用于在视频图像上添加特定效果的初始素材图像,第一纹理图像中定义了每个像素位置的纹理和每个像素位置的亮度。在本公开实施例中,不同时刻对应的第一纹理图像可以不同,本公开实施例中的第一纹理图像可以是实时生成的也可以是预先设定的。
在一种可能的实施方式中,第一纹理图像可以是文字图像、风景图像、建筑图像或者其他类型的图像,在此不做限制。
S120、根据预先得到的像素位置与初始亮度以及亮度变化速率之间的映射关系,确定第一纹理图像上的目标像素位置对应于当前时刻的目标亮度。
本公开实施例中所称的像素位置可以理解为一个坐标区域,也可以理解为一个坐标点。
本公开实施例预先设置了每个像素位置的初始亮度和亮度变化速率,其中,不同像素位置对应的初始亮度可以相同也可以不同,不同像素位置对应的亮度变化速率可以相同也可以不同。
本公开实施例中所称的目标像素位置可以理解为需要进行亮度值变化的像素点位置。本公开实施例中的目标像素位置可以有一个也可以有多个。
目标像素位置的目标亮度可以理解为目标像素位置的亮度,以预设的亮度变化速率从初始时刻的初始亮度变化到当前时刻得到的亮度值。
在本公开实施例的一个示例性的实施方式中,S120可以包括下文S1-S3:
S1、根据预先得到的像素位置与初始亮度以及亮度变化速率之间的映射关系,获得目标像素位置的初始亮度和亮度变化速率。
S2、基于当前时刻的时间参数以及目标像素位置的亮度变化速率,确定目标像素位置对应于当前时刻的亮度变化量。
S3、基于目标像素位置对应于当前时刻的亮度变化量和目标像素位置的初始亮度,确定目标像素位置对应于当前时刻的目标亮度。
在本公开实施例中,各像素位置的亮度可以被配置为在预设范围(比如0到1的范围, 但不局限于0到1的范围)内周期变化。
在本公开实施例的一个实施方式中,当前时刻的时间参数可以理解为当前时刻在当前变化周期中的时间变化量。
在一种可能的实施方式中,目标亮度的计算公式可以为:
Z=f xy(t×v+a)
其中,Z为目标像素位置的目标亮度,x为目标像素位置的横坐标,y为目标像素位置的纵坐标,t为当前时刻的时间参数,v为目标像素位置的亮度变化速率,a为目标像素位置的初始亮度,f xy(*)为目标亮度的计算函数。
其中,a和v可以是预先设置的数值。
由此,可以根据预先得到的像素位置与初始亮度以及亮度变化速率之间的映射关系,获得目标像素位置的初始亮度和亮度变化速率,并将当前时刻的时间参数和目标像素位置的亮度变化速率相乘,得到目标像素位置对应于当前时刻的亮度变化量,再基于目标像素位置对应于当前时刻的亮度变化量和目标像素位置的初始亮度,可以准确的确定目标像素位置对应于当前时刻的目标亮度。
S130、将第一纹理图像上的目标像素位置的亮度调整成目标亮度,得到第二纹理图像。
具体的,电子设备确定第一纹理图像上的目标像素位置对应于当前时刻的目标亮度之后,可以将目标像素位置的亮度调整成目标亮度,以改变目标像素位置处的像素点的亮度值,使得目标像素位置在不同时刻对应不同的亮度值。
S140、基于三维重建数据,将第二纹理图像映射到视频图像上,得到目标视频图像。
在本公开实施例中,三维重建数据中包括组成场景三维模型的三维网格的数据,三维网格的数据包括顶点坐标和法线方向。
其中,三维网格可以理解为组成场景三维模型的基本单元。
在本公开实施例的一种示例性的实施方式中,可以通过顶点着色器从场景的三维重建数据中提取得到三维网格的顶点坐标和法线方向。
在本公开实施例中,纹理映射可以理解为将纹理图像上的纹理映射到场景的三维模型上的过程。
在本公开实施例的一种示例性的实施方式中,可以先基于三维网格的数据中的顶点坐标和法线方向,确定采样坐标;然后基于采样坐标对预设的第二纹理图像进行采样;并基于采样坐标与顶点之间的关联关系,将采样得到的第二纹理图像映射到视频图像上,得到目标视频图像。
具体的,由于采样坐标是基于网格的三维坐标和法线方向确定得到的,因此在基于采样坐标采样得到的纹理图像之后,可以基于采样坐标和网格之间的关联关系,将采样得到的第二纹理图像映射到视频图像上,使得采集得到的纹理图像在映射到视频的三维场景。
在本公开实施例中,在获取视频图像的三维重建数据和对应于当前时刻的第一纹理图像之后,能够根据预先得到的像素位置与初始亮度以及亮度变化速率之间的映射关系,确 定第一纹理图像上的目标像素位置对应于当前时刻的目标亮度,并将第一纹理图像上的目标像素位置的亮度调整成目标亮度,得到第二纹理图像,通过将第二纹理图像映射到视频图像上,得到目标视频图像。本公开实施例提供的方案,可以使得视频图像上的同一像素位置在不同时刻呈现出不同纹理和亮度,并使得视频图像上不同像素位置在同一时刻呈现出不同纹理和亮度,进而在视频图像上实现了一种流动闪烁的纹理效果,提高了视频的趣味性。
在本公开另一种实施方式中,可以将预先得到的参考纹理图像上的纹理随机采样到预设模板的至少部分像素位置上,以获得对应于当前时刻的第一纹理图像。
其中,预先得到的参考纹理图像可以是待采样的纹理图像。
其中,预设模板可以是预先对电子设备的屏幕中的像素划分成多个均匀块后得到的采样模板。
其中,预设模板中每个像素位置的尺寸可以是固定尺寸,使得参考纹理图像中的纹理数据采样到预设模板的像素位置上时,避免预设模板的像素位置内的纹理数据变形。
在一些实施例中,将预先得到的参考纹理图像上的纹理随机采样到预设模板的至少部分像素位置上,可以包括下文S10-S14:
S10、针对预设模板的至少部分像素位置中的任一像素位置,从预先得到的噪声纹理图像中随机选择一个像素位置作为采样位置,噪声纹理图像中包括采样位置对应的随机坐标的信息。
S12、从噪声纹理图像中提取采样位置对应的随机坐标。
S14、将参考纹理图像中对应于随机坐标的位置上的纹理采样到预设模板上。
其中,随机坐标可以是随机生成的一个坐标。
其中,S14可以包括:将随机坐标作为采样坐标,以将参考纹理图像中对应于随机坐标的位置上的纹理采样到预设模板上。
具体的,电子设备获取到参考纹理图像、预先得到的噪声纹理图像以及预设模板之后,针对预设模板的至少部分像素位置中的任一像素位置,从预先得到的噪声纹理图像中随机选择一个像素位置作为采样位置,并确定采样位置的随机坐标,将随机坐标作为采样坐标,以将参考纹理图像中对应于随机坐标的位置上的纹理采样到预设模板上,直到完成所有采样后,获得对应于当前时刻的第一纹理图像。
图2a示出了本公开实施例提供的一种参考纹理图像的示意图,图2b示出了本公开实施例提供的一种预设模板的示意图,图2c示出了本公开实施例提供的一种噪声纹理图像的示意图。
图2a所示的参考纹理图像可以是文字图像。图2b所示的预设模板的每个小方块为一个像素位置。图2c所示的噪声纹理图像中的每个采样位置均对应一个或多个随机坐标。
参见图2a-图2c,电子设备针对预设模板的至少部分像素位置中的像素位置1和像素位置2,在当前时刻的上一时刻,像素位置1对应的纹理为A4,像素位置2对应的纹理为A3,在当前时刻,从噪声纹理图像中随机选择一个像素位置作为采样位置,并确定采样位置的随机坐标,将随机坐标作为采样坐标,将参考纹理图像中对应于随机坐标的位置上的 纹理A1采样到像素位置1,使得像素位置1的纹理由A4调整为A1,并将参考纹理图像中对应于随机坐标的位置上的纹理A2采样到像素位置2,使得像素位置2的纹理由A3调整为A2,得到对应于当前时刻的第一纹理图像。
由此,在本公开实施例中,可以引入噪声纹理图像,从噪声纹理图像中提取该采样位置对应的随机坐标,基于随机坐标,将预先得到的参考纹理图像上的纹理随机采样到预设模板的至少部分像素位置上,获得对应于当前时刻的第一纹理图像,在连续时间段内,采集到的第一纹理图像的纹理信息可以不断变化,以呈现出纹理动态变化的效果。
在另一些实施例中,将预先得到的参考纹理图像上的纹理随机采样到预设模板的至少部分像素位置上,可以包括下文S20-S24:
S20、针对预设模板的至少部分像素位置中的任一像素位置,对任一像素位置在预设模板上的坐标进行坐标偏移处理,得到任一像素位置对应的偏移坐标。
S22、基于偏移坐标从预设的噪声纹理图像中获取相应位置上的随机坐标。
S24、将参考纹理图像中对应于随机坐标的位置上的纹理采集到任一像素位置上。
其中,偏移坐标可以是像素位置对应的初始坐标进行坐标偏移处理后得到的坐标,其中,偏移处理比如可以是将初始坐标与当前时刻对应的时间参数进行叠加处理,但不局限于将初始坐标与当前时刻对应的时间参数进行叠加处理。
具体的,电子设备获取到参考纹理图像、预先得到的噪声纹理图像以及预设模板之后,针对预设模板的至少部分像素位置中的任一像素位置,对任一像素位置在预设模板上的坐标进行坐标偏移处理,并根据任意像素位置的初始坐标,得到任一像素位置对应的偏移坐标,接着,将偏移坐标对应的位置作为预设的噪声纹理图像中的采样位置,确定采样位置对应的随机坐标,进一步的,将随机坐标作为采样坐标,以将参考纹理图像中对应于随机坐标的位置上的纹理采样到任一像素位置上,获得对应于当前时刻的第一纹理图像。
由此,在本公开实施例中,可以引入时间参数,针对预设模板的至少部分像素位置中的任一像素位置,对任一像素位置在预设模板上的坐标进行坐标偏移处理,得到任一像素位置对应的偏移坐标,并且,引入噪声纹理图像,基于偏移位置和噪声纹理图像,获得对应于当前时刻的第一纹理图像,在连续时间段内,采集到的第一纹理图像的纹理信息可以不断变化,以呈现出纹理动态变化的效果。
在又一些实施例中,将预先得到的参考纹理图像上的纹理随机采样到预设模板的至少部分像素位置上,可以包括下文S30-S32:
S30、针对预设模板的至少部分像素位置中的任一像素位置,对任一像素位置在预设模板上的坐标进行坐标偏移处理,得到任一像素位置对应的偏移坐标。
S32、将参考纹理图像中对应于偏移坐标的位置上的纹理采集到任一像素位置上。
具体的,电子设备获取到参考纹理图像和预设模板之后,针对预设模板的至少部分像素位置中的任一像素位置,对任一像素位置在预设模板上的坐标进行坐标偏移处理,并根据任意像素位置的初始坐标,得到任一像素位置对应的偏移坐标,接着,将偏移坐标作为采样坐标,以将参考纹理图像中对应于偏移坐标的位置上的纹理采样到任一像素位置上,获得对应于当前时刻的第一纹理图像。
本公开实施例通过对上述方式得到的第一纹理图像进行亮度调整,得到第二纹理图像, 并将第二纹理图像映射到三维场景上,使得三维场景可以呈现出由亮度变化效果和纹理变化效果合成的动态变化效果,例如可以出现由纹理闪烁效果和流动效果的生成字符雨的效果,进而提高了视频的趣味性。
在本公开又一种实施方式中,可以对视频图像的三维重建数据中的三维网格的顶点坐标信息和法线方向信息进行处理,得到三维网格中的片段的三维坐标和法线方向,并根据片段的三维坐标和法线方向,对第二纹理图像进行采样,进一步将采样得到的纹理映射到片段上,得到目标视频图像。
图3示出了本公开实施例提供的另一种视频处理方法的流程示意图。
如图1所示,该视频处理方法可以包括如下S310-S370。
S310、获取视频图像的三维重建数据和对应于当前时刻的第一纹理图像。
S320、根据预先得到的像素位置与初始亮度以及亮度变化速率之间的映射关系,确定第一纹理图像上的目标像素位置对应于当前时刻的目标亮度。
S330、将第一纹理图像上的目标像素位置的亮度调整成目标亮度,得到第二纹理图像。
其中,S310~S330与S110~S130相似,在此不做赘述。
S340、对三维重建数据中的三维网格进行差分处理,得到三维网格中的片段以及片段在三维网格中的偏移位置。
在本公开实施例中,差分处理可以是基于三维网格的顶点,并利用插值函数,按照预设的步长,将三维网格离散化处理,使得三维网格离散化为一个或多个片段。
在本公开实施例中,片段是指对三维网格进行等比例分割后得到的最小单元。
其中,片段相对于三维网格的顶点的偏移位置可以根据片段相对于三维网格的顶点的步长和顶点的位置确定。
具体的,电子设备从三维重建数据中提取得到三维网格的顶点三维坐标和顶点法线方向之后,可以将提取得到三维网格的顶点三维坐标和顶点法线方向输入片段着色器,片段着色器可以基于有限差分法,根据三维网格的顶点,并利用插值函数,按照预设的步长,将三维网格离散化处理,使得三维网格离散化为一个或多个片段,得到三维网格中的片段以及片段在三维网格中的偏移位置。
S350、基于偏移位置,以及三维网格的顶点坐标和法线方向,确定片段的坐标和法线方向。
在本公开实施例中,S350可以包括:针对每个片段,根据三维网格的顶点三维坐标和每个片段在三维网格中的偏移位置,计算每个片段的坐标,根据片段的坐标,构建片段的法线,将三维网格的法线方向作为每个片段的法线方向。
具体的,电子设备得到三维网格中的片段以及片段在三维网格中的偏移位置之后,可以利用片段着色器,将每个片段在三维网格中的偏移位置对应的坐标,作为片段的坐标,根据片段的坐标,构建片段的法线,将三维网格的法线方向作为每个片段的法线方向。
由此,在本公开实施例中,在得到第二纹理图像之后,利用片段着色器对三维网格进行差分处理,得到三维网格中的片段以及片段在三维网格中的偏移位置,再基于偏移位置,以及三维网格的顶点坐标和法线方向,准确的确定片段的坐标和法线方向。
S360、基于片段的坐标和法线方向,对第二纹理图像进行采样。
在本公开实施例中,在一种可能的实施方式中,S360可以包括下文S11-S15:
S11、基于片段的坐标和法线方向,确定片段的法线与预设三维坐标系中的三个坐标轴之间的距离关系。
S13、在法线与三个坐标轴中的第一坐标轴的距离最近时,基于三维坐标在三个坐标轴中的第二坐标轴、第三坐标轴上的分量,组成采样坐标;或者,在法线与第一坐标轴和第二坐标轴距离最近时,可以基于三维坐标在第二坐标轴、第三坐标轴上的分量,或者三维坐标在第一坐标轴、第三坐标轴上的分量,组成采样坐标。
其中,法线与第一坐标轴和第二坐标轴距离最近是指,法线与第一坐标轴和第二坐标轴距离相同,且小于法线与第三坐标轴之间的距离。
S15、基于采样坐标对第二纹理图像进行采样。
在一些实施例中,S11可以包括下文S111-S115:
S111、对片段的法线长度进行归一化处理,得到目标法线。
S113、基于片段的三维坐标和法线方向,确定目标法线在三个坐标轴上的分量。
S115、基于目标法线在三个坐标轴上的分量,确定目标法线与三个坐标轴之间的距离关系。
其中,目标法线与坐标轴的距离与目标法线在坐标轴上的分量成反比。
在另一些实施例中,S11可以包括下文S211-S213:
S211、根据片段的三维坐标和法线方向,计算片段的法线与预设三维坐标系的三个坐标轴所在的直线的夹角。
S213、将最小夹角对应的坐标轴作为与片段的法线距离最近的第一坐标轴,并将最大夹角和次大夹角对应的坐标轴作为与片段的法线距离非最近的第二坐标轴和第三坐标轴,其中,夹角可以为小于90°的任意锐角。
其中,预设三维坐标系可以是片段所属的三维网格模型所在的三维坐标系。
其中,片段的法线与三个坐标轴所在的直线的夹角可以用于表征法线与三个坐标轴之间的接近程度。
可以理解的是,片段的法线与坐标轴所在的直线的夹角越大,则片段的法线越远离该坐标轴,因此,片段的法线与该坐标轴的距离越大,相反的,片段的法线与坐标轴所在的直线的夹角越小,则片段的法线越靠近该坐标轴,因此,片段的法线与该坐标轴的距离越小。
由此,在本公开实施例中,可以根据片段的三维坐标,以及归一化处理后的目标法线在三个坐标轴上的分量,确定目标法线与三个坐标轴之间的距离关系,或者,根据片段的法线与坐标轴之间的夹角,确定目标法线与三个坐标轴之间的距离关系,以便后续可以根据距离关系,确定采样坐标。
另外,针对上文S13中,三维坐标在三个坐标轴中的第二坐标轴、第三坐标轴上的分量,可以理解为三维坐标在三个坐标轴中的第二坐标轴、第三坐标轴上的坐标。同理,三维坐标在第二坐标轴、第三坐标轴上的分量,可以理解为三维坐标在三个坐标轴中的第二坐标轴、第三坐标轴上的坐标,三维坐标在第一坐标轴、第三坐标轴上的分量,可以理解 为三维坐标在三个坐标轴中的第一坐标轴、第三坐标轴上的坐标。
另外,针对上文S15来说,电子设备可以基于采样坐标,对纹理图像上对应采样坐标的位置处的像素点的纹理信息进行采样,得到相应的纹理。
S370、将采样得到的纹理映射到片段上。
在本公开实施例中,纹理映射可以理解为将纹理图像上的纹理映射到场景的三维模型上的过程。
在本公开实施例中,S370可以包括S3701:
S3701、在法线与预设三维坐标系中的第一坐标轴的距离最近时,沿着第一坐标轴的方向,将采样得到的纹理映射到片段上。
具体的,由于采样坐标是基于片段的三维坐标和法线方向确定得到的,因此在基于采样坐标采样得到的纹理图像之后,可以在根据法线与预设三维坐标系中的坐标轴的距离,确定出法线与预设三维坐标系中的第一坐标轴的距离最近时,沿着与法线的距离最近的第一坐标轴的方向,将采样得到的纹理图像映射到片段上,使得采集得到的纹理图像在映射到视频的三维场景。
在一种可能的实施方式中,可以采用三向映射(Tri-planar Mapping)方式或者普通映射方式,将第二纹理图像中采样得到的纹理信息映射到视频图像上,使得第二纹理图像映射到了场景的三维模型上。
由此,在本公开实施例中,由于本公开实施例在确定采样坐标时考虑了片段的三维坐标和法线方向,因此,基于采样坐标采集得到的纹理图像在映射到视频的三维场景之后,可以与视频的三维场景贴合,并呈现出一种自然逼真的效果,进而提高了视频的趣味性。
图4是本公开实施例提供的一种视频处理装置的结构示意图,该处理装置可以被理解为上述电子设备或者上述电子设备中的部分功能模块。如图4所示,该视频处理装置400可以包括:获取模块410、确定模块420、亮度调整模块430和纹理映射模块440。
其中,获取模块410,用于获取当前视频图像的三维重建数据和对应于当前时刻的第一纹理图像;
确定模块420,用于根据预先得到的像素位置与初始亮度以及亮度变化速率之间的映射关系,确定第一纹理图像上的目标像素位置对应于当前时刻的目标亮度;
亮度调整模块430,用于将第一纹理图像上的目标像素位置的亮度调整成目标亮度,得到第二纹理图像;
纹理映射模块440,用于基于三维重建数据,将第二纹理图像映射到视频图像上,得到目标视频图像。
在一种可能的实施方式中,确定模块420,包括:
获取子模块,用于根据预先得到的像素位置与初始亮度以及亮度变化速率之间的映射关系,获得目标像素位置的初始亮度和亮度变化速率;
第一确定子模块,用于基于当前时刻的时间参数以及目标像素位置的亮度变化速率,确定目标像素位置对应于当前时刻的亮度变化量;
第二确定子模块,用于基于目标像素位置对应于当前时刻的亮度变化量和目标像素位 置的初始亮度,确定目标像素位置对应于当前时刻的目标亮度。
在一种可能的实施方式中,获取模块410,包括:
随机采样子模块,用于针对当前时刻,将预先得到的参考纹理图像上的纹理随机的采样到预设模板的至少部分像素位置上,获得对应于当前时刻的第一纹理图像。
在一种可能的实施方式中,随机采样子模块,包括:
选择子单元,用于针对至少部分像素位置中的任一像素位置,从预先得到的噪声纹理图像中随机选择一个像素位置作为目标像素位置,噪声纹理图像中包括目标像素位置对应的随机坐标的信息;
提取子单元,用于从噪声纹理图像中提取目标像素位置对应的随机坐标;
第一采样子单元,将参考纹理图像中对应于随机坐标的纹理采样到任一像素位置上。
在一种可能的实施方式中,随机采样子模块,包括:
处理子单元,用于针对至少部分像素位置中的任一像素位置,对任一像素位置在预设模板上的坐标进行坐标偏移处理,得到任一像素位置对应的偏移坐标;
获取子单元,用于基于偏移坐标从预设的噪声纹理图像中获取目标像素位置对应的随机坐标,目标像素位置在噪声纹理图像中的位置坐标与偏移坐标匹配;
第二采样子单元,用于将参考纹理图像中对应于随机坐标的纹理采集到任一像素位置上。
在一种可能的实施方式中,三维重建数据中包括三维网格的顶点坐标信息和法线方向信息;
其中,纹理映射模块440,包括:
差分处理模块,用于对三维网格进行差分处理,得到三维网格中的片段以及片段在三维网格中的偏移位置;
第三确定模块,用于基于偏移位置,以及三维网格的顶点坐标和法线方向,确定片段的坐标和法线方向;
图像采样模块,用于基于片段的坐标和法线方向,对第二纹理图像进行采样;
纹理映射子模块,用于将采样得到的纹理映射到片段上。
在一种可能的实施方式中,纹理映射子模块用于:
在法线与预设三维坐标系中的第一坐标轴的距离最近时,沿着第一坐标轴的方向,将采样得到的纹理映射到片段上。
本实施例提供的装置能够执行上述图1-图3中任一实施例的方法,其执行方式和有益效果类似,在这里不再赘述。
本公开实施例还提供一种电子设备,该电子设备包括处理器和存储器,其中,所述存储器中存储有计算机程序,当所述计算机程序被所述处理器执行时可以实现如上述图1、图3,以及图2a-图2c中任一实施例的方法。
示例的,图5是本公开实施例中的一种终端设备的结构示意图。下面具体参考图5,其示出了适于用来实现本公开实施例中的电子设备500的结构示意图。本公开实施例中的电子设备500可以包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、PDA(个人数字助理)、PAD(平板电脑)、PMP(便携式多媒体播放器)、车载终端(例如车载导航 终端)等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。图5示出的终端设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。
如图5所示,电子设备500可以包括处理装置(例如中央处理器、图形处理器等)501,其可以根据存储在只读存储器(ROM)502中的程序或者从存储装置508加载到随机访问存储器(RAM)503中的程序而执行各种适当的动作和处理。在RAM 503中,还存储有电子设备500操作所需的各种程序和数据。处理装置501、ROM 502以及RAM 503通过总线504彼此相连。输入/输出(I/O)接口505也连接至总线504。
通常,以下装置可以连接至I/O接口505:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置506;包括例如液晶显示器(LCD)、扬声器、振动器等的输出装置507;包括例如磁带、硬盘等的存储装置508;以及通信装置509。通信装置509可以允许电子设备500与其他设备进行无线或有线通信以交换数据。虽然图5示出了具有各种装置的电子设备500,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在非暂态计算机可读介质上的计算机程序,该计算机程序包含用于执行如流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置509从网络上被下载和安装,或者从存储装置508被安装,或者从ROM 502被安装。在该计算机程序被处理装置501执行时,执行本公开实施例的方法中限定的上述功能。
需要说明的是,本公开上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。
在一些实施方式中,客户端、服务器可以利用诸如HTTP(HyperText Transfer Protocol,超文本传输协议)之类的任何当前已知或未来研发的网络协议进行通信,并且可以与任意形式或介质的数字数据通信(例如,通信网络)互连。通信网络的示例包括局域网(“LAN”),广域网(“WAN”),网际网(例如,互联网)以及端对端网络(例如,ad hoc端对端网络), 以及任何当前已知或未来研发的网络。
上述计算机可读介质可以是上述终端设备中所包含的;也可以是单独存在,而未装配入该终端设备中。
上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备:获取视频图像的三维重建数据和对应于当前时刻的第一纹理图像;
根据预先得到的像素位置与初始亮度以及亮度变化速率之间的映射关系,确定第一纹理图像上的目标像素位置对应于当前时刻的目标亮度;
将第一纹理图像上的目标像素位置的亮度调整成目标亮度,得到第二纹理图像;
基于三维重建数据,将第二纹理图像映射到视频图像上,得到目标视频图像。
可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括但不限于面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
描述于本公开实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,单元的名称在某种情况下并不构成对该单元本身的限定。
本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、片上系统(SOC)、复杂可编程逻辑设备(CPLD)等等。
在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携 式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。
本公开实施例还提供一种计算机可读存储介质,所述存储介质中存储有计算机程序,当所述计算机程序被处理器执行时可以实现如上述图1、图3,以及图2a-图2c中任一实施例的方法,其执行方式和有益效果类似,在这里不再赘述。
需要说明的是,在本文中,诸如“第一”和“第二”等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
以上所述仅是本公开的具体实施方式,使本领域技术人员能够理解或实现本公开。对这些实施例的多种修改对本领域的技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本公开的精神或范围的情况下,在其它实施例中实现。因此,本公开将不会被限制于本文所述的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。

Claims (17)

  1. 一种视频处理方法,包括:
    获取视频图像的三维重建数据和对应于当前时刻的第一纹理图像;
    根据预先得到的像素位置与初始亮度以及亮度变化速率之间的映射关系,确定所述第一纹理图像上的目标像素位置对应于当前时刻的目标亮度;
    将所述第一纹理图像上的所述目标像素位置的亮度调整成所述目标亮度,得到第二纹理图像;
    基于所述三维重建数据,将所述第二纹理图像映射到所述视频图像上,得到目标视频图像。
  2. 根据权利要求1所述的方法,其中,所述根据预先得到的像素位置与初始亮度以及亮度变化速率之间的映射关系,确定所述第一纹理图像上的目标像素位置对应于当前时刻的目标亮度,包括:
    根据预先得到的像素位置与初始亮度以及亮度变化速率之间的映射关系,获得所述目标像素位置的初始亮度和亮度变化速率;
    基于当前时刻的时间参数以及所述目标像素位置的亮度变化速率,确定所述目标像素位置对应于当前时刻的亮度变化量;
    基于所述目标像素位置对应于当前时刻的亮度变化量和所述目标像素位置的初始亮度,确定所述目标像素位置对应于当前时刻的目标亮度。
  3. 根据权利要求1所述的方法,其中,所述获取对应于当前时刻的第一纹理图像,包括:
    针对当前时刻,将预先得到的参考纹理图像上的纹理随机采样到预设模板的至少部分像素位置上,获得对应于当前时刻的第一纹理图像。
  4. 根据权利要求3所述的方法,其中,所述将预先得到的参考纹理图像上的纹理随机采样到预设模板的至少部分像素位置上,包括:
    针对所述预设模板的至少部分像素位置中的任一像素位置,从预先得到的噪声纹理图像中随机选择一个像素位置作为采样位置,所述噪声纹理图像中包括所述采样位置对应的随机坐标的信息;
    从所述噪声纹理图像中提取所述采样位置对应的随机坐标;
    将所述参考纹理图像中对应于所述随机坐标的位置上的纹理采样到所述任一像素位置上。
  5. 根据权利要求3所述的方法,其中,所述将预先得到的参考纹理图像上的纹理随机采样到预设模板的至少部分像素位置上,包括:
    针对所述预设模板的至少部分像素位置中的任一像素位置,对所述任一像素位置在所述预设模板上的坐标进行坐标偏移处理,得到所述任一像素位置对应的偏移坐标;
    基于所述偏移坐标从预设的噪声纹理图像中获取相应位置上的随机坐标;
    将所述参考纹理图像中对应于所述随机坐标的位置上的纹理采集到所述任一像素位置上。
  6. 根据权利要求1-5中任一项所述的方法,其中,所述三维重建数据中包括三维网 格的顶点坐标信息和法线方向信息;
    所述基于所述三维重建数据,将所述第二纹理图像映射到所述视频图像上,得到目标视频图像,包括:
    对所述三维网格进行差分处理,得到所述三维网格中的片段以及所述片段在所述三维网格中的偏移位置;
    基于所述偏移位置,以及所述三维网格的顶点坐标和法线方向,确定所述片段的坐标和法线方向;
    基于所述片段的坐标和法线方向,对所述第二纹理图像进行采样;
    将采样得到的纹理映射到所述片段上。
  7. 根据权利要求6所述的方法,其中,所述将采样得到的纹理映射到所述片段上,包括:
    在所述法线与预设三维坐标系中的第一坐标轴的距离最近时,沿着所述第一坐标轴的方向,将所述采样得到的纹理映射到所述片段上。
  8. 一种视频处理装置,包括:
    获取模块,用于获取当前视频图像的三维重建数据和对应于当前时刻的第一纹理图像;
    确定模块,用于根据预先得到的像素位置与初始亮度以及亮度变化速率之间的映射关系,确定所述第一纹理图像上的目标像素位置对应于当前时刻的目标亮度;
    亮度调整模块,用于将所述第一纹理图像上的所述目标像素位置的亮度调整成所述目标亮度,得到第二纹理图像;
    纹理映射模块,用于基于所述三维重建数据,将所述第二纹理图像映射到所述视频图像上,得到目标视频图像。
  9. 根据权利要求8所述的装置,其中,所述确定模块,包括:
    获取子模块,用于根据预先得到的像素位置与初始亮度以及亮度变化速率之间的映射关系,获得所述目标像素位置的初始亮度和亮度变化速率;
    第一确定子模块,用于基于当前时刻的时间参数以及所述目标像素位置的亮度变化速率,确定所述目标像素位置对应于当前时刻的亮度变化量;
    第二确定子模块,用于基于所述目标像素位置对应于当前时刻的亮度变化量和所述目标像素位置的初始亮度,确定所述目标像素位置对应于当前时刻的目标亮度。
  10. 根据权利要求8所述的装置,其中,所述获取模块,包括:
    随机采样子模块,用于针对当前时刻,将预先得到的参考纹理图像上的纹理随机的采样到预设模板的至少部分像素位置上,获得对应于当前时刻的第一纹理图像。
  11. 根据权利要求10所述的装置,其中,所述随机采样子模块,包括:
    选择子单元,用于针对所述至少部分像素位置中的任一像素位置,从预先得到的噪声纹理图像中随机选择一个像素位置作为目标像素位置,所述噪声纹理图像中包括所述目标像素位置对应的随机坐标的信息;
    提取子单元,用于从所述噪声纹理图像中提取所述目标像素位置对应的随机坐标;
    第一采样子单元,将所述参考纹理图像中对应于所述随机坐标的纹理采样到所述 任一像素位置上。
  12. 根据权利要求10所述的装置,其中,所述随机采样子模块,包括:
    处理子单元,用于针对所述至少部分像素位置中的任一像素位置,对所述任一像素位置在所述预设模板上的坐标进行坐标偏移处理,得到所述任一像素位置对应的偏移坐标;
    获取子单元,用于基于所述偏移坐标从预设的噪声纹理图像中获取目标像素位置对应的随机坐标,所述目标像素位置在所述噪声纹理图像中的位置坐标与所述偏移坐标匹配;
    第二采样子单元,用于将所述参考纹理图像中对应于所述随机坐标的纹理采集到所述任一像素位置上。
  13. 根据权利要求8-12中任一项所述的装置,其中,所述三维重建数据中包括三维网格的顶点坐标信息和法线方向信息;
    所述纹理映射模块,包括:
    差分处理模块,用于对所述三维网格进行差分处理,得到所述三维网格中的片段以及所述片段在所述三维网格中的偏移位置;
    第三确定模块,用于基于所述偏移位置,以及所述三维网格的顶点坐标和法线方向,确定所述片段的坐标和法线方向;
    图像采样模块,用于基于所述片段的坐标和法线方向,对所述第二纹理图像进行采样;
    纹理映射子模块,用于将采样得到的纹理映射到所述片段上。
  14. 根据权利要求13所述的装置,其中,所述纹理映射子模块用于:
    在所述法线与预设三维坐标系中的第一坐标轴的距离最近时,沿着所述第一坐标轴的方向,将所述采样得到的纹理映射到所述片段上。
  15. 一种电子设备,包括:
    存储器和处理器,其中,所述存储器中存储有计算机程序,当所述计算机程序被所述处理器执行时,实现如权利要求1-7中任一项所述的方法。
  16. 一种计算机可读存储介质,其特征在于,所述存储介质中存储有计算机程序,当所述计算机程序被处理器执行时,实现如权利要求1-7中任一项所述的方法。
  17. 一种计算机程序产品,其包括承载在非暂态计算机可读介质上的计算机程序,该计算机程序包含用于执行如权利要求1-7中任一项所述的方法的程序代码。
PCT/CN2022/110796 2021-08-31 2022-08-08 视频处理方法、装置、设备及存储介质 WO2023029892A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111016296.2A CN115733938A (zh) 2021-08-31 2021-08-31 视频处理方法、装置、设备及存储介质
CN202111016296.2 2021-08-31

Publications (1)

Publication Number Publication Date
WO2023029892A1 true WO2023029892A1 (zh) 2023-03-09

Family

ID=85291802

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/110796 WO2023029892A1 (zh) 2021-08-31 2022-08-08 视频处理方法、装置、设备及存储介质

Country Status (2)

Country Link
CN (1) CN115733938A (zh)
WO (1) WO2023029892A1 (zh)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5687307A (en) * 1993-09-21 1997-11-11 Canon Kabushiki Kaisha Computer graphic animation in which texture animation is independently performed on a plurality of objects in three-dimensional space
US6999093B1 (en) * 2003-01-08 2006-02-14 Microsoft Corporation Dynamic time-of-day sky box lighting
CN102301399A (zh) * 2009-09-04 2011-12-28 松下电器产业株式会社 图像生成系统、图像生成方法、计算机程序及其记录介质
CN106683165A (zh) * 2015-11-11 2017-05-17 武汉大学 文化遗产的四维可视化方法
US20170148206A1 (en) * 2015-11-20 2017-05-25 Google Inc. Electronic display stabilization using pixel velocities
CN107958480A (zh) * 2017-11-23 2018-04-24 腾讯科技(上海)有限公司 图像渲染方法、装置及存储介质
CN108470369A (zh) * 2018-03-26 2018-08-31 城市生活(北京)资讯有限公司 一种水面渲染方法及装置
CN111476861A (zh) * 2020-05-18 2020-07-31 周恩泽 一种图像渲染方法、装置、电子设备及存储介质
WO2020182880A1 (en) * 2019-03-11 2020-09-17 3Shape A/S System and method for generating digital three-dimensional dental models

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10283487A (ja) * 1997-04-04 1998-10-23 Fujitsu F I P Kk 多重テクスチャマッピング装置及び方法並びに多重テクスチャマッピングのためのプログラムを格納した記憶媒体
CN108876921B (zh) * 2017-05-08 2021-09-17 腾讯科技(深圳)有限公司 三维装扮模型处理方法、装置、计算机设备和存储介质
US11043019B2 (en) * 2017-07-13 2021-06-22 Devar Entertainment Limited Method of displaying a wide-format augmented reality object
CN111681307B (zh) * 2020-06-08 2023-10-20 武汉真蓝三维科技有限公司 一种应用于三维软件的动态三维坐标轴的实现方法
CN112288848A (zh) * 2020-10-13 2021-01-29 中国建筑第八工程局有限公司 无人机航拍三维建模计算工程量的方法

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5687307A (en) * 1993-09-21 1997-11-11 Canon Kabushiki Kaisha Computer graphic animation in which texture animation is independently performed on a plurality of objects in three-dimensional space
US6999093B1 (en) * 2003-01-08 2006-02-14 Microsoft Corporation Dynamic time-of-day sky box lighting
CN102301399A (zh) * 2009-09-04 2011-12-28 松下电器产业株式会社 图像生成系统、图像生成方法、计算机程序及其记录介质
CN106683165A (zh) * 2015-11-11 2017-05-17 武汉大学 文化遗产的四维可视化方法
US20170148206A1 (en) * 2015-11-20 2017-05-25 Google Inc. Electronic display stabilization using pixel velocities
CN107958480A (zh) * 2017-11-23 2018-04-24 腾讯科技(上海)有限公司 图像渲染方法、装置及存储介质
CN108470369A (zh) * 2018-03-26 2018-08-31 城市生活(北京)资讯有限公司 一种水面渲染方法及装置
WO2020182880A1 (en) * 2019-03-11 2020-09-17 3Shape A/S System and method for generating digital three-dimensional dental models
CN111476861A (zh) * 2020-05-18 2020-07-31 周恩泽 一种图像渲染方法、装置、电子设备及存储介质

Also Published As

Publication number Publication date
CN115733938A (zh) 2023-03-03

Similar Documents

Publication Publication Date Title
CN112380379B (zh) 歌词特效展示方法、装置、电子设备及计算机可读介质
CN112333491B (zh) 视频处理方法、显示装置和存储介质
WO2023029893A1 (zh) 纹理映射方法、装置、设备及存储介质
CN110728622B (zh) 鱼眼图像处理方法、装置、电子设备及计算机可读介质
CN109801354B (zh) 全景处理方法和装置
WO2023103999A1 (zh) 3d目标点渲染方法、装置、设备及存储介质
WO2023125365A1 (zh) 图像处理方法、装置、电子设备及存储介质
WO2023221409A1 (zh) 虚拟现实空间的字幕渲染方法、装置、设备及介质
CN111652675A (zh) 展示方法、装置和电子设备
CN111292406B (zh) 模型渲染方法、装置、电子设备及介质
WO2023138468A1 (zh) 虚拟物体的生成方法、装置、设备及存储介质
WO2023138467A1 (zh) 虚拟物体的生成方法、装置、设备及存储介质
WO2023098649A1 (zh) 视频生成方法、装置、设备及存储介质
CN111862342A (zh) 增强现实的纹理处理方法、装置、电子设备及存储介质
CN109816791B (zh) 用于生成信息的方法和装置
WO2023109564A1 (zh) 视频图像处理方法、装置、电子设备及存储介质
WO2023029892A1 (zh) 视频处理方法、装置、设备及存储介质
CN116309137A (zh) 一种多视点图像去模糊方法、装置、系统和电子介质
CN114332224A (zh) 3d目标检测样本的生成方法、装置、设备及存储介质
CN114723600A (zh) 美妆特效的生成方法、装置、设备、存储介质和程序产品
CN116109744A (zh) 一种绒毛渲染方法、装置、设备及介质
CN114549781A (zh) 数据处理方法、装置、电子设备和存储介质
CN112383810A (zh) 歌词视频展示方法、装置、电子设备及计算机可读介质
CN113066166A (zh) 图像处理方法、装置和电子设备
CN111460334A (zh) 信息显示方法、装置和电子设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22863033

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE