Image rendering method, device, electronic device and computer-readable storage medium

By obtaining the rail push parameters and relative depth information of the virtual camera and adjusting the image pixel depth, the problem of low generation efficiency of Hitchcock effect in the prior art is solved, and a more efficient image rendering effect is achieved.

CN117596497BActive Publication Date: 2024-11-22SHUXING TECH (BEIJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311282989.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-28
Publication Date
2024-11-22
Estimated Expiration
2043-09-28

AI Technical Summary

Technical Problem

In the prior art, the Hitchcock effect is achieved by adjusting the camera focal length by artificially pulling the camera, which is relatively low in efficiency, requires a certain amount of experience and multiple shots to achieve the expected effect.

Method used

By obtaining the rail push parameters when the virtual camera simulates the Hitchcock effect, the camera's shooting position at different target moments is determined, and pixel depth information is adjusted based on the relative depth, and image rendering is performed to generate an image with the Hitchcock effect.

Benefits of technology

It improves the efficiency of the image presenting Hitchcock effect, reduces the dependence of artificial operations, and achieves faster and more accurate effect generation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117596497B_ABST
    Figure CN117596497B_ABST
Patent Text Reader

Abstract

The present application discloses an image rendering method, device, electronic device and computer-readable storage medium. The embodiment of the present application obtains a target image to be generated with a Hitchcock effect; obtains the push track parameters of a virtual camera that shoots the target image when simulating the Hitchcock effect, and the push track parameters are used to indicate the shooting position of the virtual camera at at least one target moment; based on the push track parameters, the shooting screen when the virtual camera shoots the target image at the target moment is determined respectively; based on the relative depth between each pixel in the shooting screen corresponding to the target moment, the depth adjustment information of each pixel in the shooting screen is determined; based on the depth adjustment information corresponding to at least one shooting screen, the target image is rendered to obtain an image result with a Hitchcock effect. The embodiment of the present application can improve the efficiency of making an image present a Hitchcock effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image rendering technology, and in particular to an image rendering method, device, electronic device and computer-readable storage medium. Background Art

[0002] Under the wave of the Internet, with the continuous development of virtual reality technology, rendering virtual images through rendering engines for use in animation, movies, games and other scenes is becoming more and more common in people's lives, and people's requirements for the display of virtual images are also getting higher and higher.

[0003] At present, in order to better meet the image requirements in different scenes, it is sometimes necessary to control the image to generate the Hitchcock effect. For example, in real scenes, in order to develop different plots in the movie, the camera's zooming is required to make the image taken by the camera generate the Hitchcock effect to assist the movie plot, such as increasing the tense atmosphere. In the prior art, the focal length of the camera is generally adjusted by artificial zooming to achieve the Hitchcock effect. However, since it requires certain experience and multiple shots to achieve the expected Hitchcock effect, the efficiency of making the image present the Hitchcock effect is low. Summary of the invention

[0004] The embodiments of the present application provide an image rendering method, device, electronic device, and computer-readable storage medium, which can improve the efficiency of making images present the Hitchcock effect.

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

[0006] Acquire a target image to be generated with a Hitchcock effect;

[0007] Obtaining a tracking parameter of a virtual camera that shoots the target image when simulating a Hitchcock effect, wherein the tracking parameter is used to indicate a shooting position of the virtual camera at at least one target moment;

[0008] Based on the track pushing parameters, respectively determine the shooting pictures of the virtual camera when shooting the target image at the target time;

[0009] Determining depth adjustment information of each pixel in the captured image based on the relative depth between each pixel in the captured image corresponding to the target moment;

[0010] Based on the depth adjustment information corresponding to at least one of the shooting pictures, the target image is rendered to obtain an image result with a Hitchcock effect.

[0011] In a second aspect, an embodiment of the present application further provides an image rendering device, the device comprising:

[0012] An image acquisition module, used for acquiring a target image to be generated with a Hitchcock effect;

[0013] A parameter acquisition module, used to acquire the push track parameters of the virtual camera shooting the target image when simulating the Hitchcock effect, wherein the push track parameters are used to indicate the shooting position of the virtual camera at at least one target moment;

[0014] A picture determination module, used to determine the shooting pictures of the virtual camera when shooting the target image at the target time based on the track pushing parameters;

[0015] An information determination module, configured to determine depth adjustment information of each pixel in the photographed picture based on a relative depth between each pixel in the photographed picture corresponding to the target moment;

[0016] The rendering module is used to render the target image based on the depth adjustment information corresponding to at least one of the shooting pictures to obtain an image result with a Hitchcock effect.

[0017] In a third aspect, an embodiment of the present application further provides an electronic device, comprising a memory storing a plurality of instructions; the processor loads instructions from the memory to execute the steps in any one of the image rendering methods provided in the embodiments of the present application.

[0018] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a plurality of instructions, wherein the instructions are suitable for a processor to load to execute the steps in any one of the image rendering methods provided in the embodiments of the present application.

[0019] In the embodiment of the present application, a target image for generating a Hitchcock effect is obtained; tracking parameters of a virtual camera that shoots the target image when simulating the Hitchcock effect are obtained, and the tracking parameters are used to indicate the shooting position of the virtual camera at at least one target moment; based on the tracking parameters, shooting pictures when the virtual camera shoots the target image at the target moment are determined respectively; based on the relative depth between each pixel in the shooting picture corresponding to the target moment, depth adjustment information of each pixel in the shooting picture is determined; based on the depth adjustment information corresponding to at least one of the shooting pictures, the target image is rendered to automatically generate and obtain an image result with a Hitchcock effect, which can improve the efficiency of making the image present a Hitchcock effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0021] Figure 1 This is a schematic diagram of an embodiment of the image rendering method provided in the embodiment of the present application;

