A 3D image generation method, device and storage medium

By acquiring and adjusting images of multiple field of view angles on ordinary terminal devices, matching and re-rendering the template, the problem of high cost of existing 3D shooting equipment is solved, and the low cost of shooting 3D images or videos on ordinary devices is achieved. and low threshold.

CN114998228BActive Publication Date: 2024-12-20FUTURE TECH XIANG YANG CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210556765.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-20
Publication Date
2024-12-20
Estimated Expiration
2042-05-20

AI Technical Summary

Technical Problem

Existing 3D shooting equipment is expensive and requires high-standard cameras, resulting in high cost and threshold for shooting 3D images or videos.

Method used

A 3D image generation method is provided, using ordinary terminal devices such as mobile phones to obtain and adjust images of multiple field of view angles, perform template matching and re-rendering, and generate 3D images or videos, reducing dependence on high-spec devices.

Benefits of technology

It realizes shooting 3D images or videos on ordinary terminal devices, reducing the cost and threshold of 3D shooting, and does not require professional 3D shooting equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114998228B_ABST
    Figure CN114998228B_ABST
Patent Text Reader

Abstract

The present invention provides a method for generating 3D images, which can be used to shoot 3D images or 3D videos on ordinary terminal devices. The method includes: if the terminal device does not support direct output of depth maps, obtaining a first image corresponding to a first field of view angle and a second image corresponding to a second field of view angle; adjusting the first image and the second image according to a first target adjustment ratio to obtain a first target image and a second target image; matching the first target image with the second target image according to the first field of view angle and the second field of view angle to obtain a target area; matching the target area and other images to obtain a matching image; processing the matching image and the target area through a re-rendering algorithm to generate a 3D image corresponding to the first image and the second image. The present invention also provides a device and a storage medium using the 3D image generation method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of photography, and in particular to a method, device and storage medium for generating a 3D image. Background Art

[0002] With the development of shooting equipment, users can shoot 3D images or 3D videos through professional 3D shooting equipment. However, existing 3D shooting equipment shoots 3D images or 3D videos by setting up two or more cameras of the same specifications, and has high requirements for the cameras. It is necessary to set up two or more high-specification cameras at the same time, resulting in high costs for shooting 3D images. Summary of the invention

[0003] The present invention solves the problem of high cost of shooting 3D images in the prior art and provides a 3D image generation method, device and storage medium, which can be directly used in common terminal devices, such as mobile phones, to shoot 3D images or 3D videos.

[0004] A first aspect of the present invention provides a method for generating a 3D image, comprising the following steps:

[0005] If the terminal device does not support direct output of the depth map, obtaining a first image corresponding to the first field of view angle and a second image corresponding to the second field of view angle;

[0006] Adjusting the first image and the second image according to a first target adjustment ratio to obtain a first target image and a second target image;

[0007] Matching the first target image with the second target image according to the first field of view angle and the second field of view angle to obtain a target area, where the target area corresponds to the first target image or the second target image;

[0008] Matching the target area with other images to obtain a matching image, where the other images are images or areas corresponding to the target area in the first target image and the second target image;

[0009] The matching image and the target area are processed by a re-rendering algorithm to generate a 3D image corresponding to the first image and the second image.

[0010] A second aspect of the present invention provides a terminal device, including an acquisition unit, an adjustment unit, a template matching unit, a stereo matching unit and a rendering unit, wherein the acquisition unit is used to acquire a first image corresponding to a first field of view angle and a second image corresponding to a second field of view angle when the terminal device does not support direct output of a depth map, and is also used to acquire a third image and a fourth image when the terminal device supports direct output of a depth map, wherein the third image is a color image and the fourth image is a depth map; the adjustment unit is used to adjust the first image and the second image according to a first target adjustment ratio to obtain a first target image and a second target image, and is also used to adjust the third image and the fourth image according to a second target adjustment ratio to obtain a third target image and a fourth target image; the template The plate matching unit is used to match the first target image with the second target image according to the first field of view angle and the second field of view angle to obtain a target area, and the target area corresponds to the first target image or the second target image; the stereo matching unit is used to match the target area with other images to obtain a matching image, and the other image is an image or area in the first target image and the second target image corresponding to the target area; the rendering unit is used to render the matching image with the target area to generate a 3D image corresponding to the first image and the second image, and is also used to render the third target image with the fourth target image to generate a 3D image corresponding to the third image and the fourth image.

