Image generation method, device, equipment and storage medium

By translating the initial 3D point and light source in a three-dimensional virtual scene to generate a target distorted image, the problem of unrealistic image distortion effects in existing technologies is solved, and the effect of quickly generating highly realistic distorted images is achieved, which is suitable for three-dimensional movies and deep learning.

CN114742930BActive Publication Date: 2025-09-05BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210388013.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-13
Publication Date
2025-09-05
Estimated Expiration
2042-04-13

AI Technical Summary

Technical Problem

Existing technologies find it difficult to quickly generate images with highly realistic distortion effects, especially those captured by wide-angle cameras, which results in information loss or changes in lighting information.

Method used

By obtaining the initial 3D points and lighting information of the three-dimensional virtual scene and translating the initial 3D points and light sources along the set direction, a target distorted image is generated.

Benefits of technology

It achieves the rapid generation of images with highly realistic distortion effects, suitable for 3D film production and deep learning training.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114742930B_ABST
    Figure CN114742930B_ABST
Patent Text Reader

Abstract

The embodiments of the present disclosure disclose an image generation method, apparatus, device, and storage medium. Initial 3D points and lighting information of a three-dimensional virtual scene are obtained; the initial 3D points are translated along a set direction to obtain target 3D points; and a target distorted image is generated based on the target 3D points and the lighting information. The image generation method provided by the embodiments of the present disclosure translates 3D points in a three-dimensional virtual scene along a set direction, and generates a target distorted image based on the translated 3D points and the lighting information. This method can quickly generate an image with a distortion effect and improve the authenticity of the image distortion effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the field of image processing technology, and in particular to an image generation method, apparatus, device, and storage medium. Background Art

[0002] Wide-angle cameras, which have a viewing angle greater than 180°, are primarily categorized as mirror cameras and lens cameras. Because the imagery exceeding 180° needs to be packed into a limited image, the image near the edges experiences varying degrees of distortion, a phenomenon known as distortion.

[0003] In industries like 3D film production and deep learning data generation, depending on the requirements (for example, creating a video with a wide-angle camera, deep learning requires wide-angle camera images as training data), a large number of distorted images may be required. Therefore, being able to quickly obtain distorted images is particularly important. Summary of the Invention

[0004] The embodiments of the present disclosure provide an image generation method, apparatus, device, and storage medium, which can quickly generate an image with a distortion effect and improve the authenticity of the image distortion effect.

[0005] In a first aspect, an embodiment of the present disclosure provides an image generation method, comprising:

[0006] Obtain the initial 3D points and lighting information of the three-dimensional virtual scene;

[0007] Translate the initial 3D point along a set direction to obtain a target 3D point;

[0008] A target distorted image is generated based on the target 3D point and the illumination information.

[0009] In a second aspect, the embodiments of the present disclosure further provide an image generating device, including:

[0010] The initial 3D point acquisition module is used to obtain the initial 3D points and lighting information of the three-dimensional virtual scene;

[0011] A target 3D point acquisition module is used to translate the initial 3D point along a set direction to obtain a target 3D point;

[0012] The target distorted image generation module is used to generate a target distorted image based on the target 3D point and the illumination information.

[0013] In a third aspect, an embodiment of the present disclosure further provides an electronic device, the electronic device comprising:

[0014] one or more processing devices;

[0015] a storage device for storing one or more programs;

[0016] When the one or more programs are executed by the one or more processing devices, the one or more processing devices implement the image generating method as described in the embodiment of the present disclosure.

[0017] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the image generation method as described in the embodiment of the present disclosure.

[0018] The embodiments of the present disclosure disclose an image generation method, apparatus, device, and storage medium. Initial 3D points and lighting information of a three-dimensional virtual scene are obtained; the initial 3D points are translated along a set direction to obtain target 3D points; and a target distorted image is generated based on the target 3D points and lighting information. The image generation method provided by the embodiments of the present disclosure translates 3D points in a three-dimensional virtual scene along a set direction, and generates a target distorted image based on the translated 3D points and lighting information. This method can quickly generate an image with a distortion effect and improve the authenticity of the image distortion effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 is a flowchart of an image generation method in an embodiment of the present disclosure;

[0020] Figure 2 is a structural diagram of an image generating device according to an embodiment of the present disclosure;