[0022] Figure 2 is a schematic diagram of an idle area provided in an embodiment of the present application;

[0023] Figure 3 is a structural schematic diagram of an image rendering device provided in an embodiment of the present application;

[0024] Figure 4 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0025] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.

[0026] Before explaining the embodiments of the present application in detail, some terms involved in the embodiments of the present application are first explained.

[0027] Among them, in the description of the embodiments of the present application, the terms "first", "second", etc. may be used in this article to describe various concepts, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another concept. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0028] The embodiment of the present application provides an image rendering method, device, electronic device and computer-readable storage medium. Specifically, the image rendering method of the embodiment of the present application can be performed by an electronic device, wherein the electronic device can be a terminal or a server. The terminal can be a terminal device such as a smart phone, a tablet computer, a laptop computer, a touch screen, a game console, a personal computer (PC, Personal Computer), a personal digital assistant (Personal Digital Assistant, PDA), etc. The terminal can also include a client, which can be a game application client, a browser client carrying a game program, or an instant messaging client, etc. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and basic cloud computing services such as big data and artificial intelligence platforms.

[0029] For example, the electronic device is explained by taking a terminal as an example, and the terminal can obtain a target image to be generated with a Hitchcock effect; obtain a push-track parameter of a virtual camera that shoots the target image when simulating the Hitchcock effect, and the push-track parameter is used to indicate the shooting position of the virtual camera at at least one target moment; based on the push-track parameter, determine the shooting picture when the virtual camera shoots the target image at the target moment; based on the relative depth between each pixel in the shooting picture corresponding to the target moment, determine the depth adjustment information of each pixel in the shooting picture; based on the depth adjustment information corresponding to at least one of the shooting pictures, render the target image to obtain an image result with a Hitchcock effect.

[0030] Based on the above problems, the embodiments of the present application provide an image rendering method, device, electronic device and computer-readable storage medium, which can improve the efficiency of making images present the Hitchcock effect.

[0031] The following is a detailed description of the embodiments in conjunction with the accompanying drawings. It should be noted that the description order of the following embodiments is not intended to limit the preferred order of the embodiments. Although the logical order is shown in the flow chart, in some cases, the steps shown or described may be performed in an order different from that shown in the accompanying drawings.

[0032] In this embodiment, a terminal is taken as an example for description. This embodiment provides an image rendering method, such as Figure 1 As shown, the specific process of the image rendering method can be as follows:

[0033] 101. Obtain a target image for generating a Hitchcock effect.

[0034] The main image of the Hitchcock effect is that the foreground area (the subject in the image) remains unchanged in size, while the background area undergoes a dramatic change in perspective, thus creating a visual effect of the background moving away from or approaching the subject. This is intended to express the suspense of the plot, the tense atmosphere, or the strong emotional changes in the characters.

[0035] The target image is an image for which the Hitchcock effect is to be generated. The target image may be an image in a picture or a specific image presented in a video. When people want to perform special effects processing related to the Hitchcock effect on a picture, an image result with the Hitchcock effect corresponding to the picture is generated. The image result may be a video containing at least two frames of pictures or a picture, which may be set according to the needs.

[0036] 102. Obtaining tracking parameters of a virtual camera that shoots the target image when simulating a Hitchcock effect, wherein the tracking parameters are used to indicate a shooting position of the virtual camera at at least one target moment.

[0037] It can be understood that since the above-mentioned Hitchcock effect is equivalent to the sliding zoom of the camera, in this embodiment, the terminal generates the Hitchcock effect of the target image based on the sliding zoom principle of the camera, that is, in order to make the target image taken by the virtual camera present a sliding zoom effect, the terminal needs to control the virtual camera to simulate the sliding zoom of the real camera when shooting.

[0038] Therefore, the terminal can obtain the push-track parameters of the virtual camera when simulating the Hitchcock effect. The push-track parameters include the shooting position of the virtual camera at least one target moment to achieve the purpose of sliding zoom, so that the terminal can determine the relevant information associated with the sliding zoom based on the shooting position of the virtual camera at different target moments.

[0039] Among them, the above-mentioned target moment is the shooting moment after the virtual camera moves on the dolly. When there is only one target moment, the image result with the Hitchcock effect is a picture. When there are two or more target moments, the image result with the Hitchcock effect is a video, and the number of video frames contained in the video is consistent with the number of the above-mentioned target moments.

[0040] In some embodiments, when obtaining the shooting positions of the virtual camera at multiple target moments, a set of continuously changing position information can be obtained by interpolation. For example, a set of continuously changing position information can form a position change curve, such as a sin curve, a linear curve, etc., so that the virtual camera can be controlled to slide based on the position change curve.

[0041] 103. Based on the above-mentioned tracking parameters, determine the shooting picture of the above-mentioned virtual camera when shooting the target image at the above-mentioned target time.