[0011] The third aspect of the present invention provides a computer device, which includes at least one connected processor, memory and transceiver, wherein the memory is used to store program code, and the processor is used to call the program code in the memory to execute the steps of the multi-camera based shooting method described in the first aspect above.

[0012] A fourth aspect of the present invention provides a computer storage medium comprising instructions, which, when executed on a computer, enables the computer to execute the steps of the multi-camera based shooting method described in any of the above aspects.

[0013] Compared with the prior art, the 3D image generation method of the present invention can be applied to ordinary terminal devices with two or more image sensors, such as mobile phones. The two image sensors on the terminal device can obtain the first image and the second image by shooting, and then execute the 3D image production method of the present invention to complete the shooting of 3D images or 3D videos. No professional 3D shooting equipment is required, which reduces the cost and threshold of 3D shooting. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1A schematic diagram of a flow chart of a method for generating a 3D image provided by an embodiment of the present invention;

[0015] Figure 2 A schematic diagram of a virtual structure of a terminal device provided by an embodiment of the present invention;

[0016] Figure 3 A schematic diagram of the hardware structure of another terminal device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0017] The technical solutions in the embodiments of the present invention are described clearly and completely below. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0018] See also Figure 1 , which is a flow chart of a method for generating a 3D image provided by an embodiment of the present invention, comprising:

[0019] 101. If the terminal device does not support direct output of the depth map, obtain a first image corresponding to the first field of view angle and a second image corresponding to the second field of view angle.

[0020] In this embodiment, the terminal device is a device with a shooting function, and the first image and the second image can be acquired by a first image sensor and a second image sensor respectively provided in the terminal device, and the first image sensor and the second image sensor respectively correspond to the first field of view angle and the second field of view angle. The first image sensor and the second image sensor are set to have the same shooting direction, and the first image is a color image, and the second image is a color image.

[0021] 102. Adjust the first image and the second image according to a first target adjustment ratio to obtain a first target image and a second target image.

[0022] In this embodiment, the first image and the second image are adjusted according to the first target adjustment ratio to obtain the first target image and the second target image, which specifically includes the following steps:

[0023] A01, determining the first target adjustment ratio according to a device parameter corresponding to the terminal device;

[0024] A02, determining a first adjustment coefficient corresponding to the first image and a second adjustment coefficient corresponding to the second image according to the first target adjustment ratio;

[0025] A03, adjusting the first image according to the first adjustment coefficient to obtain the first target image;

[0026] A04: Adjust the second image according to the second adjustment coefficient to obtain the second target image.

[0027] Wherein, the first target adjustment ratio can be directly obtained from the terminal device or obtained through calibration, the first target adjustment ratio is 1:k, the first adjustment coefficient is k1, and the second adjustment coefficient is k2, then k1:k2=1:k, and k, k1 and k2 are positive numbers. The first image is adjusted according to the k1 to obtain the first target image, and the second image is adjusted according to the k2 to obtain the second target image. For example, when k=1.5, k1=1 is selected, k2=1.5, the first image is adjusted according to the k1, because k1=1, the first image is not scaled to obtain the first target image; the second image is adjusted according to the k2, because k2=1.5, the second image is enlarged by 0.5 times to obtain the second target image. Similarly, when k=2, k1=0.5 is selected, k2=1, the first image is reduced by half to obtain the target image, and the second image is not scaled to obtain the second target image.