[0021] Figure 3 It is a structural diagram of an electronic device in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0022] The following describes embodiments of the present disclosure in more detail with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.

[0023] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0024] As used herein, the term "including" and its variations are open-ended, i.e., "including but not limited to." The term "based on" means "based, at least in part, on." The term "one embodiment" means "at least one embodiment," the term "another embodiment" means "at least one additional embodiment," and the term "some embodiments" means "at least some embodiments." Other terms are defined in the following description.

[0025] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0026] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, they should be understood as "one or more".

[0027] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0028] In industries such as 3D film production and deep learning data generation, different requirements require the generation of images or videos with distortion effects.

[0029] There are two existing methods for simulating camera distortion: 1. Processing image pixels to change the image content in a distorted manner, resulting in a distorted image. 2. Modifying the shape of objects to be rendered in the scene in a distorted manner, and then rendering the resulting image.

[0030] Method 1, which only post-processes images captured by a standard camera, is faster and can also be used to simulate distortion in real scenes. However, wide-angle cameras distort incoming light, often capturing content that cannot be captured by standard cameras. This content cannot be restored through post-processing, so method 1 suffers from information loss and cannot perfectly simulate camera distortion.

[0031] Method 2 can "move" surfaces that are originally inaccessible to the camera by deforming them, effectively recreating what the wide-angle camera captured. However, because this method modifies the object's shape, it loses its original lighting information when rendering.

[0032] Figure 1This is a flowchart of an image generation method provided in the first embodiment of the present disclosure. This embodiment is applicable to the case of generating images with distortion effects. The method can be executed by an image generation device, which can be composed of hardware and / or software and can generally be integrated into a device with image generation function, which can be an electronic device such as a server, mobile terminal or server cluster. Figure 1 As shown, the method specifically includes the following steps:

[0033] S110 , obtaining initial 3D points and lighting information of the three-dimensional virtual scene.

[0034] The initial 3D points may be the grid points that constitute the objects in the three-dimensional virtual scene. The illumination information may be understood as illumination texture information, which may include the position information of the light source and the surface texture information of the objects in the three-dimensional virtual scene. Specifically, the position information and illumination information of the initial 3D points in the camera coordinate system may be obtained through a three-dimensional modeling engine. The position information of the initial 3D points in the camera coordinate system is represented by three-dimensional coordinates (X, Y, Z), and the position information of the light source may also be represented by three-dimensional coordinates (x, y, z).

[0035] S120: translating the initial 3D point along a set direction to obtain a target 3D point.

[0036] The set direction may be a direction perpendicular to the camera projection plane and away from the camera optical center, that is, the positive direction of the Z axis. Specifically, the offset of each initial 3D point needs to be determined first, and then each initial 3D point is offset by the offset along the positive direction of the Z axis.

[0037] In this embodiment, the initial 3D point is translated along the set direction to obtain the target 3D point by: obtaining position information of the initial 3D point in the camera coordinate system; determining a first offset based on the position information; and offsetting the initial 3D point along the set direction by the first offset.

[0038] Shifting the initial 3D point by the first offset along the set direction can be understood as: the X and Y coordinates of the initial 3D point remain unchanged, and the Z coordinate value is added to the first offset. Assuming the first offset is △Z, the coordinates of the target 3D point are (X, Y, Z + △Z). In this embodiment, the first offset is determined based on the position information of the initial 3D point, so that the offset corresponding to each initial 3D point is different, so that each initial 3D point is projected onto the two-dimensional plane without overlapping, thereby avoiding depth conflicts when rendering the two-dimensional image.

[0039] Specifically, the method of determining the first offset based on the position information can be: determining the distance between the initial 3D point and the camera optical center based on the position information; determining the offset coefficient based on the camera parameters; and determining the first offset based on the offset coefficient and the distance between the initial 3D point and the camera optical center.

[0040] The distance between the initial 3D point and the camera optical center can be expressed by the following formula based on the position information: The camera parameter ξ may be a camera mirror parameter, which can be obtained from the camera configuration information. Specifically, determining the first offset based on the offset coefficient and the distance between the initial 3D point and the camera optical center may be performed by multiplying the offset coefficient by the distance between the initial 3D point and the camera optical center to obtain the first offset, which can be expressed as the following formula: ΔZ = ξ|χ1|. In this embodiment, determining the first offset based on the position information of the initial 3D point and the camera parameters can increase the speed of determining the first offset.