[0042] In this embodiment, since the above-mentioned push track parameters are used to indicate the shooting position of the above-mentioned virtual camera at at least one target moment, and the picture taken by the camera at this position can be clearly determined based on the camera shooting position, the terminal can clearly determine the shooting picture taken by the virtual camera at each target moment based on the push track parameters.

[0043] In some embodiments, since the images captured by the virtual camera at different positions are different, it may happen that the images captured by the virtual camera at a certain position include areas outside the target image. Therefore, after respectively determining the captured images of the virtual camera when capturing the target image at the target moment, it is necessary to judge the captured images and whether there are idle areas other than the target image in the captured images. If not, the terminal can directly make subsequent judgments based on the target image. If so, the terminal needs to reconstruct the target image by meshing (remembered as Mesh) so as to determine the complete captured images based on the reconstructed mesh information, which is equivalent to completing the idle areas in the captured images. Among them, the mesh reconstruction method described in this embodiment can be executed in the terminal or in the server, and is set according to the needs.

[0044] For example, Figure 2 As shown, Figure 2 The black areas on the left and top of the image are the idle areas in the captured image, and the terminal needs to fill in the idle areas.

[0045] Specifically, if there is an idle area in the captured image, the idle area is edge-repaired by using a preset edge repair model to obtain the idle area after edge repair; and the idle area after edge repair is image-repaired by using a preset image repair model to obtain a repaired captured image.

[0046] The image restoration model may include a depth restoration model and an image color restoration model, so that the depth restoration model is used to perform depth restoration on the idle area after edge restoration, and the image color restoration model is used to perform image color restoration on the idle area after edge restoration. Furthermore, the edge restoration model and the image restoration model may be trained to learn and improve restoration capabilities.

[0047] In addition, based on the depth information and image color (denoted as RGB) information of each pixel of the repaired captured image, the mesh information of the reconstructed mesh corresponding to the captured image can be constructed. For example, the coordinates of each vertex that constitutes the mesh are (x*depth, y*depth, depth), where the above depth is the depth, and the image color information corresponding to each vertex is (r, g, b). A triangular facet corresponding to the captured image can be formed based on multiple vertices, and rendering can be performed based on the facet to reduce the number of sampling times.

[0048] It can be understood that the terminal can extract the depth information of each pixel of the target image through a preset depth estimation model. The depth information can be used as the Z-axis coordinate corresponding to each pixel in the target image. Since the depth information at different positions is different, there is a sense of hierarchy between different positions of the target image. Therefore, when practicing grid reconstruction, the two-dimensional coordinates of the target image on the picture are converted into three-dimensional coordinates in the camera coordinate system, such as (x*depth, y*depth, depth) mentioned above.

[0049] 104. Determine depth adjustment information of each pixel in the captured image based on a relative depth between each pixel in the captured image corresponding to the target moment.

[0050] In this embodiment, since different positions in the captured image have different corresponding depths, especially the depth difference between the foreground area and the background area is greater, in order to achieve the Hitchcock zoom effect, the terminal needs to adjust the image depth in the captured image based on the relative depth between each pixel in the captured image, that is, determine the depth adjustment information of each pixel in the captured image. The above-mentioned depth adjustment information can be information about increasing or decreasing the current depth of the pixel, or information after the pixel is adjusted.

[0051] In some embodiments, the target image includes a foreground area and a background area, and determining the depth adjustment information of each pixel in the captured picture based on the relative depth between each pixel in the captured picture corresponding to the target moment may include: determining the depth discrete value corresponding to the target image based on the depth information of each pixel in the captured picture, so as to express the relative depth between each pixel in the captured picture through the depth discrete value; and then, determining the depth adjustment information of each pixel in the captured picture based on the depth discrete value corresponding to the target image.

[0052] The above-mentioned depth discrete value may be the range, variance, standard deviation, dispersion coefficient, etc. of each pixel in the captured image, which may be set specifically according to requirements.

[0053] It can be understood that the range size between the foreground area and the background area can be obtained through the above-mentioned depth discrete value. If the depth discrete value is smaller, it means that the foreground area and the background area are closer, then the depth information of the pixels can be adjusted to a greater extent to further the foreground area and the background area; if the depth discrete value is larger, it means that the foreground area and the background area are farther away, then the depth information of the pixels can be adjusted to a smaller extent to further the foreground area and the background area.

[0054] Exemplarily, the above-mentioned depth discrete value can be obtained by calculating the standard deviation. Determining the depth discrete value corresponding to the target image based on the depth information of each pixel in the captured image may include: calculating the depth standard deviation corresponding to the captured image based on the depth information of each pixel in the captured image, and then determining the depth standard deviation as the depth discrete value corresponding to the target image.

[0055] In some embodiments, in order to determine the corresponding depth adjustment information, determining the depth adjustment information of each pixel in the captured image based on the depth discrete value corresponding to the target image may include: obtaining a preset depth adjustment indication parameter, and based on the depth discrete value corresponding to the target image and the depth adjustment indication parameter, processing with a preset depth conversion formula to determine the depth adjustment information of each pixel in the captured image.

[0056] Among them, the above-mentioned depth adjustment indication parameter can be set to a preset value, or the depth adjustment indication parameter corresponding to the pixel can be mapped according to the depth information of different pixels, for example, the depth information of the pixel is directly used as the depth adjustment indication parameter of the pixel, or a mapping curve between the pixel depth information and the depth adjustment indication parameter is set to determine the depth adjustment indication information corresponding to each pixel based on the mapping curve.