[0028] It can be understood that, based on the different device parameters corresponding to the terminal device, the first field of view angle is different from the second field of view angle, and the image resolution and size of the first image and the second image are different. After adjusting the first image and the second image according to the first target adjustment ratio k1:k2, the image resolution of the first target image and the second target image are the same, and the pixels of the same object in the first target image and the second target image are the same. For example, if the first target image includes a building and the second target image also includes the building, the pixels occupied by the building in the first target image are the same as the pixels occupied in the second target image.

[0029] Determining the first target adjustment ratio according to the device parameters corresponding to the terminal device may include the following steps:

[0030] B01. Determine a 3D photography calibration pattern, where the calibration pattern includes a plurality of calibration base points and a plurality of color blocks;

[0031] B02: The first image sensor and the second image sensor shoot the 3D shooting calibration pattern to obtain a first calibration image corresponding to the first image sensor and a second calibration image corresponding to the second image sensor;

[0032] B03. Calibrate the first calibration image and the second calibration image to confirm the first target adjustment ratio.

[0033] 103. Match the first target image with the second target image according to the first field of view angle and the second field of view angle to obtain a target area, where the target area corresponds to the first target image or the second target image.

[0034] In this embodiment, matching the first target image with the second target image according to the first field of view angle and the second field of view angle to obtain the target area specifically includes the following steps:

[0035] C01. If the first field of view angle is smaller than the second field of view angle, performing template matching on the second target image using the first target image as a template to obtain the target area in the second target image corresponding to the first target image, wherein the target area has the same size as the first target image;

[0036] C02. If the first field of view angle is greater than the second field of view angle, performing template matching on the first target image using the second target image as a template to obtain the target area in the first target image corresponding to the second target image, wherein the target area has the same size as the second target image;

[0037] C03. If the first field of view angle is equal to the second field of view angle, matching the first target image with the second target image to obtain the target area in the first target image and the target area in the second target image which correspond to each other.

[0038] It can be understood that the image captured by the image sensor with a larger field of view angle has a larger coverage range. Therefore, when the first field of view angle is smaller than the second field of view angle, the coverage range of the first image is smaller than the coverage range of the second image, and the size of the first target image is smaller than the size of the second target image, so step C01 is executed; when the first field of view angle is greater than the second field of view angle, the coverage range of the first image is larger than the coverage range of the second image, and the size of the first target image is larger than the size of the second target image, so step C02 is executed; when the first field of view angle is equal to the second field of view angle, the coverage range of the first image is basically the same as the coverage range of the second image, and the size of the first target image is basically the same as the size of the second target image. At the same time, because the first image sensor and the second image sensor are set at different positions, there are overlapping areas and non-overlapping areas between the coverage range of the first image and the coverage range of the second image, so step C03 is executed.

[0039] 104. Match the target area and other images to obtain a matching image, where the other images are images or areas corresponding to the target area in the first target image and the second target image.

[0040] In this embodiment, if the first field of view angle is smaller than the second field of view angle, the target area corresponds to the first target image, and the other image is the first target image; if the first field of view angle is greater than the second field of view angle, the target area corresponds to the second target image, and the other image is the second target image; if the first field of view angle is equal to the second field of view angle, the target area in the first target image and the target area in the second target image correspond to each other, and the other image is the target area in the first target image or the target area in the second target image.

[0041] The matching image is a depth map, and matching the target area and other images to obtain a matching image includes:

[0042] D01, determining a stereo matching algorithm for the target area and the other images;

[0043] D02. Perform stereo matching on the target area and other images using the stereo matching algorithm to obtain the matching image.

[0044] The stereo matching algorithm is not specifically limited and can be selected according to actual needs. For example, the stereo matching algorithm can be StereoBM, StereoSGBM, Graph Cut, Dynamic Programming, etc.

[0045] 105. Process the matching image and the target area by using a re-rendering algorithm to generate a 3D image corresponding to the first image and the second image.

