Picture processing method and device, electronic equipment and storage medium
By obtaining and mixing the depth maps of real scenes and game scenes, filtering the real scenes is solved, and the problems of unstable background of the game screen, light adaptation and lack of visual focus are improved, and the visual experience of players is improved.
Patent Information
- Application Number
- CN202510254536.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-04
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2045-03-04
AI Technical Summary
The game screen has problems such as unstable background, players need to repeatedly adapt to different lights, and lack of visual focus, which seriously affects the player's gaming experience.
By obtaining the depth map of the real scene and the game scene, mix and generate the target depth map, and filter the real scene according to the target depth map, and synthesize the real scene and display the content on a stable interface.
Without changing the layout of the real scene, ensure the stability of the interface display content, reduce the discomfort caused by inconsistent brightness between the virtual window and the real scene, and focus the player's attention on the virtual window, and enhance the player's visual experience.
Smart Images

Figure CN119818943A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of game technology, and in particular to a picture processing method, a picture processing device, an electronic device and a computer-readable storage medium. Background Art
[0002] With the development of science and technology, game developers have developed different types of games based on different hardware devices, such as mobile games, PC games, AR (Augmented Reality) games, and VR (Virtual Reality) games. In the corresponding games, players can play the games through the corresponding game devices. However, in the process of presenting the game screen on the game devices, there are problems such as unstable background, players need to repeatedly adapt to different light, and lack of visual focus, which seriously affects the players' gaming experience. Summary of the invention
[0003] The embodiments of the present invention provide a method, device, electronic device and computer-readable storage medium for processing a picture, so as to solve or partially solve the problems of unstable background in the game picture, the need for players to repeatedly adapt to different light and lack of visual focus.
[0004] The embodiment of the present invention discloses a method for processing a picture, which provides a graphical user interface through an electronic terminal, and the method includes:
[0005] Displaying a real scene of the player's environment and a virtual window in the graphical user interface, and displaying a game scene in the virtual window;
[0006] Acquire a first depth map corresponding to the real scene and a second depth map corresponding to the game scene;
[0007] Mixing the first depth map with the second depth map to obtain a target depth map;
[0008] The real scene is subjected to filter processing according to the target depth map, and the processed first real scene is displayed in the graphical user interface based on the result of the filter processing.
[0009] The embodiment of the present invention further discloses a picture processing device, which provides a graphical user interface through an electronic terminal, and the device includes:
[0010] A scene display module, used to display the real scene of the player's environment and a virtual window in the graphical user interface, and to display the game scene in the virtual window;
[0011] A depth information acquisition module, used to acquire a first depth map corresponding to the real scene and a second depth map corresponding to the game scene;
[0012] A depth information fusion module, configured to mix the first depth map with the second depth map to obtain a target depth map;
[0013] A filter processing module is used to perform filter processing on the real scene according to the target depth map, and display the processed first real scene in the graphical user interface based on the result of the filter processing.
[0014] The embodiment of the present invention further discloses an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0015] The memory is used to store computer programs;
[0016] The processor is used to implement the method described in the embodiment of the present invention when executing the program stored in the memory.
[0017] The embodiment of the present invention further discloses a computer-readable storage medium having instructions stored thereon, which, when executed by one or more processors, enables the processors to execute the method described in the embodiment of the present invention.
[0018] The embodiments of the present invention include the following advantages:
[0019] In an embodiment of the present invention, for the real scene of the player's environment displayed during the game and the game scene displayed in the virtual window, the terminal can obtain a first depth map corresponding to the real scene and a second depth map corresponding to the game scene, and mix the first depth map with the second depth map to obtain a target depth map, and then filter the real scene according to the target depth map, and display the processed first real scene in a graphical user interface based on the result of the filter processing, so that the virtual content and the real scene are combined through the depth map, which can ensure the stability of the content displayed on the interface without changing the layout of the scene in reality, and at the same time reduce the discomfort caused by the inconsistent brightness between the virtual window and the real scene, and enable the player's attention to be effectively focused on the virtual window, thereby improving the player's visual experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 is a flowchart of a method for processing a picture provided in an embodiment of the present invention;
[0021] Figure 2 is a schematic diagram of a depth map provided in an embodiment of the present invention;
[0022] Figure 3 is a schematic diagram of a depth map provided in an embodiment of the present invention;
[0023] Figure 4 is a schematic diagram of a depth map provided in an embodiment of the present invention;
[0024] Figure 5 is a schematic diagram of a game interface provided in an embodiment of the present invention;
[0025] Figure 6 is a schematic diagram of a game interface provided in an embodiment of the present invention;
[0026] Figure 7 It is a structural block diagram of a picture processing device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0027] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0028] As an example, in a corresponding game, players can play the game through a corresponding gaming device. However, in the process of the gaming device presenting the game screen, there are problems such as unstable background, players need to repeatedly adapt to different light, and lack of visual focus, which seriously affect the player's gaming experience.
[0029] In this regard, in the present invention, for the real scene of the player's environment displayed during the game and the game scene displayed in the virtual window, the terminal can obtain a first depth map corresponding to the real scene and a second depth map corresponding to the game scene, and mix the first depth map with the second depth map to obtain a target depth map, and then filter the real scene according to the target depth map, and display the processed first real scene in the graphical user interface based on the result of the filter processing, so that the virtual content and the real scene are combined through the depth map, which can ensure the stability of the content displayed on the interface without changing the layout of the scene in reality, and at the same time reduce the discomfort caused by the inconsistent brightness between the virtual window and the real scene, and enable the player's attention to be effectively focused on the virtual window, thereby improving the player's visual experience.
[0030] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, some technical features involved in the embodiments of the present invention are explained and illustrated below:
[0031] Overlay refers to the technology of image processing and graphic design. Its main function is to superimpose one layer of image or color on another layer of image to produce different visual effects. Among them, the basic principle of overlay: Color mixing: Overlay generates new color values by performing specific mathematical operations on the color values of the bottom image and the top image. Usually, this mixing effect will enhance the brightness of the bottom image; Brightness value: The brightness value of the top image will affect the final effect. The higher the brightness value, the easier it is to see the details of the bottom image; Visual effect: Overlay can produce effects such as enhanced contrast and rich colors, making the image more vivid and layered.
[0032] A depth map is a type of image data used to represent the distance or depth information from each pixel in a scene to the observer. It is usually presented in the form of a grayscale image, where the grayscale value of each pixel corresponds to the depth of that point. The related concepts involved in the depth map may include:
[0033] 1. Grayscale representation: In the depth map, white can be used to represent close distances, black to represent long distances, and gray to represent intermediate distances. This method allows depth information to be represented and processed in the form of two-dimensional images.
[0034] 2. Pixel depth: The value of each pixel represents the depth information of that point, usually expressed in units (such as meters) or normalized values (relative values).
[0035] 3. Acquisition method: Depth map can be obtained in many ways, including:
[0036] Stereo vision: Depth calculation using images obtained by binocular cameras.
[0037] Laser scanning: Directly measure depth using devices such as LiDAR.
[0038] Depth camera: Through dedicated equipment, it can directly output depth maps.
[0039] Specifically, refer to Figure 1 , shows a flowchart of a method for processing a picture provided in an embodiment of the present invention, which provides a graphical user interface through an electronic terminal, and may specifically include the following steps:
[0040] Step 101, displaying a real scene of the player's environment and a virtual window in the graphical user interface, and displaying a game scene in the virtual window;
[0041] The electronic terminal (hereinafter referred to as the terminal) may be a terminal running a game application. During the game, the graphical user interface of the terminal may present the corresponding game scene to the player. In some games, in addition to the game scene, the content displayed in the terminal graphical user interface may also display the real scene of the player's environment.
[0042] For example, assuming that the electronic terminal is a head-mounted display device, the head-mounted display device can display the real scene corresponding to the player's environment in the graphical user interface, and at the same time display the corresponding virtual window. The virtual window can display the corresponding game scene, so that the player can see the real scene and the virtual picture at the same time inside the head-mounted display device.
[0043] Optionally, the head-mounted display device may be a spatial computing device, which may provide players with a good visual experience by integrating technologies such as VR (Virtual Reality), AR (Augmented Reality) and MR (Mixed Reality).
[0044] It should be noted that when the terminal displays the real scene and the virtual screen at the same time, the user may be in various scene conditions when using the floating window function of the head display device. For some products, especially game products that require an immersive experience, the background that changes at any time is easy to affect and interfere with the player's overall feeling of the game play process; when the content displayed in the virtual window is too different from the real background, the user's eyes need to move back and forth repeatedly under the two kinds of light, and the pupil of the eye needs to adapt to the light, which may cause discomfort; when the virtual window is displayed, due to the difference in content between the game scene displayed in the virtual window and the real scene, it is easy to lack visual focus, affecting the player's immersive experience. In this regard, in response to the above-mentioned possible problems, this application can process the real scene according to the needs of the player during the game to provide the player with a better game visual experience.
[0045] Step 102, obtaining a first depth map corresponding to the real scene and a second depth map corresponding to the game scene;
[0046] During the game, the terminal can obtain a first depth map corresponding to the real scene and a second depth map corresponding to the game scene according to a preset trigger condition or a trigger operation of the player, so as to process the real scene according to the first depth map and the second depth map, so as to combine the game scene with the real scene based on the corresponding processing results, thereby reducing the impact on other people in the same space without changing the scene layout in the real scene.
[0047] Among them, the depth map can be an image representing the distance from each pixel in the scene to the camera. The depth map can be marked in the form of a grayscale image. The brightness values corresponding to pixels closer to the camera are higher, and the brightness values corresponding to pixels farther from the camera are lower.
[0048] In some feasible implementations, when the player inputs a filter adding operation for a real scene, it can trigger the processing of the real scene through a depth map. Specifically, the terminal can respond to the filter adding operation for the real scene and obtain a first depth map corresponding to the real scene and a second depth map corresponding to the virtual window. Optionally, a functional control is displayed in the graphical user interface. In the case where the electronic terminal is a head-mounted display device, the player can input a gaze operation for the functional space. The terminal scans the environment in response to the gaze operation for the functional control, obtains a first depth map corresponding to the real scene, and obtains depth information corresponding to the game scene through a virtual camera in the game, and generates a second depth map corresponding to the depth information, so as to add corresponding filters to the real scene based on the first depth map and the second depth map, realize the combination of the game scene and the real scene, and ensure the overall consistency of the picture without changing the scene layout in the real scene.
[0049] It should be noted that in addition to triggering the addition of filters through corresponding function controls, the addition of corresponding filters to real scenes can also be triggered through voice commands, physical buttons, etc. Players can choose according to actual needs. Among them, filter processing for real scenes includes but is not limited to blur processing, brightness processing, and adding textures, etc. For example, in the case of blur processing, the blurriness of the real scene can be adjusted in combination with the depth map; in the case of brightness processing, the brightness of the real scene can be adjusted in combination with the depth map; in the case of adding texture, the corresponding texture image (such as a static image corresponding to the game scene, etc.) can be added to the real scene in combination with the depth map, etc., and the present invention does not limit this.
[0050] Step 103, mixing the first depth map and the second depth map to obtain a target depth map;
[0051] After obtaining the first depth map corresponding to the real scene and the second depth map corresponding to the game scene, the terminal can mix the first depth map with the second depth map to obtain the corresponding target depth map, so as to perform image processing on the real scene based on the target depth map, thereby realizing the fusion of virtual content and the real scene, and ensuring the overall consistency of the picture without changing the scene layout in the real scene.
[0052] In some feasible implementations, the first depth map includes first pixels, and the second depth map includes second pixels. In the process of hybrid calculation, the first brightness value corresponding to each first pixel in the first depth map can be obtained first, and the second brightness value corresponding to each second pixel in the second depth map can be obtained. Then, a positive film overlay calculation is performed based on the first brightness value and the second brightness value to obtain a target depth map corresponding to the first depth map and the second depth map, so as to perform image processing on the real scene based on the target depth map, realize the fusion of virtual content and the real scene, and ensure the overall consistency of the picture without changing the scene layout in the real scene.
[0053] In the process of performing mixed calculation on the first depth map and the second depth map, in order to ensure the accuracy of the mixed calculation, the same position can be used as a reference to perform a positive overlay calculation on the pixel points corresponding to the same position in the first depth map and the second depth map. Specifically, the first target pixel point can be extracted from the first pixel point, and the second target pixel point can be extracted from the second pixel point. The first target pixel point and the second target pixel point correspond to the same position in the first depth map and the second depth map, respectively. Then, the first brightness value corresponding to the first target pixel point, the second brightness value corresponding to the second target pixel point and the preset brightness range are used to perform a positive overlay calculation to obtain the corresponding target brightness value. Finally, according to each target brightness value, the target depth map corresponding to the first depth map and the second depth map is constructed.
[0054] It should be noted that in the above process, if there is a misalignment in depth information between the first depth map and the second depth map, such as inconsistent image sizes between the first depth map and the second depth map, inconsistent coordinates corresponding to the pixels, inconsistent depth value ranges corresponding to the pixels, etc., the first depth map and the second depth map can be aligned first to obtain the aligned first depth map and the second depth map, and then a mixed calculation can be performed based on the aligned depth maps to ensure data consistency.
[0055] In some examples, two depth maps can be adjusted to images of the same size through size alignment, such as by resizing: enlarging a smaller depth map or reducing a larger depth map; cropping: cropping an area of the same size as the smaller depth map from a larger depth map; interpolation: using an interpolation algorithm (such as bilinear interpolation) to maintain the smoothness of depth information during the scaling process. If the two depth maps come from different perspectives or cameras, their coordinate systems need to be aligned, such as by camera calibration: obtaining the camera's intrinsic parameters (focal length, principal point) and extrinsic parameters (rotation, translation); depth map projection: projecting one depth map into the coordinate system of another depth map. If the depth value ranges of the two depth maps are inconsistent, the depth values can be normalized to the range of [0, 1], etc., so that the consistency and accuracy of the depth information between different depth maps can be ensured through alignment processing.
[0056] Furthermore, in the process of performing overlay calculation on the first depth map and the second depth map, it is assumed that the pixels at the same position in the first depth map and the second depth map are pixel A and pixel B respectively (for example, the corresponding plane coordinate system can be constructed, and then the positioning can be performed based on the coordinates corresponding to each pixel point, etc.), by obtaining the brightness value a corresponding to pixel point A and the brightness value b corresponding to pixel point B, and setting the brightness range of the pixel point to [0, 225], the formula for overlay calculation can be C=a*b / 255, so that the target brightness value after the fusion of pixel point A or pixel point B can be calculated by this formula, and then by repeating the calculation process, the target brightness values corresponding to all pixels are calculated, and then they are combined according to the corresponding positions to obtain the target depth map, thereby realizing the fusion of virtual content and real scene, and ensuring the overall consistency of the picture without changing the scene layout in the real scene.
[0057] For example, refer to Figure 2 , Figure 3 , shows a schematic diagram of a depth map provided in an embodiment of the present invention, wherein: Figure 2 It can be the first depth map corresponding to the real scene, Figure 3 It can be the second depth map corresponding to the game scene, which can be Figure 2 and Figure 3 Fusion is performed to obtain the target depth map, such as Figure 4 As shown, the virtual content and the real scene are integrated, and the overall consistency of the picture is ensured without changing the scene layout in the real scene. Optionally, the first depth map can be used as the bottom layer image, and the second depth map can be used as the upper layer overlay image for positive film overlay calculation.
[0058] It should be noted that, for the calculation formula of the overlay C=a*b / 255, when a is 0, no matter what value b takes, C is always 0, that is, when a is completely black, no matter what depth map b is, it will not affect a; when b=0, then C=0; when b=225, then C=a, that is, when the pixels of the upper image are pure white, after superposition, the pixels of the original image a do not change; when 0<b<255, then b÷255<1, C<a, the pixels in the first depth map become darker after the overlay, so that by fusing the depth information of the virtual content and the real scene, the target depth map can be obtained, and then the corresponding filter effect is added to the real scene through the target depth map to enhance the visual effect of the real scene.
[0059] Step 104: filter the real scene according to the target depth map, and display the processed first real scene in the graphical user interface based on the result of the filter processing.
[0060] In an embodiment of the present invention, after obtaining a target depth map by fusing a depth map corresponding to a real scene with a depth map corresponding to a virtual scene in a game, the real scene can be filtered according to the target depth map, and the processed first real scene can be displayed in a graphical user interface based on the result of the filtering process, thereby combining virtual content with the real scene through the depth map. The stability of the content displayed on the interface can be ensured without changing the layout of the real scene. At the same time, the characteristic of the depth map that white is near and black is far can be used to reduce the impact of the bright background in the real scene on the player, reduce the discomfort caused by the inconsistent brightness between the virtual window and the real scene, and enable the player's attention to be effectively focused on the virtual window, thereby improving the player's visual experience.
[0061] In some feasible implementations, the terminal can sample the target depth map and the real scene respectively to obtain a third target pixel and a fourth target pixel representing the same position, where the third target pixel is located in the target depth map and the fourth target pixel is located in the real scene. Then, the first color value corresponding to the third target pixel is obtained, and the second color value corresponding to the fourth target pixel is obtained. The first color value and the second color value are then used to perform a positive film overlay calculation to obtain the target color value corresponding to the fourth pixel. Finally, the real scene is color adjusted based on the target color value to obtain a first real scene corresponding to the real scene, and the first real scene is displayed in a graphical user interface.
[0062] It should be noted that when the size of the target depth map is inconsistent with that of the real scene, corresponding alignment processing can be performed to make the pixels contained in the target depth map consistent with the pixels contained in the real scene, including consistent position and quantity, etc., so that each pixel in the real scene can be processed according to the target depth map, thereby adding corresponding filters to the real scene.
[0063] In one example, assuming that the target pixel C in the real scene has a higher brightness, the corresponding color value is #FDFEED, and the corresponding RGB value is (253, 254, 237), while the color value of the pixel D at the same position in the generated target depth map is #161616, and the corresponding RGB value is (22, 22, 22). The calculation process of the overlay can be: (real scene ①.rgb(253, 254, 237)*depth map C.rgb(22, 22, 22))÷255=(21.8, 21.9, 20. 4), so the color value obtained after adding the filter to the target pixel C through the target depth map can be (21.8, 21.9, 20.4), and so on, after all the pixels in the real scene are calculated, the stability of the interface display content can be guaranteed without changing the layout of the real scene. At the same time, the characteristic of the depth map that white is near and black is far can be used to add corresponding depth fog to the real background, thereby reducing the impact of the bright background on the player's line of sight, so that the player's attention can be effectively focused on the virtual window, and the player's visual experience is improved.
[0064] Optionally, in the process of filtering the real scene, for the target depth map obtained by the mixed calculation, the terminal can also obtain brightness adjustment information for the target depth map, and then use the brightness adjustment information to adjust the brightness information of the target depth map. Among them, the brightness adjustment information can be the adjustment information preset by the terminal, or it can be the adjustment information input by the player in real time during the process of triggering the filter processing. For example, the target depth map can be generated in real time according to the content displayed by the current graphical user interface. After the generation, the player can also adjust the brightness of the target depth map to control the range of the fog effect, so as to provide more degrees of freedom; at the same time, the terminal can also be provided by the manufacturer at the factory. The corresponding preset adjustment information, the player can directly use the preset parameters, so that by adjusting the brightness value of the target depth map, the range of the real scene covered by the filter can be effectively adjusted, and in the case of cooperating with the game plot process, the player's immersion experience can be greatly enhanced. Optionally, the player can adjust the brightness of the target depth map through the corresponding interactive controls, etc., and the present invention is not limited to this.
[0065] Optionally, if the player wishes or the game process reaches a specific moment of the game and meets specific conditions, the real scene can also be processed in combination with the game scene. Specifically, the game scene can be added to the first real scene to obtain a second real scene, and then the second real scene can be displayed in the graphical user interface. For example, after obtaining the target depth map, the terminal can extract the corresponding static scene from the game scene, and then adjust the brightness of the static scene according to the brightness information corresponding to the target depth map, and then overlay the adjusted static scene on the real scene, thereby further enhancing the visual immersion during the game and bringing a good visual experience to the players.
[0066] It should be noted that the embodiments of the present invention include but are not limited to the above examples. It is understandable that those skilled in the art can also make settings according to actual needs under the guidance of the ideas of the embodiments of the present invention, and the present invention is not limited to this.
[0067] In an embodiment of the present invention, for the real scene of the player's environment displayed during the game and the game scene displayed in the virtual window, the terminal can obtain a first depth map corresponding to the real scene and a second depth map corresponding to the game scene, and mix the first depth map with the second depth map to obtain a target depth map, and then filter the real scene according to the target depth map, and display the processed first real scene in a graphical user interface based on the result of the filter processing, so that the virtual content and the real scene are combined through the depth map, which can ensure the stability of the content displayed on the interface without changing the layout of the scene in reality, and at the same time reduce the discomfort caused by the inconsistent brightness between the virtual window and the real scene, and enable the player's attention to be effectively focused on the virtual window, thereby improving the player's visual experience.
[0068] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the following examples are used for exemplary description:
[0069] As an example, suppose a player plays a game through a head-mounted display device, and the head-mounted display device displays a real scene and a corresponding virtual window, and a game scene is displayed in the virtual window. After collecting depth information of the real scene and the game scene respectively, the corresponding first depth map and second depth map are obtained, and then the first depth map and the second depth map are mixed and calculated in a positive film overlay manner to obtain a target depth map. After obtaining the target depth map, the real scene can be sampled according to the target depth map. The real scene is fully displayed in the place where the color is pure white rgb (255,255,255) in the target depth map, and the real scene is not displayed in the place where the color is pure black rgb (0,0,0), and the remaining values are transitioned between the two effects.
[0070] Assuming that the target pixel point A in the real scene displayed by the graphical user interface has a position pixel corresponding to pure black (0,0,0) on the depth black and white map (i.e., the target depth map), the target pixel point A and the points farther away from the target pixel point A do not display the real scene at all. Otherwise, according to the method of fully displaying the real scene and displaying according to the transition effect, for example, referring to Figure 5 , shows a schematic diagram of a game interface provided in an embodiment of the present invention. Assume that the target pixel point A is connected to the bottom point (the point closest to the camera) in the graphical user interface to form a line segment AB. If the length of AB is 10 meters, then point A (0,0,0) and point B (255,255,255) are not displayed at all for a portion more than 10 meters away from the camera (the portion with brightness less than or equal to (0,0,0) can actually be displayed as pure black). For a portion less than 10 meters, as the distance decreases, the corresponding brightness or blurriness gradually decreases until the corresponding real scene is fully displayed. Thus, by combining the depth map and utilizing the characteristic of the depth map that near white and far black are used, the corresponding depth fog is added to the real background, thereby reducing the impact of the highlighted background on the player's line of sight, allowing the player's attention to be effectively focused on the virtual window, thereby enhancing the player's visual experience.
[0071] In addition, during the game, if the player wishes or the game progress reaches a specific moment in the game and meets specific conditions, the real scene can be processed in combination with the game scene. Figure 6 The terminal can extract the corresponding static scene from the game scene displayed in the virtual window 20, and then overlay and display the corresponding static scene in the real scene 10 in combination with the target depth map, thereby further enhancing the visual immersion during the game and bringing a good visual experience to the players.
[0072] Through the above process, virtual content and real scenes can be combined through depth maps, and the stability of interface display content can be guaranteed without changing the layout of the real scene. At the same time, the discomfort caused by inconsistent brightness between the virtual window and the real scene can be reduced, and the player's attention can be effectively focused on the virtual window, thereby improving the player's visual experience.
[0073] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0074] Reference Figure 7, shows a structural block diagram of a picture processing device provided in an embodiment of the present invention, which provides a graphical user interface through an electronic terminal, and specifically may include the following modules:
[0075] A scene display module 701, used to display the real scene of the player's environment and a virtual window in the graphical user interface, and to display the game scene in the virtual window;
[0076] A depth information acquisition module 702, used to acquire a first depth map corresponding to the real scene and a second depth map corresponding to the game scene;
[0077] A depth information fusion module 703, configured to mix the first depth map with the second depth map to obtain a target depth map;
[0078] The filter processing module 704 is used to perform filter processing on the real scene according to the target depth map, and display the processed first real scene in the graphical user interface based on the result of the filter processing.
[0079] In some feasible implementations, the first depth map includes a first pixel point, the second depth map includes a second pixel point, and the depth information fusion module 703 is specifically used to:
[0080] Obtaining a first brightness value corresponding to each of the first pixel points;
[0081] Obtaining a second brightness value corresponding to each of the second pixel points;
[0082] A multiply calculation is performed according to the first brightness value and the second brightness value to obtain a target depth map corresponding to the first depth map and the second depth map.
[0083] In some feasible implementations, the depth information fusion module 703 is specifically used to:
[0084] Extracting a first target pixel from the first pixel, and extracting a second target pixel from the second pixel, wherein the first target pixel and the second target pixel correspond to the same position in the first depth map and the second depth map respectively;
[0085] Performing a positive overlay calculation using a first brightness value corresponding to the first target pixel, a second brightness value corresponding to the second target pixel, and a preset brightness range to obtain a corresponding target brightness value;
[0086] According to each of the target brightness values, a target depth map corresponding to the first depth map and the second depth map is constructed.
[0087] Some possible implementations also include:
[0088] The alignment processing module is used to perform alignment processing on the first depth map and the second depth map to obtain the aligned first depth map and the second depth map.
[0089] In some feasible implementations, the filter processing module 704 is specifically used to:
[0090] The target depth map and the real scene are sampled respectively to obtain a third target pixel point and a fourth target pixel point representing the same position, wherein the third target pixel point is located in the target depth map, and the fourth target pixel point is located in the real scene;
[0091] Obtaining a first color value corresponding to the third target pixel;
[0092] Obtaining a second color value corresponding to the fourth target pixel;
[0093] Performing a multiplication calculation using the first color value and the second color value to obtain a target color value corresponding to the fourth pixel;
[0094] The real scene is color-adjusted based on the target color value to obtain a first real scene corresponding to the real scene, and the first real scene is displayed in the graphical user interface.
[0095] In some feasible implementations, the depth information acquisition module 702 is specifically used to:
[0096] In response to a filter adding operation for the real scene, a first depth map corresponding to the real scene and a second depth map corresponding to the virtual window are obtained.
[0097] In some feasible implementations, the graphical user interface displays a function control, and the depth information acquisition module 702 is specifically used to:
[0098] In response to a gaze operation on the functional control, scanning the environment to obtain a first depth map corresponding to the real scene;
[0099] And, obtaining depth information corresponding to the game scene through a virtual camera in the game, and generating a second depth map corresponding to the depth information.
[0100] In some feasible implementations, the device further includes:
[0101] An adjustment information acquisition module, used to acquire brightness adjustment information for the target depth map;
[0102] An adjustment module is used to adjust the brightness information of the target depth map using the brightness adjustment information.
[0103] Some possible implementations also include:
[0104] A scene processing module, used for adding the game scene to the first real scene to obtain a second real scene;
[0105] A display module is used to display the second reality scene in the graphical user interface.
[0106] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0107] In addition, an embodiment of the present invention further provides an electronic device, including: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the various processes of the above-mentioned screen processing method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0108] The embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each process of the above-mentioned picture processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0109] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0110] It should be understood by those skilled in the art that the embodiments of the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, EEPROM, Flash, and eMMC, etc.) containing computer-usable program codes.
[0111] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0112] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0113] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0114] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0115] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0116] The above is a detailed introduction to a method for processing a picture and a device for processing a picture provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A method for processing a picture, characterized in that: Providing a graphical user interface via an electronic terminal, the method comprising: Displaying a real scene of the player's environment and a virtual window in the graphical user interface, and displaying a game scene in the virtual window; Acquire a first depth map corresponding to the real scene and a second depth map corresponding to the game scene; Mixing the first depth map with the second depth map to obtain a target depth map; The real scene is subjected to filter processing according to the target depth map, and the processed first real scene is displayed in the graphical user interface based on the result of the filter processing.
2. The method according to claim 1, characterized in that The first depth map includes a first pixel point, the second depth map includes a second pixel point, and the mixing of the first depth map and the second depth map to obtain a target depth map includes: Obtaining a first brightness value corresponding to each of the first pixel points; Obtaining a second brightness value corresponding to each of the second pixel points; A multiply calculation is performed according to the first brightness value and the second brightness value to obtain a target depth map corresponding to the first depth map and the second depth map.
3. The method according to claim 2, characterized in that The performing a multiply calculation according to the first brightness value and the second brightness value to obtain a target depth map corresponding to the first depth map and the second depth map includes: Extracting a first target pixel from the first pixel, and extracting a second target pixel from the second pixel, wherein the first target pixel and the second target pixel correspond to the same position in the first depth map and the second depth map respectively; Performing a positive overlay calculation using a first brightness value corresponding to the first target pixel, a second brightness value corresponding to the second target pixel, and a preset brightness range to obtain a corresponding target brightness value; According to each of the target brightness values, a target depth map corresponding to the first depth map and the second depth map is constructed.
4. The method according to claim 2 or 3, characterized in that: Also includes: The first depth map and the second depth map are aligned to obtain the aligned first depth map and the aligned second depth map.
5. The method according to claim 1, 2 or 3, characterized in that: The filtering the real scene according to the target depth map, and displaying the processed first real scene in the graphical user interface based on the result of the filtering, comprises: The target depth map and the real scene are sampled respectively to obtain a third target pixel point and a fourth target pixel point representing the same position, wherein the third target pixel point is located in the target depth map, and the fourth target pixel point is located in the real scene; Obtaining a first color value corresponding to the third target pixel; Obtaining a second color value corresponding to the fourth target pixel; Performing a multiplication calculation using the first color value and the second color value to obtain a target color value corresponding to the fourth pixel; The real scene is color-adjusted based on the target color value to obtain a first real scene corresponding to the real scene, and the first real scene is displayed in the graphical user interface.
6. The method according to claim 1, characterized in that The obtaining of the first depth map corresponding to the real scene and the second depth map corresponding to the game scene includes: In response to a filter adding operation for the real scene, a first depth map corresponding to the real scene and a second depth map corresponding to the virtual window are obtained.
7. The method according to claim 6, characterized in that The graphical user interface displays a function control, and in response to the filter adding operation for the real scene, obtaining a first depth map corresponding to the real scene and a second depth map corresponding to the virtual window includes: In response to a gaze operation on the functional control, scanning the environment to obtain a first depth map corresponding to the real scene; And, obtaining depth information corresponding to the game scene through a virtual camera in the game, and generating a second depth map corresponding to the depth information.
8. The method according to claim 1, 2 or 3, characterized in that: After the first depth map and the second depth map are mixed to obtain a target depth map, the method further includes: Acquire brightness adjustment information for the target depth map; The brightness adjustment information is used to adjust the brightness information of the target depth map.
9. The method according to claim 5, characterized in that Also includes: Add the game scene to the first real scene to obtain a second real scene; The second reality scene is displayed in the graphical user interface.
10. A picture processing device, characterized in that: Providing a graphical user interface via an electronic terminal, the device comprises: A scene display module, used to display the real scene of the player's environment and a virtual window in the graphical user interface, and to display the game scene in the virtual window; A depth information acquisition module, used to acquire a first depth map corresponding to the real scene and a second depth map corresponding to the game scene; A depth information fusion module, configured to mix the first depth map with the second depth map to obtain a target depth map; A filter processing module is used to perform filter processing on the real scene according to the target depth map, and display the processed first real scene in the graphical user interface based on the result of the filter processing.
11. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; The memory is used to store computer programs; The processor is used to implement the method according to any one of claims 1 to 9 when executing the program stored in the memory.
12. A computer-readable storage medium having instructions stored thereon, which, when executed by one or more processors, cause the processors to perform the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Data processing method and device, computer readable medium, processor and electronic equipment
CN114119797A
Ambient light shielding processing method, device and equipment
CN114832375A
Data processing method, terminal and server
WO2015139600A1