[0057] Specifically, the depth information of each pixel can be normalized to the range of 0 to 1, so that the depth discrete value corresponding to the target image is a value in the range of 0 to 1, and then the depth adjustment indication parameter S can be set to a number greater than 1, so the above-mentioned depth conversion formula New_Depth_scale=s / sigma can be obtained, wherein the above-mentioned New_Depth_scale is the depth adjustment information, and the above-mentioned sigma is the depth discrete value. From the conversion formula, it can be concluded that the smaller the sigma, the larger the new_depth scale, and the larger the Sigma, the smaller the new_depth scale, which can explain that the depth adjustment amplitude when the distance between the foreground area and the background area is relatively close is smaller than the depth adjustment amplitude when the distance between the foreground area and the background area is relatively far, that is, the depth adjustment information when the distance between the foreground area and the background area is relatively close is less than the depth adjustment information when the distance between the foreground area and the background area is relatively far.

[0058] In some embodiments, since the depth adjustment information will adjust both the foreground area and the background area in the captured image, in order to avoid the foreground area becoming much smaller due to the adjustment of the depth adjustment information, in this embodiment, the virtual camera's push-track parameters can be associated with the depth adjustment information of the foreground area to determine the virtual next push-track parameters based on the depth adjustment information of each pixel in the currently determined foreground area, that is, the position of the camera to capture the target image at the next moment.

[0059] Specifically, the at least one target moment includes a moment to be processed and an associated moment of the moment to be processed, and there is at least one shooting interval between the moment to be processed and the associated moment. The obtaining of the push-track parameters of the virtual camera that shoots the target image when simulating the Hitchcock effect may include: determining the regional depth information of the foreground area corresponding to the associated moment based on the depth adjustment information of each pixel in the foreground area of ​​the target image at the associated moment; and obtaining the shooting position of the virtual camera when shooting the target image at the moment to be processed based on the regional depth information and a preset push-track indication coefficient.

[0060] Among them, based on the depth adjustment information of each pixel in the foreground area, the depth adjustment information of each pixel can be averaged and the average value can be used as the regional depth information. Alternatively, based on the depth adjustment information of each pixel in the foreground area, the adjusted target depth information of each pixel in the foreground area can be determined, and then the target depth information of each pixel can be averaged and the average value can be used as the regional depth information.

[0061] In addition, the regional depth information of the foreground area can also be obtained by identifying the subject recognition model.

[0062] Specifically, the above-mentioned obtaining the shooting position of the virtual camera when shooting the target image at the time to be processed based on the area depth information and the preset push-track indication coefficient may include: calculating the product between the area depth information and the preset push-track indication coefficient, and using the product as the forward movement distance of the virtual camera; then, based on the position of the virtual camera at the associated moment and the obtained forward movement distance, obtaining the shooting position of the virtual camera when shooting the target image at the previous target moment.

[0063] 105. Render the target image based on the depth adjustment information corresponding to at least one of the captured images to obtain an image result with a Hitchcock effect.

[0064] In this embodiment, after obtaining the depth adjustment information corresponding to at least one of the captured images, the terminal can perform depth adjustment and rendering on the target image based on the depth adjustment information to obtain an image result with a Hitchcock effect. The image result can be a video or a picture, thereby realizing a picture or a video with the target image, thereby generating an image result with a Hitchcock effect, thereby improving the efficiency and portability of generating the Hitchcock effect.

[0065] In some embodiments, in order to improve the Hitchcock effect of the target image, after obtaining the depth adjustment information corresponding to each target moment, a set of continuously changing depth adjustment information can be obtained by interpolation. For example, a set of continuously changing depth adjustment information can form a depth change curve, wherein each pixel can correspond to a depth change curve, or the target image can directly correspond to a depth change curve, thereby obtaining the change of the image in the image result with the Hitchcock effect based on the depth change curve.

[0066] Specifically, the terminal can render the target image through a preset rendering module based on the reconstructed mesh information (the coordinates and image color information of each vertex), the position change curve corresponding to the virtual camera, and the depth change curve, that is, render the image changes of each frame with the Hitchcock effect, thereby obtaining the final image result with the Hitchcock effect. Among them, if the depth adjustment information in the depth change curve is the adjustment information, then the depth information in the coordinates of each vertex needs to be multiplied by the depth adjustment information to obtain the multiplied result to adjust the corresponding vertex.

[0067] In some embodiments, since the above-mentioned depth adjustment information may be the adjustment value that needs to be adjusted for each pixel in the captured picture, rendering the target image based on the depth adjustment information corresponding to at least one of the captured pictures to obtain an image result with a Hitchcock effect may include: determining the adjusted target depth information of each pixel in each of the captured pictures based on the depth adjustment information corresponding to each of the captured pictures and the depth information of each pixel in each of the captured pictures; rendering the target image based on the target depth information of each pixel in at least one of the captured pictures to obtain an image result with a Hitchcock effect.