[0046] In this embodiment, the processing of the matching image and the target area by a re-rendering algorithm to generate a 3D image corresponding to the first image and the second image includes the following steps:

[0047] E01. Acquire a target viewpoint, where the target viewpoint is any one of the at least one viewpoint;

[0048] E02, rendering the target area according to the target viewpoint and the matching image to obtain an interlaced image corresponding to the target viewpoint;

[0049] E03. Interweave the interleaved image and the target area to generate a 3D image corresponding to the first image and the second image.

[0050] It should be noted that the viewpoints are viewpoints with different angles in which the z-axis in the camera's xyz coordinate system remains unchanged, so that the sizes of the interlaced images obtained by rendering are the same.

[0051] The re-rendering of the target area according to the target viewpoint and the matching image to obtain the left image and the right image corresponding to the target viewpoint specifically includes:

[0052] E021. Determine the initial point cloud of the matching image;

[0053] E022. Adjusting the point coordinates in the initial point cloud according to the target viewpoint to obtain a target point cloud corresponding to the target viewpoint;

[0054] E023, processing the target point cloud into a target depth map corresponding to the target viewpoint;

[0055] E024. Render the target area according to the target depth map to obtain an interlaced image corresponding to the target viewpoint.

[0056] It should be noted that, multiple different target viewpoints correspond to multiple different interlaced images. During interlacing, two interlaced images can be used for interlacing according to actual needs, or the target area can be interlaced with one interlaced image to generate a 3D image corresponding to the first image and the second image.

[0057] 106. If the terminal device supports direct output of a depth map, a third image and a fourth image are obtained, where the third image is a color image and the fourth image is a depth map.

[0058] In this embodiment, the third image and the fourth image are acquired by photographing by the terminal device.

[0059] 107. Adjust the third image and the fourth image according to the second target adjustment ratio to obtain a third target image and a fourth target image.

[0060] In this embodiment, the step of adjusting the third image and the fourth image according to the second target adjustment ratio to obtain the third target image and the fourth target image specifically includes the following steps:

[0061] determining the second target adjustment ratio according to the attribute information of the third image and the attribute information of the fourth image;

[0062] determining a third adjustment coefficient corresponding to the third image and a fourth adjustment coefficient corresponding to the fourth image according to the second target adjustment ratio;

[0063] Adjusting the third image according to the third adjustment coefficient to obtain the third target image;

[0064] The fourth image is adjusted according to the fourth adjustment coefficient to obtain the fourth target image.

[0065] The attribute information includes size information. After the third image and the fourth image are adjusted by the second adjustment ratio, the size of the third target image and the size of the fourth target image are the same.

[0066] The second target adjustment ratio is 1:K, the third adjustment coefficient is K1, and the fourth adjustment coefficient is K2, then K1:K2=1:K, and K, K1 and K2 are positive numbers. The third image is adjusted according to K1 to obtain the third target image, and the fourth image is adjusted according to K2 to obtain the fourth target image. The fourth image is a depth map with a lower resolution, and it is preferred to adjust the fourth image to the same size as the third image. For example, when K=2, preferably K1=1, K2=2, because K1=1, the third image is not scaled to obtain the third target image, because K2=2, the fourth image is doubled to obtain the fourth target image.

[0067] 108. Process the third target image and the fourth target image by using a re-rendering algorithm to generate a 3D image corresponding to the third image and the fourth image.

[0068] This step is basically the same as the above step 105. The processing method of the third target image is the same as the processing method of the target area, and the processing method of the fourth target image is the same as the processing method of the matching image, which will not be repeated here.

[0069] It is understandable that the 3D video shooting can be completed by executing the 3D image generation method of the present invention on a single frame image in the video shot by the terminal device to form the 3D image, and then processing the 3D image into a video.