[0041] S130 , generating a target distorted image based on the target 3D points and illumination information.

[0042] Specifically, a method of generating a target distorted image based on the target 3D points and the illumination information may be: rendering the target 3D points into a two-dimensional image based on the illumination information to obtain the target distorted image.

[0043] In this embodiment, a 3D engine can be configured to render a target 3D point into a 2D image based on illumination information. Specifically, the target 3D point and illumination information are input into the configured 3D engine, and a distorted target image is output. The configured 3D engine can be any existing 3D engine and is not limited here. In this embodiment, rendering the target 3D point into a 2D image based on illumination information can improve the display quality of the generated distorted target image.

[0044] Optionally, a method of generating a target distorted image based on the target 3D point and illumination information may be: translating the light source along a set direction to obtain translated illumination information; and generating a target distorted image based on the target 3D point and the translated illumination information.

[0045] The set direction can be a direction perpendicular to the camera projection plane and away from the camera optical center, that is, it can be the positive direction of the Z axis. Specifically, it is necessary to first determine the offset of the light source, and then offset the light source by the offset amount along the positive direction of the Z axis. In this embodiment, a target distorted image is generated based on the target 3D point and the translated lighting information, which can reduce shadow distortion to a certain extent, so that the rendered target distorted image is close to the lighting information in the original scene.

[0046] Specifically, the light source may be translated along the set direction by: acquiring position information of the light source in the camera coordinate system; determining a second offset based on the position information; and offsetting the light source along the set direction by the second offset.

[0047] Shifting the light source by the second offset along the set direction can be understood as: the x- and y-coordinates of the light source remain unchanged, and the z-coordinate value is added to the second offset. Assuming the first offset is △z, the coordinates of the light source after translation are (x, y, z + △z). In this embodiment, determining the second offset based on the position information of the light source can reduce shadow distortion to a certain extent, making the rendered target distorted image closer to the lighting information in the original scene.

[0048] Specifically, the second offset can be determined based on the position information by: determining the distance between the light source and the optical center of the camera according to the position information; determining the offset coefficient based on the camera parameters; and determining the second offset according to the offset coefficient and the distance between the light source and the optical center of the camera.

[0049] The distance between the light source and the optical center of the camera can be determined based on the position information using the following formula: The camera parameter ξ may be a camera mirror parameter, which can be obtained from the camera configuration information. Specifically, determining the second offset based on the offset coefficient and the distance of the light source from the camera optical center may be performed by multiplying the offset coefficient by the distance of the light source from the camera optical center to obtain the second offset, which can be expressed as the following formula: Δz = ξ|χ²|. In this embodiment, determining the second offset based on the light source position information and the camera parameters can increase the speed of determining the second offset.

[0050] In this embodiment, the generated distorted target image can be used in application scenarios such as 3D film production and deep learning training. Specifically, after obtaining the distorted target image, multiple distorted target images can be stitched together to produce a video with the effect of a wide-angle camera shot. Alternatively, the distorted target image can be used as sample data to train a neural network. For example, if a neural network with distortion correction is to be trained, the distorted target image and the original image can be used as a data pair to train the neural network.

[0051] The technical solution of the disclosed embodiments obtains initial 3D points and lighting information of a three-dimensional virtual scene; translates the initial 3D points along a set direction to obtain target 3D points; and generates a target distorted image based on the target 3D points and lighting information. The image generation method provided by the disclosed embodiments translates 3D points in a three-dimensional virtual scene along a set direction and generates a target distorted image based on the translated 3D points and lighting information. This method can quickly generate an image with a distorted effect and improve the realism of the image distortion effect.

[0052] Figure 2 is a structural diagram of an image generating device provided by an embodiment of the present disclosure, such as Figure 2 As shown, the device includes:

[0053] The initial 3D point acquisition module 210 is used to obtain the initial 3D points and lighting information of the three-dimensional virtual scene;

[0054] The target 3D point acquisition module 220 is used to translate the initial 3D point along a set direction to obtain the target 3D point;

[0055] The target distorted image generation module 230 is configured to generate a target distorted image based on the target 3D points and illumination information.

[0056] Optionally, the target 3D point acquisition module 220 is further configured to:

[0057] Get the position information of the initial 3D point in the camera coordinate system;

[0058] determining a first offset based on the position information;

[0059] Offset the initial 3D point by the first offset along the set direction.

[0060] Optionally, the target 3D point acquisition module 220 is further configured to:

[0061] Determine the distance between the initial 3D point and the camera optical center based on the position information;

[0062] determining a shift coefficient based on camera parameters;

[0063] A first offset is determined according to the offset coefficient and the distance between the initial 3D point and the optical center of the camera.

[0064] Optionally, the illumination information includes position information of the light source; the target distorted image generation module 230 is further configured to:

[0065] Translate the light source along the set direction to obtain the lighting information after translation;

[0066] Generate a target distorted image based on the target 3D points and the translated illumination information.

[0067] Optionally, the target distorted image generation module 230 is further configured to:

[0068] Get the position information of the light source in the camera coordinate system;

[0069] determining a second offset based on the position information;

[0070] Shift the light source by the second offset along the set direction.

[0071] Optionally, the target distorted image generation module 230 is further configured to:

[0072] Determine the distance between the light source and the optical center of the camera based on the position information;

[0073] determining a shift coefficient based on camera parameters;

[0074] The second offset is determined according to the offset coefficient and the distance between the light source and the optical center of the camera.

[0075] Optionally, the direction is set to a direction perpendicular to the camera projection plane and away from the camera optical center.

[0076] Optionally, the target distorted image generation module 230 is further configured to:

[0077] The target 3D points are rendered into a 2D image based on the illumination information to obtain a target distorted image.

[0078] The above device can execute the methods provided by all the above embodiments of the present disclosure, and has the corresponding functional modules and beneficial effects of executing the above methods. For technical details not fully described in this embodiment, please refer to the methods provided by all the above embodiments of the present disclosure.

[0079] Reference below Figure 3 , which shows a schematic structural diagram of an electronic device 300 suitable for implementing the embodiments of the present disclosure. The electronic devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (e.g., vehicle-mounted navigation terminals), etc., fixed terminals such as digital TVs, desktop computers, etc., or various forms of servers, such as independent servers or server clusters. Figure 3 The electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure.

[0080] like Figure 3 As shown, the electronic device 300 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 301, which can perform various appropriate actions and processes according to a program stored in a read-only memory device (ROM) 302 or a program loaded from a storage device 305 into a random access memory device (RAM) 303. Various programs and data required for the operation of the electronic device 300 are also stored in the RAM 303. The processing device 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.

[0081] Typically, the following devices may be connected to the I / O interface 305: an input device 306 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 307 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 308 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 309. The communication device 309 may allow the electronic device 300 to communicate with other devices wirelessly or by wire to exchange data. Figure 3 The electronic device 300 is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead.

[0082] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing a word recommendation method. In such an embodiment, the computer program can be downloaded and installed from a network via the communication device 309, or installed from the storage device 305, or installed from the ROM 302. When the computer program is executed by the processing device 301, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.

[0083] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, 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, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.

[0084] In some embodiments, the client and server can communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0085] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0086] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device is caused to: obtain initial 3D points and lighting information of a three-dimensional virtual scene; translate the initial 3D points along a set direction to obtain target 3D points; and generate a target distorted image based on the target 3D points and the lighting information.

[0087] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including, but not limited to, object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on the remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0088] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0089] The units involved in the embodiments described in this disclosure may be implemented in software or hardware, wherein the name of a unit does not necessarily limit the unit itself.

[0090] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.

[0091] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0092] According to one or more embodiments of the present disclosure, the present disclosure discloses an image generation method, including:

[0093] Obtain the initial 3D points and lighting information of the three-dimensional virtual scene;

[0094] Translate the initial 3D point along a set direction to obtain a target 3D point;

[0095] A target distorted image is generated based on the target 3D point and the illumination information.

[0096] Furthermore, translating the initial 3D point along a set direction to obtain a target 3D point includes:

[0097] Obtaining the position information of the initial 3D point in the camera coordinate system;

[0098] determining a first offset based on the position information;

[0099] The initial 3D point is offset along the set direction by the first offset amount.

[0100] Further, determining a first offset based on the position information includes:

[0101] Determine the distance between the initial 3D point and the camera optical center according to the position information;

[0102] determining a shift coefficient based on camera parameters;