[0068] From the above content, it can be seen that the target image to be generated with the Hitchcock effect is obtained; the push-track parameters of the virtual camera that shoots the target image when simulating the Hitchcock effect are obtained, and the above push-track parameters are used to indicate the shooting position of the above virtual camera at at least one target moment; based on the above push-track parameters, the shooting pictures when the above virtual camera shoots the target image at the above target moment are determined respectively; based on the relative depth between each pixel in the above shooting picture corresponding to the above target moment, the depth adjustment information of each pixel in the above shooting picture is determined; based on the depth adjustment information corresponding to at least one of the above shooting pictures, the above target image is rendered to automatically generate and obtain an image result with the Hitchcock effect, which can improve the efficiency of making the image present the Hitchcock effect.

[0069] In order to better implement the above method, an embodiment of the present application further provides an image rendering device, which can be specifically integrated into an electronic device, such as a computer device, which can be a terminal, a server, or other device.

[0070] Among them, the terminal can be a mobile phone, a tablet computer, a smart Bluetooth device, a laptop computer, a personal computer and other devices; the server can be a single server or a server cluster composed of multiple servers.

[0071] For example, in this embodiment, the method of the embodiment of the present application is described in detail by taking the image rendering device specifically integrated in the terminal as an example. This embodiment provides an image rendering device, such as Figure 3 As shown, the image rendering device may include:

[0072] An image acquisition module 301 is used to acquire a target image for generating a Hitchcock effect;

[0073] A parameter acquisition module 302 is used to acquire the tracking parameters of the virtual camera shooting the target image when simulating the Hitchcock effect, wherein the tracking parameters are used to indicate the shooting position of the virtual camera at at least one target moment;

[0074] The picture determination module 303 is used to determine the shooting pictures when the virtual camera shoots the target image at the target time based on the track pushing parameters;

[0075] An information determination module 304, configured to determine depth adjustment information of each pixel in the photographed picture based on the relative depth between each pixel in the photographed picture corresponding to the target moment;

[0076] The rendering module 305 is used to render the target image based on the depth adjustment information corresponding to at least one of the captured images to obtain an image result with a Hitchcock effect.

[0077] In some embodiments, the image rendering device further includes an image restoration module, and the image restoration module is specifically used to:

[0078] If there is an idle area in the above-mentioned shooting picture, the edge of the idle area is repaired by using a preset edge repair model to obtain the idle area after edge repair;

[0079] The image is repaired in the idle area after the edge repair using a preset image repair model to obtain a repaired shooting picture.

[0080] In some embodiments, the target image includes a foreground area and a background area, and the information determination module 304 is specifically used to:

[0081] Determine the depth discrete value corresponding to the target image based on the depth information of each pixel in the captured image;

[0082] Based on the depth discrete value corresponding to the target image, the depth adjustment information of each pixel in the captured image is determined.

[0083] In some embodiments, the information determination module 304 is specifically used to:

[0084] Calculating the depth standard deviation of each pixel in the above-mentioned shooting picture based on the depth information of each pixel in the above-mentioned shooting picture;

[0085] The depth standard deviation is determined as the depth discrete value corresponding to the target image.

[0086] In some embodiments, the information determination module 304 is specifically used to:

[0087] A preset depth adjustment indication parameter is obtained, and based on the depth discrete value corresponding to the target image and the depth adjustment indication parameter, the depth adjustment information of each pixel in the captured image is determined.

[0088] In some embodiments, the at least one target moment includes a to-be-processed moment and an associated moment of the to-be-processed moment, and there is at least one shooting interval between the to-be-processed moment and the associated moment. The parameter acquisition module 302 is specifically used to:

[0089] Determining the regional depth information of the foreground area corresponding to the above-mentioned association moment based on the depth adjustment information of each pixel of the above-mentioned target image in the above-mentioned foreground area at the above-mentioned association moment;

[0090] Based on the above-mentioned regional depth information and the preset track-pushing indication coefficient, the shooting position of the above-mentioned virtual camera when shooting the above-mentioned target image at the time to be processed is obtained.

[0091] In some embodiments, the rendering module 305 is specifically used for:

[0092] Determine the adjusted target depth information of each pixel in each of the above-mentioned shooting pictures based on the depth adjustment information corresponding to each of the above-mentioned shooting pictures and the depth information of each pixel in each of the above-mentioned shooting pictures;

[0093] Based on the target depth information of each pixel in at least one of the above-mentioned shooting pictures, the above-mentioned target image is rendered to obtain an image result with a Hitchcock effect.

[0094] As can be seen from the above, the target image to be generated for the Hitchcock effect is acquired through the image acquisition module 301; the push-track parameters of the virtual camera that shoots the above target image when simulating the Hitchcock effect are acquired through the parameter acquisition module 302, and the above push-track parameters are used to indicate the shooting position of the above virtual camera at at least one target moment; the picture determination module 303 determines the shooting picture when the above virtual camera shoots the target image at the above target moment based on the above push-track parameters; the information determination module 304 determines the depth adjustment information of each pixel in the above shooting picture based on the relative depth between each pixel in the above shooting picture corresponding to the above target moment; the rendering module 305 renders the above target image based on the depth adjustment information corresponding to at least one of the above shooting pictures, so as to automatically generate and obtain an image result with the Hitchcock effect, which can improve the efficiency of making the image present the Hitchcock effect.