[0070] Compared with the prior art, the 3D image generation method of the present invention can be applied to ordinary terminal devices with two or more image sensors, such as mobile phones. The two image sensors on the terminal device can obtain the first image and the second image by shooting, and then execute the 3D image production method of the present invention to complete the shooting of 3D images or 3D videos. There is no need to purchase additional professional 3D shooting equipment, which reduces the cost of 3D shooting and the threshold of 3D shooting.

[0071] The above describes the embodiment of the present invention from the perspective of a method for generating a 3D image. The following describes the embodiment of the present invention from the perspective of a terminal device.

[0072] See also Figure 2 , Figure 2 A virtual structure diagram of a terminal device provided in an embodiment of the present invention, wherein the terminal device 200 includes:

[0073] An acquisition unit 201 is used to acquire a first image corresponding to a first field of view angle and a second image corresponding to a second field of view angle when the terminal device 200 does not support direct output of a depth map, and is also used to acquire a third image and a fourth image when the terminal device supports direct output of a depth map, wherein the third image is a color image and the fourth image is a depth map;

[0074] an adjusting unit 202, configured to adjust the first image and the second image according to a first target adjustment ratio to obtain a first target image and a second target image, and further configured to adjust the third image and the fourth image according to a second target adjustment ratio to obtain a third target image and a fourth target image;

[0075] a template matching unit 203, configured to match the first target image with the second target image according to the first field of view angle and the second field of view angle to obtain a target area, wherein the target area corresponds to the first target image or the second target image;

[0076] A stereo matching unit 204 is used to match the target area with other images to obtain a matching image, where the other images are images or areas corresponding to the target area in the first target image and the second target image;

[0077] The rendering unit 205 is used to render the matching image and the target area to generate a 3D image corresponding to the first image and the second image, and is also used to render the third target image and the fourth target image to generate a 3D image corresponding to the third image and the fourth image.

[0078] Optionally, the adjusting unit 202 is further configured to:

[0079] Determining the first target adjustment ratio according to a device parameter corresponding to the terminal device;

[0080] Determining a first adjustment coefficient corresponding to the first image and a second adjustment coefficient corresponding to the second image according to the first target adjustment ratio;

[0081] Adjusting the first image according to the first adjustment coefficient to obtain the first target image;

[0082] The second image is adjusted according to the second adjustment coefficient to obtain the second target image.

[0083] Optionally, the adjusting unit 202 is further configured to:

[0084] determining the second target adjustment ratio according to the attribute information of the third image and the attribute information of the fourth image;

[0085] determining a third adjustment coefficient corresponding to the third image and a fourth adjustment coefficient corresponding to the fourth image according to the second target adjustment ratio;

[0086] Adjusting the third image according to the third adjustment coefficient to obtain the third target image;

[0087] The fourth image is adjusted according to the fourth adjustment coefficient to obtain the fourth target image.

[0088] Optionally, the template matching unit 203 is further used for:

[0089] If the first field of view angle is smaller than the second field of view angle, performing template matching on the second target image using the first target image as a template to obtain the target area in the second target image corresponding to the first target image, wherein the target area has the same size as the first target image;

[0090] If the first field of view angle is greater than the second field of view angle, performing template matching on the first target image using the second target image as a template to obtain the target area in the first target image corresponding to the second target image, and the target area has the same size as the second target image;

[0091] If the first field of view angle is equal to the second field of view angle, the first target image is matched with the second target image to obtain the target area in the first target image and the target area in the second target image.

[0092] Optionally, the stereo matching unit 204 is further used for:

[0093] Determine a stereo matching algorithm for the target area and the other images, wherein the stereo matching algorithm is at least one of StereoBM, StereoSGBM, Graph Cut and Dynamic Programming;

[0094] The target area and other images are stereo matched by the stereo matching algorithm to obtain the matching image.

[0095] Optionally, the rendering unit 205 is further configured to:

[0096] Acquire a target viewpoint, where the target viewpoint is any one of the at least one viewpoint;

