Image display method, device, computer equipment and storage medium
Through the combination of hardware synthesizer and GPU, the display enhancement processing before and after switching the layer synthesis mode is ensured, which solves the problem of sudden change in image display effect and improves the image display quality.
Patent Information
- Application Number
- CN202110914167.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-10
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2041-08-10
AI Technical Summary
The existing technology cannot guarantee the continuity of display enhancement processing when the layer synthesis mode is switched, resulting in a sudden change in the image display effect. Especially when the hardware synthesizer cannot perform layer synthesis, the display enhancement fails.
By default, the hardware compositor is used to perform display enhancement and synthesis on the layers, and when the layer composition mode is switched, the GPU is switched to perform display enhancement processing to ensure that the images are processed through display enhancement before and after the layer composition mode is switched.
It realizes the continuity of display enhancement before and after switching the layer synthesis mode, avoids sudden changes in image display effect, and improves image display quality.
Smart Images

Figure CN113625983B
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of image display technology, and in particular to an image display method, apparatus, computer equipment, and storage medium. Background Art
[0002] With the development of display technology, people have higher and higher requirements for image display effects. For example, in video playback scenarios, people hope that the displayed video effects are clear, beautiful and pleasing to the eye.
[0003] In the related art, in order to improve the image display effect, before the image is displayed, the image frame can be processed in advance, and the processed image frame can be transmitted to the display component for display, thereby improving the final image display quality. Summary of the invention
[0004] The embodiments of the present application provide an image display method, device, computer equipment and storage medium. The technical solution is as follows:
[0005] On the one hand, an embodiment of the present application provides an image display method, the method comprising:
[0006] Performing display enhancement processing and layer synthesis on the layer through a hardware synthesizer to obtain a first synthesized layer;
[0007] Displaying the first composite layer as an image by a display component;
[0008] In response to the layer synthesis mode switching instruction, the layer is subjected to display enhancement processing and layer synthesis by a graphics processing unit (GPU) to obtain a second synthesized layer;
[0009] The second composite layer is displayed as an image through the display component.
[0010] On the other hand, an embodiment of the present application provides an image display device, the device comprising:
[0011] A first synthesis module, used for performing display enhancement processing and layer synthesis on the layer through a hardware synthesizer to obtain a first synthesized layer;
[0012] A display module, used for displaying the first composite layer as an image through a display component;
[0013] A second synthesis module is used for responding to the layer synthesis mode switching instruction, performing display enhancement processing and layer synthesis on the layer through the GPU to obtain a second synthesized layer;
[0014] The display module is used to display the image of the second synthetic layer through the display component.
[0015] On the other hand, an embodiment of the present application provides a computer device, which includes a processor, a memory and a display component, wherein the memory stores at least one program, and the at least one program is loaded and executed by the processor to implement the image display method described in the above aspects.
[0016] On the other hand, an embodiment of the present application provides a computer-readable storage medium, wherein the storage medium stores at least one instruction, and the at least one instruction is used to be executed by a processor to implement the image display method as described in the above aspect.
[0017] According to another aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the image display method provided in the above optional implementation.
[0018] The beneficial effects brought by the technical solution provided by the embodiment of the present application include at least:
[0019] In an embodiment of the present application, in a default state, display enhancement and layer synthesis processing are performed on the layer through a hardware synthesizer, and the first synthesized layer is displayed as an image through a display component to optimize the image display effect; and when the layer synthesis mode is switched and the layer synthesis processing is switched to the GPU, display enhancement processing continues to be performed on the layer through the GPU, and the second synthesized layer is displayed as an image through the display component, thereby ensuring that display enhancement continues before and after the layer synthesis mode is switched, avoiding sudden changes in the image display effect before and after the layer synthesis mode is switched, and further improving the image display quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 is a schematic diagram showing the principle of an image display method shown in an exemplary embodiment;
[0021] Figure 2 A structural block diagram of a computer device provided by an exemplary embodiment of the present application is shown;
[0022] Figure 3 is a flow chart of an image display method shown in an exemplary embodiment of the present application;
[0023] Figure 4 It is a schematic diagram of the implementation of the layer synthesis and display process during the image flipping process;
[0024] Figure 5 is a flowchart of an image display method shown in another exemplary embodiment of the present application;
[0025] Figure 6 is a schematic diagram of an implementation of a layer display enhancement and synthesis process shown in an exemplary embodiment;
[0026] Figure 7 is a flowchart of an image display method shown in another exemplary embodiment of the present application;
[0027] Figure 8 is a schematic diagram of an implementation of a layer display enhancement and synthesis process shown in an exemplary embodiment;
[0028] Fig. 9 is a schematic diagram of an implementation of an enhanced parameter multiplexing process shown in an exemplary embodiment of the present application;
[0029] Fig.10 It is a structural block diagram of an image display device provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0030] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0031] The term "multiple" as used herein refers to two or more than two. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the related objects are in an "or" relationship.
[0032] Display enhancement technology is an image processing technology that enhances the display effect of an image to improve the image perception. According to the implementation stage of display enhancement, display enhancement can be divided into two implementation methods: decoding end and display end. Among them, when display enhancement is implemented at the decoding end, the computer device performs display enhancement processing on the image frame during the image rendering stage; when display enhancement is implemented at the display end, the computer device does not perform display enhancement processing on the image frame during the image rendering stage, but performs display enhancement processing on the layer during the layer synthesis stage, thereby transmitting the synthesized image to the display component for image display.
[0033] Furthermore, when display enhancement is implemented on the display side, in order to reduce the processing pressure of the GPU (especially in display scenarios with high GPU requirements such as games), computer devices usually use hardware synthesizers to perform layer synthesis, and use the hardware synthesizer to perform display enhancement processing on the layers during the layer synthesis process. However, in certain specific usage scenarios, when the computer device cannot perform layer synthesis through the hardware synthesizer, it can only perform layer synthesis through the GPU. Since the layers are not processed by the hardware synthesizer, the layers cannot be displayed enhanced, which in turn causes the display enhancement to fail.
[0034] In the technical solution provided in the embodiment of the present application, in the default state, the computer device performs display enhancement and layer synthesis processing on the layer 11 through the hardware synthesizer 12 to obtain the first synthesized layer 13, and sends the first synthesized layer 13 to the display for the display component 14 to display the image; and when the layer synthesis mode is switched, in order to ensure the continuous display enhancement, the computer device continues to perform display enhancement processing on the layer 11 when performing layer synthesis on the layer 11 through the GPU 15, and sends the synthesized second synthesized layer 16 to the display, to ensure that the image displayed by the display component 14 before and after the layer synthesis mode is switched is display enhanced, thereby optimizing the image display effect.
[0035] Please refer to Figure 2 , which shows a block diagram of a computer device provided by an exemplary embodiment of the present application. The computer device may be an electronic device such as a smart phone, a tablet computer, a portable personal computer, etc. The computer device in the present application may include one or more of the following components: a processor 210, a memory 220, and a display component 230.
[0036] The processor 210 may include one or more processing cores. The processor 210 uses various interfaces and lines to connect the various parts of the entire computer device, and executes various functions of the computer device and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 220, and calling data stored in the memory 220. Optionally, the processor 210 can be implemented in at least one hardware form of digital signal processing (DSP), field programmable gate array (FPGA), and programmable logic array (PLA). The processor 210 can integrate one or a combination of a central processing unit (CPU), a GPU, a neural network processor (NPU), and a modem. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing display content; the NPU is responsible for artificial intelligence-related data processing, and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 210, but may be implemented separately through a communication chip.
[0037] In a possible design, the processor 210 in the embodiment of the present application includes a hardware synthesizer 211, a GPU 212, and an NPU 213. Among them, the hardware synthesizer 211 is used to perform layer synthesis in the default state, the GPU 212 is used to perform layer synthesis when the hardware synthesizer 211 cannot perform layer synthesis, and the NPU 213 is used to perform scene recognition on the layer through a neural network model, so that the hardware synthesizer 211 and the GPU 212 can perform display enhancement based on the enhancement parameters corresponding to the scene in the layer.
[0038] Optionally, the hardware synthesizer 211 and the NPU 213 may be arranged in a coprocessor independent of the processor 210 , which is not limited in this embodiment.
[0039] The memory 220 may include a random access memory (RAM) or a read-only memory (ROM). Optionally, the memory 220 includes a non-transitory computer-readable storage medium. The memory 220 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 220 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc. The operating system may be an Android system (including a system deeply developed based on the Android system), an IOS system developed by Apple (including a system deeply developed based on the IOS system) or other systems. The data storage area may also store data created by the computer device during use, etc.
[0040] The display component 230 is a component for displaying images. Optionally, the display component 230 also has a touch function for receiving a touch operation on or near the display component 230 using a finger, a touch pen, or any other suitable object. The display component 230 can be designed to be a combination of one or more of a full screen, a curved screen, or a special-shaped screen, which is not limited in the embodiments of the present application.
[0041] In addition, those skilled in the art can understand that the structure of the computer device shown in the above drawings does not constitute a limitation on the computer device, and the computer device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. For example, the computer device also includes radio frequency circuits, shooting components, sensors, audio circuits, wireless fidelity (WiFi) components, power supplies, Bluetooth components and other components, which will not be described in detail here.
[0042] Please refer to Figure 3 , which shows a flowchart of an image display method shown in an exemplary embodiment of the present application. This embodiment takes the method applied to a computer device as an example for exemplary description, and the method includes:
[0043] Step 301: Perform display enhancement processing and layer synthesis on the layer through a hardware synthesizer to obtain a first synthesized layer.
[0044] In a possible implementation, in a default state, the computer device performs display enhancement processing on multiple layers (surfaces) corresponding to the current image frame through a hardware synthesizer, and synthesizes the layers after the display enhancement processing to obtain a synthesized layer. Since the layers have been subjected to the display enhancement processing, the subsequent image display effect can be improved.
[0045] The layer synthesis process is a process of stacking the layers according to the display areas and display orders corresponding to the layers. For example, when the layers corresponding to the current image frame include the first layer corresponding to the status bar, the second layer corresponding to the navigation bar, and the third layer corresponding to the wallpaper, the hardware synthesizer superimposes the first layer on top of the third layer and the second layer on the bottom of the third layer to obtain a synthesized layer.
[0046] Optionally, the hardware synthesizer is a mobile display processor (MDP), and the MDP can be set in a processor, or a coprocessor independent of the processor.
[0047] In some embodiments, the computer device performs display enhancement processing on each layer corresponding to the current image frame through a hardware synthesizer, or only performs display enhancement processing on specific layers in the current video frame, and the display enhancement methods corresponding to different layers can be the same or different.
[0048] Step 302: Display the first composite layer as an image through a display component.
[0049] In some embodiments, the synthesized first synthetic layer is stored in a frame buffer (FrameBuffer), and the computer device further sends the frame buffer to a display component, which displays an image based on the first synthetic layer in the frame buffer.
[0050] Step 303, in response to the layer synthesis mode switching instruction, the GPU performs display enhancement processing and layer synthesis on the layer to obtain a second synthesized layer.
[0051] In a possible implementation, the layer synthesis mode switching instruction is triggered when the layer synthesis mode switching condition is met, and the computer device switches the execution subject of layer synthesis from the hardware synthesizer to the GPU based on the layer synthesis mode switching instruction. Since the hardware synthesizer performs display enhancement processing before performing layer synthesis, in order to ensure the consistency of the image display effect before and after the layer synthesis mode is switched, the computer device also first performs display enhancement processing on the layer of the current image frame, and then synthesizes the display enhanced layer to obtain a second synthesized layer. Optionally, the GPU and the hardware synthesizer perform display enhancement processing on the same layer in the image frame, and the parameters used for the display enhancement processing of the layer are the same.
[0052] The layer synthesis mode switching instruction may be triggered by a user operation or may be automatically triggered by the computer device according to its own operating state.
[0053] In some embodiments, when the hardware synthesizer is unable to perform layer synthesis, or when the scene requires hardware synthesis through the GPU, the computer device switches the layer synthesis mode.
[0054] In one possible application scenario, the hardware synthesizer can only perform layer synthesis when the image display direction is 90° or 180°, but cannot perform layer synthesis at other image display directions. Therefore, when the image display direction of the computer device changes (manually triggered by the user, or automatically triggered based on the gravity sensor), the computer device triggers the layer synthesis mode switching instruction, and during the process of changing the image display direction, the computer device switches to using the GPU for layer synthesis.
[0055] Schematically, in portrait mode, the smartphone uses a hardware synthesizer for layer synthesis. When the image display direction switches from portrait to landscape, the smartphone switches to using the GPU for layer synthesis. Of course, when the image display direction is rotated 180° (for example, when the phone is flipped), or when the landscape mode is switched to the portrait mode, the computer device also needs to switch to using the GPU for layer synthesis.
[0056] In another possible application scenario, the hardware synthesizer is used to synthesize simple image frames (such as 2D image frames). When complex image frames (such as 3D image frames) need to be synthesized, in order to achieve better layer synthesis effects, the computer device switches to using the GPU for layer synthesis.
[0057] Schematically, when displaying a 2D image, the smartphone uses a hardware synthesizer to perform layer synthesis. When the displayed image is switched from a 2D image to a 3D image, the smartphone switches to using a GPU to perform layer synthesis.
[0058] Of course, in addition to the above-mentioned scenarios, other scenarios that require the use of a GPU for layer synthesis can be identified as layer synthesis switching scenarios, and this embodiment does not limit the triggering method for switching the layer synthesis mode.
[0059] Step 304: Display the second composite layer as an image through a display component.
[0060] Similar to the hardware synthesizer layer synthesis, the synthesized second synthesized layer is stored in the frame buffer, and the computer device further sends the frame buffer to the display component, which displays the image based on the second synthesized layer in the frame buffer. Since both the first synthesized layer and the second synthesized layer are display enhanced (that is, the layers can still be display enhanced without passing through the hardware synthesizer), the continuity of the display enhancement effect before and after the synthesis mode is switched can be guaranteed, avoiding the problem of image mutation (possibly screen flickering) caused by the inability to enhance the display effect after the synthesis mode is switched.
[0061] Optionally, when the layer synthesis mode is switched again, the computer device performs display enhancement and layer synthesis again through the hardware synthesizer.
[0062] In a possible application scenario, in response to the image display direction stopping changing, the layer synthesis mode switching instruction is triggered again, and the computer device re-performs display enhancement processing and layer synthesis on the layer through the hardware synthesizer to obtain a third synthetic layer, and displays the image of the third synthetic layer through the display component.
[0063] Indicatively, Figure 4 As shown, when the smartphone plays a video, the hardware synthesizer 42 performs display enhancement and layer synthesis on the layer 41, and sends the synthesis result to the display component 43 for display. When the smartphone flips 180°, since the displayed video screen needs to be flipped, the hardware synthesizer 42 cannot synthesize the layer during the flipping process. Therefore, the smartphone performs display enhancement and layer synthesis on the layer 41 through the GPU 44 during the screen flipping process, and sends the synthesis result to the display component 43 for display. When the screen flipping is completed, the smartphone switches the hardware synthesizer 42 again to perform display enhancement and layer synthesis on the layer 41 to ensure the consistency of the video screen display enhancement effect during the screen flipping process. Among them, the hardware synthesizer 42 and the GPU 44 both perform display enhancement processing by obtaining the enhancement parameter 45.
[0064] To summarize, in the embodiments of the present application, in the default state, the hardware synthesizer is used to perform display enhancement and layer synthesis processing on the layer, and the display component is used to display the first synthesized layer as an image, thereby optimizing the image display effect; and when the layer synthesis mode is switched and the GPU is used for layer synthesis processing, the GPU continues to perform display enhancement processing on the layer, and the display component is used to display the second synthesized layer as an image, thereby ensuring that the display enhancement continues before and after the layer synthesis mode is switched, thereby avoiding sudden changes in the image display effect before and after the layer synthesis mode is switched, and further improving the image display quality.
[0065] One image frame is composed of multiple layers to be synthesized, wherein different layers to be synthesized display different contents. Since not all contents displayed in each layer to be synthesized need to be displayed enhanced (for example, the layers corresponding to the status bar and the navigation bar do not need to be displayed enhanced, while the images corresponding to the wallpaper need to be displayed enhanced), before performing display enhancement processing on the layers, the computer device first needs to determine the target layer from the layers to be synthesized so as to subsequently display enhance the target layer. The target layer is a layer with display enhancement requirements, and the number of target layers is at least one. The following is an exemplary embodiment for illustration.
[0066] Please refer to Figure 5 , which shows a flowchart of an image display method shown in another exemplary embodiment of the present application. This embodiment takes the method applied to a computer device as an example for exemplary description, and the method includes:
[0067] Step 501: Determine the identification of a layer to be enhanced based on a foreground application. The identification of the layer to be enhanced is the identification of a layer in the foreground application that has a display enhancement requirement.
[0068] Since the image frames in different applications contain different layers, in order to ensure the accuracy of subsequent layer display enhancement, in a possible implementation, the layers with display enhancement requirements in different applications are preset and determined, and the corresponding relationship between the application and the identification of the layer to be enhanced is set. The corresponding relationship is pre-configured in the computer device and supports updating.
[0069] Optionally, the number of layers having display enhancement requirements in different applications may be the same or different.
[0070] In an illustrative example, the correspondence between the application program and the identifier of the layer to be enhanced is shown in Table 1.
[0071] Table 1
[0072] app Identification of layers to be enhanced App A surface001, surface002 App B surface003 App C surface004, surface005
[0073] In a possible implementation, the computer device obtains the application identifier of the foreground application (which may be the package name of the application), and then queries the to-be-enhanced layer identifier from the correspondence between the application and the to-be-enhanced layer identifier based on the application identifier.
[0074] In some embodiments, if the layer identifier to be enhanced is determined based on the foreground application, the computer device executes the following step 502; if the layer identifier to be enhanced is not determined based on the foreground application (that is, the computer device does not support display enhancement of the current foreground application), the computer device only synthesizes the layer without performing display enhancement.
[0075] Of course, in order to improve the application scope of display enhancement, in some other embodiments, if the identification of the layer to be enhanced is not determined based on the foreground application, the computer device can identify each layer to be synthesized and identify the layer to be enhanced. The computer device can determine the layer to be enhanced according to the content richness of the layer to be synthesized, or according to the degree of change of the layer to be synthesized (such as the content difference of the same layer to be synthesized in adjacent image frames), which is not limited in this embodiment.
[0076] Step 502: determine the layer corresponding to the to-be-enhanced layer identifier among the to-be-synthesized layers as the target layer.
[0077] Furthermore, the computer device matches the identification of the layer to be enhanced with the layer identifications corresponding to each layer to be synthesized, thereby determining the matched layer to be synthesized as the target layer.
[0078] In an illustrative example, Figure 6 As shown, the image frame currently displayed by the foreground application "App B" is composed of surface 009, surface 003 and surface 010. Based on the corresponding relationship shown in Table 1, the computer device determines the layer indicated by surface 003 as the target layer.
[0079] Step 503: Perform display enhancement processing on the target layer through a hardware synthesizer.
[0080] The computer device performs display enhancement (pixel level) on the target image through a hardware synthesizer to obtain a target image after display enhancement. For example, the computer device performs contrast enhancement, saturation enhancement, and sharpness enhancement on each pixel point in the target layer through a hardware synthesizer; or, performs contrast enhancement, saturation reduction, and sharpness reduction on each pixel point in the target layer through a hardware synthesizer.
[0081] Indicatively, Figure 6As shown, the computer device performs display enhancement on the layer indicated by surface003 through a hardware synthesizer to obtain the surface003 layer after display enhancement.
[0082] Step 504: synthesize the enhanced target layer and other layers to obtain a first synthesized layer.
[0083] After display enhancement is completed, the hardware synthesizer performs layer synthesis on the target layer after display enhancement and other layers that have not been subjected to display enhancement processing to obtain a first synthesized layer. The specific process of synthesizing layers by the hardware synthesizer is not described in detail in this embodiment of the application.
[0084] Indicatively, Figure 6 As shown, the computer device performs layer synthesis on the surface003 layer after display enhancement, and the surface009 layer and the surface010 layer which have not been display enhanced, to obtain a first synthesized layer, wherein the surface009 layer is located at the bottom of the surface003 layer, and the surface010 layer is located at the top of the surface003 layer.
[0085] Step 505, in response to the layer synthesis mode switching instruction, the target layer is subjected to display enhancement processing by the GPU.
[0086] Likewise, when the layer synthesis method is switched, the computer device continues to perform display enhancement processing on the target layer through the GPU.
[0087] Step 506: The enhanced target layer and other layers are synthesized to obtain a second synthesized layer.
[0088] After the display enhancement is completed, the GPU performs layer synthesis on the target layer after the display enhancement and other layers that have not been subjected to the display enhancement process to obtain a second synthesized layer. The specific process of GPU synthesizing layers is not described in detail in this embodiment of the application.
[0089] In this embodiment, by pre-setting layers with display enhancement requirements in different applications, a target layer can be determined from multiple layers to be synthesized according to the foreground application, so that the display of the target layer is enhanced, thereby avoiding unnecessary processing consumption caused by display enhancement of all layers in the image frame.
[0090] When display enhancement is performed on the target layer, in a possible implementation, a unified enhancement parameter may be used. However, since the enhancement requirements for display effects are different in different scenes (related to the display content in the layer), the effect of display enhancement using the unified enhancement parameter is not good.
[0091] For example, when the target layer contains the sky, sea, and food, you need to increase the saturation to improve the display effect; when the target layer contains buildings, you need to increase the sharpness to improve the display effect; when the target layer contains faces, you need to reduce the saturation and sharpness to improve the display effect.
[0092] In a possible implementation, for different scenes, the computer device needs to determine different enhancement parameters, so as to perform targeted display enhancement on the layer based on the enhancement parameters, thereby improving the image display effect in different scenes.
[0093] Please refer to Figure 7 , which shows a flowchart of an image display method shown in another exemplary embodiment of the present application. This embodiment takes the method applied to a computer device as an example for exemplary description, and the method includes:
[0094] Step 701: Determine the identification of a layer to be enhanced based on a foreground application. The identification of the layer to be enhanced is the identification of a layer in the foreground application that has a display enhancement requirement.
[0095] Step 702: determine the layer corresponding to the to-be-enhanced layer identifier among the to-be-synthesized layers as the target layer.
[0096] The implementation of steps 701 to 702 may refer to steps 501 to 502, and will not be described in detail in this embodiment.
[0097] Step 703: Perform scene recognition on the target layer to obtain the target scene.
[0098] In one possible implementation, after determining the target layer, the computer device performs scene recognition on the target layer in each image frame, or the computer device performs scene recognition on the target layer in the image frame at a target recognition frequency (e.g., 500ms / time) to obtain the target scene.
[0099] Optionally, the target scene belongs to a preset candidate scene, which can include any one of a portrait scene, a sky scene, a grass scene, a food scene, and a building scene, or a combination of at least two scenes (such as a person+grass scene). The embodiments of the present application do not limit the specific types of candidate scenes.
[0100] In some embodiments, the computer device is provided with an NPU and a scene recognition model. When performing scene recognition on the target layer, the computer device uses the scene recognition model (running on the NPU) to perform scene recognition on the target layer. This step may include the following steps:
[0101] 1. Scale the target layer to the target size.
[0102] Since the sizes of target layers in different applications vary, and the scene recognition model has input size requirements, before using the scene recognition model for scene recognition, it is first necessary to scale the target size to the target size so that the scaled target layer meets the model input size of the scene recognition model.
[0103] In an illustrative example, the computer device uniformly scales the target layer to 256px×256px.
[0104] 2. Input the target layer of the target size into the scene recognition model to obtain the output scene probability. The target size conforms to the model input size of the scene recognition model, and the scene probability includes the probability corresponding to the candidate scene.
[0105] Optionally, the model input image of the scene recognition model outputs the probability of each candidate scene. In one possible implementation, the backbone network of the scene recognition model is a convolutional neural network (for extracting features from images), and the convolutional neural network is followed by a classification network (for classifying scenes based on image features). The scene probability output by the classification network is the probability that the input image belongs to each candidate scene. The embodiments of the present application do not limit the specific model structure of the scene recognition model.
[0106] Optionally, the scene recognition model set in the computer device supports updating. When the candidate scenes supported for recognition change, or the scene recognition model is optimized (to improve the accuracy of scene recognition), the model parameters of the scene recognition model need to be updated.
[0107] In an illustrative example, when the candidate scenes include a portrait scene, a sky scene, a grass scene, a food scene, and a building scene, the scene probabilities shown by the scene recognition model are: P1=0.2, P2=0.05, P3=0.04, P4=0.7, P5=0.01.
[0108] 3. Based on the scene probability, determine the target scene from the candidate scenes.
[0109] In a possible implementation, if the highest probability among the scene probabilities is greater than a probability threshold (eg, 0.6), the computer device determines the candidate scene corresponding to the highest probability as the target scene.
[0110] In combination with the examples in the above steps, the computer device determines that the target scene is a food scene.
[0111] In addition to the computer device automatically identifying the scene, in other possible implementations, the computer device provides a scene setting portal, through which the user can manually set the display scene. Accordingly, the computer device determines the target scene based on the scene setting operation, and the scene setting operation can be a triggering operation for the scene setting option, which is not limited in this embodiment.
[0112] Step 704: determine target enhancement parameters corresponding to the target scene, wherein different scenes correspond to different enhancement parameters, and different enhancement parameters correspond to different display enhancement effects.
[0113] In a possible implementation, different enhancement parameters are pre-set for different scenes, wherein different enhancement parameters correspond to display enhancement effects, thereby providing targeted display enhancement for different scenes. After the computer device determines the target scene, it determines the target enhancement parameter corresponding to the target scene, so that the candidate can perform targeted display enhancement processing.
[0114] Optionally, the enhancement parameter includes at least one of saturation, contrast and sharpness, and the enhancement parameter can be a positive value (such as increasing the saturation) or a negative value (such as reducing the saturation). The embodiment of the present application does not limit the specific type of the enhancement parameter.
[0115] In an illustrative example, the corresponding relationship between different scenes and enhancement parameters is shown in Table 2.
[0116] Table 2
[0117]
[0118] Optionally, when there are multiple target layers, the computer device needs to determine the target scenes corresponding to different target layers and obtain corresponding target enhancement parameters. This embodiment is not described in detail here.
[0119] It should be noted that when the target scene corresponding to the target layer changes, the computer device needs to re-determine the target enhancement parameters to ensure the accuracy and real-time performance of the display enhancement processing.
[0120] Step 705: Based on the target enhancement parameters, the target layer is subjected to display enhancement processing by a hardware synthesizer.
[0121] Furthermore, the hardware synthesizer obtains the target enhancement parameters, and processes the pixels in the target layer based on the display enhancement method indicated by the target enhancement parameters to obtain the target layer after display enhancement.
[0122] In some embodiments, when at least two target scenes are determined (for example, when browsing multiple photos of different scenes at the same time), the computer device can use different target enhancement parameters to perform display enhancement processing on the target layer for different scene areas.
[0123] In a possible implementation, the computer device determines an i-th scene area corresponding to an i-th target scene, and based on an i-th target enhancement parameter corresponding to the i-th target scene, performs display enhancement processing on the i-th scene area in the target layer through a GPU, wherein the i-th target scene is any one of at least two target scenes.
[0124] Optionally, when a computer device uses a scene recognition model to perform scene recognition on a target layer, the scene recognition model can, in addition to outputting the target scene, also output regional information of a scene area corresponding to the target scene. The computer device then performs different display enhancement processing for different target scenes based on the regional information.
[0125] In an illustrative example, when a user browses two photos at the same time, and the target scene corresponding to the left photo is "people", and the target scene corresponding to the right photo is "landscape", the computer device uses the display enhancement parameters corresponding to "people" to perform display enhancement processing on the left half of the target layer, and uses the display enhancement parameters corresponding to "landscape" to perform display enhancement processing on the right half of the target layer.
[0126] Step 706: The enhanced target layer and other layers are synthesized to obtain a first synthesized layer.
[0127] Indicatively, Figure 8 As shown, the image frame currently displayed by the foreground application is composed of surface 009, surface 003 and surface 010, and the surface 003 layer is the target layer. The computer device uses the scene recognition model to perform scene recognition on the surface 003 layer, and based on the recognized target scene, determines the target enhancement parameters corresponding to the target scene from the enhancement parameter set. The hardware synthesizer performs display enhancement on the layer indicated by surface 003 based on the target enhancement parameters to obtain the surface 003 layer after display enhancement, and then performs layer synthesis on the surface 003 layer after display enhancement, and the surface 009 layer and the surface 010 layer that have not been displayed enhanced to obtain a first synthesized layer.
[0128] Step 707, in response to the layer synthesis mode switching instruction, based on the target enhancement parameters, the target layer is subjected to display enhancement processing by the GPU.
[0129] In one possible implementation, the determined target enhancement parameters exist in a designated storage area, and both the hardware synthesizer and the GPU have read permission for the storage area. When the layer synthesis mode is switched, the GPU reads the target enhancement parameters, thereby performing display enhancement processing on the target layer based on the target enhancement parameters.
[0130] Step 708: The enhanced target layer and other layers are synthesized to obtain a second synthesized layer.
[0131] The implementation of this step may refer to the above step 506, and this embodiment will not be described in detail here.
[0132] In this embodiment, scene recognition is performed on the target layer through a scene recognition model, and the target enhancement parameters used for display enhancement processing of the target layer are determined based on the identified target scene, thereby achieving targeted display enhancement in different scenes, which helps to improve the image display effects in different scenes.
[0133] Since the target scene corresponding to the target layer remains unchanged in a short period of time, in order to reduce the power consumption of the computer device, the computer device performs scene recognition on the target layer in the nth image frame. After obtaining the target scene, the computer device applies the target enhancement parameters corresponding to the target scene to the m consecutive image frames after the nth image frame, that is, the target enhancement parameters are determined as the enhancement parameters corresponding to the target layer in the n+1th to n+mth image frames, thereby eliminating the scene recognition of the target layer in the n+1th to n+mth image frames (due to the short time interval, the scene recognition of the target layer in the n+1th to n+mth image frames is most likely the same as the nth image frame).
[0134] Optionally, m is a constant value, or is dynamically adjusted based on the scene recognition result corresponding to the target layer in the nth image frame (for example, m is 5 in a sky scene and m is 3 in a portrait scene), which is not limited in this embodiment.
[0135] Indicatively, Fig. 9 As shown, after the computer device performs scene recognition on the target layer of the nth image frame and determines the target enhancement parameters, there is no need to perform scene recognition on the target layers of the n+1th to n+mth frames, but directly applies the target enhancement parameters corresponding to the nth image frame to the display enhancement processing of the target layers in the n+1th to n+mth frames; for the n+m+1th image frame, the computer device needs to re-perform scene recognition and enhancement parameter determination, and apply the target enhancement parameters corresponding to the n+m+1th image frame to the display enhancement processing of the target layers in the n+m+2th to n+2mth frames.
[0136] Please refer to Fig.10, which shows a structural block diagram of an image display device provided by an exemplary embodiment of the present application. The device can be implemented as all or part of a computer device through software, hardware, or a combination of both. The device includes:
[0137] A first synthesis module 1001, used for performing display enhancement processing and layer synthesis on the layer through a hardware synthesizer to obtain a first synthesized layer;
[0138] A display module 1002, configured to display the first composite layer as an image through a display component;
[0139] The second synthesis module 1003 is used to respond to the layer synthesis mode switching instruction, perform display enhancement processing and layer synthesis on the layer through the graphics processor GPU to obtain a second synthesized layer;
[0140] The display module 1002 is used to display the second synthetic layer through the display component.
[0141] Optionally, the first synthesis module 1001 includes:
[0142] A first enhancement unit, configured to perform display enhancement processing on the target layer through the hardware synthesizer;
[0143] A first synthesis unit, used for synthesizing the target layer after display enhancement and other layers to obtain the first synthesized layer;
[0144] The second synthesis module 1003 includes:
[0145] A second enhancement unit, configured to perform display enhancement processing on the target layer through the GPU;
[0146] The second synthesis unit is used to synthesize the target layer after display enhancement and other layers to obtain the second synthesized layer.
[0147] Optionally, the device comprises:
[0148] The layer determination module is used to determine the target layer from the layers to be synthesized.
[0149] Optionally, the layer determination module includes:
[0150] A first determining unit is used to determine an identifier of a layer to be enhanced based on a foreground application, where the identifier of the layer to be enhanced is an identifier of a layer in the foreground application that has a display enhancement requirement;
[0151] The second determining unit is used to determine the layer corresponding to the to-be-enhanced layer identifier among the to-be-synthesized layers as the target layer.
[0152] Optionally, the first synthesis unit is used for:
[0153] Based on the target enhancement parameter, performing display enhancement processing on the target layer through the hardware synthesizer;
[0154] The second synthesis unit is used for:
[0155] Based on the target enhancement parameters, the GPU performs display enhancement processing on the target layer.
[0156] Optionally, the device further comprises:
[0157] A scene determination module, used to perform scene recognition on the target layer to obtain a target scene, or to determine the target scene based on a scene setting operation;
[0158] The parameter determination module is used to determine the target enhancement parameter corresponding to the target scene, wherein different scenes correspond to different enhancement parameters, and different enhancement parameters correspond to different display enhancement effects.
[0159] Optionally, the scene recognition module is used to:
[0160] Scaling the target layer to a target size;
[0161] Inputting the target layer of the target size into a scene recognition model to obtain an output scene probability, wherein the target size conforms to the model input size of the scene recognition model, and the scene probability includes a probability corresponding to a candidate scene;
[0162] Based on the scene probability, the target scene is determined from the candidate scenes.
[0163] Optionally, the identification module is used to:
[0164] Performing scene recognition on the target layer in the nth image frame to obtain the target scene;
[0165] The device also includes:
[0166] A multiplexing module is used to determine the target enhancement parameters as enhancement parameters corresponding to the target layers in the n+1th to n+mth image frames, where n and m are positive integers.
[0167] Optionally, the target scenarios are at least two;
[0168] The second synthesis unit is used for:
[0169] Determine the i-th scene area corresponding to the i-th target scene, where i is a positive integer;
[0170] Based on the i-th target enhancement parameter corresponding to the i-th target scene, the GPU performs display enhancement processing on the i-th scene area in the target layer.
[0171] Optionally, the target enhancement parameter includes at least one of saturation, contrast and sharpness.
[0172] Optionally, the second synthesis module 1003 is used to:
[0173] In response to a change in the image display direction, triggering the layer synthesis mode switching instruction;
[0174] During the change of the image display direction, the GPU performs display enhancement processing and layer synthesis on the layer to obtain the second synthesized layer.
[0175] Optionally, the device further comprises:
[0176] A third synthesis module is used for triggering the layer synthesis mode switching instruction in response to the image display direction stopping changing, performing display enhancement processing and layer synthesis on the layer through the hardware synthesizer to obtain a third synthesized layer;
[0177] The third display module is used to display the image of the third composite layer through the display component.
[0178] Optionally, the hardware synthesizer is a mobile display processor MDP.
[0179] To summarize, in the embodiments of the present application, in the default state, the hardware synthesizer is used to perform display enhancement and layer synthesis processing on the layer, and the display component is used to display the first synthesized layer as an image, thereby optimizing the image display effect; and when the layer synthesis mode is switched and the GPU is used for layer synthesis processing, the GPU continues to perform display enhancement processing on the layer, and the display component is used to display the second synthesized layer as an image, thereby ensuring that the display enhancement continues before and after the layer synthesis mode is switched, thereby avoiding sudden changes in the image display effect before and after the layer synthesis mode is switched, and further improving the image display quality.
[0180] In this embodiment, by pre-setting layers with display enhancement requirements in different applications, a target layer can be determined from multiple layers to be synthesized according to the foreground application, so that the display of the target layer is enhanced, thereby avoiding unnecessary processing consumption caused by display enhancement of all layers in the image frame.
[0181] In this embodiment, scene recognition is performed on the target layer through a scene recognition model, and the target enhancement parameters used for display enhancement processing of the target layer are determined based on the identified target scene, thereby achieving targeted display enhancement in different scenes, which helps to improve the image display effects in different scenes.
[0182] An embodiment of the present application further provides a computer-readable storage medium, which stores at least one instruction, and the at least one instruction is used to be executed by a processor to implement the image display method as described in the above embodiments.
[0183] According to another aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the image display method provided in the above optional implementation.
[0184] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the embodiments of the present application can be implemented with hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein the communication media include any media that facilitates the transmission of a computer program from one place to another. The storage medium can be any available medium that a general or special-purpose computer can access.
[0185] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. An image display method, characterized in that: The method comprises: Performing display enhancement processing and layer synthesis on the layer by a hardware synthesizer to obtain a first synthesized layer, wherein the hardware synthesizer supports layer synthesis in a portrait screen state or a landscape screen state, and does not support layer synthesis in other image display directions; Displaying the first composite layer as an image by a display component; In response to a change in the image display direction, during the image display direction change process, the GPU performs display enhancement processing and layer synthesis on the layer to obtain a second synthesized layer; Displaying an image of the second composite layer by the display component; In response to the image display direction stopping changing, performing display enhancement processing and layer synthesis on the layer through the hardware synthesizer to obtain a third synthesized layer; Displaying the third composite layer as an image by means of the display component; Among them, the GPU and the hardware synthesizer perform display enhancement processing on the same layer in the image frame, and the target enhancement parameters used for the display enhancement processing on the layer are the same, and the target enhancement parameters are stored in a designated storage area, and the hardware synthesizer and the GPU both have read permission for the designated storage area; the target enhancement parameters correspond to the target scene, and when the same layer contains at least two target scenes, the target enhancement parameters corresponding to different target scenes are used to perform display enhancement processing on the scene area corresponding to the target scene.
2. The method according to claim 1, characterized in that The step of performing display enhancement processing and layer synthesis on the layer by a hardware synthesizer to obtain a first synthesized layer includes: Performing display enhancement processing on the target layer through the hardware synthesizer; Combining the target layer after display enhancement and other layers to obtain the first composite layer; The step of performing display enhancement processing and layer synthesis on the layer by the GPU to obtain a second synthesized layer includes: Performing display enhancement processing on the target layer by the GPU; The target layer after display enhancement and other layers are synthesized to obtain the second synthesized layer.
3. The method according to claim 2, characterized in that The method comprises: The target layer is determined from the layers to be synthesized.
4. The method according to claim 3, characterized in that The step of determining the target layer from the layers to be synthesized includes: Determine an identifier of a layer to be enhanced based on a foreground application, where the identifier of the layer to be enhanced is an identifier of a layer in the foreground application that has a display enhancement requirement; The layer corresponding to the to-be-enhanced layer identifier in the to-be-synthesized layers is determined as the target layer.
5. The method according to claim 2, characterized in that: The performing display enhancement processing on the target layer by the hardware synthesizer includes: Based on the target enhancement parameter, performing display enhancement processing on the target layer through the hardware synthesizer; The performing display enhancement processing on the target layer by the GPU includes: Based on the target enhancement parameters, the GPU performs display enhancement processing on the target layer.
6. The method according to claim 5, characterized in that The method further comprises: Performing scene recognition on the target layer to obtain a target scene, or determining the target scene based on a scene setting operation; The target enhancement parameter corresponding to the target scene is determined, wherein different scenes correspond to different enhancement parameters, and different enhancement parameters correspond to different display enhancement effects.
7. The method according to claim 6, characterized in that The performing scene recognition on the target layer to obtain the target scene includes: Scaling the target layer to a target size; Inputting the target layer of the target size into a scene recognition model to obtain an output scene probability, wherein the target size conforms to the model input size of the scene recognition model, and the scene probability includes a probability corresponding to a candidate scene; Based on the scene probability, the target scene is determined from the candidate scenes.
8. The method according to claim 6, characterized in that The performing scene recognition on the target layer to obtain the target scene includes: Performing scene recognition on the target layer in the nth image frame to obtain the target scene; The method further comprises: The target enhancement parameters are determined as enhancement parameters corresponding to the target layers in the n+1th to n+mth image frames, where n and m are positive integers.
9. The method according to claim 6, characterized in that The target scenarios are at least two; The performing display enhancement processing on the target layer by the GPU based on the target enhancement parameter includes: Determine the i-th scene area corresponding to the i-th target scene, where i is a positive integer; Based on the i-th target enhancement parameter corresponding to the i-th target scene, the GPU performs display enhancement processing on the i-th scene area in the target layer.
10. The method according to claim 5, characterized in that The target enhancement parameter includes at least one of saturation, contrast and sharpness.
11. The method according to any one of claims 1 to 10, characterized in that: The hardware synthesizer is a mobile display processor MDP.
12. An image display device, characterized in that: The device comprises: A first synthesis module, used for performing display enhancement processing and layer synthesis on the layer through a hardware synthesizer to obtain a first synthesized layer, wherein the hardware synthesizer supports layer synthesis in a portrait screen state or a landscape screen state, and does not support layer synthesis in other image display directions; A display module, used for displaying the first composite layer as an image through a display component; A second synthesis module is used for responding to a change in the image display direction, and in the process of the image display direction changing, performing display enhancement processing and layer synthesis on the layer through the GPU to obtain a second synthesized layer; The display module is used to display the second composite layer as an image through the display component; A third synthesis module is used for performing display enhancement processing and layer synthesis on the layer through the hardware synthesizer in response to the image display direction stopping changing, so as to obtain a third synthesized layer; A third display module, used for displaying an image of the third composite layer through the display component; Among them, the GPU and the hardware synthesizer perform display enhancement processing on the same layer in the image frame, and the target enhancement parameters used for the display enhancement processing on the layer are the same, and the target enhancement parameters are stored in a designated storage area, and the hardware synthesizer and the GPU both have read permission for the designated storage area; the target enhancement parameters correspond to the target scene, and when the same layer contains at least two target scenes, the target enhancement parameters corresponding to different target scenes are used to perform display enhancement processing on the scene area corresponding to the target scene.
13. A computer device, characterized in that: The computer device includes a processor, a memory and a display component, wherein the memory stores at least one program, and the at least one program is loaded and executed by the processor to implement the image display method according to any one of claims 1 to 11.
14. A computer-readable storage medium, characterized in that: The storage medium stores at least one instruction, and the at least one instruction is used to be executed by a processor to implement the image display method according to any one of claims 1 to 11.