[0095] Accordingly, the embodiment of the present application also provides an electronic device, which may be a terminal, and the terminal may be a smart phone, a tablet computer, a laptop computer, a touch screen, a game console, a personal computer (PC, Personal Computer), a personal digital assistant (Personal Digital Assistant, PDA) and other terminal devices. Figure 4 As shown, Figure 4A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device 400 includes a processor 401 having one or more processing cores, a memory 402 having one or more computer-readable storage media, and a computer program stored in the memory 402 and executable on the processor. The processor 401 is electrically connected to the memory 402. Those skilled in the art will appreciate that the electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown, or combine certain components, or arrange components differently.

[0096] The processor 401 is the control center of the electronic device 400. It uses various interfaces and lines to connect various parts of the entire electronic device 400, executes various functions of the electronic device 400 and processes data by running or loading software programs and / or modules stored in the memory 402, and calling data stored in the memory 402, thereby monitoring the electronic device 400 as a whole.

[0097] In the embodiment of the present application, the processor 401 in the electronic device 400 will load instructions corresponding to the processes of one or more application programs into the memory 402 according to the following steps, and the processor 401 will run the application programs stored in the memory 402 to implement various functions:

[0098] Acquire a target image to be generated with a Hitchcock effect;

[0099] Obtaining a tracking parameter of a virtual camera that shoots the target image when simulating a Hitchcock effect, wherein the tracking parameter is used to indicate a shooting position of the virtual camera at at least one target moment;

[0100] Based on the track pushing parameters, respectively determine the shooting pictures of the virtual camera when shooting the target image at the target time;

[0101] Determining depth adjustment information of each pixel in the captured image based on the relative depth between each pixel in the captured image corresponding to the target moment;

[0102] Based on the depth adjustment information corresponding to at least one of the shooting pictures, the target image is rendered to obtain an image result with a Hitchcock effect.

[0103] In some embodiments, after respectively determining the shooting pictures of the virtual camera when shooting the target image at the target time, the method further includes:

[0104] If there is an idle area in the above-mentioned shooting picture, the edge of the idle area is repaired by using a preset edge repair model to obtain the idle area after edge repair;

[0105] The image is repaired in the idle area after the edge repair using a preset image repair model to obtain a repaired shooting picture.

[0106] In some embodiments, the target image includes a foreground area and a background area, and the depth adjustment information of each pixel in the captured image based on the relative depth between each pixel in the captured image corresponding to the target moment is determined, including:

[0107] Determine the depth discrete value corresponding to the target image based on the depth information of each pixel in the captured image;

[0108] Based on the depth discrete value corresponding to the target image, the depth adjustment information of each pixel in the captured image is determined.

[0109] In some embodiments, determining the depth discrete value corresponding to the target image based on the depth information of each pixel in the captured image includes:

[0110] Calculating the depth standard deviation of each pixel in the above-mentioned shooting picture based on the depth information of each pixel in the above-mentioned shooting picture;

[0111] The depth standard deviation is determined as the depth discrete value corresponding to the target image.

[0112] In some embodiments, determining the depth adjustment information of each pixel in the captured image based on the depth discrete value corresponding to the target image includes:

[0113] A preset depth adjustment indication parameter is obtained, and based on the depth discrete value corresponding to the target image and the depth adjustment indication parameter, the depth adjustment information of each pixel in the captured image is determined.

[0114] In some embodiments, the at least one target moment includes a to-be-processed moment and an associated moment of the to-be-processed moment, there is at least one shooting interval between the to-be-processed moment and the associated moment, and the obtaining of the push track parameters of the virtual camera that shoots the target image when simulating the Hitchcock effect includes:

[0115] Determining the regional depth information of the foreground area corresponding to the above-mentioned association moment based on the depth adjustment information of each pixel of the above-mentioned target image in the above-mentioned foreground area at the above-mentioned association moment;

[0116] Based on the above-mentioned regional depth information and the preset track-pushing indication coefficient, the shooting position of the above-mentioned virtual camera when shooting the above-mentioned target image at the time to be processed is obtained.

[0117] In some embodiments, the target image is rendered based on the depth adjustment information corresponding to at least one of the captured images to obtain an image result with a Hitchcock effect, including:

[0118] Determine the adjusted target depth information of each pixel in each of the above-mentioned shooting pictures based on the depth adjustment information corresponding to each of the above-mentioned shooting pictures and the depth information of each pixel in each of the above-mentioned shooting pictures;

[0119] Based on the target depth information of each pixel in at least one of the above-mentioned shooting pictures, the above-mentioned target image is rendered to obtain an image result with a Hitchcock effect.

[0120] Therefore, the electronic device 400 provided by this embodiment can bring the following technical effects: improving the efficiency of making images present the Hitchcock effect.