[0097] Rendering the target area according to the target viewpoint and the matching image to obtain an interlaced image corresponding to the target viewpoint;

[0098] The interlaced image is interlaced with the target area to generate a 3D image corresponding to the first image and the second image.

[0099] Next, another terminal device provided by an embodiment of the present invention is introduced. Figure 3 As shown, Figure 3 A schematic diagram of the hardware structure of a terminal device provided in an embodiment of the present invention, wherein the terminal device 300 includes:

[0100] Receiver 301, transmitter 302, processor 303 and memory 304 (wherein the number of processor 303 in terminal device 300 can be one or more, Figure 3 In some embodiments of the present invention, the receiver 301, the transmitter 302, the processor 303 and the memory 304 may be connected via a bus or other means, wherein: Figure 3 The example of connecting through bus is taken in the following.

[0101] The memory 304 may include a read-only memory and a random access memory, and provides instructions and data to the processor 303. A portion of the memory 304 may also include an NVRAM. The memory 304 stores an operating system and operating instructions, executable modules or data structures, or a subset thereof, or an extended set thereof, wherein the operating instructions may include various operating instructions for implementing various operations. The operating system may include various system programs for implementing various basic services and processing hardware-based tasks.

[0102] The processor 303 controls the operation of the terminal device, and the processor 303 can also be called a CPU. In a specific application, the various components of the terminal device are coupled together through a bus system, wherein the bus system includes not only a data bus, but also a power bus, a control bus, and a status signal bus, etc. However, for the sake of clarity, various buses are referred to as bus systems in the figure.

[0103] The 3D image generation method disclosed in the above embodiment of the present invention can be applied to the processor 303, or implemented by the processor 303. The processor 303 can be an integrated circuit chip with signal processing capabilities. Figure 1Each step of the method shown can be completed by an integrated logic circuit of hardware in the processor 303 or an instruction in the form of software. The above-mentioned processor 303 can be a general-purpose processor, DSP, ASIC, FPGA or other programmable logic device, discrete gate or transistor logic device, discrete hardware component. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present invention can be directly embodied as a hardware decoding processor to be executed, or the hardware and software modules in the decoding processor can be combined to be executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 304, and the processor 303 reads the information in the memory 304 and completes the steps of the above method in combination with its hardware.

[0104] An embodiment of the present invention also provides a computer-readable medium, comprising computer execution instructions, which can enable a server to execute the multi-camera based shooting method described in the above embodiment. The implementation principle and technical effect are similar and will not be repeated here.

[0105] It should also be noted that the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment. In addition, in the drawings of the device embodiments provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.

[0106] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.

[0107] The above descriptions are only some embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for generating a 3D image, characterized in that: The steps include: If the terminal device does not support direct output of the depth map, obtaining a first image corresponding to the first field of view angle and a second image corresponding to the second field of view angle; Adjusting the first image and the second image according to a first target adjustment ratio to obtain a first target image and a second target image; Matching the first target image with the second target image according to the first field of view angle and the second field of view angle to obtain a target area, where the target area corresponds to the first target image or the second target image; Matching the target area with other images to obtain a matching image, where the other images are images or areas corresponding to the target area in the first target image and the second target image; The matching image and the target area are processed by a re-rendering algorithm to generate a 3D image corresponding to the first image and the second image.

2. The method for generating a 3D image according to claim 1, characterized in that: The first image is a color image, the second image is a color image, and the first image and the second image are adjusted according to the first target adjustment ratio to obtain the first target image and the second target image, including the following steps: Determining the first target adjustment ratio according to a device parameter corresponding to the terminal device; Determining a first adjustment coefficient corresponding to the first image and a second adjustment coefficient corresponding to the second image according to the first target adjustment ratio; Adjusting the first image according to the first adjustment coefficient to obtain the first target image; The second image is adjusted according to the second adjustment coefficient to obtain the second target image.

3. The method for generating a 3D image according to claim 1, characterized in that: The matching the first target image with the second target image according to the first field of view angle and the second field of view angle to obtain a target area comprises the following steps: If the first field of view angle is smaller than the second field of view angle, performing template matching on the second target image using the first target image as a template to obtain the target area in the second target image corresponding to the first target image, wherein the target area has the same size as the first target image; If the first field of view angle is greater than the second field of view angle, performing template matching on the first target image using the second target image as a template to obtain the target area in the first target image corresponding to the second target image, and the target area has the same size as the second target image; If the first field of view angle is equal to the second field of view angle, the first target image is matched with the second target image to obtain the target area in the first target image and the target area in the second target image.

4. The method for generating a 3D image according to claim 1, characterized in that: The matching image is a depth map, and matching the target area and other images to obtain a matching image includes: Determine a stereo matching algorithm for the target area and the other images; The target area and other images are stereo matched by the stereo matching algorithm to obtain the matching image.

5. The method for generating a 3D image according to claim 1, characterized in that: The processing of the matching image and the target area by a re-rendering algorithm to generate a 3D image corresponding to the first image and the second image comprises the following steps: Acquire a target viewpoint, where the target viewpoint is any one of the at least one viewpoint; Rendering the target area according to the target viewpoint and the matching image to obtain an interlaced image corresponding to the target viewpoint; The interlaced image is interlaced with the target area to generate a 3D image corresponding to the first image and the second image.

6. The method for generating a 3D image according to claim 1, characterized in that: The method further comprises the steps of: If the terminal device supports direct output of the depth map, a third image and a fourth image are obtained, wherein the third image is a color image and the fourth image is a depth map; Adjusting the third image and the fourth image according to the second target adjustment ratio to obtain a third target image and a fourth target image; The third target image and the fourth target image are processed by a re-rendering algorithm to generate a 3D image corresponding to the third image and the fourth image.

7. The method for generating a 3D image according to claim 6, characterized in that: The step of adjusting the third image and the fourth image according to the second target adjustment ratio to obtain the third target image and the fourth target image comprises the following steps: determining the second target adjustment ratio according to the attribute information of the third image and the attribute information of the fourth image; determining a third adjustment coefficient corresponding to the third image and a fourth adjustment coefficient corresponding to the fourth image according to the second target adjustment ratio; Adjusting the third image according to the third adjustment coefficient to obtain the third target image; The fourth image is adjusted according to the fourth adjustment coefficient to obtain the fourth target image.

8. A terminal device, characterized in that: include: an acquisition unit, configured to acquire a first image corresponding to a first field of view angle and a second image corresponding to a second field of view angle when the terminal device does not support direct output of a depth map, and further configured to acquire a third image and a fourth image when the terminal device supports direct output of a depth map, wherein the third image is a color image and the fourth image is a depth map; an adjusting unit, configured to adjust the first image and the second image according to a first target adjustment ratio to obtain a first target image and a second target image, and further configured to adjust the third image and the fourth image according to a second target adjustment ratio to obtain a third target image and a fourth target image; a template matching unit, configured to match the first target image with the second target image according to the first field of view angle and the second field of view angle to obtain a target area, wherein the target area corresponds to the first target image or the second target image; A stereo matching unit, configured to match the target area with other images to obtain a matching image, wherein the other images are images or areas corresponding to the target area in the first target image and the second target image; A rendering unit is used to render the matching image and the target area to generate a 3D image corresponding to the first image and the second image, and is also used to render the third target image and the fourth target image to generate a 3D image corresponding to the third image and the fourth image.

9. A computer device, characterized in that: include: At least one connected processor, memory and transceiver, wherein the memory is used to store program code, and the processor is used to call the program code in the memory to execute the method for generating a stereoscopic image according to any one of claims 1 to 7.

10. A computer storage medium, characterized in that: include: The instructions, when executed on a computer, cause the computer to execute the method for generating a stereoscopic image according to any one of claims 1 to 7.