[0103] A first offset is determined according to the offset coefficient and a distance between the initial 3D point and the optical center of the camera.

[0104] Furthermore, the illumination information includes position information of a light source; and generating a target distorted image based on the target 3D point and the illumination information includes:

[0105] translating the light source along the set direction to obtain illumination information after translation;

[0106] A target distorted image is generated based on the target 3D point and the translated illumination information.

[0107] Furthermore, translating the light source along the set direction includes:

[0108] Obtaining position information of the light source in the camera coordinate system;

[0109] determining a second offset based on the position information;

[0110] The light source is shifted along the set direction by the second offset.

[0111] Further, determining a second offset based on the position information includes:

[0112] Determine the distance between the light source and the optical center of the camera according to the position information;

[0113] determining a shift coefficient based on camera parameters;

[0114] A second offset is determined according to the offset coefficient and a distance between the light source and the optical center of the camera.

[0115] Furthermore, the set direction is a direction perpendicular to the camera projection plane and away from the camera optical center.

[0116] Furthermore, generating a target distorted image based on the target 3D point and the illumination information includes:

[0117] The target 3D point is rendered into a two-dimensional image based on the illumination information to obtain a target distorted image.

[0118] It should be understood that the various forms of processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions of this disclosure can be achieved, and this document is not limited here.

[0119] The above specific embodiments do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the scope of protection of this disclosure.

Claims

1. An image generation method, characterized in that: include: Acquiring initial 3D points and lighting information of the three-dimensional virtual scene, wherein the lighting information includes surface texture information of each object in the three-dimensional virtual scene; translating the initial 3D point along a set direction to obtain a target 3D point, wherein each initial 3D point has a different corresponding offset when translated along the set direction, and the set direction is a direction perpendicular to the camera projection plane and away from the camera optical center; A target distorted image is generated based on the target 3D point and the illumination information.

2. The method according to claim 1, characterized in that The initial 3D point is translated along a set direction to obtain a target 3D point, including: Obtaining the position information of the initial 3D point in the camera coordinate system; determining a first offset based on the position information; The initial 3D point is offset along the set direction by the first offset amount.

3. The method according to claim 2, characterized in that Determining a first offset based on the position information includes: Determine the distance between the initial 3D point and the camera optical center according to the position information; determining a shift coefficient based on camera parameters; A first offset is determined according to the offset coefficient and a distance between the initial 3D point and the optical center of the camera.

4. The method according to claim 1, wherein The lighting information includes position information of the light source; Generating a target distorted image based on the target 3D point and the illumination information, comprising: translating the light source along the set direction to obtain illumination information after translation; A target distorted image is generated based on the target 3D point and the translated illumination information.

5. The method according to claim 4, characterized in that The step of translating the light source along the set direction comprises: Obtaining position information of the light source in the camera coordinate system; determining a second offset based on the position information; The light source is shifted along the set direction by the second offset.

6. The method according to claim 5, characterized in that Determining a second offset based on the position information includes: Determine the distance between the light source and the optical center of the camera according to the position information; determining a shift coefficient based on camera parameters; A second offset is determined according to the offset coefficient and a distance between the light source and the optical center of the camera.

7. The method according to claim 1 or 4, characterized in that Generating a target distorted image based on the target 3D point and the illumination information, comprising: The target 3D point is rendered into a two-dimensional image based on the illumination information to obtain a target distorted image.

8. An image generating device, characterized in that: include: An initial 3D point acquisition module, configured to acquire initial 3D points and lighting information of a three-dimensional virtual scene, wherein the lighting information includes surface texture information of each object in the three-dimensional virtual scene; a target 3D point acquisition module, configured to translate the initial 3D point along a set direction to obtain a target 3D point, wherein each initial 3D point has a different corresponding offset when translated along the set direction, the set direction being a direction perpendicular to the camera projection plane and away from the camera optical center; The target distorted image generation module is used to generate a target distorted image based on the target 3D point and the illumination information.

9. An electronic device, characterized in that: The electronic device comprises: one or more processing devices; a storage device for storing one or more programs; When the one or more programs are executed by the one or more processing devices, the one or more processing devices implement the image generating method according to any one of claims 1 to 7.

10. A computer-readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processing device, the image generating method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Virtual distortion image generation method and device

    CN113989467A