[0121] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0122] Optional, such as Figure 4 As shown, the electronic device 400 further includes: a touch screen 403, a radio frequency circuit 404, an audio circuit 405, an input unit 406, and a power supply 407. The processor 401 is electrically connected to the touch screen 403, the radio frequency circuit 404, the audio circuit 405, the input unit 406, and the power supply 407, respectively. Those skilled in the art can understand that Figure 4 The electronic device structure shown in the figure does not constitute a limitation of the electronic device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0123] The touch display screen 403 can be used to display a graphical user interface and receive operation instructions generated by the user acting on the graphical user interface. The touch display screen 403 may include a display panel and a touch panel. Among them, the display panel may be used to display information input by the user or information provided to the user and various graphical user interfaces of the electronic device, and these graphical user interfaces may be composed of graphics, text, icons, videos and any combination thereof. Optionally, the display panel may be configured in the form of a liquid crystal display (LCD, Liquid Crystal Display), an organic light-emitting diode (OLED, Organic Light-Emitting Diode) and the like. The touch panel may be used to collect the user's touch operation on or near it (such as the user using any suitable object or attachment such as a finger, a stylus, etc. on the touch panel or near the touch panel), and generate corresponding operation instructions, and the operation instructions execute corresponding programs. Optionally, the touch panel may include two parts, a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the touch point coordinates, and then sends it to the processor 401, and can receive the command sent by the processor 401 and execute it. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it is transmitted to the processor 401 to determine the type of touch event, and then the processor 401 provides a corresponding visual output on the display panel according to the type of touch event. In an embodiment of the present application, the touch panel and the display panel can be integrated into the touch display screen 403 to realize the input and output functions. However, in some embodiments, the touch panel and the touch panel can be used as two independent components to realize the input and output functions. That is, the touch display screen 403 can also be used as a part of the input unit 406 to realize the input function.

[0124] The radio frequency circuit 404 may be used to send and receive radio frequency signals, so as to establish wireless communication with a network device or other electronic devices through wireless communication, and to send and receive signals with the network device or other electronic devices.

[0125] The audio circuit 405 can be used to provide an audio interface between the user and the electronic device through a speaker and a microphone. The audio circuit 405 can transmit the electrical signal converted from the received audio data to the speaker, which is converted into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 405 and converted into audio data, and then the audio data is output to the processor 401 for processing, and then sent to another electronic device through the radio frequency circuit 404, or the audio data is output to the memory 402 for further processing. The audio circuit 405 may also include an earplug jack to provide communication between an external headset and an electronic device.

[0126] The input unit 406 may be used to receive input numbers, character information or user feature information (such as fingerprint, iris, facial information, etc.), and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0127] The power supply 407 is used to supply power to various components of the electronic device 400. Optionally, the power supply 407 can be logically connected to the processor 401 through a power management system, so that the power management system can manage charging, discharging, and power consumption. The power supply 407 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0128] although Figure 4 Not shown, the electronic device 400 may also include a camera, a sensor, a wireless fidelity module, a Bluetooth module, etc., which will not be described in detail here.

[0129] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0130] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0131] To this end, an embodiment of the present application provides a computer-readable storage medium, in which multiple computer programs are stored, and the computer program can be loaded by a processor to execute the steps in any image rendering method provided in the embodiment of the present application. For example, the computer program can execute the following steps:

[0132] Acquire a target image to be generated with a Hitchcock effect;

[0133] Obtaining a tracking parameter of a virtual camera that shoots the target image when simulating a Hitchcock effect, wherein the tracking parameter is used to indicate a shooting position of the virtual camera at at least one target moment;

[0134] Based on the track pushing parameters, respectively determine the shooting pictures of the virtual camera when shooting the target image at the target time;

[0135] Determining depth adjustment information of each pixel in the captured image based on the relative depth between each pixel in the captured image corresponding to the target moment;

[0136] Based on the depth adjustment information corresponding to at least one of the shooting pictures, the target image is rendered to obtain an image result with a Hitchcock effect.

[0137] In some embodiments, after respectively determining the shooting pictures of the virtual camera when shooting the target image at the target time, the method further includes:

[0138] If there is an idle area in the above-mentioned shooting picture, the edge of the idle area is repaired by using a preset edge repair model to obtain the idle area after edge repair;

[0139] The image is repaired in the idle area after the edge repair using a preset image repair model to obtain a repaired shooting picture.

[0140] In some embodiments, the target image includes a foreground area and a background area, and the depth adjustment information of each pixel in the captured image based on the relative depth between each pixel in the captured image corresponding to the target moment is determined, including:

[0141] Determine the depth discrete value corresponding to the target image based on the depth information of each pixel in the captured image;

[0142] Based on the depth discrete value corresponding to the target image, the depth adjustment information of each pixel in the captured image is determined.

[0143] In some embodiments, determining the depth discrete value corresponding to the target image based on the depth information of each pixel in the captured image includes:

[0144] Calculating the depth standard deviation of each pixel in the above-mentioned shooting picture based on the depth information of each pixel in the above-mentioned shooting picture;

[0145] The depth standard deviation is determined as the depth discrete value corresponding to the target image.

[0146] In some embodiments, determining the depth adjustment information of each pixel in the captured image based on the depth discrete value corresponding to the target image includes:

[0147] A preset depth adjustment indication parameter is obtained, and based on the depth discrete value corresponding to the target image and the depth adjustment indication parameter, the depth adjustment information of each pixel in the captured image is determined.

[0148] In some embodiments, the at least one target moment includes a to-be-processed moment and an associated moment of the to-be-processed moment, there is at least one shooting interval between the to-be-processed moment and the associated moment, and the obtaining of the push track parameters of the virtual camera that shoots the target image when simulating the Hitchcock effect includes:

[0149] Determining the regional depth information of the foreground area corresponding to the above-mentioned association moment based on the depth adjustment information of each pixel of the above-mentioned target image in the above-mentioned foreground area at the above-mentioned association moment;

[0150] Based on the above-mentioned regional depth information and the preset track-pushing indication coefficient, the shooting position of the above-mentioned virtual camera when shooting the above-mentioned target image at the time to be processed is obtained.

[0151] In some embodiments, the target image is rendered based on the depth adjustment information corresponding to at least one of the captured images to obtain an image result with a Hitchcock effect, including:

[0152] Determine the adjusted target depth information of each pixel in each of the above-mentioned shooting pictures based on the depth adjustment information corresponding to each of the above-mentioned shooting pictures and the depth information of each pixel in each of the above-mentioned shooting pictures;

[0153] Based on the target depth information of each pixel in at least one of the above-mentioned shooting pictures, the above-mentioned target image is rendered to obtain an image result with a Hitchcock effect.

[0154] It can be seen that the computer program can be loaded by the processor to execute the steps in any image rendering method provided in the embodiments of the present application, thereby bringing the following technical effects: improving the efficiency of making the image present the Hitchcock effect.

[0155] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0156] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0157] Since the computer program stored in the computer-readable storage medium can execute the steps in any one of the image rendering methods provided in the embodiments of the present application, the beneficial effects that can be achieved by any one of the image rendering methods provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0158] The above is a detailed introduction to an image rendering method, device, electronic device and computer-readable storage medium provided in the embodiments of the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for technical personnel in this field, according to the ideas of the present application, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. An image rendering method, characterized in that: The method comprises: Acquire a target image to be used for generating a Hitchcock effect, wherein the target image includes a foreground area and a background area; Acquire a tracking parameter of a virtual camera that shoots the target image when simulating a Hitchcock effect, wherein the tracking parameter is used to indicate a shooting position of the virtual camera at at least one target moment; Based on the track pushing parameters, respectively determining the shooting pictures when the virtual camera shoots the target image at the target time; Determine a depth discrete value corresponding to the target image based on the depth information of each pixel in the captured image, wherein the smaller the depth discrete value is, the closer the foreground area is to the background area, and the larger the depth discrete value is, the farther the foreground area is from the background area; Determining depth adjustment information of each pixel in the captured image based on the depth discrete value corresponding to the target image; Based on the depth adjustment information corresponding to at least one of the captured images, the target image is rendered to obtain an image result with a Hitchcock effect.

2. The image rendering method according to claim 1, characterized in that: After respectively determining the shooting pictures when the virtual camera shoots the target image at the target time, the method further includes: If there is an idle area in the captured image, edge repair is performed on the idle area using a preset edge repair model to obtain an idle area after edge repair; The image is repaired in the idle area after the edge repair by using a preset image repair model to obtain a repaired shooting picture.

3. The image rendering method according to claim 1, wherein: The determining, based on the depth information of each pixel in the captured image, a discrete depth value corresponding to the target image includes: Calculating a depth standard deviation corresponding to the captured image based on the depth information of each pixel in the captured image; The depth standard deviation is determined as a depth discrete value corresponding to the target image.

4. The image rendering method according to claim 1, characterized in that: The determining, based on the depth discrete value corresponding to the target image, the depth adjustment information of each pixel in the captured image includes: A preset depth adjustment indication parameter is obtained, and depth adjustment information of each pixel in the captured image is determined based on the depth discrete value corresponding to the target image and the depth adjustment indication parameter.

5. The image rendering method according to claim 1, characterized in that: The at least one target moment includes a to-be-processed moment and a time associated with the to-be-processed moment, and there is at least one shooting interval between the to-be-processed moment and the associated moment. The step of obtaining the push track parameters of the virtual camera used to shoot the target image when simulating the Hitchcock effect includes: Determining regional depth information of the foreground area corresponding to the association moment based on depth adjustment information of each pixel in the foreground area of ​​the target image at the association moment; Based on the regional depth information and the preset track-pushing indication coefficient, the shooting position of the virtual camera when shooting the target image at the time to be processed is obtained.

6. The image rendering method according to any one of claims 1 to 5, characterized in that: The rendering of the target image based on the depth adjustment information corresponding to at least one of the captured images to obtain an image result with a Hitchcock effect includes: Determine the adjusted target depth information of each pixel in each of the shooting pictures based on the depth adjustment information corresponding to each of the shooting pictures and the depth information of each pixel in each of the shooting pictures; Based on the target depth information of each pixel in at least one of the captured images, the target image is rendered to obtain an image result with a Hitchcock effect.

7. An image rendering device, characterized in that: The device comprises: An image acquisition module, used for acquiring a target image to be used for generating a Hitchcock effect, wherein the target image includes a foreground area and a background area; A parameter acquisition module, used for acquiring a tracking parameter of a virtual camera for shooting the target image when simulating a Hitchcock effect, wherein the tracking parameter is used for indicating a shooting position of the virtual camera at at least one target moment; A picture determination module, used to determine, based on the track pushing parameters, the shooting pictures when the virtual camera shoots the target image at the target time; an information determination module, configured to determine a depth discrete value corresponding to the target image based on the depth information of each pixel in the captured image; and determine depth adjustment information of each pixel in the captured image based on the depth discrete value corresponding to the target image, wherein the smaller the depth discrete value is, the closer the foreground area is to the background area, and the larger the depth discrete value is, the farther the foreground area is from the background area; The rendering module is used to render the target image based on the depth adjustment information corresponding to at least one of the shooting pictures to obtain an image result with a Hitchcock effect.

8. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores a plurality of instructions; the processor loads instructions from the memory to execute the steps in the image rendering method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the steps in the image rendering method according to any one of claims 1 to 6.